Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete account #17510

Merged
merged 5 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions OsmAnd/res/drawable/dlg_btn_tertiary_harmfull.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/deletion_color_warning" />
<corners android:radius="@dimen/dlg_button_rect_rad" />
</shape>
</item>
<item android:state_enabled="false">
<shape android:shape="rectangle">
<solid android:color="@color/inactive_buttons_and_links_bg_light" />
<corners android:radius="@dimen/dlg_button_rect_rad" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/deletion_color_warning" />
<corners android:radius="@dimen/dlg_button_rect_rad" />
</shape>
</item>
</selector>
10 changes: 8 additions & 2 deletions OsmAnd/res/layout/fragment_backup_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,19 @@

<include
android:id="@+id/delete_all_container"
layout="@layout/preference_with_descr" />
layout="@layout/preference_button" />

<include layout="@layout/divider_half_item_with_background" />

<include
android:id="@+id/delete_old_container"
layout="@layout/preference_with_descr" />
layout="@layout/preference_button" />

<include layout="@layout/divider_half_item_with_background" />

<include
android:id="@+id/delete_account_container"
layout="@layout/preference_button" />

</LinearLayout>

Expand Down
10 changes: 9 additions & 1 deletion OsmAnd/res/layout/fragment_cloud_authorize.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
osmand:layout_behavior="net.osmand.plus.backup.ui.AuthorizeFragment$FixScrollingFooterBehaviour">
osmand:layout_behavior="net.osmand.plus.backup.ui.ScrollingFooterBehaviour">

<me.zhanghai.android.materialprogressbar.MaterialProgressBar
android:id="@+id/progress_bar"
Expand Down Expand Up @@ -68,6 +68,14 @@
android:layout_marginTop="@dimen/content_padding_small_half"
android:visibility="gone" />

<include
android:id="@+id/delete_account_container"
layout="@layout/authorize_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/content_padding_small_half"
android:visibility="gone" />

<include
android:id="@+id/verify_email_container"
layout="@layout/verify_email_container"
Expand Down
213 changes: 213 additions & 0 deletions OsmAnd/res/layout/fragment_delete_backup_account.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/list_background_color"
android:clickable="true"
android:focusable="true">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
osmand:layout_behavior="net.osmand.plus.backup.ui.ScrollingFooterBehaviour">

<androidx.core.widget.NestedScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/bottom_sheet_large_list_item_height">

<LinearLayout
android:id="@+id/warnings_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<net.osmand.plus.widgets.TextViewEx
android:id="@+id/warning"
style="@style/TitleStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/content_padding"
android:layout_marginVertical="@dimen/content_padding_small"
android:textColor="?android:textColorPrimary"
tools:text="@string/delete_account_warning" />

<include
android:id="@+id/data_deleted"
layout="@layout/simple_warning_item" />

<include
android:id="@+id/account_deleted"
layout="@layout/simple_warning_item" />

<include
android:id="@+id/secondary_devices"
layout="@layout/simple_warning_item" />

<include layout="@layout/simple_divider_item" />

<net.osmand.plus.widgets.TextViewEx
android:id="@+id/manage_subscriptions"
style="@style/DescStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginHorizontal="@dimen/content_padding"
android:layout_marginVertical="@dimen/content_padding_small"
android:textColor="?android:textColorSecondary"
tools:text="@string/osmand_cloud_deletion_subscriptions_warning" />

</LinearLayout>

<LinearLayout
android:id="@+id/progress_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/dialog_content_margin">

<me.zhanghai.android.materialprogressbar.MaterialProgressBar
android:id="@+id/progress_bar"
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_marginHorizontal="@dimen/content_padding"
android:layout_marginBottom="@dimen/content_padding_small_half"
android:indeterminate="false"
osmand:mpb_progressStyle="horizontal"
osmand:mpb_setBothDrawables="true"
osmand:mpb_useIntrinsicPadding="false" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/content_padding"
android:layout_marginVertical="@dimen/content_padding_small"
android:orientation="horizontal">

