Merge branch 'master' into fix_osmand_live_p1

This commit is contained in:
Vitaliy 2021-03-29 21:41:26 +03:00
commit e9a8d28ad1
4 changed files with 14 additions and 11 deletions

View file

@ -39,9 +39,13 @@ public abstract class BaseCard {
}
public BaseCard(@NonNull MapActivity mapActivity) {
this(mapActivity, true);
}
public BaseCard(@NonNull MapActivity mapActivity, boolean usedOnMap) {
this.mapActivity = mapActivity;
this.app = mapActivity.getMyApplication();
nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls();
nightMode = usedOnMap ? app.getDaynightHelper().isNightModeForMapControls() : !app.getSettings().isLightContent();
}
public abstract int getCardLayoutId();

View file

@ -39,7 +39,7 @@ public class SubscriptionsCard extends BaseCard {
}
public SubscriptionsCard(@NonNull MapActivity mapActivity, @NonNull Fragment target, @NonNull InAppPurchaseHelper purchaseHelper) {
super(mapActivity);
super(mapActivity, false);
this.target = target;
this.purchaseHelper = purchaseHelper;
}

View file

@ -39,7 +39,7 @@ public class SubscriptionsListCard extends BaseCard {
}
public SubscriptionsListCard(@NonNull MapActivity mapActivity, @NonNull InAppPurchaseHelper purchaseHelper) {
super(mapActivity);
super(mapActivity, false);
this.purchaseHelper = purchaseHelper;
this.dateFormat = new SimpleDateFormat("MMM d, yyyy", Locale.getDefault());
}

View file

@ -20,7 +20,6 @@ import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.plus.routepreparationmenu.cards.BaseCard;
import net.osmand.plus.wikipedia.WikipediaDialogFragment;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat;
@ -41,15 +40,15 @@ public class TroubleshootingOrPurchasingCard extends BaseCard {
}
public TroubleshootingOrPurchasingCard(@NonNull MapActivity mapActivity, @NonNull InAppPurchaseHelper purchaseHelper, boolean isPaidVersion) {
super(mapActivity);
super(mapActivity, false);
this.purchaseHelper = purchaseHelper;
this.isPaidVersion = isPaidVersion;
}
@Override
protected void updateContent() {
setupRestorePurchasesBtn(R.id.restore_purchases);
setupNewDeviceOrAccountBtn(R.id.new_device_account_container);
setupRestorePurchasesBtn();
setupNewDeviceOrAccountBtn();
setupSupportDescription();
setupContactUsLink();
@ -82,8 +81,8 @@ public class TroubleshootingOrPurchasingCard extends BaseCard {
}
}
protected void setupRestorePurchasesBtn(@IdRes int btnId) {
View purchasesRestore = view.findViewById(btnId);
protected void setupRestorePurchasesBtn() {
View purchasesRestore = view.findViewById(R.id.restore_purchases);
purchasesRestore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -94,8 +93,8 @@ public class TroubleshootingOrPurchasingCard extends BaseCard {
});
}
protected void setupNewDeviceOrAccountBtn(@IdRes int btnId) {
View newDeviceAccountContainer = view.findViewById(btnId);
protected void setupNewDeviceOrAccountBtn() {
View newDeviceAccountContainer = view.findViewById(R.id.new_device_account_container);
newDeviceAccountContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {