From 0ec114322edc7ba0cf03d6857a8e747ccee975be Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Mon, 2 Mar 2020 09:06:16 -0500 Subject: [PATCH] Fix UI touch issues for Android TV --- .../res/drawable/background_test_button.xml | 10 ++++++ .../app/src/main/res/layout/activity_main.xml | 8 +++-- .../res/layout/item_recycler_bypass_list.xml | 6 +++- .../main/res/layout/item_recycler_main.xml | 32 ++++++++++++------- .../res/layout/item_recycler_sub_setting.xml | 21 ++++++++---- V2rayNG/app/src/main/res/values/dimens.xml | 1 + 6 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 V2rayNG/app/src/main/res/drawable/background_test_button.xml diff --git a/V2rayNG/app/src/main/res/drawable/background_test_button.xml b/V2rayNG/app/src/main/res/drawable/background_test_button.xml new file mode 100644 index 000000000..ed2c5e680 --- /dev/null +++ b/V2rayNG/app/src/main/res/drawable/background_test_button.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/V2rayNG/app/src/main/res/layout/activity_main.xml b/V2rayNG/app/src/main/res/layout/activity_main.xml index 054ba3ba6..ce364e7ad 100644 --- a/V2rayNG/app/src/main/res/layout/activity_main.xml +++ b/V2rayNG/app/src/main/res/layout/activity_main.xml @@ -54,8 +54,10 @@ android:id="@+id/layout_test" android:layout_width="match_parent" android:layout_height="@dimen/connection_test_height" - android:background="@color/colorPrimary_text" - android:gravity="center|left"> + android:background="@drawable/background_test_button" + android:gravity="center|left" + android:clickable="true" + android:focusable="true"> diff --git a/V2rayNG/app/src/main/res/layout/item_recycler_bypass_list.xml b/V2rayNG/app/src/main/res/layout/item_recycler_bypass_list.xml index 2c4031d96..bde3c01de 100644 --- a/V2rayNG/app/src/main/res/layout/item_recycler_bypass_list.xml +++ b/V2rayNG/app/src/main/res/layout/item_recycler_bypass_list.xml @@ -2,7 +2,10 @@ + android:gravity="center_vertical" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true"> + android:orientation="horizontal" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:nextFocusRight="@+id/layout_share"> + android:padding="@dimen/layout_margin_spacing" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:nextFocusLeft="@+id/info_container"> + android:padding="@dimen/layout_margin_spacing" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true"> + android:padding="@dimen/layout_margin_spacing" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true"> + card_view:cardCornerRadius="5dp" + android:nextFocusRight="@+id/layout_edit"> + android:padding="@dimen/layout_margin_spacing" + android:visibility="invisible" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true"> + android:padding="@dimen/layout_margin_spacing" + android:background="?android:attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:nextFocusLeft="@+id/item_cardview"> 50dp 16dp 16dp + 8dp 50dp 24dp 72dp