Remove Add account dialog
Change button text to rename
This commit is contained in:
+2
-2
@@ -60,8 +60,8 @@ public class AccountDetailActivity
|
||||
startActivity(accountDetailsWithQrActivityIntent);
|
||||
}
|
||||
});
|
||||
TextView btnEdit = findViewById(R.id.edit_btn);
|
||||
btnEdit.setOnClickListener(new View.OnClickListener() {
|
||||
TextView btnRename = findViewById(R.id.rename_btn);
|
||||
btnRename.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO add action for edit
|
||||
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
/* Copyright (c) 2021 The Brave Authors. All rights reserved.
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.chromium.chrome.browser.crypto_wallet.fragments;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import org.chromium.chrome.R;
|
||||
|
||||
public class AddAccountOnboardingDialogFragment
|
||||
extends DialogFragment implements View.OnClickListener {
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
setDialogParams();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
assert getDialog() != null;
|
||||
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||
if ((keyCode == android.view.KeyEvent.KEYCODE_BACK)) {
|
||||
dismiss();
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
});
|
||||
setDialogParams();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(
|
||||
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_add_account_onboarding_dialog, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
Button mDoneButton = view.findViewById(R.id.btn_enable);
|
||||
mDoneButton.setOnClickListener(this);
|
||||
|
||||
ImageView btnClose = view.findViewById(R.id.btn_close);
|
||||
btnClose.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
private void setDialogParams() {
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
assert getActivity() != null;
|
||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
int mDeviceWidth = displayMetrics.widthPixels;
|
||||
|
||||
assert getDialog() != null;
|
||||
WindowManager.LayoutParams params = getDialog().getWindow().getAttributes();
|
||||
boolean isTablet = false;
|
||||
boolean isLandscape = false;
|
||||
if (isTablet) {
|
||||
params.width = (int) (0.5 * mDeviceWidth);
|
||||
} else {
|
||||
if (isLandscape) {
|
||||
params.width = (int) (0.5 * mDeviceWidth);
|
||||
} else {
|
||||
params.width = (int) (0.9 * mDeviceWidth);
|
||||
}
|
||||
}
|
||||
params.height = LinearLayout.LayoutParams.WRAP_CONTENT;
|
||||
getDialog().getWindow().setAttributes(params);
|
||||
}
|
||||
}
|
||||
-12
@@ -24,7 +24,6 @@ import org.chromium.brave_wallet.mojom.KeyringController;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.crypto_wallet.activities.BraveWalletActivity;
|
||||
import org.chromium.chrome.browser.crypto_wallet.adapters.RecoveryPhraseAdapter;
|
||||
import org.chromium.chrome.browser.crypto_wallet.fragments.AddAccountOnboardingDialogFragment;
|
||||
import org.chromium.chrome.browser.crypto_wallet.util.ItemOffsetDecoration;
|
||||
import org.chromium.chrome.browser.crypto_wallet.util.Utils;
|
||||
import org.chromium.ui.widget.Toast;
|
||||
@@ -77,7 +76,6 @@ public class VerifyRecoveryPhraseFragment extends CryptoOnboardingFragment {
|
||||
recoveryPhrasesToVerifyAdapter.getRecoveryPhraseList());
|
||||
if (result.equals(recoveryPhraseToVerify)) {
|
||||
onNextPage.gotoNextPage(true);
|
||||
showAddAccountDialog();
|
||||
} else {
|
||||
phraseNotMatch();
|
||||
}
|
||||
@@ -153,16 +151,6 @@ public class VerifyRecoveryPhraseFragment extends CryptoOnboardingFragment {
|
||||
selectedPhraseRecyclerView.setAdapter(recoveryPhrasesToVerifyAdapter);
|
||||
}
|
||||
|
||||
private void showAddAccountDialog() {
|
||||
AddAccountOnboardingDialogFragment addAccountOnboardingDialogFragment =
|
||||
new AddAccountOnboardingDialogFragment();
|
||||
addAccountOnboardingDialogFragment.setCancelable(false);
|
||||
assert getActivity() != null;
|
||||
addAccountOnboardingDialogFragment.show(
|
||||
((FragmentActivity) getActivity()).getSupportFragmentManager(),
|
||||
"AddAccountOnboardingDialog");
|
||||
}
|
||||
|
||||
OnRecoveryPhraseSelected onRecoveryPhraseSelected = new OnRecoveryPhraseSelected() {
|
||||
@Override
|
||||
public void onSelectedRecoveryPhrase(String phrase) {
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="VectorRaster"
|
||||
android:width="221dp"
|
||||
android:height="120dp"
|
||||
android:viewportWidth="221"
|
||||
android:viewportHeight="120">
|
||||
<path
|
||||
android:pathData="M164.184,54.513m-50.568,0a50.568,50.568 0,1 1,101.136 0a50.568,50.568 0,1 1,-101.136 0"
|
||||
android:fillColor="#3B3E4F"/>
|
||||
<path
|
||||
android:pathData="M136.551,87.631L156.954,87.631A1.133,1.133 0,0 1,158.088 88.765L158.088,92.59A1.133,1.133 0,0 1,156.954 93.724L136.551,93.724A1.133,1.133 0,0 1,135.418 92.59L135.418,88.765A1.133,1.133 0,0 1,136.551 87.631z"
|
||||
android:fillColor="#FFDD63"/>
|
||||
<path
|
||||
android:pathData="M135.417,89.803h22.67v1.749h-22.67z"
|
||||
android:fillColor="#FFD43B"/>
|
||||
<path
|
||||
android:pathData="M170.553,87.631L190.956,87.631A1.133,1.133 0,0 1,192.09 88.765L192.09,92.59A1.133,1.133 0,0 1,190.956 93.724L170.553,93.724A1.133,1.133 0,0 1,169.42 92.59L169.42,88.765A1.133,1.133 0,0 1,170.553 87.631z"
|
||||
android:fillColor="#FFDD63"/>
|
||||
<path
|
||||
android:pathData="M169.42,89.803h22.67v1.749h-22.67z"
|
||||
android:fillColor="#FFD43B"/>
|
||||
<path
|
||||
android:pathData="M136.551,93.724L156.954,93.724A1.133,1.133 0,0 1,158.088 94.857L158.088,98.683A1.133,1.133 0,0 1,156.954 99.816L136.551,99.816A1.133,1.133 0,0 1,135.418 98.683L135.418,94.857A1.133,1.133 0,0 1,136.551 93.724z"
|
||||
android:fillColor="#FFDD63"/>
|
||||
<path
|
||||
android:pathData="M135.417,95.895h22.67v1.749h-22.67z"
|
||||
android:fillColor="#FFD43B"/>
|
||||
<path
|
||||
android:pathData="M170.553,93.724L190.956,93.724A1.133,1.133 0,0 1,192.09 94.857L192.09,98.683A1.133,1.133 0,0 1,190.956 99.816L170.553,99.816A1.133,1.133 0,0 1,169.42 98.683L169.42,94.857A1.133,1.133 0,0 1,170.553 93.724z"
|
||||
android:fillColor="#FFDD63"/>
|
||||
<path
|
||||
android:pathData="M169.42,95.895h22.67v1.749h-22.67z"
|
||||
android:fillColor="#FFD43B"/>
|
||||
<path
|
||||
android:pathData="M136.551,81.539L156.954,81.539A1.133,1.133 0,0 1,158.088 82.673L158.088,86.498A1.133,1.133 0,0 1,156.954 87.631L136.551,87.631A1.133,1.133 0,0 1,135.418 86.498L135.418,82.673A1.133,1.133 0,0 1,136.551 81.539z"
|
||||
android:fillColor="#FFDD63"/>
|
||||
<path
|
||||
android:pathData="M135.417,83.71h22.67v1.749h-22.67z"
|
||||
android:fillColor="#FFD43B"/>
|
||||
<path
|
||||
android:pathData="M153.982,92.237L174.385,92.237A1.133,1.133 0,0 1,175.519 93.37L175.519,97.196A1.133,1.133 0,0 1,174.385 98.329L153.982,98.329A1.133,1.133 0,0 1,152.849 97.196L152.849,93.37A1.133,1.133 0,0 1,153.982 92.237z"
|
||||
android:fillColor="#FFDD63"/>
|
||||
<path
|
||||
android:pathData="M152.849,94.408h22.67v1.749h-22.67z"
|
||||
android:fillColor="#FFD43B"/>
|
||||
<path
|
||||
android:pathData="M170.553,81.539L190.956,81.539A1.133,1.133 0,0 1,192.09 82.673L192.09,86.498A1.133,1.133 0,0 1,190.956 87.631L170.553,87.631A1.133,1.133 0,0 1,169.42 86.498L169.42,82.673A1.133,1.133 0,0 1,170.553 81.539z"
|
||||
android:fillColor="#FFDD63"/>
|
||||
<path
|
||||
android:pathData="M169.42,83.71h22.67v1.749h-22.67z"
|
||||
android:fillColor="#FFD43B"/>
|
||||
<path
|
||||
android:pathData="M153.982,86.145L174.385,86.145A1.133,1.133 0,0 1,175.519 87.278L175.519,91.103A1.133,1.133 0,0 1,174.385 92.237L153.982,92.237A1.133,1.133 0,0 1,152.849 91.103L152.849,87.278A1.133,1.133 0,0 1,153.982 86.145z"
|
||||
android:fillColor="#FFDD63"/>
|
||||
<path
|
||||
android:pathData="M152.849,88.316h22.67v1.749h-22.67z"
|
||||
android:fillColor="#FFD43B"/>
|
||||
<path
|
||||
android:pathData="M165.954,29.399C169.698,29.399 172.704,30.425 174.972,32.477C177.276,34.493 178.428,37.283 178.428,40.847C178.428,44.375 177.294,47.075 175.026,48.947C172.758,50.783 169.752,51.701 166.008,51.701L165.792,55.859H159.15L158.88,46.679H161.31C164.442,46.679 166.854,46.265 168.546,45.437C170.238,44.609 171.084,43.097 171.084,40.901C171.084,39.317 170.616,38.057 169.68,37.121C168.78,36.185 167.538,35.717 165.954,35.717C164.298,35.717 163.002,36.167 162.066,37.067C161.166,37.967 160.716,39.209 160.716,40.793H153.588C153.552,38.597 154.02,36.635 154.992,34.907C155.964,33.179 157.386,31.829 159.258,30.857C161.166,29.885 163.398,29.399 165.954,29.399ZM162.444,68.765C161.076,68.765 159.942,68.351 159.042,67.523C158.178,66.659 157.746,65.597 157.746,64.337C157.746,63.077 158.178,62.033 159.042,61.205C159.942,60.341 161.076,59.909 162.444,59.909C163.776,59.909 164.874,60.341 165.738,61.205C166.602,62.033 167.034,63.077 167.034,64.337C167.034,65.597 166.602,66.659 165.738,67.523C164.874,68.351 163.776,68.765 162.444,68.765Z"
|
||||
android:fillColor="#DADCE8"/>
|
||||
<path
|
||||
android:pathData="M135.084,17.146C131.445,20.395 128.249,24.278 125.67,28.744C112.89,50.88 120.126,78.985 141.832,91.517C163.539,104.049 191.496,96.264 204.277,74.128C208.648,66.557 210.678,58.287 210.588,50.181C212.641,60.372 211.231,71.062 205.802,80.464C193.304,102.111 164.243,108.731 140.893,95.249C117.542,81.768 108.744,53.29 121.242,31.643C124.728,25.605 129.503,20.736 135.084,17.146Z"
|
||||
android:fillColor="#A6ADB4"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M164.921,55.003m-50.44,0a50.44,50.44 0,1 1,100.88 0a50.44,50.44 0,1 1,-100.88 0"
|
||||
android:strokeWidth="9.06783"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#CED4DA"/>
|
||||
<path
|
||||
android:pathData="M54.974,55.004m-54.974,0a54.974,54.974 0,1 1,109.947 0a54.974,54.974 0,1 1,-109.947 0"
|
||||
android:fillColor="#F1F3F5"/>
|
||||
<path
|
||||
android:pathData="M54.974,55.003m-41.372,0a41.372,41.372 0,1 1,82.744 0a41.372,41.372 0,1 1,-82.744 0"
|
||||
android:strokeWidth="4.53391"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#CED4DA"/>
|
||||
</vector>
|
||||
@@ -64,10 +64,10 @@
|
||||
android:paddingEnd="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:id = "@+id/edit_btn"
|
||||
android:id = "@+id/rename_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/edit"
|
||||
android:text="@string/rename"
|
||||
android:textColor="@color/wallet_text_color"
|
||||
android:background="@drawable/rounded_white_holo_bg"
|
||||
app:drawableStartCompat="@drawable/ic_edit"
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@null"
|
||||
android:layout_gravity="end"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="16dp"
|
||||
app:srcCompat="@drawable/ic_baseline_close_24"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@null"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="20dp"
|
||||
app:srcCompat="@drawable/ic_add_account_onboarding"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/all_set"
|
||||
android:textColor="@color/wallet_text_color"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/add_account_dialog_text"
|
||||
android:textColor="#868E96"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_enable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/crypto_wallet_blue_button"
|
||||
android:text="@string/add_account"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textColor="@android:color/white"
|
||||
style="?android:attr/borderlessButtonStyle"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
Reference in New Issue
Block a user