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

Center identity name when edit icon is visible #6

Merged
merged 2 commits into from
Mar 5, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Exiting the wallet after accepting an identity verification error
- Incorrect environment name in a private key export file for Mainnet
- Improper handling of rejected identity verification when setting up a new wallet
- An issue where the identity name was off-center when the edit name icon was visible
- An issue where exporting transaction logs for an account without any transactions would be stuck at 0%

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,8 @@ constructor(
private var onChangeNameClickListener: OnChangeNameClickListener? = null

fun enableChangeNameOption(identity: Identity) {
binding.nameTextview.compoundDrawablePadding = 20
val drawable = AppCompatResources.getDrawable(context, R.drawable.cryptox_ico_edit)
binding.nameTextview.setCompoundDrawablesRelativeWithIntrinsicBounds(
null,
null,
drawable,
null
)
binding.nameTextview.setOnClickListener {
binding.nameIcon.isVisible = true
binding.nameTextAndIcon.setOnClickListener {
onChangeNameClickListener?.onChangeNameClicked(identity)
}
}
Expand Down
36 changes: 26 additions & 10 deletions app/src/main/res/layout/view_identity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,34 @@
tools:text="@string/view_identity_status_done"
tools:textColor="@color/ccx_status_success" />

<TextView
android:id="@+id/name_textview"
<RelativeLayout
android:id="@+id/name_text_and_icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textAppearance="@style/CCX_Typography_H2"
android:textColor="@color/ccx_neutral_tint_1"
tools:drawableEndCompat="@drawable/cryptox_ico_edit"
tools:text="Identity 1" />
>

<TextView
android:id="@+id/name_textview"
android:layout_width="match_parent"
android:layout_marginHorizontal="25dp"
android:layout_height="wrap_content"
android:gravity="center"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="@style/CCX_Typography_H2"
android:textColor="@color/ccx_neutral_tint_1"
tools:text="Identity 1" />

<ImageView
android:id="@+id/name_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:visibility="invisible"
android:src="@drawable/cryptox_ico_edit"/>
</RelativeLayout>

<TextView
android:id="@+id/expires_textview"
Expand Down
Loading