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.
This commit is contained in:
TwistedUmbrella 2014-02-03 00:03:30 -05:00
parent 1d9ec43b22
commit 15c6e731b5
11 changed files with 54 additions and 68 deletions

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Selector style for listrow -->
<item android:drawable="@drawable/gradient_bg" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="@drawable/gradient_bg_hover" android:state_pressed="true"/>
<item android:drawable="@drawable/gradient_bg_hover" android:state_pressed="false" android:state_selected="true"/>
</selector>

View File

@ -1,13 +0,0 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View File

@ -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" >
<ImageView
android:id="@+id/item_icon"

View File

@ -9,7 +9,10 @@
android:id="@+id/childview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
android:orientation="horizontal"
android:clickable="true"
android:focusable="true"
android:background="@android:drawable/list_selector_background" >
<ImageView
android:id="@+id/item_icon"

View File

@ -38,7 +38,8 @@
<de.ankri.views.Switch
android:id="@+id/unstable_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
@ -65,7 +66,8 @@
<de.ankri.views.Switch
android:id="@+id/mipmaps_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
@ -92,7 +94,8 @@
<de.ankri.views.Switch
android:id="@+id/stretch_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
@ -169,7 +172,8 @@
<de.ankri.views.Switch
android:id="@+id/dynarec_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
@ -224,7 +228,8 @@
<de.ankri.views.Switch
android:id="@+id/limitfps_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
@ -251,7 +256,8 @@
<de.ankri.views.Switch
android:id="@+id/render_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>

View File

@ -62,7 +62,8 @@
<de.ankri.views.Switch
android:id="@+id/switchTouchVibrationEnabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
@ -116,7 +117,8 @@
<de.ankri.views.Switch
android:id="@+id/micInPort2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
</TableLayout>

View File

@ -51,10 +51,11 @@
<de.ankri.views.Switch
android:id="@+id/switchModifiedLayoutEnabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="25dp"
android:gravity="center_vertical" >
@ -77,7 +78,8 @@
<de.ankri.views.Switch
android:id="@+id/switchCompatibilityEnabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
@ -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" />
<LinearLayout
@ -424,7 +426,7 @@
android:text="@string/remove" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="25dp"
android:gravity="center_vertical" >
@ -447,7 +449,8 @@
<de.ankri.views.Switch
android:id="@+id/dpad_js_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
@ -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" />
<LinearLayout
@ -497,8 +500,8 @@
android:id="@+id/dpad_down_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 Down" />
@ -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 @@
</TableLayout>
</LinearLayout>
</ScrollView>
</ScrollView>

View File

@ -11,27 +11,26 @@
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginBottom="2dp"
android:orientation="horizontal" >
<ImageView
android:id="@+id/header_menu"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/ic_drawer" />
<ImageView
android:id="@+id/header_icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/ic_launcher" />
<ImageView
android:id="@+id/header_menu"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/ic_drawer" />
<ImageView
android:id="@+id/header_icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/ic_launcher" />
</LinearLayout>
<TextView
android:id="@+id/textView1"
@ -42,15 +41,11 @@
android:text="@string/app_name"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="32dp" />
</LinearLayout>
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<requestFocus />
</FrameLayout>
android:layout_height="match_parent" />
</LinearLayout>

View File

@ -1,6 +1,6 @@
<resources>
<style name="AppTheme" parent="android:Theme.Holo">
<style name="AppTheme" parent="android:Theme.Holo.NoActionBar">
<item name="switchStyle">@style/switch_dark</item>
<item name="textAppearance">@style/TextAppearance</item>
</style>

View File

@ -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();
}
}

View File

@ -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();