From 15c6e731b508b63ee44f2a305fdff5962ef2c874 Mon Sep 17 00:00:00 2001 From: TwistedUmbrella Date: Mon, 3 Feb 2014 00:03:30 -0500 Subject: [PATCH] Convert to unified menu layout, Add @hooby3dfx focusable Applied the focusable to the switches, which worked. Applied the focusable to the list items, which seems to not have worked. Also added the state drawable, but so far it has not allowed scrolling the list on Nvidia Shield. --- shell/android/res/drawable/build_selector.xml | 9 ------ .../res/layout-v12/mainuilayout_fragment.xml | 13 -------- shell/android/res/layout/app_list_item.xml | 5 ++- shell/android/res/layout/bios_list_item.xml | 5 ++- .../android/res/layout/configure_fragment.xml | 18 +++++++---- shell/android/res/layout/input_fragment.xml | 6 ++-- .../android/res/layout/input_mod_fragment.xml | 25 ++++++++------- .../res/layout/mainuilayout_fragment.xml | 31 ++++++++----------- shell/android/res/values-v12/styles.xml | 2 +- .../src/com/reicast/emulator/FileBrowser.java | 3 +- .../com/reicast/emulator/MainActivity.java | 5 --- 11 files changed, 54 insertions(+), 68 deletions(-) delete mode 100755 shell/android/res/drawable/build_selector.xml delete mode 100644 shell/android/res/layout-v12/mainuilayout_fragment.xml diff --git a/shell/android/res/drawable/build_selector.xml b/shell/android/res/drawable/build_selector.xml deleted file mode 100755 index fb1560c2e..000000000 --- a/shell/android/res/drawable/build_selector.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/shell/android/res/layout-v12/mainuilayout_fragment.xml b/shell/android/res/layout-v12/mainuilayout_fragment.xml deleted file mode 100644 index 3642ed43e..000000000 --- a/shell/android/res/layout-v12/mainuilayout_fragment.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/shell/android/res/layout/app_list_item.xml b/shell/android/res/layout/app_list_item.xml index f6da1e3e6..ba0f66d3f 100644 --- a/shell/android/res/layout/app_list_item.xml +++ b/shell/android/res/layout/app_list_item.xml @@ -14,7 +14,10 @@ android:id="@+id/childview" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="horizontal" > + android:orientation="horizontal" + android:clickable="true" + android:focusable="true" + android:background="@android:drawable/list_selector_background" > + android:orientation="horizontal" + android:clickable="true" + android:focusable="true" + android:background="@android:drawable/list_selector_background" > + android:layout_height="wrap_content" + android:focusable="true" /> @@ -65,7 +66,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> @@ -92,7 +94,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> @@ -169,7 +172,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> @@ -224,7 +228,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> @@ -251,7 +256,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> diff --git a/shell/android/res/layout/input_fragment.xml b/shell/android/res/layout/input_fragment.xml index 1de0b7213..d599b27cc 100644 --- a/shell/android/res/layout/input_fragment.xml +++ b/shell/android/res/layout/input_fragment.xml @@ -62,7 +62,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> @@ -116,7 +117,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> diff --git a/shell/android/res/layout/input_mod_fragment.xml b/shell/android/res/layout/input_mod_fragment.xml index 04971a3ed..e6877dcde 100644 --- a/shell/android/res/layout/input_mod_fragment.xml +++ b/shell/android/res/layout/input_mod_fragment.xml @@ -51,10 +51,11 @@ + android:layout_height="wrap_content" + android:focusable="true" /> - + @@ -77,7 +78,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> @@ -395,9 +397,9 @@ android:id="@+id/joystick_key" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginLeft="4dp" android:layout_weight="1" android:ems="10" - android:layout_marginLeft="4dp" android:text="Joystick" /> - + @@ -447,7 +449,8 @@ + android:layout_height="wrap_content" + android:focusable="true" /> @@ -459,9 +462,9 @@ android:id="@+id/dpad_up_key" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginLeft="4dp" android:layout_weight="1" android:ems="10" - android:layout_marginLeft="4dp" android:text="DPad Up" /> @@ -535,8 +538,8 @@ android:id="@+id/dpad_left_key" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_weight="1" android:layout_marginLeft="4dp" + android:layout_weight="1" android:ems="10" android:text="DPad Left" /> @@ -573,8 +576,8 @@ android:id="@+id/dpad_right_key" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_weight="1" android:layout_marginLeft="4dp" + android:layout_weight="1" android:ems="10" android:text="DPad Right" /> @@ -656,4 +659,4 @@ - + \ No newline at end of file diff --git a/shell/android/res/layout/mainuilayout_fragment.xml b/shell/android/res/layout/mainuilayout_fragment.xml index a9ce2489c..a4d3f3f46 100644 --- a/shell/android/res/layout/mainuilayout_fragment.xml +++ b/shell/android/res/layout/mainuilayout_fragment.xml @@ -11,27 +11,26 @@ android:layout_height="wrap_content" android:layout_marginBottom="2dp" android:orientation="horizontal" > - + - - - + + + - - - - - + android:layout_height="match_parent" /> \ No newline at end of file diff --git a/shell/android/res/values-v12/styles.xml b/shell/android/res/values-v12/styles.xml index bb5a994e2..18bdd6050 100644 --- a/shell/android/res/values-v12/styles.xml +++ b/shell/android/res/values-v12/styles.xml @@ -1,6 +1,6 @@ - diff --git a/shell/android/src/com/reicast/emulator/FileBrowser.java b/shell/android/src/com/reicast/emulator/FileBrowser.java index b3899a29e..edc7bb82b 100644 --- a/shell/android/src/com/reicast/emulator/FileBrowser.java +++ b/shell/android/src/com/reicast/emulator/FileBrowser.java @@ -214,11 +214,11 @@ public class FileBrowser extends Fragment { for (int i = 0; i < games.size(); i++) { createListItem(list, games.get(i)); } - list.invalidate(); } else { Toast.makeText(parentActivity, "Please configure a games directory", Toast.LENGTH_LONG).show(); } + list.invalidate(); } } @@ -445,5 +445,6 @@ public class FileBrowser extends Fragment { }); v.addView(childview); } + v.invalidate(); } } diff --git a/shell/android/src/com/reicast/emulator/MainActivity.java b/shell/android/src/com/reicast/emulator/MainActivity.java index df778181b..eb097101b 100644 --- a/shell/android/src/com/reicast/emulator/MainActivity.java +++ b/shell/android/src/com/reicast/emulator/MainActivity.java @@ -219,10 +219,6 @@ public class MainActivity extends SlidingFragmentActivity implements } }); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { - getActionBar().setHomeButtonEnabled(true); - getActionBar().setDisplayHomeAsUpEnabled(true); - } else { findViewById(R.id.header).setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { @@ -232,7 +228,6 @@ public class MainActivity extends SlidingFragmentActivity implements return false; } }); - } System.gc();