diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java
index 9ade60dcda58a..8e101d0823fae 100644
--- a/core/java/com/android/internal/app/AlertController.java
+++ b/core/java/com/android/internal/app/AlertController.java
@@ -61,6 +61,7 @@ import android.widget.TextView;
import java.lang.ref.WeakReference;
public class AlertController {
+ public static final int MICRO = 1;
private final Context mContext;
private final DialogInterface mDialogInterface;
@@ -183,6 +184,8 @@ public class AlertController {
a.recycle();
switch (controllerType) {
+ case MICRO:
+ return new MicroAlertController(context, di, window);
default:
return new AlertController(context, di, window);
}
@@ -1128,6 +1131,7 @@ public class AlertController {
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View v, int position, long id) {
+ position -= listView.getHeaderViewsCount();
mOnClickListener.onClick(dialog.mDialogInterface, position);
if (!mIsSingleChoice) {
dialog.mDialogInterface.dismiss();
@@ -1138,6 +1142,7 @@ public class AlertController {
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View v, int position, long id) {
+ position -= listView.getHeaderViewsCount();
if (mCheckedItems != null) {
mCheckedItems[position] = listView.isItemChecked(position);
}
diff --git a/core/java/com/android/internal/app/MicroAlertController.java b/core/java/com/android/internal/app/MicroAlertController.java
new file mode 100644
index 0000000000000..085b2265dfee0
--- /dev/null
+++ b/core/java/com/android/internal/app/MicroAlertController.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+package com.android.internal.app;
+
+import android.content.Context;
+import android.content.DialogInterface;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.ScrollView;
+import android.widget.TextView;
+import android.widget.AbsListView;
+
+import com.android.internal.app.AlertController;
+import com.android.internal.R;
+
+public class MicroAlertController extends AlertController {
+ public MicroAlertController(Context context, DialogInterface di, Window window) {
+ super(context, di, window);
+ }
+
+ @Override
+ protected void setupContent(ViewGroup contentPanel) {
+ // Special case for small screen - the scroll view is higher in hierarchy
+ mScrollView = (ScrollView) mWindow.findViewById(R.id.scrollView);
+
+ // Special case for users that only want to display a String
+ mMessageView = (TextView) contentPanel.findViewById(R.id.message);
+ if (mMessageView == null) {
+ return;
+ }
+
+ if (mMessage != null) {
+ mMessageView.setText(mMessage);
+ } else {
+ // no message, remove associated views
+ mMessageView.setVisibility(View.GONE);
+ contentPanel.removeView(mMessageView);
+
+ if (mListView != null) {
+ // has ListView, swap ScrollView with ListView
+
+ // move topPanel into header of ListView
+ View topPanel = mScrollView.findViewById(R.id.topPanel);
+ ((ViewGroup) topPanel.getParent()).removeView(topPanel);
+ topPanel.setLayoutParams(
+ new AbsListView.LayoutParams(topPanel.getLayoutParams()));
+ mListView.addHeaderView(topPanel, null, false);
+
+ // move buttonPanel into footer of ListView
+ View buttonPanel = mScrollView.findViewById(R.id.buttonPanel);
+ ((ViewGroup) buttonPanel.getParent()).removeView(buttonPanel);
+ buttonPanel.setLayoutParams(
+ new AbsListView.LayoutParams(buttonPanel.getLayoutParams()));
+ mListView.addFooterView(buttonPanel, null, false);
+
+ // swap ScrollView w/ ListView
+ final ViewGroup scrollParent = (ViewGroup) mScrollView.getParent();
+ final int childIndex = scrollParent.indexOfChild(mScrollView);
+ scrollParent.removeViewAt(childIndex);
+ scrollParent.addView(mListView, childIndex,
+ new ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
+ } else {
+ // no content, just hide everything
+ contentPanel.setVisibility(View.GONE);
+ }
+ }
+ }
+}
diff --git a/core/res/res/layout-notround/alert_dialog_header_micro.xml b/core/res/res/layout-notround/alert_dialog_header_micro.xml
new file mode 100644
index 0000000000000..fc840d9fa73fa
--- /dev/null
+++ b/core/res/res/layout-notround/alert_dialog_header_micro.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
diff --git a/core/res/res/layout-round/alert_dialog_header_micro.xml b/core/res/res/layout-round/alert_dialog_header_micro.xml
new file mode 100644
index 0000000000000..6f7ae02388a34
--- /dev/null
+++ b/core/res/res/layout-round/alert_dialog_header_micro.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
diff --git a/core/res/res/layout/alert_dialog_micro.xml b/core/res/res/layout/alert_dialog_micro.xml
index abdbd163e9482..04f8a2a22ad7d 100644
--- a/core/res/res/layout/alert_dialog_micro.xml
+++ b/core/res/res/layout/alert_dialog_micro.xml
@@ -1,6 +1,6 @@
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="match_parent">
-
-
-
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/core/res/res/values-notround/dimens_micro.xml b/core/res/res/values-notround/dimens_micro.xml
new file mode 100644
index 0000000000000..326f7e55aebe4
--- /dev/null
+++ b/core/res/res/values-notround/dimens_micro.xml
@@ -0,0 +1,19 @@
+
+
+
+ 8dp
+ 16dp
+
diff --git a/core/res/res/values-notround/styles_micro.xml b/core/res/res/values-notround/styles_micro.xml
new file mode 100644
index 0000000000000..c45e36459ab0d
--- /dev/null
+++ b/core/res/res/values-notround/styles_micro.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
diff --git a/core/res/res/values-round/dimens_micro.xml b/core/res/res/values-round/dimens_micro.xml
new file mode 100644
index 0000000000000..9bf97dd412e9c
--- /dev/null
+++ b/core/res/res/values-round/dimens_micro.xml
@@ -0,0 +1,19 @@
+
+
+
+ 32dp
+ 22dp
+
diff --git a/core/res/res/values-round/styles_micro.xml b/core/res/res/values-round/styles_micro.xml
new file mode 100644
index 0000000000000..7a1e5117f4722
--- /dev/null
+++ b/core/res/res/values-round/styles_micro.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
diff --git a/core/res/res/values/colors_micro.xml b/core/res/res/values/colors_micro.xml
new file mode 100644
index 0000000000000..b268e9a18b1f5
--- /dev/null
+++ b/core/res/res/values/colors_micro.xml
@@ -0,0 +1,55 @@
+
+
+
+ @color/white
+ @color/black
+
+ @color/micro_blue_grey_b15
+ @color/white
+ @color/micro_blue_grey_b30
+ @color/micro_blue_grey_500
+
+ @color/micro_blue_grey_b65
+ @color/micro_blue_grey_b40
+
+ @color/micro_blue_grey_500
+ @color/micro_blue_grey_b100
+
+ @color/micro_button_gray
+
+
+
+
+
+ #ff607d8b
+
+ #ffb0e5ff
+
+ #ff7295a6
+
+ #ff465b66
+
+ #ff35454d
+
+ #ff1a2226
+
+
+
+
+ #ff4fc0b0
+ #ffc2c2c2
+ #ff0288d1
+
diff --git a/core/res/res/values/dimens_micro.xml b/core/res/res/values/dimens_micro.xml
new file mode 100644
index 0000000000000..dc8b124756782
--- /dev/null
+++ b/core/res/res/values/dimens_micro.xml
@@ -0,0 +1,29 @@
+
+
+
+ 22sp
+ 20sp
+ 18sp
+ 16sp
+ 14sp
+ 12sp
+
+ 20sp
+ 18sp
+ 16sp
+
+ - 1.2
+
diff --git a/core/res/res/values/styles_micro.xml b/core/res/res/values/styles_micro.xml
index 341a0a4c4ea59..dba17058a4d0c 100644
--- a/core/res/res/values/styles_micro.xml
+++ b/core/res/res/values/styles_micro.xml
@@ -40,7 +40,7 @@
- @anim/slide_in_exit_micro
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/core/res/res/values/themes_micro.xml b/core/res/res/values/themes_micro.xml
index 25a6e006c0314..92106b294f8ce 100644
--- a/core/res/res/values/themes_micro.xml
+++ b/core/res/res/values/themes_micro.xml
@@ -21,11 +21,36 @@
- @style/Widget.Micro.TextView
- @style/Widget.Micro.NumberPicker
- @style/Animation.Micro.Activity
- - @color/black
+ - @color/background_micro_dark
- @null
- false
- true
+
+ - @style/TextAppearance.Micro
+ - @style/TextAppearance.Micro.Inverse
+
+ - @style/TextAppearance.Micro.Large
+ - @style/TextAppearance.Micro.Medium
+ - @style/TextAppearance.Micro.Small
+
+ - @style/TextAppearance.Micro.Subtitle
+ - @style/TextAppearance.Micro.Body1
+ - @style/TextAppearance.Micro.Body2
+ - @dimen/list_item_padding_horizontal_micro
+ - @dimen/list_item_padding_horizontal_micro
+ - @dimen/list_item_padding_horizontal_micro
+ - @dimen/list_item_padding_horizontal_micro
+
+
+ - @style/Widget.Micro.ButtonBar
+ - @style/Widget.Micro.Button.ButtonBar.AlertDialog
+
+
+ - @color/primary_dark_micro_dark
+ - @color/primary_micro_dark
+ - @color/accent_micro_dark
+ - ?attr/colorPrimary
-
@@ -67,21 +109,17 @@
- @style/DialogWindowTitle.Micro
- @style/AlertDialog.Micro
- false
- - @android:color/transparent
- true
- @null
- - @android:dimen/dialog_min_width_major
- - @android:dimen/dialog_min_width_minor
+ - @dimen/dialog_min_width_major
+ - @dimen/dialog_min_width_minor