<net.osmand.plus.widgets.TextViewEx
style="@style/TitleStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/shared_string_progress"
android:textColor="?android:textColorPrimary" />

<net.osmand.plus.widgets.TextViewEx
android:id="@+id/percentage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:lineSpacingMultiplier="@dimen/text_button_letter_spacing"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular"
tools:text="25%" />

</LinearLayout>

<include layout="@layout/simple_divider_item" />

<net.osmand.plus.widgets.TextViewEx
android:id="@+id/progress_description"
style="@style/TitleStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginHorizontal="@dimen/content_padding"
android:layout_marginVertical="@dimen/content_padding_small"
android:textColor="?android:textColorSecondary"
tools:text="@string/osmand_cloud_deleting_account_descr" />

</LinearLayout>

</LinearLayout>

</androidx.core.widget.NestedScrollView>

<LinearLayout
android:id="@+id/buttons_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?attr/list_background_color"
android:orientation="vertical"
android:paddingHorizontal="@dimen/content_padding"
android:paddingBottom="@dimen/content_padding">

<net.osmand.plus.widgets.TextViewEx
android:id="@+id/delete_button_warning"
style="@style/DescStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginVertical="@dimen/content_padding_small"
android:text="@string/action_cannot_be_undone"
android:textColor="?android:textColorSecondary" />

<include
android:id="@+id/delete_button"
layout="@layout/bottom_sheet_dialog_button"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_cancel_button_height" />

<include
android:id="@+id/close_button"
layout="@layout/bottom_sheet_dialog_button"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_button_height" />

</LinearLayout>

</FrameLayout>

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:stateListAnimator="@animator/appbar_always_elevated">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height_expanded"
android:background="?attr/list_background_color"
osmand:collapsedTitleTextAppearance="@style/AppBarTitlePrimary"
osmand:expandedTitleGravity="start|bottom"
osmand:expandedTitleMarginBottom="@dimen/content_padding_small"
osmand:expandedTitleMarginEnd="@dimen/content_padding"
osmand:expandedTitleMarginStart="@dimen/content_padding"
osmand:expandedTitleTextAppearance="@style/AppBarTitlePrimary"
osmand:layout_scrollFlags="scroll|exitUntilCollapsed">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:minHeight="@dimen/toolbar_height"
osmand:layout_collapseMode="pin"
osmand:layout_scrollFlags="scroll|enterAlways|exitUntilCollapsed"
osmand:titleMarginEnd="0dp"
osmand:titleMarginStart="0dp"
tools:title="@string/delete_account">

</androidx.appcompat.widget.Toolbar>

</com.google.android.material.appbar.CollapsingToolbarLayout>

</com.google.android.material.appbar.AppBarLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
29 changes: 29 additions & 0 deletions OsmAnd/res/layout/simple_warning_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
android:paddingVertical="@dimen/content_padding_small">

<ImageView
android:id="@+id/icon"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="@dimen/content_padding"
tools:src="@drawable/ic_action_info_dark"
tools:tint="@color/icon_color_default_light" />

<net.osmand.plus.widgets.TextViewEx
android:id="@+id/title"
style="@style/TitleStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="@dimen/content_padding"
android:layout_weight="1"
android:textColor="?android:textColorPrimary"
tools:text="Title" />

</LinearLayout>
1 change: 1 addition & 0 deletions OsmAnd/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -529,4 +529,5 @@
<color name="track_gradient_end">#F3374D</color>

<color name="external_device_empty_icon_bg_day">#F3F4F6</color>
<color name="deletion_color_warning">#E71D36</color>
</resources>
17 changes: 17 additions & 0 deletions OsmAnd/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@
Thx - Hardy
-->

