diff options
| author | cjh1249131356 <cjh1249131356@gmail.com> | 2022-06-02 21:33:22 +0800 |
|---|---|---|
| committer | Hemant Sharma <hemantbeast@gmail.com> | 2022-11-15 12:16:44 +0530 |
| commit | 52dad59b67193b33724fecfcb7dade4767bcc3e2 (patch) | |
| tree | ea22ddc5c6f840dc8faa92d2a0e12418b0735f55 | |
| parent | 6e62547db1012f524a60a516fc9dadbca9fb2c74 (diff) | |
GameSpace: Drop disable heads up option
- Ready for implementing notification overlay from exTHmUI's gaming mode
Signed-off-by: cjh1249131356 <cjh1249131356@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
10 files changed, 1 insertions, 121 deletions
diff --git a/app/src/main/java/io/chaldeaprjkt/gamespace/data/AppSettings.kt b/app/src/main/java/io/chaldeaprjkt/gamespace/data/AppSettings.kt index 73d0ec4..668d880 100644 --- a/app/src/main/java/io/chaldeaprjkt/gamespace/data/AppSettings.kt +++ b/app/src/main/java/io/chaldeaprjkt/gamespace/data/AppSettings.kt @@ -41,10 +41,6 @@ class AppSettings @Inject constructor(private val context: Context) { get() = db.getBoolean("show_fps", false) set(point) = db.edit().putBoolean("show_fps", point).apply() - var noHeadsUp - get() = db.getBoolean(KEY_HEADS_UP_DISABLE, true) - set(it) = db.edit().putBoolean(KEY_HEADS_UP_DISABLE, it).apply() - var noAutoBrightness get() = db.getBoolean(KEY_AUTO_BRIGHTNESS_DISABLE, true) set(it) = db.edit().putBoolean(KEY_AUTO_BRIGHTNESS_DISABLE, it).apply() @@ -74,7 +70,6 @@ class AppSettings @Inject constructor(private val context: Context) { set(value) = db.edit().putBoolean(KEY_LOCK_GESTURE, value).apply() companion object { - const val KEY_HEADS_UP_DISABLE = "gamespace_heads_up_disabled" const val KEY_AUTO_BRIGHTNESS_DISABLE = "gamespace_auto_brightness_disabled" const val KEY_3SCREENSHOT_DISABLE = "gamespace_tfgesture_disabled" const val KEY_STAY_AWAKE = "gamespace_stay_awake" diff --git a/app/src/main/java/io/chaldeaprjkt/gamespace/data/GameSession.kt b/app/src/main/java/io/chaldeaprjkt/gamespace/data/GameSession.kt index 7aa0639..9c3dd2a 100644 --- a/app/src/main/java/io/chaldeaprjkt/gamespace/data/GameSession.kt +++ b/app/src/main/java/io/chaldeaprjkt/gamespace/data/GameSession.kt @@ -57,14 +57,10 @@ class GameSession @Inject constructor( state = SessionState( packageName = sessionName, autoBrightness = systemSettings.autoBrightness, - headsUp = systemSettings.headsUp, threeScreenshot = systemSettings.threeScreenshot, ringerMode = audioManager.ringerModeInternal, adbEnabled = systemSettings.adbEnabled, ) - if (appSettings.noHeadsUp) { - systemSettings.headsUp = false - } if (appSettings.noAutoBrightness) { systemSettings.autoBrightness = false } @@ -81,9 +77,6 @@ class GameSession @Inject constructor( fun unregister() { val orig = state?.copy() ?: return - if (appSettings.noHeadsUp) { - orig.headsUp?.let { systemSettings.headsUp = it } - } if (appSettings.noAutoBrightness) { orig.autoBrightness?.let { systemSettings.autoBrightness = it } } diff --git a/app/src/main/java/io/chaldeaprjkt/gamespace/data/SessionState.kt b/app/src/main/java/io/chaldeaprjkt/gamespace/data/SessionState.kt index 1de808c..c3f5244 100644 --- a/app/src/main/java/io/chaldeaprjkt/gamespace/data/SessionState.kt +++ b/app/src/main/java/io/chaldeaprjkt/gamespace/data/SessionState.kt @@ -23,7 +23,6 @@ import androidx.annotation.Keep data class SessionState( var packageName: String, var autoBrightness: Boolean? = null, - var headsUp: Boolean? = null, var threeScreenshot: Boolean? = null, var ringerMode: Int = AudioManager.RINGER_MODE_NORMAL, var adbEnabled: Boolean? = null, diff --git a/app/src/main/java/io/chaldeaprjkt/gamespace/data/SystemSettings.kt b/app/src/main/java/io/chaldeaprjkt/gamespace/data/SystemSettings.kt index b1a2c93..44f559f 100644 --- a/app/src/main/java/io/chaldeaprjkt/gamespace/data/SystemSettings.kt +++ b/app/src/main/java/io/chaldeaprjkt/gamespace/data/SystemSettings.kt @@ -29,17 +29,6 @@ class SystemSettings @Inject constructor( private val resolver = context.contentResolver - var headsUp - get() = - Settings.Global.getInt(resolver, Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED, 1) == 1 - set(it) { - Settings.Global.putInt( - resolver, - Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED, - it.toInt() - ) - } - var autoBrightness get() = Settings.System.getIntForUser( diff --git a/app/src/main/java/io/chaldeaprjkt/gamespace/widget/tiles/HeadsupTile.kt b/app/src/main/java/io/chaldeaprjkt/gamespace/widget/tiles/HeadsupTile.kt deleted file mode 100644 index c62781e..0000000 --- a/app/src/main/java/io/chaldeaprjkt/gamespace/widget/tiles/HeadsupTile.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2021 Chaldeaprjkt - * - * 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. - */ -package io.chaldeaprjkt.gamespace.widget.tiles - -import android.content.Context -import android.util.AttributeSet -import android.view.View -import io.chaldeaprjkt.gamespace.R - -class HeadsupTile @JvmOverloads constructor( - context: Context, attrs: AttributeSet? = null -) : BaseTile(context, attrs) { - - override fun onAttachedToWindow() { - super.onAttachedToWindow() - headsUpEnabled = systemSettings.headsUp - title?.text = context.getString(R.string.heads_up_title) - icon?.setImageResource(R.drawable.ic_action_heads_up) - } - - private var headsUpEnabled = false - set(value) { - field = value - if (value) { - summary?.text = context.getString(R.string.state_enabled) - } else { - summary?.text = context.getString(R.string.state_disabled) - } - systemSettings.headsUp = value - isSelected = value - } - - override fun onClick(v: View?) { - super.onClick(v) - headsUpEnabled = !headsUpEnabled - } -} diff --git a/app/src/main/res/drawable/ic_action_heads_up.xml b/app/src/main/res/drawable/ic_action_heads_up.xml deleted file mode 100644 index 5749b96..0000000 --- a/app/src/main/res/drawable/ic_action_heads_up.xml +++ /dev/null @@ -1,32 +0,0 @@ -<!-- - Copyright (C) 2020 Paranoid Android - - 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. ---> -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="64dp" - android:height="64dp" - android:tint="?android:attr/colorControlNormal" - android:viewportWidth="24.0" - android:viewportHeight="24.0"> - - <path - android:fillColor="@android:color/white" - android:fillType="evenOdd" - android:pathData="M 6 13 L 2 9 L 2 19 C 2 20.1 2.9 21 4 21 L 20 21 C 21.1 21 22 20.1 22 19 L 22 15 C 22 13.9 21.1 13 20 13 L 6 13 Z M 4 13.828 L 4 19 L 20 19 L 20 15 L 5.172 15 L 4 13.828 Z" - android:strokeWidth="1" /> - <path - android:fillColor="@android:color/white" - android:pathData="M 4 3 C 3.47 3 2.961 3.211 2.586 3.586 C 2.211 3.961 2 4.47 2 5 C 2 5.53 2.211 6.039 2.586 6.414 C 2.961 6.789 3.47 7 4 7 C 4.53 7 5.039 6.789 5.414 6.414 C 5.789 6.039 6 5.53 6 5 C 6 4.47 5.789 3.961 5.414 3.586 C 5.039 3.211 4.53 3 4 3 Z" - android:strokeWidth="1" /> -</vector>
\ No newline at end of file diff --git a/app/src/main/res/layout-land/tiles.xml b/app/src/main/res/layout-land/tiles.xml index f5ea043..394c7c4 100644 --- a/app/src/main/res/layout-land/tiles.xml +++ b/app/src/main/res/layout-land/tiles.xml @@ -20,17 +20,13 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4dp" - android:columnCount="3" + android:columnCount="2" android:orientation="horizontal"> <io.chaldeaprjkt.gamespace.widget.tiles.GameModeTile android:layout_width="wrap_content" android:layout_height="wrap_content" /> - <io.chaldeaprjkt.gamespace.widget.tiles.HeadsupTile - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - <io.chaldeaprjkt.gamespace.widget.tiles.FPSInfoTile android:layout_width="wrap_content" android:layout_height="wrap_content" /> diff --git a/app/src/main/res/layout/tiles.xml b/app/src/main/res/layout/tiles.xml index 4441dce..394c7c4 100644 --- a/app/src/main/res/layout/tiles.xml +++ b/app/src/main/res/layout/tiles.xml @@ -27,10 +27,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" /> - <io.chaldeaprjkt.gamespace.widget.tiles.HeadsupTile - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - <io.chaldeaprjkt.gamespace.widget.tiles.FPSInfoTile android:layout_width="wrap_content" android:layout_height="wrap_content" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 174327c..76f4d74 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,7 +20,6 @@ <string name="settings_summary">Manage your gaming setup</string> <string name="app_selector_label">Pick your game</string> <string name="auto_brightness_disabled_title">Disable auto-brightness</string> - <string name="heads_up_disabled_title">Disable heads up notifications</string> <string name="in_game_preferences_title">In-game options</string> <string name="game_list_title">Library</string> <string name="game_remove_message">Are you sure you want to remove %1$s from your library?</string> @@ -36,7 +35,6 @@ <string name="game_mode_performance">Performance</string> <string name="game_mode_battery">Battery</string> - <string name="heads_up_title">Heads up</string> <string name="fps_Info_title">FPS info</string> <string name="stay_awake_title">Stay awake</string> <string name="lock_gesture_title">Lock gesture</string> diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index 5eb430d..b900e05 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -59,10 +59,6 @@ android:title="@string/lock_gesture_title" /> <SwitchPreference - android:key="gamespace_heads_up_disabled" - android:title="@string/heads_up_disabled_title" /> - - <SwitchPreference android:key="gamespace_auto_brightness_disabled" android:title="@string/auto_brightness_disabled_title" /> |
