diff options
11 files changed, 67 insertions, 68 deletions
diff --git a/core/res/res/layout/alert_dialog_material.xml b/core/res/res/layout/alert_dialog_material.xml index 5f9066a40320..831ee988c371 100644 --- a/core/res/res/layout/alert_dialog_material.xml +++ b/core/res/res/layout/alert_dialog_material.xml @@ -33,8 +33,8 @@ android:gravity="center_vertical|start" android:paddingStart="@dimen/alert_dialog_padding_material" android:paddingEnd="@dimen/alert_dialog_padding_material" - android:paddingTop="@dimen/alert_dialog_padding_material" - android:paddingBottom="8dip"> + android:paddingTop="@dimen/alert_dialog_padding_top_material" + android:paddingBottom="12dip"> <ImageView android:id="@+id/icon" android:layout_width="32dip" android:layout_height="32dip" @@ -67,9 +67,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="@dimen/alert_dialog_padding_material" - android:paddingEnd="@dimen/alert_dialog_padding_material" - android:paddingTop="@dimen/alert_dialog_padding_material" - android:paddingBottom="@dimen/alert_dialog_padding_material" /> + android:paddingEnd="@dimen/alert_dialog_padding_material" /> </ScrollView> </LinearLayout> @@ -77,7 +75,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" - android:minHeight="64dp"> + android:minHeight="48dp"> <FrameLayout android:id="@+id/custom" android:layout_width="match_parent" android:layout_height="wrap_content" /> @@ -89,15 +87,14 @@ android:layout_height="wrap_content" android:layoutDirection="locale" android:orientation="horizontal" - android:paddingStart="6dp" - android:paddingEnd="6dp" - android:paddingBottom="6dp"> + android:paddingStart="12dp" + android:paddingEnd="12dp" + android:paddingTop="8dp" + android:paddingBottom="8dp"> <Button android:id="@+id/button3" style="?attr/buttonBarNeutralButtonStyle" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="2" - android:minHeight="@dimen/alert_dialog_button_bar_height" /> + android:layout_height="wrap_content" /> <Space android:layout_width="0dp" android:layout_height="0dp" @@ -106,14 +103,10 @@ <Button android:id="@+id/button2" style="?attr/buttonBarNegativeButtonStyle" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="2" - android:minHeight="@dimen/alert_dialog_button_bar_height" /> + android:layout_height="wrap_content" /> <Button android:id="@+id/button1" style="?attr/buttonBarPositiveButtonStyle" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="2" - android:minHeight="@dimen/alert_dialog_button_bar_height" /> + android:layout_height="wrap_content" /> </LinearLayout> </LinearLayout> diff --git a/core/res/res/layout/alert_dialog_progress_material.xml b/core/res/res/layout/alert_dialog_progress_material.xml index b9d0814d8013..bcf946f9897d 100644 --- a/core/res/res/layout/alert_dialog_progress_material.xml +++ b/core/res/res/layout/alert_dialog_progress_material.xml @@ -17,32 +17,25 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" - android:layout_height="match_parent"> - <ProgressBar android:id="@+id/progress" - style="?android:attr/progressBarStyleHorizontal" + android:layout_height="match_parent" + android:paddingStart="@dimen/alert_dialog_padding_material" + android:paddingEnd="@dimen/alert_dialog_padding_material"> + <ProgressBar + android:id="@+id/progress" + style="?attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="16dip" - android:layout_marginBottom="1dip" - android:layout_marginStart="16dip" - android:layout_marginEnd="16dip" android:layout_centerHorizontal="true" /> <TextView android:id="@+id/progress_percent" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingBottom="16dip" - android:layout_marginStart="16dip" - android:layout_marginEnd="16dip" android:layout_alignParentStart="true" android:layout_below="@id/progress" /> <TextView android:id="@+id/progress_number" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingBottom="16dip" - android:layout_marginStart="16dip" - android:layout_marginEnd="16dip" android:layout_alignParentEnd="true" android:layout_below="@id/progress" /> </RelativeLayout> diff --git a/core/res/res/layout/dialog_custom_title_material.xml b/core/res/res/layout/dialog_custom_title_material.xml index 550b72e8a167..248a05eac493 100644 --- a/core/res/res/layout/dialog_custom_title_material.xml +++ b/core/res/res/layout/dialog_custom_title_material.xml @@ -23,17 +23,17 @@ This is a custom layout for a dialog. android:fitsSystemWindows="true"> <FrameLayout android:id="@android:id/title_container" android:layout_width="match_parent" - android:layout_height="?android:attr/windowTitleSize" + android:layout_height="?attr/windowTitleSize" android:layout_weight="0" android:gravity="center_vertical|start" - style="?android:attr/windowTitleBackgroundStyle" /> + style="?attr/windowTitleBackgroundStyle" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical" - android:foreground="?android:attr/windowContentOverlay"> - <FrameLayout android:id="@android:id/content" + android:foreground="?attr/windowContentOverlay"> + <FrameLayout android:id="@id/content" android:layout_width="match_parent" android:layout_height="match_parent" /> </FrameLayout> diff --git a/core/res/res/layout/dialog_title_icons_material.xml b/core/res/res/layout/dialog_title_icons_material.xml index 28e20d93ffc3..21396da3aeb6 100644 --- a/core/res/res/layout/dialog_title_icons_material.xml +++ b/core/res/res/layout/dialog_title_icons_material.xml @@ -28,16 +28,16 @@ enabled. android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_vertical" - android:paddingStart="16dip" - android:paddingEnd="16dip" - android:paddingTop="16dip"> + android:paddingStart="@dimen/alert_dialog_padding_material" + android:paddingEnd="@dimen/alert_dialog_padding_material" + android:paddingTop="@dimen/alert_dialog_padding_material"> <ImageView android:id="@+id/left_icon" android:layout_width="32dip" android:layout_height="32dip" android:scaleType="fitCenter" android:layout_marginEnd="8dip" /> - <TextView android:id="@android:id/title" - style="?android:attr/windowTitleStyle" + <TextView android:id="@id/title" + style="?attr/windowTitleStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" /> @@ -52,8 +52,8 @@ enabled. android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical" - android:foreground="?android:attr/windowContentOverlay"> - <FrameLayout android:id="@android:id/content" + android:foreground="?attr/windowContentOverlay"> + <FrameLayout android:id="@id/content" android:layout_width="match_parent" android:layout_height="match_parent" /> </FrameLayout> diff --git a/core/res/res/layout/dialog_title_material.xml b/core/res/res/layout/dialog_title_material.xml index 918c8f1c18c4..fcf61644940d 100644 --- a/core/res/res/layout/dialog_title_material.xml +++ b/core/res/res/layout/dialog_title_material.xml @@ -29,15 +29,15 @@ enabled. android:layout_width="match_parent" android:layout_height="wrap_content" android:textAlignment="viewStart" - android:paddingStart="16dip" - android:paddingEnd="16dip" - android:paddingTop="16dip" /> + android:paddingStart="@dimen/alert_dialog_padding_material" + android:paddingEnd="@dimen/alert_dialog_padding_material" + android:paddingTop="@dimen/alert_dialog_padding_top_material" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical" - android:foreground="?android:attr/windowContentOverlay"> - <FrameLayout android:id="@android:id/content" + android:foreground="?attr/windowContentOverlay"> + <FrameLayout android:id="@id/content" android:layout_width="match_parent" android:layout_height="match_parent" /> </FrameLayout> diff --git a/core/res/res/layout/progress_dialog_material.xml b/core/res/res/layout/progress_dialog_material.xml index 84d06b57e138..c6eb1f9ee69f 100644 --- a/core/res/res/layout/progress_dialog_material.xml +++ b/core/res/res/layout/progress_dialog_material.xml @@ -19,21 +19,25 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - <LinearLayout android:id="@+id/body" + <LinearLayout + android:id="@+id/body" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:baselineAligned="false" - android:padding="16dip"> + android:paddingStart="@dimen/alert_dialog_padding_material" + android:paddingEnd="@dimen/alert_dialog_padding_material"> - <ProgressBar android:id="@android:id/progress" + <ProgressBar + android:id="@id/progress" style="?android:attr/progressBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:max="10000" - android:layout_marginEnd="16dip" /> + android:layout_marginEnd="16dp" /> - <TextView android:id="@+id/message" + <TextView + android:id="@+id/message" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" /> diff --git a/core/res/res/values/dimens_material.xml b/core/res/res/values/dimens_material.xml index 5f7f0ed20dcd..275a5ec0ad56 100644 --- a/core/res/res/values/dimens_material.xml +++ b/core/res/res/values/dimens_material.xml @@ -77,5 +77,6 @@ <!-- Default rounded corner for controls --> <dimen name="control_corner_material">2dp</dimen> - <dimen name="alert_dialog_padding_material">18dp</dimen> + <dimen name="alert_dialog_padding_material">24dp</dimen> + <dimen name="alert_dialog_padding_top_material">18dp</dimen> </resources> diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml index a7335af11087..26c7d10732dc 100644 --- a/core/res/res/values/styles_material.xml +++ b/core/res/res/values/styles_material.xml @@ -474,6 +474,13 @@ please see styles_device_defaults.xml. <item name="stateListAnimator">@anim/disabled_anim_material</item> </style> + <!-- Alert dialog button bar button --> + <style name="Widget.Material.Button.ButtonBar.AlertDialog" parent="Widget.Material.Button.Borderless.Colored"> + <item name="minWidth">64dp</item> + <item name="maxLines">2</item> + <item name="minHeight">@dimen/alert_dialog_button_bar_height</item> + </style> + <!-- Small borderless ink button --> <style name="Widget.Material.Button.Borderless.Small"> <item name="minHeight">48dip</item> @@ -496,7 +503,6 @@ please see styles_device_defaults.xml. <style name="Widget.Material.ButtonBar.AlertDialog"> <item name="background">@null</item> - <item name="minHeight">@dimen/alert_dialog_button_bar_height</item> </style> <style name="Widget.Material.SearchView"> @@ -936,6 +942,7 @@ please see styles_device_defaults.xml. <style name="Widget.Material.Light.Button.Small" parent="Widget.Material.Button.Small"/> <style name="Widget.Material.Light.Button.Borderless" parent="Widget.Material.Button.Borderless"/> <style name="Widget.Material.Light.Button.Borderless.Colored" parent="Widget.Material.Button.Borderless.Colored"/> + <style name="Widget.Material.Light.Button.ButtonBar.AlertDialog" parent="Widget.Material.Button.ButtonBar.AlertDialog" /> <style name="Widget.Material.Light.Button.Borderless.Small" parent="Widget.Material.Button.Borderless.Small"/> <style name="Widget.Material.Light.Button.Inset" parent="Widget.Material.Button.Inset"/> <style name="Widget.Material.Light.Button.Toggle" parent="Widget.Material.Button.Toggle" /> diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml index ab5cd5a4ea70..4aca02e1ab50 100644 --- a/core/res/res/values/themes_material.xml +++ b/core/res/res/values/themes_material.xml @@ -333,7 +333,7 @@ please see themes_device_defaults.xml. <item name="dividerVertical">?attr/listDivider</item> <item name="dividerHorizontal">?attr/listDivider</item> <item name="buttonBarStyle">@style/Widget.Material.ButtonBar</item> - <item name="buttonBarButtonStyle">@style/Widget.Material.Button.Borderless.Colored</item> + <item name="buttonBarButtonStyle">@style/Widget.Material.Button.ButtonBar.AlertDialog</item> <item name="segmentedButtonStyle">@style/Widget.Material.SegmentedButton</item> <!-- SearchView attributes --> @@ -679,7 +679,7 @@ please see themes_device_defaults.xml. <item name="dividerVertical">?attr/listDivider</item> <item name="dividerHorizontal">?attr/listDivider</item> <item name="buttonBarStyle">@style/Widget.Material.Light.ButtonBar</item> - <item name="buttonBarButtonStyle">@style/Widget.Material.Light.Button.Borderless.Colored</item> + <item name="buttonBarButtonStyle">@style/Widget.Material.Light.Button.ButtonBar.AlertDialog</item> <item name="segmentedButtonStyle">@style/Widget.Material.Light.SegmentedButton</item> <!-- SearchView attributes --> diff --git a/core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/downloadmanagertests/DownloadManagerTestApp.java b/core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/downloadmanagertests/DownloadManagerTestApp.java index bcf2e45d5bb2..db547e243e49 100644 --- a/core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/downloadmanagertests/DownloadManagerTestApp.java +++ b/core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/downloadmanagertests/DownloadManagerTestApp.java @@ -60,10 +60,10 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { super.setUp(); DownloadManagerTestRunner mRunner = (DownloadManagerTestRunner)getInstrumentation(); externalDownloadUriValue = normalizeUri(mRunner.externalDownloadUriValue); - assertNotNull(externalDownloadUriValue); + assertNotNull("download url is null", externalDownloadUriValue); externalLargeDownloadUriValue = normalizeUri(mRunner.externalDownloadUriValue); - assertNotNull(externalLargeDownloadUriValue); + assertNotNull("large download url is null", externalLargeDownloadUriValue); } /** @@ -140,7 +140,7 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { dlRequest = mDownloadManager.enqueue(request); waitForDownloadToStart(dlRequest); - assertTrue(dlRequest != -1); + assertTrue("request id is -1 from download manager", dlRequest != -1); // Store ID of download for later retrieval outputFile = new DataOutputStream(fileOutput); @@ -183,7 +183,7 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { mContext.deleteFile(DOWNLOAD_STARTED_FLAG); } - assertTrue(dlRequest != -1); + assertTrue("request id is -1 from download manager", dlRequest != -1); Cursor cursor = getCursor(dlRequest); ParcelFileDescriptor pfd = null; try { @@ -193,7 +193,7 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { int status = cursor.getInt(columnIndex); int currentWaitTime = 0; - assertTrue(waitForDownload(dlRequest, 15 * 60 * 1000)); + assertTrue("download not finished", waitForDownload(dlRequest, 15 * 60 * 1000)); Log.i(LOG_TAG, "Verifying download information..."); // Verify specific info about the file (size, name, etc)... @@ -233,7 +233,7 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { dlRequest = mDownloadManager.enqueue(request); // Rather large file, so wait up to 15 mins... - assertTrue(waitForDownload(dlRequest, 15 * 60 * 1000)); + assertTrue("download not finished", waitForDownload(dlRequest, 15 * 60 * 1000)); Cursor cursor = getCursor(dlRequest); ParcelFileDescriptor pfd = null; @@ -317,7 +317,7 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { Log.i(LOG_TAG, "Turning on WiFi..."); setWiFiStateOn(true); Log.i(LOG_TAG, "Waiting up to 10 minutes for download to complete..."); - assertTrue(waitForDownload(dlRequest, 10 * 60 * 1000)); + assertTrue("download not finished", waitForDownload(dlRequest, 10 * 60 * 1000)); ParcelFileDescriptor pfd = mDownloadManager.openDownloadedFile(dlRequest); verifyFileSize(pfd, filesize); } finally { @@ -385,7 +385,7 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { setWiFiStateOn(true); Log.i(LOG_TAG, "Waiting up to 10 minutes for download to complete..."); - assertTrue(waitForDownload(dlRequest, 10 * 60 * 1000)); + assertTrue("download not finished", waitForDownload(dlRequest, 10 * 60 * 1000)); ParcelFileDescriptor pfd = mDownloadManager.openDownloadedFile(dlRequest); verifyFileSize(pfd, filesize); } finally { @@ -456,7 +456,7 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { setAirplaneModeOn(false); Log.i(LOG_TAG, "Waiting up to 10 minutes for donwload to complete..."); - assertTrue(waitForDownload(dlRequest, 10 * 60 * 1000)); // wait up to 10 mins + assertTrue("download not finished", waitForDownload(dlRequest, 10 * 60 * 1000)); // wait up to 10 mins ParcelFileDescriptor pfd = mDownloadManager.openDownloadedFile(dlRequest); verifyFileSize(pfd, filesize); } finally { @@ -489,11 +489,11 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest { Request request = new Request(remoteUri); request.setTitle(filename); dlRequest = mDownloadManager.enqueue(request); - assertTrue(dlRequest != -1); + assertTrue("request id is -1 from download manager", dlRequest != -1); downloadIds.add(dlRequest); } - assertTrue(waitForMultipleDownloads(downloadIds, 15 * 60 * 2000)); // wait 15 mins max + assertTrue("download not finished", waitForMultipleDownloads(downloadIds, 15 * 60 * 2000)); // wait 15 mins max } finally { removeAllCurrentDownloads(); } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDualTileLabel.java b/packages/SystemUI/src/com/android/systemui/qs/QSDualTileLabel.java index 377fcc0eef3a..b86e67c829e0 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSDualTileLabel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSDualTileLabel.java @@ -59,7 +59,7 @@ public class QSDualTileLabel extends FrameLayout { .getDimensionPixelSize(R.dimen.qs_dual_tile_padding_horizontal); mFirstLine = initTextView(); - mFirstLine.setPadding(mHorizontalPaddingPx, 0, 0, 0); + mFirstLine.setPadding(mHorizontalPaddingPx, 0, mHorizontalPaddingPx, 0); final LinearLayout firstLineLayout = new LinearLayout(mContext); firstLineLayout.setPadding(0, 0, 0, 0); firstLineLayout.setOrientation(LinearLayout.HORIZONTAL); @@ -104,6 +104,7 @@ public class QSDualTileLabel extends FrameLayout { lp.topMargin = h * 4 / 5; mSecondLine.setLayoutParams(lp); mFirstLine.setMinHeight(h); + mFirstLine.setPadding(mHorizontalPaddingPx, 0, 0, 0); } } |