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

Commit 51652f56 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE. Preference activity changes to work on smaller tablet...

Merge "DO NOT MERGE. Preference activity changes to work on smaller tablet screens." into honeycomb-mr2
parents 988b6648 1d2385d0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -519,6 +519,7 @@ public class Preference implements Comparable<Preference>, OnDependencyChangeLis
            if (mIcon != null) {
                imageView.setImageDrawable(mIcon);
            }
            imageView.setVisibility(mIcon != null ? View.VISIBLE : View.GONE);
        }
        if (mShouldDisableView) {
            setEnabledStateOnViews(view, isEnabled());
@@ -618,6 +619,7 @@ public class Preference implements Comparable<Preference>, OnDependencyChangeLis
    public void setIcon(Drawable icon) {
        if ((icon == null && mIcon != null) || (icon != null && mIcon != icon)) {
            mIcon = icon;

            notifyChanged();
        }
    }
+8 −16
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@ package android.preference;

import com.android.internal.util.XmlUtils;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import android.app.ActionBar;
import android.app.Fragment;
import android.app.FragmentBreadCrumbs;
@@ -44,8 +41,8 @@ import android.util.TypedValue;
import android.util.Xml;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.AbsListView;
import android.widget.ArrayAdapter;
import android.widget.Button;
@@ -58,6 +55,9 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

/**
 * This is the base class for an activity to show a hierarchy of preferences
 * to the user.  Prior to {@link android.os.Build.VERSION_CODES#HONEYCOMB}
@@ -641,17 +641,9 @@ public abstract class PreferenceActivity extends ListActivity implements
     * enough.
     */
    public boolean onIsMultiPane() {
        Configuration config = getResources().getConfiguration();
        if ((config.screenLayout&Configuration.SCREENLAYOUT_SIZE_MASK)
                == Configuration.SCREENLAYOUT_SIZE_XLARGE) {
            return true;
        }
        if ((config.screenLayout&Configuration.SCREENLAYOUT_SIZE_MASK)
                == Configuration.SCREENLAYOUT_SIZE_LARGE
                && config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
            return true;
        }
        return false;
        boolean preferMultiPane = getResources().getBoolean(
                com.android.internal.R.bool.preferences_prefer_dual_pane);
        return preferMultiPane;
    }

    /**
@@ -992,7 +984,7 @@ public abstract class PreferenceActivity extends ListActivity implements
        if (mFragmentBreadCrumbs == null) {
            View crumbs = findViewById(android.R.id.title);
            // For screens with a different kind of title, don't create breadcrumbs.
            if (!(crumbs instanceof FragmentBreadCrumbs)) return;
            if (crumbs != null && !(crumbs instanceof FragmentBreadCrumbs)) return;
            mFragmentBreadCrumbs = (FragmentBreadCrumbs) findViewById(android.R.id.title);
            if (mFragmentBreadCrumbs == null) {
                mFragmentBreadCrumbs = new FragmentBreadCrumbs(this);
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
          http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_height="wrap_content"
        android:layout_width="match_parent">
    <android.app.FragmentBreadCrumbs
            android:id="@android:id/title"
            android:layout_height="72dip"
            android:layout_width="match_parent"
            android:paddingTop="16dip"
            android:paddingBottom="8dip"
            android:gravity="center_vertical|left"
            android:layout_marginLeft="@dimen/preference_breadcrumb_paddingLeft"
            android:layout_marginRight="@dimen/preference_breadcrumb_paddingRight"
        />

    <ImageView
            android:layout_width="match_parent"
            android:layout_height="1dip"
            android:paddingLeft="@dimen/preference_breadcrumb_paddingLeft"
            android:paddingRight="@dimen/preference_breadcrumb_paddingRight"
            android:src="#404040"
        />
</LinearLayout>
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
          http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- This layout disables breadcrumbs in the fragment area and causes PreferenceActivity to
    put the breadcrumbs in the action bar. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_height="@dimen/preference_fragment_padding_side"
        android:layout_width="match_parent">
</LinearLayout>
 No newline at end of file
Loading