Skip to content

Commit ca940b1

Browse files
k
Signed-off-by: Jyotiraditya Panda <jyotiraditya@aospa.co>
1 parent b9690f7 commit ca940b1

7 files changed

Lines changed: 134 additions & 7 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="63dp"
4+
android:height="63dp"
5+
android:tint="?android:attr/colorControlNormal"
6+
android:viewportWidth="63"
7+
android:viewportHeight="63">
8+
<path
9+
android:fillColor="#000000"
10+
android:fillType="evenOdd"
11+
android:pathData="M14.576 23.044l-5.692-9.257 4.025-2.475 5.827 9.477c3.977-1.78 8.322-2.727 12.764-2.727s8.787 0.947 12.764 2.727l5.827-9.477 4.025 2.475-5.692 9.257c1.85 1.193 3.584 2.587 5.164 4.168 5.859 5.858 9.15 13.803 9.15 22.088v2.363H0.263V49.3c0-8.285 3.29-16.23 9.149-22.088 1.58-1.581 3.313-2.975 5.164-4.168zm8.392 14.446c0 1.812-1.469 3.28-3.28 3.28-1.813 0-3.282-1.468-3.282-3.28 0-1.813 1.469-3.282 3.281-3.282s3.281 1.47 3.281 3.282zm20.344 3.28c1.812 0 3.281-1.468 3.281-3.28 0-1.813-1.469-3.282-3.28-3.282-1.813 0-3.282 1.47-3.282 3.282s1.469 3.28 3.281 3.28zM12.753 30.554c4.972-4.972 11.716-7.765 18.747-7.765 7.032 0 13.775 2.793 18.747 7.765 4.413 4.412 7.109 10.22 7.66 16.384H5.093c0.551-6.165 3.248-11.972 7.66-16.384z" />
12+
</vector>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (C) 2021 Wave-OS
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License
16+
-->
17+
18+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:paddingBottom="8dp"
22+
android:orientation="horizontal">
23+
24+
<RelativeLayout
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:background="@drawable/about_card_bg"
28+
android:paddingStart="20dp"
29+
android:paddingTop="21dp"
30+
android:paddingEnd="16dp"
31+
android:paddingBottom="21dp">
32+
33+
<TextView
34+
android:id="@android:id/title"
35+
android:layout_width="wrap_content"
36+
android:layout_height="wrap_content"
37+
android:layout_alignParentTop="true"
38+
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
39+
android:textColor="?android:attr/textColorPrimary"
40+
android:textSize="16sp" />
41+
42+
<TextView
43+
android:id="@android:id/summary"
44+
android:layout_width="wrap_content"
45+
android:layout_height="wrap_content"
46+
android:layout_below="@android:id/title"
47+
android:layout_marginTop="2dp"
48+
android:layout_marginEnd="41dp"
49+
android:fontFamily="@*android:string/config_bodyFontFamily"
50+
android:textColor="?android:attr/textColorSecondary"
51+
android:textSize="13sp" />
52+
53+
<RelativeLayout
54+
android:id="@+id/icon_frame"
55+
android:layout_width="wrap_content"
56+
android:layout_height="wrap_content">
57+
58+
<androidx.preference.internal.PreferenceImageView
59+
android:id="@android:id/icon"
60+
android:layout_width="21dp"
61+
android:layout_height="21dp"
62+
android:layout_alignParentEnd="true"
63+
android:layout_centerVertical="true"
64+
android:contentDescription="@null" />
65+
</RelativeLayout>
66+
</RelativeLayout>
67+
68+
<!-- Preference should place its actual preference widget here. -->
69+
<LinearLayout
70+
android:id="@android:id/widget_frame"
71+
android:layout_width="wrap_content"
72+
android:layout_height="match_parent"
73+
android:gravity="center_vertical"
74+
android:orientation="vertical" />
75+
</LinearLayout>

