Merge pull request #11316 from brave/android_wallet_ui_tweaks
Makes small UI adjustments to wallets on Android
This commit is contained in:
+3
-2
@@ -65,8 +65,9 @@ public class AccountDetailsWithQrActivity
|
||||
accountValueText.setText(Utils.stripAccountAddress(mAddress));
|
||||
|
||||
ImageView accountCopyImage = findViewById(R.id.account_copy_image);
|
||||
accountCopyImage.setOnClickListener(
|
||||
v -> Utils.saveTextToClipboard(AccountDetailsWithQrActivity.this, mAddress));
|
||||
accountCopyImage.setOnClickListener(v
|
||||
-> Utils.saveTextToClipboard(AccountDetailsWithQrActivity.this, mAddress,
|
||||
R.string.address_has_been_copied));
|
||||
|
||||
EditText accountNameText = findViewById(R.id.account_name_text);
|
||||
accountNameText.setText(mName);
|
||||
|
||||
+2
-2
@@ -50,8 +50,8 @@ public class AccountPrivateKeyActivity
|
||||
EditText privateKeyText = findViewById(R.id.private_key_text);
|
||||
TextView copyToClipboardText = findViewById(R.id.copy_to_clipboard_text);
|
||||
copyToClipboardText.setOnClickListener(v
|
||||
-> Utils.saveTextToClipboard(
|
||||
AccountPrivateKeyActivity.this, privateKeyText.getText().toString()));
|
||||
-> Utils.saveTextToClipboard(AccountPrivateKeyActivity.this,
|
||||
privateKeyText.getText().toString(), R.string.text_has_been_copied));
|
||||
|
||||
LinearLayout bannerLayout = findViewById(R.id.wallet_backup_banner);
|
||||
bannerLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -168,6 +168,12 @@ public class WalletCoinAdapter extends RecyclerView.Adapter<WalletCoinAdapter.Vi
|
||||
} else if (mType == AdapterType.ACCOUNTS_LIST) {
|
||||
Utils.setBlockiesBitmapResource(
|
||||
mExecutor, mHandler, holder.iconImg, walletListItemModel.getSubTitle(), true);
|
||||
holder.itemView.setOnLongClickListener(v -> {
|
||||
Utils.saveTextToClipboard(context, walletListItemModel.getSubTitle(),
|
||||
R.string.address_has_been_copied);
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ public class PortfolioFragment extends Fragment
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
assert getActivity() != null;
|
||||
|
||||
Button editVisibleAssets = view.findViewById(R.id.edit_visible_assets);
|
||||
TextView editVisibleAssets = view.findViewById(R.id.edit_visible_assets);
|
||||
editVisibleAssets.setOnClickListener(v -> {
|
||||
String chainName = mSpinner.getSelectedItem().toString();
|
||||
String chainId = Utils.getNetworkConst(getActivity(), chainName);
|
||||
|
||||
+2
-1
@@ -98,7 +98,8 @@ public class RecoveryPhraseSaveCopyBottomSheetDialogFragment extends BottomSheet
|
||||
if (view == mSaveLayout) {
|
||||
Utils.LaunchBackupFilePicker((AsyncInitializationActivity) getActivity(), this);
|
||||
} else if (view == mCopyLayout) {
|
||||
Utils.saveTextToClipboard(getActivity(), mRecoveryPhrasesText);
|
||||
Utils.saveTextToClipboard(
|
||||
getActivity(), mRecoveryPhrasesText, R.string.text_has_been_copied);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@@ -139,12 +139,12 @@ public class Utils {
|
||||
return recoveryPhrasesText.trim();
|
||||
}
|
||||
|
||||
public static void saveTextToClipboard(Context context, String textToCopy) {
|
||||
public static void saveTextToClipboard(Context context, String textToCopy, int textToShow) {
|
||||
ClipboardManager clipboard =
|
||||
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("", textToCopy);
|
||||
clipboard.setPrimaryClip(clip);
|
||||
Toast.makeText(context, R.string.text_has_been_copied, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(context, textToShow, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
public static String getTextFromClipboard(Context context) {
|
||||
|
||||
@@ -248,27 +248,25 @@
|
||||
android:id="@+id/rvCoins"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<TextView
|
||||
android:id="@+id/edit_visible_assets"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/crypto_wallet_blue_button"
|
||||
android:text="@string/edit_visible_assets"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/wallet_text_color"
|
||||
android:background="@drawable/rounded_white_holo_bg"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:textColor="@android:color/white"
|
||||
style="?android:attr/borderlessButtonStyle"/>
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="7dp"
|
||||
android:paddingStart="13dp"
|
||||
android:paddingTop="13dp"
|
||||
android:paddingBottom="13dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
@@ -28,7 +28,7 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/wallet_text_color"
|
||||
android:textSize="16sp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp" />
|
||||
|
||||
@@ -1428,6 +1428,9 @@ Are you sure you want to do this?
|
||||
<message name="IDS_TEXT_HAS_BEEN_COPIED" desc="Copy to clipboard toast text.">
|
||||
Your text has been copied to the clipboard.
|
||||
</message>
|
||||
<message name="IDS_ADDRESS_HAS_BEEN_COPIED" desc="Copy to clipboard toast text.">
|
||||
Public address has been copied to the clipboard.
|
||||
</message>
|
||||
<message name="IDS_TEXT_HAS_BEEN_SAVED" desc="Save to file toast text.">
|
||||
Your text has been saved to a text file.
|
||||
</message>
|
||||
|
||||
Reference in New Issue
Block a user