Skip to content

Commit cc156d4

Browse files
committed
remove the toolbar at widget config screens
1 parent f823315 commit cc156d4

File tree

4 files changed

+9
-34
lines changed

4 files changed

+9
-34
lines changed

app/src/main/kotlin/com/simplemobiletools/flashlight/activities/WidgetBrightDisplayConfigureActivity.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class WidgetBrightDisplayConfigureActivity : SimpleActivity() {
5858
override fun onResume() {
5959
super.onResume()
6060
window.decorView.setBackgroundColor(0)
61-
setupToolbar(config_bright_display_toolbar)
6261

6362
if (mFeatureLockedDialog != null && isOrWasThankYouInstalled()) {
6463
mFeatureLockedDialog?.dismissDialog()
@@ -67,6 +66,10 @@ class WidgetBrightDisplayConfigureActivity : SimpleActivity() {
6766

6867
private fun initVariables() {
6968
mWidgetColor = config.widgetBgColor
69+
if (mWidgetColor == resources.getInteger(R.integer.default_widget_bg_color) && config.isUsingSystemTheme) {
70+
mWidgetColor = resources.getColor(R.color.you_primary_color, theme)
71+
}
72+
7073
mWidgetAlpha = Color.alpha(mWidgetColor) / 255.toFloat()
7174

7275
mWidgetColorWithoutTransparency = Color.rgb(Color.red(mWidgetColor), Color.green(mWidgetColor), Color.blue(mWidgetColor))

app/src/main/kotlin/com/simplemobiletools/flashlight/activities/WidgetTorchConfigureActivity.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class WidgetTorchConfigureActivity : SimpleActivity() {
5959
override fun onResume() {
6060
super.onResume()
6161
window.decorView.setBackgroundColor(0)
62-
setupToolbar(config_torch_toolbar)
6362

6463
if (mFeatureLockedDialog != null && isOrWasThankYouInstalled()) {
6564
mFeatureLockedDialog?.dismissDialog()
@@ -68,6 +67,10 @@ class WidgetTorchConfigureActivity : SimpleActivity() {
6867

6968
private fun initVariables() {
7069
mWidgetColor = config.widgetBgColor
70+
if (mWidgetColor == resources.getInteger(R.integer.default_widget_bg_color) && config.isUsingSystemTheme) {
71+
mWidgetColor = resources.getColor(R.color.you_primary_color, theme)
72+
}
73+
7174
mWidgetAlpha = Color.alpha(mWidgetColor) / 255.toFloat()
7275

7376
mWidgetColorWithoutTransparency = Color.rgb(Color.red(mWidgetColor), Color.green(mWidgetColor), Color.blue(mWidgetColor))

app/src/main/res/layout/widget_bright_display_config.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
43
android:id="@+id/config_bright_display_coordinator"
54
android:layout_width="match_parent"
65
android:layout_height="match_parent">
76

8-
<com.google.android.material.appbar.AppBarLayout
9-
android:id="@+id/config_bright_display_app_bar_layout"
10-
android:layout_width="match_parent"
11-
android:layout_height="wrap_content">
12-
13-
<com.google.android.material.appbar.MaterialToolbar
14-
android:id="@+id/config_bright_display_toolbar"
15-
android:layout_width="match_parent"
16-
android:layout_height="?attr/actionBarSize"
17-
android:background="@color/color_primary"
18-
app:title="@string/app_launcher_name"
19-
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
20-
21-
</com.google.android.material.appbar.AppBarLayout>
22-
237
<RelativeLayout
248
android:id="@+id/config_bright_display_holder"
259
android:layout_width="match_parent"

app/src/main/res/layout/widget_torch_config.xml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
43
android:id="@+id/config_torch_coordinator"
54
android:layout_width="match_parent"
65
android:layout_height="match_parent">
76

8-
<com.google.android.material.appbar.AppBarLayout
9-
android:id="@+id/config_torch_app_bar_layout"
10-
android:layout_width="match_parent"
11-
android:layout_height="wrap_content">
12-
13-
<com.google.android.material.appbar.MaterialToolbar
14-
android:id="@+id/config_torch_toolbar"
15-
android:layout_width="match_parent"
16-
android:layout_height="?attr/actionBarSize"
17-
android:background="@color/color_primary"
18-
app:title="@string/app_launcher_name"
19-
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
20-
21-
</com.google.android.material.appbar.AppBarLayout>
22-
237
<RelativeLayout
248
android:id="@+id/config_torch_holder"
259
android:layout_width="match_parent"
@@ -40,6 +24,7 @@
4024
android:layout_width="@dimen/main_button_size"
4125
android:layout_height="@dimen/main_button_size"
4226
android:background="@drawable/ic_flashlight" />
27+
4328
</RelativeLayout>
4429

4530
<ImageView

0 commit comments

Comments
 (0)