diff options
-rwxr-xr-x | res/layout/keyguard_appwidget_item.xml | 6 | ||||
-rw-r--r-- | res/layout/keyguard_appwidget_picker_layout.xml (renamed from res/layout/keyguard_appwidget_pick_layout.xml) | 4 | ||||
-rwxr-xr-x | res/values-land/dimens.xml | 5 | ||||
-rw-r--r-- | res/values-land/styles.xml | 21 | ||||
-rwxr-xr-x | res/values-sw600dp-land/dimens.xml | 2 | ||||
-rw-r--r-- | res/values-sw600dp-land/styles.xml | 21 | ||||
-rwxr-xr-x | res/values-sw600dp/dimens.xml | 6 | ||||
-rw-r--r-- | res/values-sw600dp/styles.xml | 4 | ||||
-rw-r--r-- | res/values-sw720dp/dimens.xml | 3 | ||||
-rw-r--r-- | res/values-sw720dp/styles.xml | 21 | ||||
-rwxr-xr-x | res/values/dimens.xml | 4 | ||||
-rw-r--r-- | res/values/styles.xml | 4 | ||||
-rw-r--r-- | src/com/android/settings/KeyguardAppWidgetPickActivity.java | 10 |
13 files changed, 107 insertions, 4 deletions
diff --git a/res/layout/keyguard_appwidget_item.xml b/res/layout/keyguard_appwidget_item.xml index ed17bcf..de0c855 100755 --- a/res/layout/keyguard_appwidget_item.xml +++ b/res/layout/keyguard_appwidget_item.xml @@ -24,8 +24,8 @@ android:background="@drawable/appwidget_item_bg" android:layout_marginTop="2dip" android:layout_marginBottom="2dip" - android:layout_marginLeft="8dip" - android:layout_marginRight="8dip" + android:layout_marginLeft="2dip" + android:layout_marginRight="2dip" android:paddingLeft="16dip" android:paddingRight="16dip" android:paddingTop="16dip" @@ -37,11 +37,11 @@ android:scaleType="center" /> <TextView android:id="@+id/label" + style="@style/KeyguardAppWidgetItem" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="24dip" android:paddingBottom="8dip" - android:textAppearance="?android:attr/textAppearanceMedium" android:gravity="left|bottom" /> </LinearLayout> </FrameLayout> diff --git a/res/layout/keyguard_appwidget_pick_layout.xml b/res/layout/keyguard_appwidget_picker_layout.xml index 85667f6..b678925 100644 --- a/res/layout/keyguard_appwidget_pick_layout.xml +++ b/res/layout/keyguard_appwidget_picker_layout.xml @@ -18,12 +18,16 @@ android:id="@+id/layout_root" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_marginLeft="@dimen/keyguard_appwidget_picker_margin_left" + android:layout_marginRight="@dimen/keyguard_appwidget_picker_margin_right" android:paddingTop="2dip" android:paddingBottom="2dip" android:orientation="vertical" > <GridView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" + android:numColumns="@integer/keyguard_appwidget_picker_cols" + android:layout_gravity="center_horizontal" android:listSelector="@android:color/transparent" android:id="@+id/widget_list" /> </LinearLayout> diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml index 2ced533..498aa4d 100755 --- a/res/values-land/dimens.xml +++ b/res/values-land/dimens.xml @@ -17,4 +17,9 @@ <resources> <dimen name="appwidget_width">421dip</dimen> <dimen name="appwidget_height">68dip</dimen> + <dimen name="appwidget_preview_width">120dip</dimen> + <dimen name="appwidget_preview_height">70dip</dimen> + <dimen name="keyguard_appwidget_picker_margin_left">2dip</dimen> + <dimen name="keyguard_appwidget_picker_margin_right">2dip</dimen> + <integer name="keyguard_appwidget_picker_cols">2</integer> </resources> diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml new file mode 100644 index 0000000..0903167 --- /dev/null +++ b/res/values-land/styles.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2012 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. +--> + +<resources> + <style name="KeyguardAppWidgetItem"> + <item name="android:textSize">16sp</item> + </style> +</resources> diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml index 994d4bb..c0a79ad 100755 --- a/res/values-sw600dp-land/dimens.xml +++ b/res/values-sw600dp-land/dimens.xml @@ -18,4 +18,6 @@ <dimen name="screen_margin_sides">128dip</dimen> <dimen name="screen_margin_top">72dip</dimen> <dimen name="screen_margin_bottom">48dip</dimen> + <dimen name="appwidget_preview_height">80dip</dimen> + <dimen name="keyguard_appwidget_picker_width">720dip</dimen> </resources> diff --git a/res/values-sw600dp-land/styles.xml b/res/values-sw600dp-land/styles.xml new file mode 100644 index 0000000..645d1fe --- /dev/null +++ b/res/values-sw600dp-land/styles.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2012 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. +--> + +<resources> + <style name="KeyguardAppWidgetItem"> + <item name="android:textSize">18sp</item> + </style> +</resources> diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml index cf7ac6b..1374efd 100755 --- a/res/values-sw600dp/dimens.xml +++ b/res/values-sw600dp/dimens.xml @@ -32,4 +32,10 @@ <dimen name="setup_item_margin">32dip</dimen> <dimen name="appwidget_min_width">325dip</dimen> <dimen name="appwidget_min_height">50dip</dimen> + + <dimen name="appwidget_preview_width">120dip</dimen> + <dimen name="appwidget_preview_height">70dip</dimen> + <dimen name="keyguard_appwidget_picker_margin_left">2dip</dimen> + <dimen name="keyguard_appwidget_picker_margin_right">2dip</dimen> + <integer name="keyguard_appwidget_picker_cols">2</integer> </resources> diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml index f780f53..9f02164 100644 --- a/res/values-sw600dp/styles.xml +++ b/res/values-sw600dp/styles.xml @@ -57,4 +57,8 @@ <item name="android:textAppearance">?android:attr/textAppearanceMedium</item> <item name="android:textSize">20sp</item> </style> + + <style name="KeyguardAppWidgetItem"> + <item name="android:textSize">16sp</item> + </style> </resources> diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml index 5a58609..d6d9184 100644 --- a/res/values-sw720dp/dimens.xml +++ b/res/values-sw720dp/dimens.xml @@ -16,4 +16,7 @@ <resources> <dimen name="pager_tabs_padding">@*android:dimen/preference_fragment_padding_side</dimen> + <dimen name="appwidget_preview_height">80dip</dimen> + <integer name="keyguard_appwidget_picker_cols">2</integer> + <dimen name="keyguard_appwidget_picker_width">720dip</dimen> </resources> diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml new file mode 100644 index 0000000..645d1fe --- /dev/null +++ b/res/values-sw720dp/styles.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2012 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. +--> + +<resources> + <style name="KeyguardAppWidgetItem"> + <item name="android:textSize">18sp</item> + </style> +</resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index efd8212..91f293c 100755 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -57,4 +57,8 @@ <!-- Size of AppWidget previews in KeyguardAppWidgetPickActivity --> <dimen name="appwidget_preview_width">140dip</dimen> <dimen name="appwidget_preview_height">80dip</dimen> + <dimen name="keyguard_appwidget_picker_max_width">800dip</dimen> + <dimen name="keyguard_appwidget_picker_margin_left">6dip</dimen> + <dimen name="keyguard_appwidget_picker_margin_right">6dip</dimen> + <integer name="keyguard_appwidget_picker_cols">1</integer> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index 9b9cb83..dda22d9 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -191,4 +191,8 @@ <item name="android:textAllCaps">true</item> <item name="android:textStyle">bold</item> </style> + + <style name="KeyguardAppWidgetItem"> + <item name="android:textSize">18sp</item> + </style> </resources> diff --git a/src/com/android/settings/KeyguardAppWidgetPickActivity.java b/src/com/android/settings/KeyguardAppWidgetPickActivity.java index 878176d..5b29720 100644 --- a/src/com/android/settings/KeyguardAppWidgetPickActivity.java +++ b/src/com/android/settings/KeyguardAppWidgetPickActivity.java @@ -89,7 +89,7 @@ public class KeyguardAppWidgetPickActivity extends Activity @Override protected void onCreate(Bundle savedInstanceState) { - setContentView(R.layout.keyguard_appwidget_pick_layout); + setContentView(R.layout.keyguard_appwidget_picker_layout); super.onCreate(savedInstanceState); // Set default return data @@ -106,6 +106,14 @@ public class KeyguardAppWidgetPickActivity extends Activity mExtraConfigureOptions = intent.getBundleExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS); mGridView = (GridView) findViewById(R.id.widget_list); + DisplayMetrics dm = new DisplayMetrics(); + getWindowManager().getDefaultDisplay().getMetrics(dm); + int maxGridWidth = getResources().getDimensionPixelSize( + R.dimen.keyguard_appwidget_picker_max_width); + + if (maxGridWidth < dm.widthPixels) { + mGridView.getLayoutParams().width = maxGridWidth; + } mAppWidgetManager = AppWidgetManager.getInstance(this); mAppWidgetLoader = new AppWidgetLoader<Item>(this, mAppWidgetManager, this); mItems = mAppWidgetLoader.getItems(getIntent()); |