Implemented #1162: Invoke NFC in Advanced View

- Extracted NFC code from ViewKeyActivity to NfcHelper to share code between classes
 - Changed the private anonymous Handler for NFC into a static private subclass, that uses WeakReference to avoid memory leaks
 - Added resources needed (retrieved from Graphics) for the NFC button inside ViewKeyAdvShareFragment.
 - Fixed the ripple boundary of the Share With... button to prevent it from bleeding to other buttons on the right (UX improvement)
This commit is contained in:
Kent
2015-03-20 06:31:18 +08:00
parent cfef53be01
commit 8d6d4328f2
9 changed files with 261 additions and 158 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -99,14 +99,12 @@
android:layout_weight="1" />
<LinearLayout
android:id="@+id/view_key_action_key_share"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:clickable="true"
android:background="?android:selectableItemBackground"
android:orientation="horizontal">
<TextView
android:id="@+id/view_key_action_key_share"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
@@ -116,7 +114,25 @@
android:layout_weight="1"
android:drawableRight="@drawable/ic_share_grey_24dp"
android:drawablePadding="8dp"
android:gravity="center_vertical" />
android:gravity="center_vertical"
android:background="?android:selectableItemBackground"/>
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:gravity="right"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="?android:attr/listDivider" />
<ImageButton
android:id="@+id/view_key_action_key_nfc"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="8dp"
android:src="@drawable/ic_nfc_grey_24dp"
android:layout_gravity="center_vertical"
android:background="?android:selectableItemBackground" />
<View
android:layout_width="1dip"
@@ -154,6 +170,7 @@
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dip"