Skip to content

Commit

Permalink
WIP: Android part started
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyBarabash committed Jul 8, 2022
1 parent 0e2ef60 commit e496045
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public class BraveSyncScreensPreference extends BravePreferenceFragment
private Button mCopyButton;
private Button mAddDeviceButton;
private Button mShowCategoriesButton;
private Button mDeleteAccountButton;
private Button mQRCodeButton;
private Button mCodeWordsButton;
// Brave Sync message text view
Expand Down Expand Up @@ -456,6 +457,11 @@ public void onActivityCreated(Bundle savedInstanceState) {
mAddDeviceButton.setOnClickListener(this);
}

mDeleteAccountButton = (Button) getView().findViewById(R.id.brave_sync_btn_delete_account);
if (null != mDeleteAccountButton) {
mDeleteAccountButton.setOnClickListener(this);
}

mShowCategoriesButton =
(Button) getView().findViewById(R.id.brave_sync_btn_show_categories);
if (null != mShowCategoriesButton) {
Expand Down Expand Up @@ -580,7 +586,7 @@ public void onClick(View v) {
&& v != mUseCameraButton && v != mConfirmCodeWordsButton
&& v != mMobileButton && v != mLaptopButton && v != mPasteButton
&& v != mCopyButton && v != mShowCategoriesButton && v != mAddDeviceButton
&& v != mQRCodeButton && v != mCodeWordsButton
&& v != mDeleteAccountButton && v != mQRCodeButton && v != mCodeWordsButton
&& v != mBraveSyncBtnAndroidSyncSettings))
return;

Expand Down Expand Up @@ -715,6 +721,8 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {
settingsLauncher.launchSettingsActivity(getContext(), BraveManageSyncSettings.class);
} else if (mAddDeviceButton == v) {
setNewChainLayout();
} else if (mDeleteAccountButton == v) {
permanentlyDeleteAccount();
}
}

Expand Down Expand Up @@ -1132,6 +1140,12 @@ public void onClick(DialogInterface dialog, int button) {
alertDialog.show();
}

private void permanentlyDeleteAccount() {
Toast.makeText(getActivity().getApplicationContext(), "permanentlyDeleteAccount()",
Toast.LENGTH_LONG)
.show();
}

private boolean mLeaveSyncChainInProgress;

private void startLeaveSyncChainOperations() {
Expand Down
8 changes: 8 additions & 0 deletions android/java/res/layout/brave_sync_done.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,13 @@
style="@style/BraveSyncButton"
android:background="@android:color/transparent"
android:textColor="@color/modern_grey_600" />

<android.widget.Button android:id="@+id/brave_sync_btn_delete_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/brave_sync_delete_account_text"
style="@style/BraveSyncButton"
android:background="@android:color/transparent"
android:textColor="@color/modern_grey_600" />
</LinearLayout>
</ScrollView>
3 changes: 3 additions & 0 deletions browser/ui/android/strings/android_brave_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,9 @@ until they verify, or until 90 days have passed.
</message>
<message name="IDS_BRAVE_SYNC_CATEGORIES_TEXT" desc="Text for button to show data types to sync. Renamed from Categories">
Data Preferences
</message>
<message name="IDS_BRAVE_SYNC_DELETE_ACCOUNT_TEXT" desc="Text for button which deletes all sync chain data on the server">
Delete Sync account
</message>
<message name="IDS_BRAVE_SYNC_REMOVE_DEVICE_TEXT" desc="Text for Brave Sync remove device message.">
Remove device
Expand Down

0 comments on commit e496045

Please sign in to comment.