Fix Notification Access layout for tabletUI support

- setup correct padding for the App list and its item

also remove showing FastScroller all the time on App Notification list

See bug: #13140648 Settings needs to support the new Quantum Paper theme

Change-Id: I11a70906f1372027622d50a81bc7744d48190f8a
This commit is contained in:
Fabrice Di Meglio
2014-07-21 13:41:32 -07:00
parent 7bc9c1bce3
commit 20b32f25f0
4 changed files with 17 additions and 10 deletions

View File

@@ -22,7 +22,8 @@
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="horizontal"
android:paddingEnd="6dip"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:gravity="center_vertical"
>
@@ -69,7 +70,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dip"
android:layout_marginStart="16dip"
android:focusable="false"
android:clickable="false" />

View File

@@ -18,19 +18,27 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="@dimen/settings_side_margin"
android:paddingEnd="@dimen/settings_side_margin"
android:drawSelectorOnTop="false"
android:fastScrollEnabled="true" />
android:fastScrollEnabled="true"
android:scrollbarStyle="outsideInset" />
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
</FrameLayout>
</LinearLayout>

View File

@@ -28,7 +28,6 @@
android:paddingEnd="@dimen/settings_side_margin"
android:divider="#0000"
android:dividerHeight="0px"
android:fastScrollAlwaysVisible="true"
android:fastScrollEnabled="true"
android:listSelector="#0000"
android:scrollbarStyle="outsideInset" />

View File

@@ -60,7 +60,7 @@ public abstract class ManagedServiceSettings extends ListFragment {
private ContentResolver mCR;
private final HashSet<ComponentName> mEnabledServices = new HashSet<ComponentName>();
private ServiceListAdapter mList;
private ServiceListAdapter mListAdapter;
abstract protected Config getConfig();
@@ -130,7 +130,7 @@ public abstract class ManagedServiceSettings extends ListFragment {
mPM = getActivity().getPackageManager();
mCR = getActivity().getContentResolver();
mList = new ServiceListAdapter(getActivity());
mListAdapter = new ServiceListAdapter(getActivity());
}
@Override
@@ -200,10 +200,10 @@ public abstract class ManagedServiceSettings extends ListFragment {
private void updateList() {
loadEnabledServices();
getServices(mConfig, mList, mPM);
mList.sort(new PackageItemInfo.DisplayNameComparator(mPM));
getServices(mConfig, mListAdapter, mPM);
mListAdapter.sort(new PackageItemInfo.DisplayNameComparator(mPM));
getListView().setAdapter(mList);
getListView().setAdapter(mListAdapter);
}
protected static int getEnabledServicesCount(Config config, Context context) {
@@ -255,7 +255,7 @@ public abstract class ManagedServiceSettings extends ListFragment {
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
ServiceInfo info = mList.getItem(position);
ServiceInfo info = mListAdapter.getItem(position);
final ComponentName cn = new ComponentName(info.packageName, info.name);
if (mEnabledServices.contains(cn)) {
// the simple version: disabling