Skip to content

Commit 1fd41be

Browse files
authored
Update Widget Layout and Theme (#55)
1 parent 629f343 commit 1fd41be

File tree

5 files changed

+97
-97
lines changed

5 files changed

+97
-97
lines changed

app/src/main/java/com/djangofiles/djangofiles/ui/settings/SettingsFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
157157
// Widget Settings
158158
findPreference<Preference>("open_widget_settings")?.setOnPreferenceClickListener {
159159
Log.d("open_widget_settings", "setOnPreferenceClickListener")
160-
findNavController().navigate(R.id.nav_item_settings_action_widget)
160+
findNavController().navigate(R.id.nav_action_widget_settings)
161161
//findNavController().navigate(
162162
// R.id.nav_item_settings_action_widget,
163163
// null,

app/src/main/java/com/djangofiles/djangofiles/widget/WidgetConfiguration.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ class WidgetConfiguration : Activity() {
1919
super.onCreate(savedInstanceState)
2020
setContentView(R.layout.widget_configure)
2121

22-
window.statusBarColor = Color.TRANSPARENT
23-
2422
setResult(RESULT_CANCELED)
2523

2624
val intent = intent
Lines changed: 94 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,121 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4-
android:id="@+id/config_root"
5-
android:layout_width="wrap_content"
6-
android:layout_height="wrap_content"
7-
android:layout_gravity="center"
8-
android:padding="24dp"
9-
android:orientation="vertical"
10-
android:background="@drawable/bg_widget_config"
11-
android:fitsSystemWindows="true"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:gravity="center"
127
tools:ignore="HardcodedText">
138

14-
<!-- Icon/Title -->
15-
<TextView
9+
<LinearLayout
10+
android:id="@+id/config_root"
1611
android:layout_width="wrap_content"
1712
android:layout_height="wrap_content"
18-
android:layout_marginBottom="16dp"
19-
android:layout_gravity="center_horizontal"
20-
android:gravity="center_vertical"
21-
android:textAppearance="@style/TextAppearance.AppCompat.Large"
22-
android:drawableStart="@mipmap/ic_launcher_round"
23-
android:drawablePadding="16dp"
24-
android:text="Widget Options"
25-
tools:ignore="UseCompatTextViewDrawableXml" />
13+
android:gravity="center_horizontal"
14+
android:padding="24dp"
15+
android:orientation="vertical"
16+
android:background="@drawable/bg_widget_config"
17+
tools:ignore="UselessParent">
2618

27-
<!-- Left/Right Column Wrapper -->
28-
<LinearLayout
29-
android:layout_width="match_parent"
30-
android:layout_height="wrap_content"
31-
android:baselineAligned="false"
32-
android:orientation="horizontal">
19+
<!-- Icon/Title -->
20+
<TextView
21+
android:layout_width="wrap_content"
22+
android:layout_height="wrap_content"
23+
android:layout_marginBottom="16dp"
24+
android:gravity="center_vertical"
25+
android:textAppearance="@style/TextAppearance.AppCompat.Large"
26+
android:drawableStart="@mipmap/ic_launcher_round"
27+
android:drawablePadding="16dp"
28+
android:text="Widget Options"
29+
tools:ignore="UseCompatTextViewDrawableXml" />
3330

34-
<!-- Left Column -->
31+
<!-- Left/Right Column Wrapper -->
3532
<LinearLayout
36-
android:layout_width="0dp"
33+
android:layout_width="match_parent"
3734
android:layout_height="wrap_content"
38-
android:layout_weight="1"
39-
android:orientation="vertical">
40-
41-
<TextView
42-
android:layout_width="wrap_content"
43-
android:layout_height="wrap_content"
44-
android:text="Background Color" />
35+
android:baselineAligned="false"
36+
android:orientation="horizontal">
4537

46-
<RadioGroup
47-
android:id="@+id/background_options"
48-
android:layout_width="match_parent"
38+
<!-- Left Column -->
39+
<LinearLayout
40+
android:layout_width="0dp"
4941
android:layout_height="wrap_content"
42+
android:layout_weight="1"
5043
android:orientation="vertical">
51-
<RadioButton
52-
android:id="@+id/option_white"
53-
android:layout_width="match_parent"
54-
android:layout_height="wrap_content"
55-
android:text="White" />
56-
<RadioButton
57-
android:id="@+id/option_black"
58-
android:layout_width="match_parent"
59-
android:layout_height="wrap_content"
60-
android:text="Black" />
61-
<RadioButton
62-
android:id="@+id/option_liberty"
63-
android:layout_width="match_parent"
44+
45+
<TextView
46+
android:layout_width="wrap_content"
6447
android:layout_height="wrap_content"
65-
android:text="Liberty" />
66-
<RadioButton
67-
android:id="@+id/option_transparent"
48+
android:text="Background Color" />
49+
50+
<RadioGroup
51+
android:id="@+id/background_options"
6852
android:layout_width="match_parent"
6953
android:layout_height="wrap_content"
70-
android:text="Transparent" />
71-
</RadioGroup>
72-
</LinearLayout><!-- Left Column -->
54+
android:orientation="vertical">
55+
<RadioButton
56+
android:id="@+id/option_white"
57+
android:layout_width="match_parent"
58+
android:layout_height="wrap_content"
59+
android:text="White" />
60+
<RadioButton
61+
android:id="@+id/option_black"
62+
android:layout_width="match_parent"
63+
android:layout_height="wrap_content"
64+
android:text="Black" />
65+
<RadioButton
66+
android:id="@+id/option_liberty"
67+
android:layout_width="match_parent"
68+
android:layout_height="wrap_content"
69+
android:text="Liberty" />
70+
<RadioButton
71+
android:id="@+id/option_transparent"
72+
android:layout_width="match_parent"
73+
android:layout_height="wrap_content"
74+
android:text="Transparent" />
75+
</RadioGroup>
76+
</LinearLayout><!-- Left Column -->
7377

74-
<!-- Right Column -->
75-
<LinearLayout
76-
android:layout_width="0dp"
77-
android:layout_height="wrap_content"
78-
android:layout_weight="1"
79-
android:orientation="vertical">
80-
<TextView
81-
android:layout_width="wrap_content"
82-
android:layout_height="wrap_content"
83-
android:text="Text Color" />
84-
<RadioGroup
85-
android:id="@+id/text_options"
86-
android:layout_width="match_parent"
78+
<!-- Right Column -->
79+
<LinearLayout
80+
android:layout_width="0dp"
8781
android:layout_height="wrap_content"
82+
android:layout_weight="1"
8883
android:orientation="vertical">
89-
<RadioButton
90-
android:id="@+id/text_white"
91-
android:layout_width="match_parent"
84+
<TextView
85+
android:layout_width="wrap_content"
9286
android:layout_height="wrap_content"
93-
android:text="White" />
94-
<RadioButton
95-
android:id="@+id/text_black"
87+
android:text="Text Color" />
88+
<RadioGroup
89+
android:id="@+id/text_options"
9690
android:layout_width="match_parent"
9791
android:layout_height="wrap_content"
98-
android:text="Black" />
99-
<RadioButton
100-
android:id="@+id/text_liberty"
101-
android:layout_width="match_parent"
102-
android:layout_height="wrap_content"
103-
android:text="Liberty" />
104-
</RadioGroup>
105-
</LinearLayout><!-- Right Column -->
92+
android:orientation="vertical">
93+
<RadioButton
94+
android:id="@+id/text_white"
95+
android:layout_width="match_parent"
96+
android:layout_height="wrap_content"
97+
android:text="White" />
98+
<RadioButton
99+
android:id="@+id/text_black"
100+
android:layout_width="match_parent"
101+
android:layout_height="wrap_content"
102+
android:text="Black" />
103+
<RadioButton
104+
android:id="@+id/text_liberty"
105+
android:layout_width="match_parent"
106+
android:layout_height="wrap_content"
107+
android:text="Liberty" />
108+
</RadioGroup>
109+
</LinearLayout><!-- Right Column -->
106110

107-
</LinearLayout><!-- Left/Right Column Wrapper -->
111+
</LinearLayout><!-- Left/Right Column Wrapper -->
108112

109-
<!-- Save Widget Button -->
110-
<com.google.android.material.button.MaterialButton
111-
android:id="@+id/confirm_button"
112-
android:layout_width="wrap_content"
113-
android:layout_height="wrap_content"
114-
android:layout_gravity="center_horizontal"
115-
android:text="Save Widget Settings" />
113+
<!-- Save Widget Button -->
114+
<com.google.android.material.button.MaterialButton
115+
android:id="@+id/confirm_button"
116+
android:layout_width="wrap_content"
117+
android:layout_height="wrap_content"
118+
android:text="Save Widget Settings" />
116119

120+
</LinearLayout>
117121
</LinearLayout>

app/src/main/res/navigation/nav_graph.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
android:label="Settings">
3636
<!-- Widget Settings -->
3737
<action
38-
android:id="@+id/nav_item_settings_action_widget"
38+
android:id="@+id/nav_action_widget_settings"
3939
app:destination="@id/nav_item_widget_settings"
4040
app:exitAnim="@anim/slide_out_left"
4141
app:enterAnim="@anim/slide_in_left"

app/src/main/res/values/themes.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515

1616
<style name="WidgetStyle" parent="Theme.MaterialComponents.DayNight" />
1717
<style name="Theme.WidgetConfig.Transparent" parent="Theme.djangofiles">
18-
<item name="android:backgroundDimEnabled">false</item>
1918
<item name="android:windowIsTranslucent">true</item>
2019
<item name="android:windowBackground">@android:color/transparent</item>
21-
<item name="android:windowNoTitle">true</item>
2220

21+
<item name="android:windowNoTitle">true</item>
2322
<item name="android:statusBarColor">@android:color/transparent</item>
24-
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
2523
</style>
2624

2725
</resources>

0 commit comments

Comments
 (0)