make copy omemo fp button a show qr code button

This commit is contained in:
Daniel Gultsch 2023-10-30 14:26:28 +01:00
parent 71b6492d61
commit dfd7410b1a
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
11 changed files with 87 additions and 7 deletions

View file

@ -1162,8 +1162,8 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
this.binding.ownFingerprintDesc.setText(R.string.omemo_fingerprint);
}
this.binding.axolotlFingerprint.setText(CryptoHelper.prettifyFingerprint(ownAxolotlFingerprint.substring(2)));
this.binding.actionCopyAxolotlToClipboard.setVisibility(View.VISIBLE);
this.binding.actionCopyAxolotlToClipboard.setOnClickListener(v -> copyOmemoFingerprint(ownAxolotlFingerprint));
this.binding.showQrCodeButton.setVisibility(View.VISIBLE);
this.binding.showQrCodeButton.setOnClickListener(v -> showQrCode());
} else {
this.binding.axolotlFingerprintBox.setVisibility(View.GONE);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

View file

@ -0,0 +1,40 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="@color/black"
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>

View file

@ -0,0 +1,40 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/white">
<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>

View file

@ -613,14 +613,14 @@
android:orientation="vertical">
<ImageButton
android:id="@+id/action_copy_axolotl_to_clipboard"
android:id="@+id/show_qr_code_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="?attr/icon_alpha"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/copy_omemo_clipboard_description"
android:padding="@dimen/image_button_padding"
android:src="?attr/icon_copy"
android:src="?attr/icon_qr_code"
android:visibility="visible" />
<ImageButton

View file

@ -81,7 +81,7 @@
<attr name="icon_add_group" format="reference" />
<attr name="icon_add_person" format="reference" />
<attr name="icon_cancel" format="reference" />
<attr name="icon_copy" format="reference" />
<attr name="icon_qr_code" format="reference" />
<attr name="icon_discard" format="reference" />
<attr name="icon_download" format="reference" />
<attr name="icon_edit" format="reference" />

View file

@ -98,7 +98,7 @@
<item name="icon_add_group" type="reference">@drawable/ic_group_add_white_24dp</item>
<item name="icon_add_person" type="reference">@drawable/ic_person_add_white_24dp</item>
<item name="icon_cancel" type="reference">@drawable/ic_cancel_black_24dp</item>
<item name="icon_copy" type="reference">@drawable/ic_content_copy_black_24dp</item>
<item name="icon_qr_code" type="reference">@drawable/ic_qr_code_black_24dp</item>
<item name="icon_discard" type="reference">@drawable/ic_delete_white_24dp</item>
<item name="icon_download" type="reference">@drawable/ic_file_download_white_24dp</item>
<item name="icon_edit" type="reference">@drawable/ic_edit_white_24dp</item>
@ -255,7 +255,7 @@
<item name="icon_add_group" type="reference">@drawable/ic_group_add_white_24dp</item>
<item name="icon_add_person" type="reference">@drawable/ic_person_add_white_24dp</item>
<item name="icon_cancel" type="reference">@drawable/ic_cancel_white_24dp</item>
<item name="icon_copy" type="reference">@drawable/ic_content_copy_white_24dp</item>
<item name="icon_qr_code" type="reference">@drawable/ic_qr_code_white_24dp</item>
<item name="icon_discard" type="reference">@drawable/ic_delete_white_24dp</item>
<item name="icon_download" type="reference">@drawable/ic_file_download_white_24dp</item>
<item name="icon_edit" type="reference">@drawable/ic_edit_white_24dp</item>