Skip to content

Commit

Permalink
Merge pull request #6 from Concordium/fix-off-center-identity-name
Browse files Browse the repository at this point in the history
Center identity name when edit icon is visible
  • Loading branch information
orhoj authored Mar 5, 2024
2 parents afc3354 + 027b765 commit 3f79fac
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
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

0 comments on commit 3f79fac

Please sign in to comment.