Skip to content

Commit

Permalink
Add a more obvious way of getting to the QR display
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlinden committed Feb 19, 2024
1 parent 0b939d4 commit 2dfb09b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
4 changes: 4 additions & 0 deletions atox/src/main/kotlin/ui/userprofile/UserProfileFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ class UserProfileFragment : BaseFragment<FragmentUserProfileBinding>(FragmentUse
}
registerForContextMenu(profileShareId)

showQr.setOnClickListener {
createQrCodeDialog().show()
}

profileOptions.profileChangeNickname.setOnClickListener {
val nameEdit = EditText(requireContext()).apply {
text.append(binding.userName.text)
Expand Down
40 changes: 40 additions & 0 deletions atox/src/main/res/drawable/ic_qr_code.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M3,11h8V3H3V11zM5,5h4v4H5V5z" />
<path
android:fillColor="@android:color/white"
android:pathData="M3,21h8v-8H3V21zM5,15h4v4H5V15z" />
<path
android:fillColor="@android:color/white"
android:pathData="M13,3v8h8V3H13zM19,9h-4V5h4V9z" />
<path
android:fillColor="@android:color/white"
android:pathData="M19,19h2v2h-2z" />
<path
android:fillColor="@android:color/white"
android:pathData="M13,13h2v2h-2z" />
<path
android:fillColor="@android:color/white"
android:pathData="M15,15h2v2h-2z" />
<path
android:fillColor="@android:color/white"
android:pathData="M13,17h2v2h-2z" />
<path
android:fillColor="@android:color/white"
android:pathData="M15,19h2v2h-2z" />
<path
android:fillColor="@android:color/white"
android:pathData="M17,17h2v2h-2z" />
<path
android:fillColor="@android:color/white"
android:pathData="M17,13h2v2h-2z" />
<path
android:fillColor="@android:color/white"
android:pathData="M19,15h2v2h-2z" />
</vector>
15 changes: 14 additions & 1 deletion atox/src/main/res/layout/fragment_user_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,20 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/tox_id"
android:textSize="16sp"/>
android:textSize="16sp"
tools:ignore="RelativeOverlap" />

<!-- Reusing the read_qr ("QR") string here is a bit hacky, but I'll revisit it later if needed. -->
<ImageView
android:id="@+id/show_qr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:background="@color/textWhiteColor"
android:contentDescription="@string/read_qr"
android:elevation="8dp"
android:src="@drawable/ic_qr_code"/>

<TextView
android:id="@+id/user_tox_id"
android:layout_width="wrap_content"
Expand Down

0 comments on commit 2dfb09b

Please sign in to comment.