Merge "Make tabs respect the device default style." into rvc-dev am: 76562e161f am: d71c5ade99
Change-Id: I9b027e4a73cf20433a56001ac6c46d7aeffca81b
This commit is contained in:
@@ -49,6 +49,7 @@ import android.content.pm.ResolveInfo;
|
|||||||
import android.content.pm.UserInfo;
|
import android.content.pm.UserInfo;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Insets;
|
import android.graphics.Insets;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@@ -65,6 +66,7 @@ import android.stats.devicepolicy.DevicePolicyEnums;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -1606,7 +1608,10 @@ public class ResolverActivity extends Activity implements
|
|||||||
for (int i = 0; i < tabWidget.getChildCount(); i++) {
|
for (int i = 0; i < tabWidget.getChildCount(); i++) {
|
||||||
View tabView = tabWidget.getChildAt(i);
|
View tabView = tabWidget.getChildAt(i);
|
||||||
TextView title = tabView.findViewById(android.R.id.title);
|
TextView title = tabView.findViewById(android.R.id.title);
|
||||||
title.setTextColor(getColor(R.color.resolver_tabs_inactive_color));
|
title.setTextAppearance(android.R.style.TextAppearance_DeviceDefault_DialogWindowTitle);
|
||||||
|
title.setTextColor(getAttrColor(this, android.R.attr.textColorTertiary));
|
||||||
|
title.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||||
|
getResources().getDimension(R.dimen.resolver_tab_text_size));
|
||||||
if (title.getText().equals(getString(R.string.resolver_personal_tab))) {
|
if (title.getText().equals(getString(R.string.resolver_personal_tab))) {
|
||||||
tabView.setContentDescription(personalContentDescription);
|
tabView.setContentDescription(personalContentDescription);
|
||||||
} else if (title.getText().equals(getString(R.string.resolver_work_tab))) {
|
} else if (title.getText().equals(getString(R.string.resolver_work_tab))) {
|
||||||
@@ -1615,10 +1620,17 @@ public class ResolverActivity extends Activity implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int getAttrColor(Context context, int attr) {
|
||||||
|
TypedArray ta = context.obtainStyledAttributes(new int[]{attr});
|
||||||
|
int colorAccent = ta.getColor(0, 0);
|
||||||
|
ta.recycle();
|
||||||
|
return colorAccent;
|
||||||
|
}
|
||||||
|
|
||||||
private void updateActiveTabStyle(TabHost tabHost) {
|
private void updateActiveTabStyle(TabHost tabHost) {
|
||||||
TextView title = tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab())
|
TextView title = tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab())
|
||||||
.findViewById(android.R.id.title);
|
.findViewById(android.R.id.title);
|
||||||
title.setTextColor(getColor(R.color.resolver_tabs_active_color));
|
title.setTextColor(getAttrColor(this, android.R.attr.colorAccent));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupViewVisibilities() {
|
private void setupViewVisibilities() {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item android:gravity="bottom">
|
<item android:gravity="bottom">
|
||||||
<shape android:shape="rectangle"
|
<shape android:shape="rectangle"
|
||||||
android:tint="@color/resolver_tabs_active_color">
|
android:tint="?attr/colorAccent">
|
||||||
<size android:height="2dp" />
|
<size android:height="2dp" />
|
||||||
<solid android:color="@color/tab_indicator_material" />
|
<solid android:color="@color/tab_indicator_material" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:fontFamily="@string/config_headlineFontFamilyMedium"
|
android:fontFamily="@string/config_headlineFontFamilyMedium"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@color/resolver_tabs_active_color"
|
android:textColor="?attr/colorAccent"
|
||||||
android:layout_centerHorizontal="true" />
|
android:layout_centerHorizontal="true" />
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/resolver_empty_state_progress"
|
android:id="@+id/resolver_empty_state_progress"
|
||||||
@@ -71,5 +71,5 @@
|
|||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_below="@+id/resolver_empty_state_subtitle"
|
android:layout_below="@+id/resolver_empty_state_subtitle"
|
||||||
android:indeterminateTint="@color/resolver_tabs_active_color"/>
|
android:indeterminateTint="?attr/colorAccent"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -33,7 +33,6 @@
|
|||||||
<color name="chooser_gradient_background">@color/loading_gradient_background_color_dark</color>
|
<color name="chooser_gradient_background">@color/loading_gradient_background_color_dark</color>
|
||||||
<color name="chooser_gradient_highlight">@color/loading_gradient_highlight_color_dark</color>
|
<color name="chooser_gradient_highlight">@color/loading_gradient_highlight_color_dark</color>
|
||||||
|
|
||||||
<color name="resolver_tabs_active_color">#FF8AB4F8</color>
|
|
||||||
<color name="resolver_empty_state_text">#FFFFFF</color>
|
<color name="resolver_empty_state_text">#FFFFFF</color>
|
||||||
<color name="resolver_empty_state_icon">#FFFFFF</color>
|
<color name="resolver_empty_state_icon">#FFFFFF</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -224,8 +224,6 @@
|
|||||||
|
|
||||||
<!-- Resolver/Chooser -->
|
<!-- Resolver/Chooser -->
|
||||||
<color name="resolver_text_color_secondary_dark">#ffC4C6C6</color>
|
<color name="resolver_text_color_secondary_dark">#ffC4C6C6</color>
|
||||||
<color name="resolver_tabs_active_color">#FF1A73E8</color>
|
|
||||||
<color name="resolver_tabs_inactive_color">#FF80868B</color>
|
|
||||||
<color name="resolver_empty_state_text">#FF202124</color>
|
<color name="resolver_empty_state_text">#FF202124</color>
|
||||||
<color name="resolver_empty_state_icon">#FF5F6368</color>
|
<color name="resolver_empty_state_icon">#FF5F6368</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -802,6 +802,7 @@
|
|||||||
<dimen name="resolver_empty_state_height_with_tabs">268dp</dimen>
|
<dimen name="resolver_empty_state_height_with_tabs">268dp</dimen>
|
||||||
<dimen name="resolver_max_collapsed_height">192dp</dimen>
|
<dimen name="resolver_max_collapsed_height">192dp</dimen>
|
||||||
<dimen name="resolver_max_collapsed_height_with_tabs">248dp</dimen>
|
<dimen name="resolver_max_collapsed_height_with_tabs">248dp</dimen>
|
||||||
|
<dimen name="resolver_tab_text_size">14sp</dimen>
|
||||||
|
|
||||||
<dimen name="chooser_action_button_icon_size">18dp</dimen>
|
<dimen name="chooser_action_button_icon_size">18dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -3908,8 +3908,6 @@
|
|||||||
<java-symbol type="layout" name="conversation_face_pile_layout" />
|
<java-symbol type="layout" name="conversation_face_pile_layout" />
|
||||||
|
|
||||||
<!-- Intent resolver and share sheet -->
|
<!-- Intent resolver and share sheet -->
|
||||||
<java-symbol type="color" name="resolver_tabs_active_color" />
|
|
||||||
<java-symbol type="color" name="resolver_tabs_inactive_color" />
|
|
||||||
<java-symbol type="string" name="resolver_personal_tab" />
|
<java-symbol type="string" name="resolver_personal_tab" />
|
||||||
<java-symbol type="string" name="resolver_personal_tab_accessibility" />
|
<java-symbol type="string" name="resolver_personal_tab_accessibility" />
|
||||||
<java-symbol type="string" name="resolver_work_tab" />
|
<java-symbol type="string" name="resolver_work_tab" />
|
||||||
@@ -3940,6 +3938,7 @@
|
|||||||
<java-symbol type="dimen" name="resolver_empty_state_height_with_tabs" />
|
<java-symbol type="dimen" name="resolver_empty_state_height_with_tabs" />
|
||||||
<java-symbol type="dimen" name="resolver_max_collapsed_height_with_tabs" />
|
<java-symbol type="dimen" name="resolver_max_collapsed_height_with_tabs" />
|
||||||
<java-symbol type="bool" name="sharesheet_show_content_preview" />
|
<java-symbol type="bool" name="sharesheet_show_content_preview" />
|
||||||
|
<java-symbol type="dimen" name="resolver_tab_text_size" />
|
||||||
|
|
||||||
<!-- Toast message for background started foreground service while-in-use permission restriction feature -->
|
<!-- Toast message for background started foreground service while-in-use permission restriction feature -->
|
||||||
<java-symbol type="string" name="allow_while_in_use_permission_in_fgs" />
|
<java-symbol type="string" name="allow_while_in_use_permission_in_fgs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user