From a6d1092a197b751436dcdfa5e4eb9bc71e710ffa Mon Sep 17 00:00:00 2001 From: Sergey Kharchenko Date: Sun, 16 Jul 2023 04:01:39 +0300 Subject: [PATCH 1/3] #1822: Fixed ui for free account --- OsmAnd/res/layout/free_backup_card.xml | 25 +++++++++++++------ .../net/osmand/plus/backup/BackupInfo.java | 3 ++- .../plus/backup/ui/BackupTypesFragment.java | 3 ++- .../backup/ui/BaseBackupTypesFragment.java | 6 +++-- .../dialogs/FavoritesTreeFragment.java | 6 +++-- .../fragments/ConfigureProfileFragment.java | 6 +++-- .../purchase/data/PurchaseUiDataUtils.java | 3 ++- 7 files changed, 36 insertions(+), 16 deletions(-) diff --git a/OsmAnd/res/layout/free_backup_card.xml b/OsmAnd/res/layout/free_backup_card.xml index e142af05e6f..08aa90769dc 100644 --- a/OsmAnd/res/layout/free_backup_card.xml +++ b/OsmAnd/res/layout/free_backup_card.xml @@ -50,7 +50,7 @@ android:layout_marginTop="@dimen/content_padding_small_half" android:text="@string/free_favorites_backup_description" android:textColor="?android:textColorSecondary" - android:textSize="16sp" /> + android:textSize="@dimen/default_desc_text_size" /> - + android:paddingTop="@dimen/content_padding_small_half" + android:paddingBottom="@dimen/content_padding_small_half" + android:layout_weight="0"> + + + + diff --git a/OsmAnd/src/net/osmand/plus/backup/BackupInfo.java b/OsmAnd/src/net/osmand/plus/backup/BackupInfo.java index 607428d2cca..597c4dfced8 100644 --- a/OsmAnd/src/net/osmand/plus/backup/BackupInfo.java +++ b/OsmAnd/src/net/osmand/plus/backup/BackupInfo.java @@ -89,11 +89,12 @@ private void createFilteredFilesToDownload(@NonNull OsmandApplication app) { private void createFilteredFilesToUpload(@NonNull OsmandApplication app) { List files = new ArrayList<>(); BackupHelper helper = app.getBackupHelper(); + boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); for (LocalFile localFile : filesToUpload) { ExportSettingsType type = localFile.item != null ? ExportSettingsType.getExportSettingsTypeForItem(localFile.item) : null; - if (type != null && helper.getBackupTypePref(type).get() && (type.isAllowedInFreeVersion() || proAvailable)) { + if (type != null && helper.getBackupTypePref(type).get() && (type.isAllowedInFreeVersion() || proAvailable || subscribedToPromo)) { files.add(localFile); } } diff --git a/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesFragment.java b/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesFragment.java index 888c84f32cd..57dd46110df 100644 --- a/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesFragment.java +++ b/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesFragment.java @@ -42,9 +42,10 @@ protected RemoteFilesType getRemoteFilesType() { @Override protected Map> getSelectedItems() { Map> selectedItemsMap = new EnumMap<>(ExportSettingsType.class); + boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); for (ExportSettingsType type : ExportSettingsType.values()) { - if (backupHelper.getBackupTypePref(type).get() && (type.isAllowedInFreeVersion() || proAvailable)) { + if (backupHelper.getBackupTypePref(type).get() && (type.isAllowedInFreeVersion() || proAvailable || subscribedToPromo)) { selectedItemsMap.put(type, getItemsForType(type)); } } diff --git a/OsmAnd/src/net/osmand/plus/backup/ui/BaseBackupTypesFragment.java b/OsmAnd/src/net/osmand/plus/backup/ui/BaseBackupTypesFragment.java index b34d862bd95..ccc2264ee3a 100644 --- a/OsmAnd/src/net/osmand/plus/backup/ui/BaseBackupTypesFragment.java +++ b/OsmAnd/src/net/osmand/plus/backup/ui/BaseBackupTypesFragment.java @@ -144,9 +144,10 @@ public void onCategorySelected(ExportSettingsCategory category, boolean selected boolean hasItemsToDelete = false; SettingsCategoryItems categoryItems = dataList.get(category); List types = categoryItems.getTypes(); + boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); for (ExportSettingsType type : types) { - if (type.isAllowedInFreeVersion() || proAvailable) { + if (type.isAllowedInFreeVersion() || proAvailable || subscribedToPromo) { List items = getItemsForType(type); hasItemsToDelete |= !Algorithms.isEmpty(items); selectedItemsMap.put(type, selected ? items : null); @@ -159,8 +160,9 @@ public void onCategorySelected(ExportSettingsCategory category, boolean selected @Override public void onTypeSelected(ExportSettingsType type, boolean selected) { + boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); - if (type.isAllowedInFreeVersion() && !proAvailable) { + if (type.isAllowedInFreeVersion() && !proAvailable && !subscribedToPromo) { List items = getItemsForType(type); selectedItemsMap.put(type, selected ? items : null); if (!selected && !Algorithms.isEmpty(items)) { diff --git a/OsmAnd/src/net/osmand/plus/myplaces/favorites/dialogs/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/favorites/dialogs/FavoritesTreeFragment.java index a6c016e6a24..eeaecde4fe7 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/favorites/dialogs/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/favorites/dialogs/FavoritesTreeFragment.java @@ -185,9 +185,10 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, searchView.setOnClickListener(v -> FavoritesSearchFragment.showInstance(getActivity(), "")); listView.addHeaderView(searchView); View dividerView = inflater.inflate(R.layout.list_item_divider, null, false); + boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); boolean isRegistered = app.getBackupHelper().isRegistered(); - if (!proAvailable && !isRegistered && !app.getSettings().FAVORITES_FREE_ACCOUNT_CARD_DISMISSED.get()) { + if (!subscribedToPromo && !proAvailable && !isRegistered && !app.getSettings().FAVORITES_FREE_ACCOUNT_CARD_DISMISSED.get()) { freeFavoritesBackupCardDivider = inflater.inflate(R.layout.list_item_divider, listView, false); listView.addHeaderView(freeFavoritesBackupCardDivider, null, false); freeFavoritesBackupCard = inflater.inflate(R.layout.free_backup_card, listView, false); @@ -667,6 +668,7 @@ public void shareFavoritesFinished() { } private void setupGetOsmAndCloudButton(@NonNull View view) { + View dismissButtonContainer = view.findViewById(R.id.dismiss_button_container); View dismissButton = view.findViewById(R.id.dismiss_button); UiUtilities iconsCache = app.getUIUtilities(); ImageView closeBtn = view.findViewById(R.id.btn_close); @@ -685,7 +687,7 @@ private void setupGetOsmAndCloudButton(@NonNull View view) { int buttonTextId = R.string.get_osmand_cloud; UiUtilities.setupDialogButton(nightMode, dismissButton, SECONDARY, buttonTextId); - dismissButton.setOnClickListener(v -> { + dismissButtonContainer.setOnClickListener(v -> { FragmentActivity activity = getActivity(); if (activity != null) { ((MyPlacesActivity) getActivity()).showOsmAndCloud(this); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java index 1a5e2f256b4..5e7f7addc1c 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java @@ -299,9 +299,10 @@ protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewH preference.setVisible(false); app.getSettings().CONFIGURE_PROFILE_FREE_ACCOUNT_CARD_DISMISSED.set(true); }); + View getCloudBtnContainer = holder.findViewById(R.id.dismiss_button_container); View getCloudBtn = holder.findViewById(R.id.dismiss_button); UiUtilities.setupDialogButton(isNightMode(), getCloudBtn, SECONDARY, R.string.get_osmand_cloud); - getCloudBtn.setOnClickListener(v -> { + getCloudBtnContainer.setOnClickListener(v -> { FragmentActivity activity = getActivity(); if (activity != null) { BackupAuthorizationFragment.showInstance(activity.getSupportFragmentManager()); @@ -341,9 +342,10 @@ private void setupNavigationSettingsPref() { } private void setupFreeFavoritesBackupCard() { + boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); boolean isRegistered = app.getBackupHelper().isRegistered(); - boolean shouldShowFreeBackupCard = !proAvailable && !isRegistered && !app.getSettings().CONFIGURE_PROFILE_FREE_ACCOUNT_CARD_DISMISSED.get(); + boolean shouldShowFreeBackupCard = !subscribedToPromo && !proAvailable && !isRegistered && !app.getSettings().CONFIGURE_PROFILE_FREE_ACCOUNT_CARD_DISMISSED.get(); Preference freeBackupCard = findPreference("free_favorites_backup_card"); if (freeBackupCard != null) { freeBackupCard.setVisible(shouldShowFreeBackupCard); diff --git a/OsmAnd/src/net/osmand/plus/settings/purchase/data/PurchaseUiDataUtils.java b/OsmAnd/src/net/osmand/plus/settings/purchase/data/PurchaseUiDataUtils.java index 3e58f861b1f..ab87705b358 100644 --- a/OsmAnd/src/net/osmand/plus/settings/purchase/data/PurchaseUiDataUtils.java +++ b/OsmAnd/src/net/osmand/plus/settings/purchase/data/PurchaseUiDataUtils.java @@ -142,9 +142,10 @@ public static boolean shouldShowBackupSubscription(@NonNull OsmandApplication ap } public static boolean shouldShowFreeAccRegistration(@NonNull OsmandApplication app) { + boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); boolean isRegistered = app.getBackupHelper().isRegistered(); - return !proAvailable && isRegistered; + return !subscribedToPromo && !proAvailable && isRegistered; } @NonNull From 48a7d0b4fed1fde5acdd784178770267732ed9cc Mon Sep 17 00:00:00 2001 From: Sergey Kharchenko Date: Tue, 18 Jul 2023 05:55:14 +0300 Subject: [PATCH 2/3] #1822: Fixed free account check (https://github.com/osmandapp/OsmAnd-Issues/issues/1822) --- .../src/net/osmand/plus/backup/ui/BackupTypesAdapter.java | 8 ++++---- .../osmand/plus/backup/ui/BaseBackupTypesFragment.java | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesAdapter.java b/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesAdapter.java index 40d7c034cba..f1786a02716 100644 --- a/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesAdapter.java +++ b/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesAdapter.java @@ -134,9 +134,9 @@ public View getChildView(int groupPosition, int childPosition, boolean isLastChi ImageView proIcon = view.findViewById(R.id.pro_icon); setupChildIcon(view, type.getIconRes(), selected && type.isAllowedInFreeVersion()); - boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); + boolean showProIcon = InAppPurchaseHelper.isOsmAndProAvailable(app) || type.isAllowedInFreeVersion(); proIcon.setImageResource(nightMode ? R.drawable.img_button_pro_night : R.drawable.img_button_pro_day); - proIcon.setVisibility(type.isAllowedInFreeVersion() || proAvailable ? View.GONE : View.VISIBLE); + proIcon.setVisibility(showProIcon ? View.GONE : View.VISIBLE); view.setOnClickListener(view1 -> { compoundButton.performClick(); if (listener != null) { @@ -144,8 +144,8 @@ public View getChildView(int groupPosition, int childPosition, boolean isLastChi } notifyDataSetChanged(); }); - AndroidUiHelper.updateVisibility(proIcon, !type.isAllowedInFreeVersion()); - AndroidUiHelper.updateVisibility(view.findViewById(R.id.switch_container), type.isAllowedInFreeVersion()); + AndroidUiHelper.updateVisibility(proIcon, !showProIcon); + AndroidUiHelper.updateVisibility(view.findViewById(R.id.switch_container), showProIcon); setupSelectableBackground(view); AndroidUiHelper.updateVisibility(view.findViewById(R.id.divider), false); AndroidUiHelper.updateVisibility(view.findViewById(R.id.card_top_divider), false); diff --git a/OsmAnd/src/net/osmand/plus/backup/ui/BaseBackupTypesFragment.java b/OsmAnd/src/net/osmand/plus/backup/ui/BaseBackupTypesFragment.java index ccc2264ee3a..cd90a6c8d56 100644 --- a/OsmAnd/src/net/osmand/plus/backup/ui/BaseBackupTypesFragment.java +++ b/OsmAnd/src/net/osmand/plus/backup/ui/BaseBackupTypesFragment.java @@ -144,10 +144,9 @@ public void onCategorySelected(ExportSettingsCategory category, boolean selected boolean hasItemsToDelete = false; SettingsCategoryItems categoryItems = dataList.get(category); List types = categoryItems.getTypes(); - boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); for (ExportSettingsType type : types) { - if (type.isAllowedInFreeVersion() || proAvailable || subscribedToPromo) { + if (type.isAllowedInFreeVersion() || proAvailable) { List items = getItemsForType(type); hasItemsToDelete |= !Algorithms.isEmpty(items); selectedItemsMap.put(type, selected ? items : null); @@ -160,9 +159,8 @@ public void onCategorySelected(ExportSettingsCategory category, boolean selected @Override public void onTypeSelected(ExportSettingsType type, boolean selected) { - boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); - if (type.isAllowedInFreeVersion() && !proAvailable && !subscribedToPromo) { + if (type.isAllowedInFreeVersion() || proAvailable) { List items = getItemsForType(type); selectedItemsMap.put(type, selected ? items : null); if (!selected && !Algorithms.isEmpty(items)) { From 9a5315b186d675855c0dfecc6d63ca1fefb989ca Mon Sep 17 00:00:00 2001 From: Sergey Kharchenko Date: Tue, 18 Jul 2023 12:00:21 +0300 Subject: [PATCH 3/3] #1822: FIxes after review --- OsmAnd/res/layout/free_backup_card.xml | 27 +++++++++---------- .../net/osmand/plus/backup/BackupInfo.java | 3 +-- .../plus/backup/ui/BackupTypesAdapter.java | 9 +++---- .../plus/backup/ui/BackupTypesFragment.java | 3 +-- .../dialogs/FavoritesTreeFragment.java | 7 +---- .../fragments/ConfigureProfileFragment.java | 5 +--- .../purchase/data/PurchaseUiDataUtils.java | 3 +-- 7 files changed, 21 insertions(+), 36 deletions(-) diff --git a/OsmAnd/res/layout/free_backup_card.xml b/OsmAnd/res/layout/free_backup_card.xml index 08aa90769dc..de3131a6728 100644 --- a/OsmAnd/res/layout/free_backup_card.xml +++ b/OsmAnd/res/layout/free_backup_card.xml @@ -7,7 +7,8 @@ android:layout_marginTop="@dimen/content_padding" android:background="?attr/bg_color" android:orientation="horizontal" - android:paddingStart="@dimen/content_padding"> + android:paddingStart="@dimen/content_padding" + > - - - - - + android:layout_marginBottom="@dimen/content_padding" + android:layout_weight="0"/> diff --git a/OsmAnd/src/net/osmand/plus/backup/BackupInfo.java b/OsmAnd/src/net/osmand/plus/backup/BackupInfo.java index 597c4dfced8..607428d2cca 100644 --- a/OsmAnd/src/net/osmand/plus/backup/BackupInfo.java +++ b/OsmAnd/src/net/osmand/plus/backup/BackupInfo.java @@ -89,12 +89,11 @@ private void createFilteredFilesToDownload(@NonNull OsmandApplication app) { private void createFilteredFilesToUpload(@NonNull OsmandApplication app) { List files = new ArrayList<>(); BackupHelper helper = app.getBackupHelper(); - boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); for (LocalFile localFile : filesToUpload) { ExportSettingsType type = localFile.item != null ? ExportSettingsType.getExportSettingsTypeForItem(localFile.item) : null; - if (type != null && helper.getBackupTypePref(type).get() && (type.isAllowedInFreeVersion() || proAvailable || subscribedToPromo)) { + if (type != null && helper.getBackupTypePref(type).get() && (type.isAllowedInFreeVersion() || proAvailable)) { files.add(localFile); } } diff --git a/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesAdapter.java b/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesAdapter.java index f1786a02716..4f3e91a403e 100644 --- a/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesAdapter.java +++ b/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesAdapter.java @@ -133,10 +133,9 @@ public View getChildView(int groupPosition, int childPosition, boolean isLastChi UiUtilities.setupCompoundButton(compoundButton, nightMode, CompoundButtonType.GLOBAL); ImageView proIcon = view.findViewById(R.id.pro_icon); - setupChildIcon(view, type.getIconRes(), selected && type.isAllowedInFreeVersion()); - boolean showProIcon = InAppPurchaseHelper.isOsmAndProAvailable(app) || type.isAllowedInFreeVersion(); + boolean showProIcon = !InAppPurchaseHelper.isOsmAndProAvailable(app) && !type.isAllowedInFreeVersion(); + setupChildIcon(view, type.getIconRes(), selected && !showProIcon); proIcon.setImageResource(nightMode ? R.drawable.img_button_pro_night : R.drawable.img_button_pro_day); - proIcon.setVisibility(showProIcon ? View.GONE : View.VISIBLE); view.setOnClickListener(view1 -> { compoundButton.performClick(); if (listener != null) { @@ -144,8 +143,8 @@ public View getChildView(int groupPosition, int childPosition, boolean isLastChi } notifyDataSetChanged(); }); - AndroidUiHelper.updateVisibility(proIcon, !showProIcon); - AndroidUiHelper.updateVisibility(view.findViewById(R.id.switch_container), showProIcon); + AndroidUiHelper.updateVisibility(proIcon, showProIcon); + AndroidUiHelper.updateVisibility(view.findViewById(R.id.switch_container), !showProIcon); setupSelectableBackground(view); AndroidUiHelper.updateVisibility(view.findViewById(R.id.divider), false); AndroidUiHelper.updateVisibility(view.findViewById(R.id.card_top_divider), false); diff --git a/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesFragment.java b/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesFragment.java index 57dd46110df..888c84f32cd 100644 --- a/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesFragment.java +++ b/OsmAnd/src/net/osmand/plus/backup/ui/BackupTypesFragment.java @@ -42,10 +42,9 @@ protected RemoteFilesType getRemoteFilesType() { @Override protected Map> getSelectedItems() { Map> selectedItemsMap = new EnumMap<>(ExportSettingsType.class); - boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); for (ExportSettingsType type : ExportSettingsType.values()) { - if (backupHelper.getBackupTypePref(type).get() && (type.isAllowedInFreeVersion() || proAvailable || subscribedToPromo)) { + if (backupHelper.getBackupTypePref(type).get() && (type.isAllowedInFreeVersion() || proAvailable)) { selectedItemsMap.put(type, getItemsForType(type)); } } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/favorites/dialogs/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/favorites/dialogs/FavoritesTreeFragment.java index eeaecde4fe7..b511798b3f2 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/favorites/dialogs/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/favorites/dialogs/FavoritesTreeFragment.java @@ -185,10 +185,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, searchView.setOnClickListener(v -> FavoritesSearchFragment.showInstance(getActivity(), "")); listView.addHeaderView(searchView); View dividerView = inflater.inflate(R.layout.list_item_divider, null, false); - boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); boolean isRegistered = app.getBackupHelper().isRegistered(); - if (!subscribedToPromo && !proAvailable && !isRegistered && !app.getSettings().FAVORITES_FREE_ACCOUNT_CARD_DISMISSED.get()) { + if (!proAvailable && !isRegistered && !app.getSettings().FAVORITES_FREE_ACCOUNT_CARD_DISMISSED.get()) { freeFavoritesBackupCardDivider = inflater.inflate(R.layout.list_item_divider, listView, false); listView.addHeaderView(freeFavoritesBackupCardDivider, null, false); freeFavoritesBackupCard = inflater.inflate(R.layout.free_backup_card, listView, false); @@ -669,7 +668,6 @@ public void shareFavoritesFinished() { private void setupGetOsmAndCloudButton(@NonNull View view) { View dismissButtonContainer = view.findViewById(R.id.dismiss_button_container); - View dismissButton = view.findViewById(R.id.dismiss_button); UiUtilities iconsCache = app.getUIUtilities(); ImageView closeBtn = view.findViewById(R.id.btn_close); closeBtn.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_cancel, isNightMode())); @@ -685,15 +683,12 @@ private void setupGetOsmAndCloudButton(@NonNull View view) { } }); - int buttonTextId = R.string.get_osmand_cloud; - UiUtilities.setupDialogButton(nightMode, dismissButton, SECONDARY, buttonTextId); dismissButtonContainer.setOnClickListener(v -> { FragmentActivity activity = getActivity(); if (activity != null) { ((MyPlacesActivity) getActivity()).showOsmAndCloud(this); } }); - AndroidUiHelper.updateVisibility(dismissButton, true); } class FavouritesAdapter extends OsmandBaseExpandableListAdapter implements Filterable { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java index 5e7f7addc1c..4c198056f20 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java @@ -300,8 +300,6 @@ protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewH app.getSettings().CONFIGURE_PROFILE_FREE_ACCOUNT_CARD_DISMISSED.set(true); }); View getCloudBtnContainer = holder.findViewById(R.id.dismiss_button_container); - View getCloudBtn = holder.findViewById(R.id.dismiss_button); - UiUtilities.setupDialogButton(isNightMode(), getCloudBtn, SECONDARY, R.string.get_osmand_cloud); getCloudBtnContainer.setOnClickListener(v -> { FragmentActivity activity = getActivity(); if (activity != null) { @@ -342,10 +340,9 @@ private void setupNavigationSettingsPref() { } private void setupFreeFavoritesBackupCard() { - boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); boolean isRegistered = app.getBackupHelper().isRegistered(); - boolean shouldShowFreeBackupCard = !subscribedToPromo && !proAvailable && !isRegistered && !app.getSettings().CONFIGURE_PROFILE_FREE_ACCOUNT_CARD_DISMISSED.get(); + boolean shouldShowFreeBackupCard = !proAvailable && !isRegistered && !app.getSettings().CONFIGURE_PROFILE_FREE_ACCOUNT_CARD_DISMISSED.get(); Preference freeBackupCard = findPreference("free_favorites_backup_card"); if (freeBackupCard != null) { freeBackupCard.setVisible(shouldShowFreeBackupCard); diff --git a/OsmAnd/src/net/osmand/plus/settings/purchase/data/PurchaseUiDataUtils.java b/OsmAnd/src/net/osmand/plus/settings/purchase/data/PurchaseUiDataUtils.java index ab87705b358..3e58f861b1f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/purchase/data/PurchaseUiDataUtils.java +++ b/OsmAnd/src/net/osmand/plus/settings/purchase/data/PurchaseUiDataUtils.java @@ -142,10 +142,9 @@ public static boolean shouldShowBackupSubscription(@NonNull OsmandApplication ap } public static boolean shouldShowFreeAccRegistration(@NonNull OsmandApplication app) { - boolean subscribedToPromo = InAppPurchaseHelper.isSubscribedToPromo(app); boolean proAvailable = InAppPurchaseHelper.isOsmAndProAvailable(app); boolean isRegistered = app.getBackupHelper().isRegistered(); - return !subscribedToPromo && !proAvailable && isRegistered; + return !proAvailable && isRegistered; } @NonNull