Loading packages/SettingsLib/BarChartPreference/res/layout/settings_bar_chart.xml +12 −25 Original line number Diff line number Diff line Loading @@ -20,17 +20,11 @@ xmlns:settings="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="10dp" android:layout_marginEnd="10dp" android:gravity="center" android:orientation="vertical"> style="@style/SettingsBarChart"> <TextView android:id="@+id/bar_chart_title" android:layout_width="wrap_content" android:layout_height="48dp" android:gravity="center" android:textAppearance="@style/BarChart.Text.HeaderTitle"/> style="@style/SettingsBarChartTitle"/> <LinearLayout android:id="@+id/bar_views_container" Loading @@ -46,36 +40,29 @@ <com.android.settingslib.widget.BarView android:id="@+id/bar_view1" style="@style/BarViewStyle" settings:barColor="#A142F4"/> style="@style/SettingsBarViewStyle" settings:barColor="@color/settings_bar_view_1_color"/> <com.android.settingslib.widget.BarView android:id="@+id/bar_view2" style="@style/BarViewStyle" settings:barColor="#24C1E0"/> style="@style/SettingsBarViewStyle" settings:barColor="@color/settings_bar_view_2_color"/> <com.android.settingslib.widget.BarView android:id="@+id/bar_view3" style="@style/BarViewStyle" settings:barColor="#4285F4"/> style="@style/SettingsBarViewStyle" settings:barColor="@color/settings_bar_view_3_color"/> <com.android.settingslib.widget.BarView android:id="@+id/bar_view4" style="@style/BarViewStyle" settings:barColor="#009688"/> style="@style/SettingsBarViewStyle" settings:barColor="@color/settings_bar_view_4_color"/> </LinearLayout> <Button android:id="@+id/bar_chart_details" style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center"/> style="@style/SettingsBarChartDetailsButton"/> </LinearLayout> <TextView android:id="@+id/empty_view" android:layout_width="match_parent" android:layout_height="@dimen/settings_bar_view_max_height" android:gravity="center" android:visibility="gone" android:textAppearance="@style/BarChart.Text.Summary"/> style="@style/SettingsBarChartEmptyText"/> </LinearLayout> packages/SettingsLib/BarChartPreference/res/layout/settings_bar_view.xml +5 −19 Original line number Diff line number Diff line Loading @@ -24,33 +24,19 @@ <View android:id="@+id/bar_view" android:layout_width="8dp" android:layout_height="wrap_content"/> android:layout_height="wrap_content" style="@style/SettingsBarChartBar"/> <ImageView android:id="@+id/icon_view" android:layout_width="@dimen/settings_bar_view_icon_size" android:layout_height="@dimen/settings_bar_view_icon_size" android:scaleType="fitCenter" android:layout_marginTop="12dp"/> style="@style/SettingsBarChartBarIcon"/> <TextView android:id="@+id/bar_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="12dp" android:singleLine="true" android:ellipsize="marquee" android:textAppearance="@style/BarChart.Text.Title"/> style="@style/SettingsBarChartBarTitle"/> <TextView android:id="@+id/bar_summary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4dp" android:layout_marginBottom="12dp" android:singleLine="true" android:ellipsize="marquee" android:textAppearance="@style/BarChart.Text.Summary"/> style="@style/SettingsBarChartBarSummary"/> </LinearLayout> No newline at end of file packages/SettingsLib/BarChartPreference/res/values/colors.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 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="settings_bar_view_1_color">#A142F4</color> <color name="settings_bar_view_2_color">#24C1E0</color> <color name="settings_bar_view_3_color">#4285F4</color> <color name="settings_bar_view_4_color">#009688</color> </resources> No newline at end of file packages/SettingsLib/BarChartPreference/res/values/styles.xml +61 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,29 @@ --> <resources> <style name="BarViewStyle"> <style name="SettingsBarChart"> <item name="android:layout_marginStart">10dp</item> <item name="android:layout_marginEnd">10dp</item> <item name="android:gravity">center</item> <item name="android:orientation">vertical</item> </style> <style name="SettingsBarChartTitle"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">48dp</item> <item name="android:gravity">center</item> <item name="android:textAppearance">@style/BarChart.Text.HeaderTitle</item> </style> <style name="SettingsBarChartDetailsButton" parent="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:gravity">center</item> </style> <style name="SettingsBarViewStyle"> <item name="android:layout_width">0dp</item> <item name="android:layout_height">250dp</item> <item name="android:layout_weight">1</item> Loading @@ -24,6 +46,44 @@ <item name="android:layout_marginEnd">8dp</item> </style> <style name="SettingsBarChartEmptyText"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">@dimen/settings_bar_view_max_height</item> <item name="android:gravity">center</item> <item name="android:visibility">gone</item> <item name="android:textAppearance">@style/BarChart.Text.Summary</item> </style> <style name="SettingsBarChartBar"> <item name="android:layout_width">8dp</item> </style> <style name="SettingsBarChartBarIcon"> <item name="android:layout_width">@dimen/settings_bar_view_icon_size</item> <item name="android:layout_height">@dimen/settings_bar_view_icon_size</item> <item name="android:scaleType">fitCenter</item> <item name="android:layout_marginTop">12dp</item> </style> <style name="SettingsBarChartBarTitle"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_marginTop">12dp</item> <item name="android:singleLine">true</item> <item name="android:ellipsize">marquee</item> <item name="android:textAppearance">@style/BarChart.Text.Title</item> </style> <style name="SettingsBarChartBarSummary"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_marginTop">4dp</item> <item name="android:layout_marginBottom">12dp</item> <item name="android:singleLine">true</item> <item name="android:ellipsize">marquee</item> <item name="android:textAppearance">@style/BarChart.Text.Summary</item> </style> <style name="BarChart.Text" parent="@android:style/TextAppearance.Material.Subhead"> <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item> Loading Loading
packages/SettingsLib/BarChartPreference/res/layout/settings_bar_chart.xml +12 −25 Original line number Diff line number Diff line Loading @@ -20,17 +20,11 @@ xmlns:settings="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="10dp" android:layout_marginEnd="10dp" android:gravity="center" android:orientation="vertical"> style="@style/SettingsBarChart"> <TextView android:id="@+id/bar_chart_title" android:layout_width="wrap_content" android:layout_height="48dp" android:gravity="center" android:textAppearance="@style/BarChart.Text.HeaderTitle"/> style="@style/SettingsBarChartTitle"/> <LinearLayout android:id="@+id/bar_views_container" Loading @@ -46,36 +40,29 @@ <com.android.settingslib.widget.BarView android:id="@+id/bar_view1" style="@style/BarViewStyle" settings:barColor="#A142F4"/> style="@style/SettingsBarViewStyle" settings:barColor="@color/settings_bar_view_1_color"/> <com.android.settingslib.widget.BarView android:id="@+id/bar_view2" style="@style/BarViewStyle" settings:barColor="#24C1E0"/> style="@style/SettingsBarViewStyle" settings:barColor="@color/settings_bar_view_2_color"/> <com.android.settingslib.widget.BarView android:id="@+id/bar_view3" style="@style/BarViewStyle" settings:barColor="#4285F4"/> style="@style/SettingsBarViewStyle" settings:barColor="@color/settings_bar_view_3_color"/> <com.android.settingslib.widget.BarView android:id="@+id/bar_view4" style="@style/BarViewStyle" settings:barColor="#009688"/> style="@style/SettingsBarViewStyle" settings:barColor="@color/settings_bar_view_4_color"/> </LinearLayout> <Button android:id="@+id/bar_chart_details" style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center"/> style="@style/SettingsBarChartDetailsButton"/> </LinearLayout> <TextView android:id="@+id/empty_view" android:layout_width="match_parent" android:layout_height="@dimen/settings_bar_view_max_height" android:gravity="center" android:visibility="gone" android:textAppearance="@style/BarChart.Text.Summary"/> style="@style/SettingsBarChartEmptyText"/> </LinearLayout>
packages/SettingsLib/BarChartPreference/res/layout/settings_bar_view.xml +5 −19 Original line number Diff line number Diff line Loading @@ -24,33 +24,19 @@ <View android:id="@+id/bar_view" android:layout_width="8dp" android:layout_height="wrap_content"/> android:layout_height="wrap_content" style="@style/SettingsBarChartBar"/> <ImageView android:id="@+id/icon_view" android:layout_width="@dimen/settings_bar_view_icon_size" android:layout_height="@dimen/settings_bar_view_icon_size" android:scaleType="fitCenter" android:layout_marginTop="12dp"/> style="@style/SettingsBarChartBarIcon"/> <TextView android:id="@+id/bar_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="12dp" android:singleLine="true" android:ellipsize="marquee" android:textAppearance="@style/BarChart.Text.Title"/> style="@style/SettingsBarChartBarTitle"/> <TextView android:id="@+id/bar_summary" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4dp" android:layout_marginBottom="12dp" android:singleLine="true" android:ellipsize="marquee" android:textAppearance="@style/BarChart.Text.Summary"/> style="@style/SettingsBarChartBarSummary"/> </LinearLayout> No newline at end of file
packages/SettingsLib/BarChartPreference/res/values/colors.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 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="settings_bar_view_1_color">#A142F4</color> <color name="settings_bar_view_2_color">#24C1E0</color> <color name="settings_bar_view_3_color">#4285F4</color> <color name="settings_bar_view_4_color">#009688</color> </resources> No newline at end of file
packages/SettingsLib/BarChartPreference/res/values/styles.xml +61 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,29 @@ --> <resources> <style name="BarViewStyle"> <style name="SettingsBarChart"> <item name="android:layout_marginStart">10dp</item> <item name="android:layout_marginEnd">10dp</item> <item name="android:gravity">center</item> <item name="android:orientation">vertical</item> </style> <style name="SettingsBarChartTitle"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">48dp</item> <item name="android:gravity">center</item> <item name="android:textAppearance">@style/BarChart.Text.HeaderTitle</item> </style> <style name="SettingsBarChartDetailsButton" parent="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:gravity">center</item> </style> <style name="SettingsBarViewStyle"> <item name="android:layout_width">0dp</item> <item name="android:layout_height">250dp</item> <item name="android:layout_weight">1</item> Loading @@ -24,6 +46,44 @@ <item name="android:layout_marginEnd">8dp</item> </style> <style name="SettingsBarChartEmptyText"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">@dimen/settings_bar_view_max_height</item> <item name="android:gravity">center</item> <item name="android:visibility">gone</item> <item name="android:textAppearance">@style/BarChart.Text.Summary</item> </style> <style name="SettingsBarChartBar"> <item name="android:layout_width">8dp</item> </style> <style name="SettingsBarChartBarIcon"> <item name="android:layout_width">@dimen/settings_bar_view_icon_size</item> <item name="android:layout_height">@dimen/settings_bar_view_icon_size</item> <item name="android:scaleType">fitCenter</item> <item name="android:layout_marginTop">12dp</item> </style> <style name="SettingsBarChartBarTitle"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_marginTop">12dp</item> <item name="android:singleLine">true</item> <item name="android:ellipsize">marquee</item> <item name="android:textAppearance">@style/BarChart.Text.Title</item> </style> <style name="SettingsBarChartBarSummary"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_marginTop">4dp</item> <item name="android:layout_marginBottom">12dp</item> <item name="android:singleLine">true</item> <item name="android:ellipsize">marquee</item> <item name="android:textAppearance">@style/BarChart.Text.Summary</item> </style> <style name="BarChart.Text" parent="@android:style/TextAppearance.Material.Subhead"> <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item> Loading