Merge "Initial update of Micro theme for Material design." into nyc-mr1-dev
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
85
core/java/com/android/internal/app/MicroAlertController.java
Normal file
85
core/java/com/android/internal/app/MicroAlertController.java
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
core/res/res/layout-notround/alert_dialog_header_micro.xml
Normal file
41
core/res/res/layout-notround/alert_dialog_header_micro.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ 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
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minHeight="@dimen/alert_dialog_title_height">
|
||||
<ImageView android:id="@+id/icon"
|
||||
android:maxHeight="24dp"
|
||||
android:maxWidth="24dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@null" />
|
||||
<com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
|
||||
style="?android:attr/windowTitleStyle"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="viewStart" />
|
||||
</LinearLayout>
|
||||
38
core/res/res/layout-round/alert_dialog_header_micro.xml
Normal file
38
core/res/res/layout-round/alert_dialog_header_micro.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ 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
|
||||
-->
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top|center_horizontal"
|
||||
android:minHeight="@dimen/alert_dialog_title_height">
|
||||
<ImageView android:id="@+id/icon"
|
||||
android:maxHeight="24dp"
|
||||
android:maxWidth="24dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@null" />
|
||||
<com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
|
||||
style="?android:attr/windowTitleStyle"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center" />
|
||||
</FrameLayout>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2014 The Android Open Source Project
|
||||
~ 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.
|
||||
@@ -14,127 +14,100 @@
|
||||
~ 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:id="@+id/parentPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout android:id="@+id/topPanel"
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/parentPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<View android:id="@+id/titleDividerTop"
|
||||
android:layout_height="match_parent">
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dip"
|
||||
android:visibility="gone"
|
||||
android:background="@android:color/holo_blue_light" />
|
||||
<LinearLayout android:id="@+id/title_template"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical|start"
|
||||
android:minHeight="@dimen/alert_dialog_title_height"
|
||||
android:layout_marginStart="16dip"
|
||||
android:layout_marginEnd="16dip">
|
||||
<ImageView android:id="@+id/icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="8dip"
|
||||
android:src="@null" />
|
||||
<com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
|
||||
style="?android:attr/windowTitleStyle"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="viewStart" />
|
||||
</LinearLayout>
|
||||
<View android:id="@+id/titleDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dip"
|
||||
android:visibility="gone"
|
||||
android:background="@android:color/holo_blue_light" />
|
||||
<!-- If the client uses a customTitle, it will be added here. -->
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/contentPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:minHeight="64dp">
|
||||
<ScrollView android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false">
|
||||
<TextView android:id="@+id/message"
|
||||
style="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dip"
|
||||
android:paddingEnd="16dip"
|
||||
android:paddingTop="8dip"
|
||||
android:paddingBottom="8dip"/>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout android:id="@+id/customPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:minHeight="64dp">
|
||||
<FrameLayout android:id="@+android:id/custom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/buttonPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/alert_dialog_button_bar_height"
|
||||
android:orientation="vertical"
|
||||
android:divider="?android:attr/dividerHorizontal"
|
||||
android:showDividers="beginning"
|
||||
android:dividerPadding="0dip">
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
style="?android:attr/buttonBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layoutDirection="locale"
|
||||
android:measureWithLargestChild="true">
|
||||
<Button android:id="@+id/button2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:textSize="14sp"
|
||||
android:minHeight="@dimen/alert_dialog_button_bar_height"
|
||||
android:layout_height="wrap_content" />
|
||||
<Button android:id="@+id/button3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:textSize="14sp"
|
||||
android:minHeight="@dimen/alert_dialog_button_bar_height"
|
||||
android:layout_height="wrap_content" />
|
||||
<Button android:id="@+id/button1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
android:minHeight="@dimen/alert_dialog_button_bar_height"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:textSize="14sp"
|
||||
android:layout_height="wrap_content" />
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<!-- Top Panel -->
|
||||
<FrameLayout
|
||||
android:paddingLeft="@dimen/dialog_padding_micro"
|
||||
android:paddingRight="@dimen/dialog_padding_micro"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/topPanel">
|
||||
<include android:id="@+id/title_template"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
layout="@layout/alert_dialog_header_micro"/>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- Content Panel -->
|
||||
<FrameLayout android:id="@+id/contentPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false">
|
||||
<TextView android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.Micro.AlertDialog.Message"
|
||||
android:paddingStart="@dimen/dialog_padding_micro"
|
||||
android:paddingEnd="@dimen/dialog_padding_micro"
|
||||
android:paddingTop="8dip"
|
||||
android:paddingBottom="8dip"/>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- Custom Panel, to replace content panel if needed -->
|
||||
<FrameLayout android:id="@+id/customPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="64dp">
|
||||
<FrameLayout android:id="@+android:id/custom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</FrameLayout>
|
||||
|
||||
<!-- Button Panel -->
|
||||
<FrameLayout
|
||||
android:id="@+id/buttonPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="?android:attr/dividerHorizontal"
|
||||
android:showDividers="beginning"
|
||||
android:dividerPadding="0dip"
|
||||
android:orientation="vertical"
|
||||
android:minHeight="@dimen/alert_dialog_button_bar_height"
|
||||
android:paddingBottom="@dimen/dialog_padding_micro"
|
||||
style="?android:attr/buttonBarStyle"
|
||||
android:layoutDirection="locale"
|
||||
android:measureWithLargestChild="true">
|
||||
<Button android:id="@+id/button1"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="@dimen/dialog_padding_micro"
|
||||
android:layout_marginRight="@dimen/dialog_padding_micro"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<Button android:id="@+id/button3"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="@dimen/dialog_padding_micro"
|
||||
android:layout_marginRight="@dimen/dialog_padding_micro"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<Button android:id="@+id/button2"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="@dimen/dialog_padding_micro"
|
||||
android:layout_marginRight="@dimen/dialog_padding_micro"
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</FrameLayout>
|
||||
|
||||
19
core/res/res/values-notround/dimens_micro.xml
Normal file
19
core/res/res/values-notround/dimens_micro.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
<resources>
|
||||
<dimen name="dialog_padding_micro">8dp</dimen>
|
||||
<dimen name="list_item_padding_horizontal_micro">16dp</dimen>
|
||||
</resources>
|
||||
20
core/res/res/values-notround/styles_micro.xml
Normal file
20
core/res/res/values-notround/styles_micro.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
<resources>
|
||||
<style name="TextAppearance.Micro.AlertDialog.Message" parent="TextAppearance.Micro.Small">
|
||||
<item name="textAlignment">viewStart</item>
|
||||
</style>
|
||||
</resources>
|
||||
19
core/res/res/values-round/dimens_micro.xml
Normal file
19
core/res/res/values-round/dimens_micro.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
<resources>
|
||||
<dimen name="dialog_padding_micro">32dp</dimen>
|
||||
<dimen name="list_item_padding_horizontal_micro">22dp</dimen>
|
||||
</resources>
|
||||
20
core/res/res/values-round/styles_micro.xml
Normal file
20
core/res/res/values-round/styles_micro.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
<resources>
|
||||
<style name="TextAppearance.Micro.AlertDialog.Message" parent="TextAppearance.Micro.Small">
|
||||
<item name="textAlignment">center</item>
|
||||
</style>
|
||||
</resources>
|
||||
55
core/res/res/values/colors_micro.xml
Normal file
55
core/res/res/values/colors_micro.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (C) 2014 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>
|
||||
<color name="foreground_micro_dark">@color/white</color>
|
||||
<color name="foreground_micro_light">@color/black</color>
|
||||
|
||||
<color name="background_micro_dark">@color/micro_blue_grey_b15</color>
|
||||
<color name="background_micro_light">@color/white</color>
|
||||
<color name="background_floating_micro_dark">@color/micro_blue_grey_b30</color>
|
||||
<color name="background_floating_micro_light">@color/micro_blue_grey_500</color>
|
||||
|
||||
<color name="primary_micro_dark">@color/micro_blue_grey_b65</color>
|
||||
<color name="primary_dark_micro_dark">@color/micro_blue_grey_b40</color>
|
||||
|
||||
<color name="accent_micro_light">@color/micro_blue_grey_500</color>
|
||||
<color name="accent_micro_dark">@color/micro_blue_grey_b100</color>
|
||||
|
||||
<color name="button_micro_dark">@color/micro_button_gray</color>
|
||||
|
||||
<!-- Primary & accent colors -->
|
||||
<eat-comment />
|
||||
|
||||
<!-- App color -->
|
||||
<color name="micro_blue_grey_500">#ff607d8b</color>
|
||||
<!-- Accent -->
|
||||
<color name="micro_blue_grey_b100">#ffb0e5ff</color>
|
||||
<!-- Lighter UI element -->
|
||||
<color name="micro_blue_grey_b65">#ff7295a6</color>
|
||||
<!-- UI Element -->
|
||||
<color name="micro_blue_grey_b40">#ff465b66</color>
|
||||
<!-- Lighter background -->
|
||||
<color name="micro_blue_grey_b30">#ff35454d</color>
|
||||
<!-- Dark background -->
|
||||
<color name="micro_blue_grey_b15">#ff1a2226</color>
|
||||
|
||||
<!-- Button colors -->
|
||||
<eat-comment />
|
||||
|
||||
<color name="micro_confirm_green">#ff4fc0b0</color>
|
||||
<color name="micro_button_gray">#ffc2c2c2</color>
|
||||
<color name="micro_action_blue">#ff0288d1</color>
|
||||
</resources>
|
||||
29
core/res/res/values/dimens_micro.xml
Normal file
29
core/res/res/values/dimens_micro.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
<resources>
|
||||
<dimen name="text_size_headline_micro">22sp</dimen>
|
||||
<dimen name="text_size_title_micro">20sp</dimen>
|
||||
<dimen name="text_size_subtitle_micro">18sp</dimen>
|
||||
<dimen name="text_size_body1_micro">16sp</dimen>
|
||||
<dimen name="text_size_body2_micro">14sp</dimen>
|
||||
<dimen name="text_size_caption_micro">12sp</dimen>
|
||||
|
||||
<dimen name="text_size_large_micro">20sp</dimen>
|
||||
<dimen name="text_size_medium_micro">18sp</dimen>
|
||||
<dimen name="text_size_small_micro">16sp</dimen>
|
||||
|
||||
<item name="line_spacing_multiplier_micro" format="float" type="dimen">1.2</item>
|
||||
</resources>
|
||||
@@ -40,7 +40,7 @@
|
||||
<item name="wallpaperIntraCloseExitAnimation">@anim/slide_in_exit_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertDialog.Micro" parent="AlertDialog.Material.Light">
|
||||
<style name="AlertDialog.Micro" parent="AlertDialog.Material">
|
||||
<item name="fullDark">@null</item>
|
||||
<item name="topDark">@null</item>
|
||||
<item name="centerDark">@null</item>
|
||||
@@ -52,30 +52,79 @@
|
||||
<item name="bottomMedium">@null</item>
|
||||
<item name="centerMedium">@null</item>
|
||||
<item name="layout">@layout/alert_dialog_micro</item>
|
||||
<item name="controllerType">micro</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogWindowTitle.Micro">
|
||||
<item name="maxLines">1</item>
|
||||
<item name="scrollHorizontally">true</item>
|
||||
<item name="textAppearance">@style/TextAppearance.Micro.DialogWindowTitle</item>
|
||||
<item name="textAlignment">viewStart</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro" parent="TextAppearance.Material">
|
||||
<item name="textSize">20sp</item>
|
||||
<item name="fontFamily">sans-serif-condensed-light</item>
|
||||
<item name="textColor">@color/micro_text_light</item>
|
||||
<item name="lineSpacingMultiplier">@dimen/line_spacing_multiplier_micro</item>
|
||||
<item name="textColor">?attr/textColorPrimary</item>
|
||||
<item name="textSize">@dimen/text_size_medium_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Inverse" parent="TextAppearance.Material">
|
||||
<item name="textColor">?attr/textColorPrimaryInverse</item>
|
||||
<item name="textColorHint">?attr/textColorHintInverse</item>
|
||||
<item name="textColorHighlight">?attr/textColorHighlightInverse</item>
|
||||
<item name="textColorLink">?attr/textColorLinkInverse</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Headline">
|
||||
<item name="textSize">@dimen/text_size_headline_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Title">
|
||||
<item name="textSize">@dimen/text_size_title_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Subtitle">
|
||||
<item name="textSize">@dimen/text_size_subtitle_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Body1">
|
||||
<item name="textSize">@dimen/text_size_body1_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Body2">
|
||||
<item name="textSize">@dimen/text_size_body2_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Caption">
|
||||
<item name="textSize">@dimen/text_size_caption_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Large">
|
||||
<item name="textSize">@dimen/text_size_large_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Medium">
|
||||
<item name="textSize">@dimen/text_size_medium_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.Small">
|
||||
<item name="textSize">@dimen/text_size_small_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.DialogWindowTitle" parent="TextAppearance.Material.DialogWindowTitle">
|
||||
<item name="textSize">20sp</item>
|
||||
<item name="fontFamily">sans-serif-condensed-light</item>
|
||||
<item name="textColor">@color/micro_text_light</item>
|
||||
<item name="lineSpacingMultiplier">@dimen/line_spacing_multiplier_micro</item>
|
||||
<item name="textColor">?attr/textColorPrimary</item>
|
||||
<item name="textSize">@dimen/text_size_large_micro</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Micro.AlertDialog.Message" parent="TextAppearance.Micro.Small" />
|
||||
|
||||
<style name="Widget.Micro" parent="Widget.Material" />
|
||||
|
||||
<style name="Widget.Micro.TextView">
|
||||
<item name="fontFamily">sans-serif-condensed</item>
|
||||
<style name="Widget.Micro.TextView" parent="Widget.Material.TextView" >
|
||||
<item name="breakStrategy">balanced</item>
|
||||
<item name="hyphenationFrequency">normal</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Micro.NumberPicker">
|
||||
@@ -90,4 +139,14 @@
|
||||
<item name="descendantFocusability">blocksDescendants</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Micro.ButtonBar">
|
||||
<item name="background">@color/background_floating_micro_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Micro.Button.ButtonBar.AlertDialog" parent="Widget.Material.Button.ButtonBar.AlertDialog">
|
||||
<item name="textAppearance">@style/TextAppearance.Micro.Small</item>
|
||||
<item name="maxLines">3</item>
|
||||
<item name="textColor">?attr/textColorPrimary</item>
|
||||
<item name="textAlignment">viewStart</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -21,11 +21,36 @@
|
||||
<item name="textViewStyle">@style/Widget.Micro.TextView</item>
|
||||
<item name="numberPickerStyle">@style/Widget.Micro.NumberPicker</item>
|
||||
<item name="windowAnimationStyle">@style/Animation.Micro.Activity</item>
|
||||
<item name="windowBackground">@color/black</item>
|
||||
<item name="windowBackground">@color/background_micro_dark</item>
|
||||
<item name="windowContentOverlay">@null</item>
|
||||
<item name="windowIsFloating">false</item>
|
||||
<!-- Required to force windowInsets dispatch through application UI. -->
|
||||
<item name="windowOverscan">true</item>
|
||||
|
||||
<item name="textAppearance">@style/TextAppearance.Micro</item>
|
||||
<item name="textAppearanceInverse">@style/TextAppearance.Micro.Inverse</item>
|
||||
|
||||
<item name="textAppearanceLarge">@style/TextAppearance.Micro.Large</item>
|
||||
<item name="textAppearanceMedium">@style/TextAppearance.Micro.Medium</item>
|
||||
<item name="textAppearanceSmall">@style/TextAppearance.Micro.Small</item>
|
||||
|
||||
<item name="textAppearanceListItem">@style/TextAppearance.Micro.Subtitle</item>
|
||||
<item name="textAppearanceListItemSmall">@style/TextAppearance.Micro.Body1</item>
|
||||
<item name="textAppearanceListItemSecondary">@style/TextAppearance.Micro.Body2</item>
|
||||
<item name="listPreferredItemPaddingLeft">@dimen/list_item_padding_horizontal_micro</item>
|
||||
<item name="listPreferredItemPaddingRight">@dimen/list_item_padding_horizontal_micro</item>
|
||||
<item name="listPreferredItemPaddingStart">@dimen/list_item_padding_horizontal_micro</item>
|
||||
<item name="listPreferredItemPaddingEnd">@dimen/list_item_padding_horizontal_micro</item>
|
||||
|
||||
<!-- Dialog styling -->
|
||||
<item name="buttonBarStyle">@style/Widget.Micro.ButtonBar</item>
|
||||
<item name="buttonBarButtonStyle">@style/Widget.Micro.Button.ButtonBar.AlertDialog</item>
|
||||
|
||||
<!-- Color palette -->
|
||||
<item name="colorPrimaryDark">@color/primary_dark_micro_dark</item>
|
||||
<item name="colorPrimary">@color/primary_micro_dark</item>
|
||||
<item name="colorAccent">@color/accent_micro_dark</item>
|
||||
<item name="colorEdgeEffect">?attr/colorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Micro" parent="Theme.MicroBase">
|
||||
@@ -49,12 +74,29 @@
|
||||
<style name="Theme.Micro.Light" parent="Theme.Micro.LightBase">
|
||||
</style>
|
||||
|
||||
<style name="Theme.Micro.DialogBase" parent="Theme.Material.Light.Dialog">
|
||||
<item name="windowTitleStyle">@android:style/DialogWindowTitle.Micro</item>
|
||||
<style name="Theme.Micro.DialogBase">
|
||||
<item name="colorBackground">?attr/colorBackgroundFloating</item>
|
||||
|
||||
<item name="windowFrame">@null</item>
|
||||
<item name="windowTitleBackgroundStyle">@style/DialogWindowTitleBackground.Material</item>
|
||||
<item name="windowElevation">@dimen/floating_window_z</item>
|
||||
<item name="windowContentOverlay">@null</item>
|
||||
<item name="windowAnimationStyle">@style/Animation.Material.Dialog</item>
|
||||
<item name="windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="windowCloseOnTouchOutside">@bool/config_closeDialogWhenTouchOutside</item>
|
||||
|
||||
<item name="colorBackgroundCacheHint">@null</item>
|
||||
|
||||
<item name="listDivider">@null</item>
|
||||
|
||||
<item name="preferencePanelStyle">@style/PreferencePanel.Dialog</item>
|
||||
|
||||
<item name="windowTitleStyle">@style/DialogWindowTitle.Micro</item>
|
||||
<item name="windowIsFloating">false</item>
|
||||
<item name="windowFullscreen">true</item>
|
||||
<item name="textAppearance">@style/TextAppearance.Micro</item>
|
||||
<item name="textAppearanceInverse">@style/TextAppearance.Micro</item>
|
||||
<item name="windowBackground">@color/background_micro_dark</item>
|
||||
<!-- Required to force windowInsets dispatch through application UI. -->
|
||||
<item name="windowOverscan">true</item>
|
||||
</style>
|
||||
@@ -67,21 +109,17 @@
|
||||
<item name="windowTitleStyle">@style/DialogWindowTitle.Micro</item>
|
||||
<item name="alertDialogStyle">@style/AlertDialog.Micro</item>
|
||||
<item name="windowIsFloating">false</item>
|
||||
<item name="windowBackground">@android:color/transparent</item>
|
||||
<item name="windowOverscan">true</item>
|
||||
<item name="windowContentOverlay">@null</item>
|
||||
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
|
||||
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
|
||||
<item name="windowMinWidthMajor">@dimen/dialog_min_width_major</item>
|
||||
<item name="windowMinWidthMinor">@dimen/dialog_min_width_minor</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Micro.Dialog.AppError" parent="Theme.Micro.Dialog">
|
||||
<item name="windowBackground">@null</item>
|
||||
<item name="alertDialogStyle">@style/AlertDialog.Micro</item>
|
||||
<item name="textAppearance">@style/TextAppearance.Micro.Large</item>
|
||||
<item name="windowOverscan">true</item>
|
||||
<item name="windowCloseOnTouchOutside">false</item>
|
||||
<item name="textSize">20sp</item>
|
||||
<item name="fontFamily">sans-serif-condensed-light</item>
|
||||
<item name="textColor">@color/micro_text_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Micro.Panel" parent="Theme.Material.Panel" />
|
||||
|
||||
Reference in New Issue
Block a user