Skip to content

Commit

Permalink
Organize code
Browse files Browse the repository at this point in the history
  • Loading branch information
WSTxda committed Sep 16, 2024
1 parent 5ad6198 commit 8245007
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 32 deletions.
34 changes: 17 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
xmlns:tools="http://schemas.android.com/tools">

<application
android:enableOnBackInvokedCallback="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:enableOnBackInvokedCallback="true"
android:theme="@style/AppTheme"
tools:targetApi="tiramisu">

Expand Down Expand Up @@ -36,13 +36,13 @@
</activity-alias>

<activity
android:name="com.wstxda.gsl.WeatherActivity"
android:name="com.wstxda.gsl.shortcut.WeatherActivity"
android:excludeFromRecents="true"
android:exported="true"
android:finishOnTaskLaunch="true"
android:icon="@mipmap/ic_launcher_weather"
android:label="@string/weather"
android:noHistory="true"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true"
android:theme="@style/Theme.Transparent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -51,13 +51,13 @@
</activity>

<activity
android:name="com.wstxda.gsl.AssistantActivity"
android:name="com.wstxda.gsl.shortcut.AssistantActivity"
android:excludeFromRecents="true"
android:exported="true"
android:finishOnTaskLaunch="true"
android:icon="@mipmap/ic_launcher_assistant"
android:label="@string/assistant"
android:noHistory="true"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true"
android:theme="@style/Theme.Transparent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -66,13 +66,13 @@
</activity>

<activity
android:name="com.wstxda.gsl.PasswordManagerActivity"
android:name="com.wstxda.gsl.shortcut.PasswordManagerActivity"
android:excludeFromRecents="true"
android:exported="true"
android:finishOnTaskLaunch="true"
android:icon="@mipmap/ic_launcher_password"
android:label="@string/password"
android:noHistory="true"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true"
android:theme="@style/Theme.Transparent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -81,14 +81,14 @@
</activity>

<activity
android:name="com.wstxda.gsl.GameActivity"
android:exported="true"
android:name="com.wstxda.gsl.shortcut.GameActivity"
android:enableOnBackInvokedCallback="true"
android:excludeFromRecents="true"
android:exported="true"
android:finishOnTaskLaunch="true"
android:icon="@mipmap/ic_launcher_game"
android:label="@string/games"
android:noHistory="true"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true"
android:theme="@style/Theme.Transparent"
tools:targetApi="tiramisu">
<intent-filter>
Expand All @@ -102,13 +102,13 @@
</activity>

<activity
android:name="com.wstxda.gsl.MusicSearchActivity"
android:name="com.wstxda.gsl.shortcut.MusicSearchActivity"
android:excludeFromRecents="true"
android:exported="true"
android:finishOnTaskLaunch="true"
android:icon="@mipmap/ic_launcher_music"
android:label="@string/music_search"
android:noHistory="true"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true"
android:theme="@style/Theme.Transparent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wstxda.gsl
package com.wstxda.gsl.fragment

import android.content.ComponentName
import android.content.Intent
Expand All @@ -9,6 +9,13 @@ import android.os.Bundle
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import com.wstxda.gsl.shortcut.AssistantActivity
import com.wstxda.gsl.shortcut.GameActivity
import com.wstxda.gsl.shortcut.MusicSearchActivity
import com.wstxda.gsl.shortcut.PasswordManagerActivity
import com.wstxda.gsl.R
import com.wstxda.gsl.SettingsActivity
import com.wstxda.gsl.shortcut.WeatherActivity

class SettingsPreferenceFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wstxda.gsl
package com.wstxda.gsl.shortcut

import android.app.Activity
import android.content.ActivityNotFoundException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wstxda.gsl
package com.wstxda.gsl.shortcut

import android.content.ActivityNotFoundException
import android.content.ComponentName
Expand All @@ -9,6 +9,8 @@ import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.preference.PreferenceManager
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.wstxda.gsl.shortcut.utils.GamePackagesBrands
import com.wstxda.gsl.R