<string name="osmand_cloud_deleted_account_descr">Account and all data was deleted from OsmAnd Cloud.</string>
<string name="osmand_cloud_deleting_account_descr">In few moments all your data and account will be deleted from OsmAnd Cloud.\n\nAll data on the device remain untouched.</string>
<string name="osmand_cloud_delete_account_confirmation_descr">Are you sure you want to delete OsmAnd Cloud account?\n\nThis action can’t be undone.</string>
<string name="osmand_cloud_delete_account_confirmation">Delete account?</string>
<string name="action_cannot_be_undone">This action can\'t be undone.</string>
<string name="osmand_cloud_deletion_secondary_devices_warning">Secondary devices will be logged off from OsmAnd Cloud and lose access to paid features.</string>
<string name="osmand_cloud_deletion_account_warning">Your account and all account details will be %1$s</string>
<string name="osmand_cloud_deletion_all_data_warning">All data from OsmAnd Cloud will be %1$s. Data on the device remains untouched.</string>
<string name="osmand_cloud_deletion_subscriptions_warning">This will not cancel your OsmAnd Pro subscription.</string>
<string name="manage_subscriptions">Manage subscriptions.</string>
<string name="delete_account_warning">Are you sure you want to delete %1$s account?</string>
<string name="shared_string_deleting">Deleting</string>
<string name="deleting_complete">Deleting complete</string>
<string name="delete_account">Delete account</string>
<string name="backup_error_delete_account_email_match">Email doesn\'t match login username</string>
<string name="verify_account_deletion_descr">We need to verify your account before delete it.\n\nPlease enter the e-mail address you registered with. A one-time password for the next step will be sent to it.</string>
<string name="verify_account">Verify your account</string>
<string name="slope_legend_description">Slope uses colors to visualize terrain steepness. You can read more about Slopes in %1$s.</string>
<string name="terrain_category_description">Terrain contour lines, full hillshade map with dark shades and slope maps with colors to show peaks and lowlands. </string>
<string name="free_mode">Free mode</string>
Expand Down
6 changes: 6 additions & 0 deletions OsmAnd/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,12 @@
<item name="android:textSize">@dimen/dialog_header_text_size</item>
</style>


<style name="AppBarTitlePrimary" parent="TextAppearance.AppCompat.Title">
<item name="android:textColor">?android:textColorPrimary</item>
<item name="android:textSize">@dimen/dialog_header_text_size</item>
</style>

<style name="ThemeOverlay.AppCompat.ActionBar">
<item name="android:padding">0dp</item>
<item name="titleMargin">0dp</item>
Expand Down
14 changes: 3 additions & 11 deletions OsmAnd/src/net/osmand/plus/activities/MapActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.auto.NavigationSession;
import net.osmand.plus.backup.ui.BackupCloudFragment;
import net.osmand.plus.base.BaseOsmAndFragment;
import net.osmand.plus.base.ContextMenuFragment;
import net.osmand.plus.base.MapViewTrackingUtilities;
Expand Down Expand Up @@ -2061,7 +2060,7 @@ private void hideVisibleMenu() {
} else if (mapContextMenu.getMultiSelectionMenu().isVisible()) {
mapContextMenu.getMultiSelectionMenu().hide();
} else if (getTrackMenuFragment() != null) {
dismissTrackMenu();
dismissFragment(TrackMenuFragment.TAG);
}
}

Expand Down Expand Up @@ -2129,17 +2128,10 @@ public WeatherForecastFragment getWeatherForecastFragment() {
return getFragment(WeatherForecastFragment.TAG);
}

public void dismissTrackMenu() {
public void dismissFragment(@Nullable String name) {
FragmentManager fragmentManager = getSupportFragmentManager();
if (!fragmentManager.isStateSaved()) {
fragmentManager.popBackStack(TrackMenuFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
}

public void dismissBackupCloudFragment() {
FragmentManager fragmentManager = getSupportFragmentManager();
if (!fragmentManager.isStateSaved()) {
fragmentManager.popBackStack(BackupCloudFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
fragmentManager.popBackStack(name, FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
}

Expand Down
Loading