--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_selected="false"
+ android:color="#b3ffffff"/>
+ <item android:color="@android:color/white"/>
+</selector>
--- /dev/null
+<?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.
+-->
+
+<ripple
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:attr/colorControlHighlight">
+ <item android:drawable="@color/card_background_grey"/>
+</ripple>
limitations under the License.
-->
-<View xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="6dp" />
+<View
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="6dp"
+ android:background="@color/card_background_grey"/>
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 Android Open Source Project
+<!--
+ Copyright (C) 2016 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.
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
+ android:background="?android:attr/selectableItemBackground"
android:ellipsize="end"
- android:maxLines="1"
- android:textColor="@android:color/white"
android:gravity="center"
- android:background="?android:attr/selectableItemBackground"
- android:textAllCaps="true"
- android:padding="@dimen/pager_tabs_title_padding"/>
\ No newline at end of file
+ android:maxLines="1"
+ android:padding="@dimen/pager_tabs_title_padding"
+ android:textColor="@color/sliding_tab_title_text_color"
+ android:textAllCaps="true"/>
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
android:layout_height="@dimen/dashboard_category_height"
android:clickable="true"
android:focusable="true"
- android:background="@drawable/selectable_card"
- android:elevation="@dimen/dashboard_category_elevation"
+ android:background="@drawable/selectable_card_grey"
android:gravity="center_vertical" >
-
- <TextView android:id="@android:id/title"
+ <ImageView
+ android:id="@android:id/icon"
+ android:layout_width="@dimen/dashboard_tile_image_size"
+ android:layout_height="@dimen/dashboard_tile_image_size"
+ android:layout_marginStart="@dimen/dashboard_tile_image_margin_start"
+ android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end"
+ android:src="@drawable/ic_expand_more"/>
+ <TextView
+ android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:paddingStart="16dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.TileTitle"
android:textColor="?android:attr/colorAccent"
- android:alpha=".87"
android:ellipsize="marquee"
- android:fadingEdge="horizontal" />
-
- <ImageView android:id="@android:id/icon"
- android:layout_width="@dimen/dashboard_tile_image_size"
- android:layout_height="@dimen/dashboard_tile_image_size"
- android:layout_marginStart="@dimen/suggestion_arrow_margin"
- android:layout_marginEnd="@dimen/suggestion_arrow_margin"
- android:src="@drawable/ic_expand_more" />
-
+ android:fadingEdge="horizontal"/>
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="end"
+ android:paddingEnd="16dp"
+ android:textAppearance="@style/TextAppearance.TileTitle"
+ android:textColor="?android:attr/colorAccent"/>
</LinearLayout>
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:background="@drawable/selectable_card_grey"
android:clickable="true"
android:focusable="true"
- android:background="@drawable/selectable_card"
- android:elevation="@dimen/dashboard_category_elevation"
- android:orientation="vertical" >
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="?android:attr/listDivider" />
-
- <LinearLayout
- android:layout_width="match_parent"
+ android:gravity="center_vertical"
+ android:minHeight="@dimen/dashboard_tile_minimum_height">
+
+ <ImageView
+ android:id="@android:id/icon"
+ android:layout_width="@dimen/dashboard_tile_image_size"
+ android:layout_height="@dimen/dashboard_tile_image_size"
+ android:layout_marginStart="@dimen/dashboard_tile_image_margin_start"
+ android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end"
+ android:scaleType="centerInside"/>
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:minHeight="@dimen/dashboard_tile_minimum_height">
+ android:layout_weight="1">
+
+ <TextView android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="@style/TextAppearance.TileTitle"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"/>
+
+ <TextView android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@android:id/title"
+ android:layout_alignStart="@android:id/title"
+ android:textAppearance="@style/TextAppearance.Small"
+ android:textColor="?android:attr/textColorSecondary"/>
+
+ </RelativeLayout>
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
<ImageView
- android:id="@android:id/icon"
- android:layout_width="@dimen/dashboard_tile_image_size"
- android:layout_height="@dimen/dashboard_tile_image_size"
- android:scaleType="centerInside"
- android:layout_marginStart="@dimen/dashboard_tile_image_margin_start"
- android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end" />
-
- <RelativeLayout
+ android:id="@+id/overflow"
+ style="?android:attr/actionOverflowButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_weight="1">
-
- <TextView android:id="@android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textAppearance="@style/TextAppearance.TileTitle"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal" />
-
- <TextView android:id="@android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@android:id/title"
- android:layout_alignStart="@android:id/title"
- android:textAppearance="@style/TextAppearance.Small"
- android:textColor="?android:attr/textColorSecondary" />
-
- </RelativeLayout>
-
- <FrameLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent">
-
- <ImageView android:id="@+id/overflow"
- android:layout_width="44dp"
- android:layout_height="44dp"
- android:paddingStart="16dp"
- android:paddingBottom="16dp"
- android:paddingTop="12dp"
- android:paddingEnd="12dp"
- android:gravity="top"
- style="?android:attr/actionOverflowButtonStyle" />
-
- </FrameLayout>
+ android:paddingStart="16dp"
+ android:paddingTop="16dp"
+ android:paddingEnd="18dp"
+ android:paddingBottom="16dp"
+ android:gravity="top"/>
- </LinearLayout>
+ </FrameLayout>
-</LinearLayout>
+</LinearLayout>
\ No newline at end of file
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@color/support_escalation_background"
+ android:background="@color/card_background_grey"
android:gravity="center_horizontal"
- android:paddingBottom="8dp">
+ android:paddingBottom="40dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/summary1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="14dp"
android:textAppearance="@style/TextAppearance.Small"
android:textColor="?android:attr/textColorSecondary"/>
</LinearLayout>
android:id="@+id/summary2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="14dp"
android:textAppearance="@style/TextAppearance.Small"
android:textColor="?android:attr/textColorSecondary"/>
</LinearLayout>
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@color/support_escalation_background"
- android:paddingTop="32dp"
- android:paddingBottom="32dp"
+ android:background="@color/card_background_grey"
+ android:paddingTop="40dp"
+ android:paddingBottom="42dp"
android:paddingStart="56dp"
android:paddingEnd="56dp"
android:orientation="vertical">
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.SupportTitle"/>
<TextView
android:id="@android:id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
android:paddingTop="8dp"
android:textAppearance="@style/TextAppearance.Small"
android:textColor="?android:attr/textColorSecondary"/>
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@color/support_escalation_background"
+ android:background="@color/card_background_grey"
android:gravity="center_horizontal"
android:orientation="vertical">
<Button
android:id="@android:id/text2"
style="@style/SupportSecondaryButton"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:minHeight="48dp"/>
</LinearLayout>
\ No newline at end of file
<color name="usage_graph_dots">#B0BEC5</color>
- <color name="support_escalation_background">#eeeeee</color>
+ <color name="card_background_grey">#eeeeee</color>
</resources>
<dimen name="dashboard_tile_image_margin_start">16dp</dimen>
<dimen name="dashboard_tile_image_margin_end">32dp</dimen>
- <dimen name="suggestion_arrow_margin">16dp</dimen>
-
<!-- SwitchBar margin start / end -->
<dimen name="switchbar_margin_start">16dp</dimen>
<dimen name="switchbar_margin_end">16dp</dimen>
<string name="condition_work_summary">Apps, background sync, and other features related to your work profile are turned off.</string>
<!-- Title for the suggestions section on the dashboard [CHAR LIMIT=30] -->
- <string name="suggestions_title">Suggestions (<xliff:g name="count" example="3">%1$d</xliff:g>)</string>
+ <string name="suggestions_title">Suggestions</string>
+
+ <!-- Summary for the suggestions section on the dashboard, representing number of suggestions. [CHAR LIMIT=10] -->
+ <string name="suggestions_summary">+<xliff:g name="count" example="3">%1$d</xliff:g></string>
<!-- Name of option to remove a suggestion from the list [CHAR LIMIT=30] -->
<string name="suggestion_remove">Remove</string>
<string name="deletion_helper_free_button">Free up <xliff:g id="freeable" example="1.2GB">%1$s</xliff:g></string>
<!-- Title text for connecting to customer support [CHAR LIMIT=80]-->
- <string name="support_escalation_title">Around-the-clock help</string>
+ <string name="support_escalation_title">Around-the-clock support</string>
<!-- Summary text for connecting to customer support [CHAR LIMIT=NONE]-->
<string name="support_escalation_summary">You can request a support call or chat and we\'ll get back to you with a quickness</string>
countItem(null, R.layout.suggestion_header, hasSuggestions, NS_SPACER);
resetCount();
if (mSuggestions != null) {
- int maxSuggestions = mSuggestionMode == SUGGESTION_MODE_DEFAULT
- ? Math.min(DEFAULT_SUGGESTION_COUNT, mSuggestions.size())
- : mSuggestionMode == SUGGESTION_MODE_EXPANDED ? mSuggestions.size()
- : 0;
+ int maxSuggestions = getDisplayableSuggestionCount();
for (int i = 0; i < mSuggestions.size(); i++) {
countItem(mSuggestions.get(i), R.layout.suggestion_tile, i < maxSuggestions,
NS_SUGGESTION);
mId++;
}
+ private int getDisplayableSuggestionCount() {
+ final int suggestionSize = mSuggestions.size();
+ return mSuggestionMode == SUGGESTION_MODE_DEFAULT
+ ? Math.min(DEFAULT_SUGGESTION_COUNT, suggestionSize)
+ : mSuggestionMode == SUGGESTION_MODE_EXPANDED
+ ? suggestionSize : 0;
+ }
+
@Override
public DashboardItemHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new DashboardItemHolder(LayoutInflater.from(parent.getContext()).inflate(
holder.icon.setImageResource(hasMoreSuggestions() ? R.drawable.ic_expand_more
: R.drawable.ic_expand_less);
holder.title.setText(mContext.getString(R.string.suggestions_title, mSuggestions.size()));
+ final int undisplayedSuggestionCount =
+ mSuggestions.size() - getDisplayableSuggestionCount();
+ if (undisplayedSuggestionCount == 0) {
+ holder.summary.setText(null);
+ } else {
+ holder.summary.setText(
+ mContext.getString(R.string.suggestions_summary, undisplayedSuggestionCount));
+ }
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
tabTitleView.setOnClickListener(this);
mTitleView.addView(tabTitleView);
- if (i == mViewPager.getCurrentItem()) {
- tabTitleView.setSelected(true);
- }
+ tabTitleView.setSelected(i == mViewPager.getCurrentItem());
}
}
if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
onViewPagerPageChanged(position, 0f);
}
- final int titleCount = getChildCount();
+ final int titleCount = mTitleView.getChildCount();
for (int i = 0; i < titleCount; i++) {
- getChildAt(i).setSelected(position == i);
+ mTitleView.getChildAt(i).setSelected(position == i);
}
}
}