fixes after merge

This commit is contained in:
Skalii 2021-03-29 21:15:16 +03:00
parent 7420b71048
commit 9a6d6049a4
2 changed files with 37 additions and 2 deletions

View file

@ -50,6 +50,7 @@ import net.osmand.plus.base.BaseOsmAndDialogFragment;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.plus.inapp.InAppPurchases.InAppSubscription;
import net.osmand.plus.liveupdates.LiveUpdatesClearBottomSheet.RefreshLiveUpdates;
import net.osmand.plus.liveupdates.LiveUpdatesHelper.TimeOfDay;
import net.osmand.plus.liveupdates.LiveUpdatesHelper.UpdateFrequency;
@ -696,6 +697,41 @@ public class LiveUpdatesFragment extends BaseOsmAndDialogFragment implements OnL
}
}
public static String getSupportRegionName(OsmandApplication app, InAppPurchaseHelper purchaseHelper) {
OsmandSettings settings = app.getSettings();
String countryName = settings.BILLING_USER_COUNTRY.get();
if (purchaseHelper != null) {
List<InAppSubscription> subscriptions = purchaseHelper.getLiveUpdates().getVisibleSubscriptions();
boolean donationSupported = false;
for (InAppSubscription s : subscriptions) {
if (s.isDonationSupported()) {
donationSupported = true;
break;
}
}
if (donationSupported) {
if (Algorithms.isEmpty(countryName)) {
if (OsmandSettings.BILLING_USER_DONATION_NONE_PARAMETER.equals(settings.BILLING_USER_COUNTRY_DOWNLOAD_NAME.get())) {
countryName = app.getString(R.string.osmand_team);
} else {
countryName = app.getString(R.string.shared_string_world);
}
}
} else {
countryName = app.getString(R.string.osmand_team);
}
} else {
countryName = app.getString(R.string.osmand_team);
}
return countryName;
}
public static String getSupportRegionHeader(OsmandApplication app, String supportRegion) {
return supportRegion.equals(app.getString(R.string.osmand_team)) ?
app.getString(R.string.default_buttons_support) :
app.getString(R.string.osm_live_support_region);
}
@ColorRes
public static int getDefaultIconColorId(boolean nightMode) {
return nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light;

View file

@ -14,7 +14,6 @@ import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.plus.liveupdates.CountrySelectionFragment;
import net.osmand.plus.liveupdates.LiveUpdatesFragment;
import net.osmand.plus.liveupdates.LiveUpdatesFragmentNew;
import net.osmand.plus.liveupdates.OsmLiveActivity;
import net.osmand.plus.routepreparationmenu.cards.BaseCard;
import net.osmand.plus.settings.backend.OsmandSettings;
@ -71,7 +70,7 @@ public class SubscriptionsCard extends BaseCard {
liveUpdatesContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LiveUpdatesFragmentNew.showInstance(mapActivity.getSupportFragmentManager(), target);
LiveUpdatesFragment.showInstance(mapActivity.getSupportFragmentManager(), target);
}
});