Permalink
Browse files

front: Made preference activities navigational using a controller.

  • Loading branch information...
fzurita committed Dec 27, 2015
1 parent 659c60f commit 144134aefc9ec5f33263b207bf8999b8fd2c03a6
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
+ android:orientation="vertical" >
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="6dp"
+ android:background="#747273" />
+ <TextView
+ android:id="@+android:id/title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:padding="12dp"
+ android:textColor="?attr/colorAccent"
+ android:textSize="20sp"
+ android:textStyle="bold" />
+</LinearLayout>
View
@@ -10,7 +10,7 @@
<item name="android:colorBackground">@android:color/black</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>
-
+
<style name="Theme.Mupen64plusaeTheme" parent="Theme.AppCompat">
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>
@@ -95,8 +95,9 @@
android:title="@string/actionCheatEditor_title" >
</android.support.v7.preference.Preference>
- <android.support.v7.preference.PreferenceCategory
+ <paulscode.android.mupen64plusae.preference.CustomPreferenceCategory
android:key="categoryCheats"
+ android:selectable="true"
android:title="@string/categoryCheats_title" />
</android.support.v7.preference.PreferenceScreen>
@@ -111,7 +112,7 @@
android:summary="@string/actionResetGamePrefs_summary"
android:title="@string/actionResetGamePrefs_title" />
- <android.support.v7.preference.PreferenceCategory>
- </android.support.v7.preference.PreferenceCategory>
+ <paulscode.android.mupen64plusae.preference.CustomPreferenceCategory>
+ </paulscode.android.mupen64plusae.preference.CustomPreferenceCategory>
</android.support.v7.preference.PreferenceScreen>
@@ -41,30 +41,30 @@
To minimize app size, consider using Android's built-in resources when possible.
For example, consider icon resources in "@android:drawable/..." instead of custom
resources in "@drawable/...".
- ***********************************************************************************
+ ***********************************************************************************
-->
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mupen64="http://schemas.android.com/apk/res/org.mupen64plusae.v3.alpha"
android:key="screenRoot" >
- <android.support.v7.preference.PreferenceCategory
+ <paulscode.android.mupen64plusae.preference.CustomPreferenceCategory
android:key="categoryLibrary"
+ android:selectable="true"
android:title="@string/categoryLibrary_title" >
<android.support.v7.preference.CheckBoxPreference
android:defaultValue="true"
android:key="showRecentlyPlayed"
android:summary="@string/showRecentlyPlayed_summary"
android:title="@string/showRecentlyPlayed_title" />
-
<android.support.v7.preference.CheckBoxPreference
android:defaultValue="true"
android:key="showFullNames"
android:summary="@string/showFullNames_summary"
android:title="@string/showFullNames_title" />
- </android.support.v7.preference.PreferenceCategory>
-
- <android.support.v7.preference.PreferenceCategory
+ </paulscode.android.mupen64plusae.preference.CustomPreferenceCategory>
+ <paulscode.android.mupen64plusae.preference.CustomPreferenceCategory
android:key="categoryDisplay"
+ android:selectable="true"
android:title="@string/categoryDisplay_title" >
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/displayOrientation_default"
@@ -100,6 +100,7 @@
android:key="displayFps"
android:summary="@string/displayFps_summary"
android:title="@string/displayFps_title" />
+
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/videoHardwareType_default"
android:entries="@array/videoHardwareType_entries"
@@ -114,9 +115,10 @@
android:key="videoPolygonOffset"
android:summary="@string/videoPolygonOffset_summary"
android:title="@string/videoPolygonOffset_title" />
- </android.support.v7.preference.PreferenceCategory>
- <android.support.v7.preference.PreferenceCategory
+ </paulscode.android.mupen64plusae.preference.CustomPreferenceCategory>
+ <paulscode.android.mupen64plusae.preference.CustomPreferenceCategory
android:key="categoryAudio"
+ android:selectable="true"
android:title="@string/categoryAudio_title" >
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/audioPlugin_default"
@@ -139,7 +141,7 @@
android:key="audioSLESBufferSize"
android:summary="@string/selectedValue"
android:title="@string/audioSLESBufferSize_title" />
- <paulscode.android.mupen64plusae.preference.CompatListPreference
+ <paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/audioSLESBufferNbr_default"
android:entries="@array/audioSLESBufferNbr_entries"
android:entryValues="@array/audioSLESBufferNbr_values"
@@ -157,9 +159,10 @@
android:key="audioSwapChannels"
android:summary="@string/audioSwapChannels_summary"
android:title="@string/audioSwapChannels_title" />
- </android.support.v7.preference.PreferenceCategory>
- <android.support.v7.preference.PreferenceCategory
+ </paulscode.android.mupen64plusae.preference.CustomPreferenceCategory>
+ <paulscode.android.mupen64plusae.preference.CustomPreferenceCategory
android:key="categoryTouchscreen"
+ android:selectable="true"
android:title="@string/categoryTouchscreen_title" >
<paulscode.android.mupen64plusae.preference.SeekBarPreference
android:defaultValue="100"
@@ -169,7 +172,6 @@
mupen64:minimumValue="50"
mupen64:stepSize="1"
mupen64:units="%" />
-
<paulscode.android.mupen64plusae.preference.SeekBarPreference
android:defaultValue="100"
android:key="touchscreenTransparency"
@@ -191,9 +193,10 @@
android:key="touchscreenAutoHold"
android:summary="@string/selectedValue"
android:title="@string/touchscreenAutoHold_title" />
- </android.support.v7.preference.PreferenceCategory>
- <android.support.v7.preference.PreferenceCategory
+ </paulscode.android.mupen64plusae.preference.CustomPreferenceCategory>
+ <paulscode.android.mupen64plusae.preference.CustomPreferenceCategory
android:key="categoryInput"
+ android:selectable="true"
android:title="@string/categoryInput_title" >
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/navigationMode_default"
@@ -202,6 +205,7 @@
android:key="navigationMode"
android:summary="@string/navigationMode_summary"
android:title="@string/navigationMode_title" />
+
<android.support.v7.preference.CheckBoxPreference
android:defaultValue="false"
android:key="inputVolumeMappable"
@@ -212,29 +216,31 @@
android:key="inputShareController"
android:summary="@string/inputShareController_summary"
android:title="@string/inputShareController_title" />
- </android.support.v7.preference.PreferenceCategory>
- <android.support.v7.preference.PreferenceCategory
+ </paulscode.android.mupen64plusae.preference.CustomPreferenceCategory>
+ <paulscode.android.mupen64plusae.preference.CustomPreferenceCategory
android:key="categoryData"
+ android:selectable="true"
android:title="@string/categoryData_title" >
<paulscode.android.mupen64plusae.preference.PathPreference
android:defaultValue="@string/pathGameSaves_default"
android:key="pathGameSaves"
android:title="@string/pathGameSaves_title"
mupen64:selectionMode="0" />
+
<paulscode.android.mupen64plusae.preference.SeekBarPreference
android:defaultValue="4"
android:key="gameAutoSaves"
android:title="@string/GameAutoSavesMax_title"
- mupen64:minimumValue="1"
mupen64:maximumValue="10"
+ mupen64:minimumValue="1"
mupen64:stepSize="1"
mupen64:units="" />
<android.support.v7.preference.Preference
android:key="actionReloadAssets"
android:summary="@string/actionReloadAssets_summary"
android:title="@string/actionReloadAssets_title" />
- </android.support.v7.preference.PreferenceCategory>
+ </paulscode.android.mupen64plusae.preference.CustomPreferenceCategory>
<android.support.v7.preference.Preference
android:icon="@drawable/ic_undo"
@@ -0,0 +1,59 @@
+/**
+ * Mupen64PlusAE, an N64 emulator for the Android platform
+ *
+ * Copyright (C) 2013 Paul Lamb
+ *
+ * This file is part of Mupen64PlusAE.
+ *
+ * Mupen64PlusAE is free software: you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Mupen64PlusAE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Mupen64PlusAE. If
+ * not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: fzurita
+ */
+package paulscode.android.mupen64plusae.preference;
+
+import org.mupen64plusae.v3.alpha.R;
+
+import android.content.Context;
+import android.support.v7.preference.PreferenceCategory;
+import android.util.AttributeSet;
+
+/**
+ * A type of {@link PreferenceCategory} that is focusable
+ */
+
+public class CustomPreferenceCategory extends PreferenceCategory
+{
+ /**
+ * Constructor
+ *
+ * @param context The {@link Context} this CustomPreferenceCategory is being used in.
+ * @param attrs A collection of attributes, as found associated with a tag in an XML document.
+ */
+ public CustomPreferenceCategory( Context context, AttributeSet attrs )
+ {
+ super( context, attrs);
+ setLayoutResource(R.layout.custom_preference_category);
+ setSelectable(true);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param context The {@link Context} this CustomPreferenceCategory will be used in.
+ */
+ public CustomPreferenceCategory( Context context )
+ {
+ super( context );
+ setLayoutResource(R.layout.custom_preference_category);
+ setSelectable(true);
+ }
+}

0 comments on commit 144134a

Please sign in to comment.