res/values/styles_preference.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<style name="PreferenceTheme" parent="@style/PreferenceThemeOverlay.SettingsBase">
2323
<item name="apnPreferenceStyle">@style/ApnPreference</item>
2424
<item name="cardPreferenceStyle">@style/CardPreference</item>
25+
<item name="aboutSoftwarePreferenceStyle">@style/AboutSoftwarePreference</item>
2526
<item name="slicePreferenceStyle">@style/SlicePreference</item>
2627
<item name="seekBarPreferenceStyle">@style/SettingsSeekBarPreference</item>
2728
<item name="twoStateButtonPreferenceStyle">@style/TwoStateButtonPreference</item>
@@ -77,4 +78,4 @@
7778
<item name="android:layout">@layout/setup_preference</item>
7879
</style>
7980

80-
</resources>
81+
</resources>

res/values/wave_attrs.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2021 WaveOS
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
18+
19+
<attr name="aboutSoftwarePreferenceStyle" format="reference" />
20+
21+
</resources>

res/values/wave_styles.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@
4040
<item name="android:lineSpacingMultiplier">1.3</item>
4141
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
4242
</style>
43+
44+
<style name="AboutSoftwarePreference" parent="@style/Preference.Material">
45+
<item name="android:layout">@layout/about_software_preference_layout</item>
46+
</style>
4347
</resources>

res/xml/firmware_version.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,32 @@
2828
android:selectable="false" />
2929

3030
<!-- Android version -->
31-
<Preference
31+
<com.android.settings.wave.widget.AboutSoftwarePreference
3232
android:key="os_firmware_version"
3333
android:title="@string/firmware_version"
3434
android:summary="@string/summary_placeholder"
35+
android:icon="@drawable/ic_android_version"
3536
settings:enableCopying="true"
3637
settings:searchable="false"
3738
settings:controller="com.android.settings.deviceinfo.firmwareversion.FirmwareVersionDetailPreferenceController"/>
3839

3940
<!-- Security patch -->
40-
<Preference
41+
<com.android.settings.wave.widget.AboutSoftwarePreference
4142
android:key="security_key"
4243
android:title="@string/security_patch"
4344
settings:enableCopying="true"
4445
settings:controller="com.android.settings.deviceinfo.firmwareversion.SecurityPatchLevelPreferenceController"/>
4546

4647
<!-- Mainline module version -->
47-
<Preference
48+
<com.android.settings.wave.widget.AboutSoftwarePreference
4849
android:key="module_version"
4950
android:title="@string/module_version"
5051
android:summary="@string/summary_placeholder"
5152
settings:enableCopying="true"
5253
settings:controller="com.android.settings.deviceinfo.firmwareversion.MainlineModuleVersionPreferenceController"/>
5354

5455
<!-- Baseband -->
55-
<Preference
56+
<com.android.settings.wave.widget.AboutSoftwarePreference
5657
android:key="base_band"
5758
android:title="@string/baseband_version"
5859
android:summary="@string/summary_placeholder"
@@ -61,15 +62,15 @@
6162
settings:controller="com.android.settings.deviceinfo.firmwareversion.BasebandVersionPreferenceController"/>
6263

6364
<!-- Kernel -->
64-
<Preference
65+
<com.android.settings.wave.widget.AboutSoftwarePreference
6566
android:key="kernel_version"
6667
android:title="@string/kernel_version"
6768
android:summary="@string/summary_placeholder"
6869
settings:enableCopying="true"
6970
settings:controller="com.android.settings.deviceinfo.firmwareversion.KernelVersionPreferenceController"/>
7071

7172
<!-- Build -->
72-
<Preference
73+
<com.android.settings.wave.widget.AboutSoftwarePreference
7374
android:key="os_build_number"
7475
android:title="@string/build_number"
7576
android:summary="@string/summary_placeholder"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.android.settings.wave.widget
2+
3+
import android.content.Context
4+
import android.util.AttributeSet
5+
6+
import androidx.preference.Preference
7+
8+
import com.android.settings.R
9+
10+
class AboutSoftwarePreference @JvmOverloads constructor(
11+
context: Context?,
12+
attrs: AttributeSet? = null /* attrs */
13+
) : Preference(context, attrs, R.attr.aboutSoftwarePreferenceStyle)

0 commit comments

Comments
 (0)