Updated layouts for keyguard widget picker
Bug: 7381803 Change-Id: I9a6a8fe3216002b486e7b6ddf7544d9fc4e73de8
This commit is contained in:
@@ -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>
|
||||
|
@@ -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>
|
@@ -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>
|
||||
|
21
res/values-land/styles.xml
Normal file
21
res/values-land/styles.xml
Normal file
@@ -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>
|
@@ -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>
|
||||
|
21
res/values-sw600dp-land/styles.xml
Normal file
21
res/values-sw600dp-land/styles.xml
Normal file
@@ -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>
|
@@ -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>
|
||||
|
@@ -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>
|
||||
|
@@ -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>
|
||||
|
21
res/values-sw720dp/styles.xml
Normal file
21
res/values-sw720dp/styles.xml
Normal file
@@ -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>
|
@@ -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>
|
||||
|
@@ -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>
|
||||
|
@@ -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());
|
||||
|
Reference in New Issue
Block a user