class GameActivity : AppCompatActivity() {

Expand Down Expand Up @@ -39,7 +41,7 @@ class GameActivity : AppCompatActivity() {
val useGameManager = sharedPreferences.getBoolean(GAME_MANAGER_PREF_KEY, false)

if (useGameManager) {
val gameManager = GameManagerBrands(this)
val gameManager = GamePackagesBrands(this)
if (!gameManager.launchGameManager()) {
showGameManagerNotFoundMessage()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.wstxda.gsl
package com.wstxda.gsl.shortcut

import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import com.wstxda.gsl.R

class MusicSearchActivity : Activity() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.wstxda.gsl
package com.wstxda.gsl.shortcut

import android.app.Activity
import android.content.ActivityNotFoundException
Expand All @@ -8,6 +8,7 @@ import android.os.Bundle
import androidx.preference.PreferenceManager
import android.widget.Toast
import androidx.annotation.StringRes
import com.wstxda.gsl.R

class PasswordManagerActivity : Activity() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.wstxda.gsl
package com.wstxda.gsl.shortcut

import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.ComponentName
import android.content.Intent
import android.net.Uri
import android.widget.Toast
import com.wstxda.gsl.R

class WeatherActivity : Activity() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.wstxda.gsl
package com.wstxda.gsl.shortcut.utils

import android.content.ActivityNotFoundException
import android.content.ComponentName
import android.content.Context
import android.content.Intent

class GameManagerBrands(private val context: Context) {
class GamePackagesBrands(private val context: Context) {

private val gameManagerIntents = listOf(

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/navigation/nav_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<fragment
android:id="@+id/settingsPreferenceFragment"
android:name="com.wstxda.gsl.SettingsPreferenceFragment"
android:name="com.wstxda.gsl.fragment.SettingsPreferenceFragment"
android:label="@string/app_settings"
tools:layout="@layout/activity_settings" />
</navigation>
10 changes: 5 additions & 5 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:defaultValue="true"
android:icon="@mipmap/ic_launcher_assistant"
android:key="assistant_activity"
android:layout="@layout/preference_app_icon_switch"
android:layout="@layout/preference_shortcuts_switch"
android:summaryOff="@string/pref_shortcut_disabled"
android:summaryOn="@string/pref_shortcut_enabled"
android:title="@string/assistant"
Expand All @@ -21,7 +21,7 @@
android:defaultValue="true"
android:icon="@mipmap/ic_launcher_weather"
android:key="weather_activity"
android:layout="@layout/preference_app_icon_switch"
android:layout="@layout/preference_shortcuts_switch"
android:summaryOff="@string/pref_shortcut_disabled"
android:summaryOn="@string/pref_shortcut_enabled"
android:title="@string/weather"
Expand All @@ -31,7 +31,7 @@
android:defaultValue="true"
android:icon="@mipmap/ic_launcher_password"
android:key="password_manager_activity"
android:layout="@layout/preference_app_icon_switch"
android:layout="@layout/preference_shortcuts_switch"
android:summaryOff="@string/pref_shortcut_disabled"
android:summaryOn="@string/pref_shortcut_enabled"
android:title="@string/password"
Expand All @@ -41,7 +41,7 @@
android:defaultValue="true"
android:icon="@mipmap/ic_launcher_game"
android:key="game_activity"
android:layout="@layout/preference_app_icon_switch"
android:layout="@layout/preference_shortcuts_switch"
android:summaryOff="@string/pref_shortcut_disabled"
android:summaryOn="@string/pref_shortcut_enabled"
android:title="@string/games"
Expand All @@ -51,7 +51,7 @@
android:defaultValue="true"
android:icon="@mipmap/ic_launcher_music"
android:key="music_search_activity"
android:layout="@layout/preference_app_icon_switch"
android:layout="@layout/preference_shortcuts_switch"
android:summaryOff="@string/pref_shortcut_disabled"
android:summaryOn="@string/pref_shortcut_enabled"
android:title="@string/music_search_quick_settings"
Expand Down

0 comments on commit 8245007

Please sign in to comment.