Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1ad5977 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

New two-pane mode for PreferenceActivity.

This introduces a whole new way to use PreferenceActivity, as
a container for PreferenceFragments that the user can switch
between from a list of headers.

Change-Id: I1c79b7c78b86790dc460a1414a999aba5de80628
parent ee9907b4
Loading
Loading
Loading
Loading
+174 −6
Original line number Diff line number Diff line
@@ -4299,6 +4299,17 @@
 visibility="public"
>
</field>
<field name="fragment"
 type="int"
 transient="false"
 volatile="false"
 value="16843557"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="freezesText"
 type="int"
 transient="false"
@@ -27640,6 +27651,33 @@
 visibility="public"
>
</method>
<method name="instantiate"
 return="android.app.Fragment"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="fname" type="java.lang.String">
</parameter>
<exception name="ClassNotFoundException" type="java.lang.ClassNotFoundException">
</exception>
<exception name="IllegalAccessException" type="java.lang.IllegalAccessException">
</exception>
<exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException">
</exception>
<exception name="InstantiationException" type="java.lang.InstantiationException">
</exception>
<exception name="InvocationTargetException" type="java.lang.reflect.InvocationTargetException">
</exception>
<exception name="NoSuchMethodException" type="java.lang.NoSuchMethodException">
</exception>
</method>
<method name="isAdded"
 return="boolean"
 abstract="false"
@@ -124117,6 +124155,17 @@
 visibility="public"
>
</field>
<field name="HONEYCOMB"
 type="int"
 transient="false"
 volatile="false"
 value="10000"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="Bundle"
 extends="java.lang.Object"
@@ -134276,7 +134325,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="intent" type="android.content.Intent">
@@ -134289,7 +134338,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="preferencesResId" type="int">
@@ -134302,7 +134351,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="key" type="java.lang.CharSequence">
@@ -134315,7 +134364,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -134326,11 +134375,65 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="deprecated"
 visibility="public"
>
</method>
<method name="loadHeadersFromResource"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="resid" type="int">
</parameter>
<parameter name="target" type="java.util.List&lt;android.preference.PreferenceActivity.Header&gt;">
</parameter>
</method>
<method name="onPreferenceTreeClick"
<method name="onBuildHeaders"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="target" type="java.util.List&lt;android.preference.PreferenceActivity.Header&gt;">
</parameter>
</method>
<method name="onGetInitialFragment"
 return="java.lang.String"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onHeaderClick"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="header" type="android.preference.PreferenceActivity.Header">
</parameter>
<parameter name="position" type="int">
</parameter>
</method>
<method name="onIsHidingHeaders"
 return="boolean"
 abstract="false"
 native="false"
@@ -134340,6 +134443,28 @@
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onIsMultiPane"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onPreferenceTreeClick"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="preferenceScreen" type="android.preference.PreferenceScreen">
</parameter>
<parameter name="preference" type="android.preference.Preference">
@@ -134352,12 +134477,55 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="preferenceScreen" type="android.preference.PreferenceScreen">
</parameter>
</method>
<method name="startWithFragment"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="fragmentName" type="java.lang.String">
</parameter>
</method>
<method name="switchToHeader"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="fragmentName" type="java.lang.String">
</parameter>
</method>
</class>
<class name="PreferenceActivity.Header"
 extends="java.lang.Object"
 abstract="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="PreferenceActivity.Header"
 type="android.preference.PreferenceActivity.Header"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
</class>
<class name="PreferenceCategory"
 extends="android.preference.PreferenceGroup"
+21 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.app;

import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
@@ -227,7 +228,25 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener
    public Fragment() {
    }

    static Fragment instantiate(Activity activity, String fname)
    /**
     * Create a new instance of a Fragment with the given class name.  This is
     * the same as calling its empty constructor.
     *
     * @param context The calling context being used to instantiate the fragment.
     * This is currently just used to get its ClassLoader.
     * @param fname The class name of the fragment to instantiate.
     * @return Returns a new fragment instance.
     * @throws NoSuchMethodException The fragment does not have an empty constructor.
     * @throws ClassNotFoundException The fragment class does not exist.
     * @throws IllegalArgumentException Bad arguments supplied to fragment class
     * constructor (should not happen).
     * @throws InstantiationException Caller does not have permission to instantiate
     * the fragment (for example its constructor is not public).
     * @throws IllegalAccessException Caller does not have permission to access
     * the given fragment class.
     * @throws InvocationTargetException Failure running the fragment's constructor.
     */
    public static Fragment instantiate(Context context, String fname)
            throws NoSuchMethodException, ClassNotFoundException,
            IllegalArgumentException, InstantiationException,
            IllegalAccessException, InvocationTargetException {
@@ -235,7 +254,7 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener

        if (clazz == null) {
            // Class not found in the cache, see if it's real, and try to add it
            clazz = activity.getClassLoader().loadClass(fname);
            clazz = context.getClassLoader().loadClass(fname);
            sClassMap.put(fname, clazz);
        }
        return (Fragment)clazz.newInstance();
+11 −0
Original line number Diff line number Diff line
@@ -196,6 +196,17 @@ public class Build {
         * </ul>
         */
        public static final int GINGERBREAD = CUR_DEVELOPMENT;

        /**
         * Next next version of Android.
         *
         * <p>Applications targeting this or a later release will get these
         * new changes in behavior:</p>
         * <ul>
         * <li> Alerts UI change?
         * </ul>
         */
        public static final int HONEYCOMB = CUR_DEVELOPMENT;
    }
    
    /** The type of build, like "user" or "eng". */
Loading