diff options
author | Jeff Davidson <jpd@google.com> | 2014-03-25 12:21:30 -0700 |
---|---|---|
committer | Jeff Davidson <jpd@google.com> | 2014-04-14 19:24:15 -0700 |
commit | b9558d91dfcae4cd98f2e25dd070dfa8c926d524 (patch) | |
tree | 3e27d237c79ea825c3794016b920121f178596bd /res/layout/app_preference_item.xml | |
parent | 210bb8694aa5ad14b2b5bd52ab77a7960b4b5712 (diff) | |
download | packages_apps_Settings-b9558d91dfcae4cd98f2e25dd070dfa8c926d524.zip packages_apps_Settings-b9558d91dfcae4cd98f2e25dd070dfa8c926d524.tar.gz packages_apps_Settings-b9558d91dfcae4cd98f2e25dd070dfa8c926d524.tar.bz2 |
Refactor SmsListPreference into AppListPreference.
This generalizes the pattern of needing to offer a selection among a
list of candidate applications.
Also move some reusable logic around querying PackageManager for icons
into AppListPreference, and remove some unnecessary update logic: the
preference will update itself when onPreferenceChange returns true,
and we can set the summary to '%s' to automatically use the entry as
the summary without having to reset it each time.
Change-Id: I007b9ed58359302f93b367a4b86354e93613bf3e
Diffstat (limited to 'res/layout/app_preference_item.xml')
-rwxr-xr-x | res/layout/app_preference_item.xml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/res/layout/app_preference_item.xml b/res/layout/app_preference_item.xml new file mode 100755 index 0000000..22ee37e --- /dev/null +++ b/res/layout/app_preference_item.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2013, 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:layout_width="match_parent" + android:layout_height="?android:attr/listPreferredItemHeight" + android:padding="6dip"> + <ImageView + android:id="@+id/app_image" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:padding="6dip" + /> + <CheckedTextView + android:id="@+id/app_label" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?android:attr/listPreferredItemHeight" + android:textAppearance="?android:attr/textAppearanceLarge" + android:textColor="?android:attr/textColorAlertDialogListItem" + android:gravity="center_vertical" + android:paddingEnd="7dip" + android:checkMark="?android:attr/listChoiceIndicatorSingle" + android:ellipsize="marquee" + /> +</LinearLayout> |