Skip to content

Commit

Permalink
Add tags for all app panels
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamza417 committed Jul 3, 2024
1 parent 4ba9bf5 commit c5e5479
Show file tree
Hide file tree
Showing 90 changed files with 269 additions and 200 deletions.
1 change: 1 addition & 0 deletions app/src/main/assets/html/changelogs.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h4>Bug Fixes</h4>
<li>Fixed shuffle issues.</li>
<li>Fixed crashing on resizing app screen on Android desktop environments.</li>
<li>Fixed crashing on reading faulty apps info for <i>Info Strip</i>.</li>
<li>Fixed crashes caused by mismatching panel IDs.</li>
<li>Fixed some minor issues.</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AudioPlayerActivity : BaseActivity() {
kotlin.runCatching {
if (intent.hasExtra(BundleConstants.audioModel)) {
supportFragmentManager.beginTransaction()
.replace(R.id.app_container, AudioPlayer.newInstance(AudioModel(), fromActivity = true), "audio_player")
.replace(R.id.app_container, AudioPlayer.newInstance(AudioModel(), fromActivity = true), AudioPlayer.TAG)
.commit()
} else {
uri = when {
Expand All @@ -51,7 +51,7 @@ class AudioPlayerActivity : BaseActivity() {
}

supportFragmentManager.beginTransaction()
.replace(R.id.app_container, AudioPlayer.newInstance(uri!!, fromActivity = true), "audio_player")
.replace(R.id.app_container, AudioPlayer.newInstance(uri!!, fromActivity = true), AudioPlayer.TAG)
.commit()
}
}.getOrElse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class InformationActivity : BaseActivity() {

supportFragmentManager.beginTransaction()
.setReorderingAllowed(true)
.replace(R.id.app_container, Information.newInstance(packageInfo), "app_info")
.replace(R.id.app_container, Information.newInstance(packageInfo), Information.TAG)
.commit()
}
}.getOrElse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,11 @@ class ManifestAssociationActivity : BaseActivity() {

withContext(Dispatchers.Main) {
hideLoader()
val xml = XML.newInstance(packageInfo, true, "AndroidManifest.xml", false)

supportFragmentManager.beginTransaction()
.setReorderingAllowed(true)
.replace(R.id.app_container, XML
.newInstance(packageInfo,
true,
"AndroidManifest.xml",
false), "app_info")
.replace(R.id.app_container, xml, XML.TAG)
.commit()
}
}.getOrElse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class PreferenceActivity : BaseActivity() {

if (savedInstanceState.isNull()) {
supportFragmentManager.beginTransaction()
.replace(R.id.app_container, Preferences.newInstance(), "preferences")
.replace(R.id.app_container, Preferences.newInstance(), Preferences.TAG)
.commit()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ class ActivityLauncher : ScopedActionDialogBottomFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "ActivityLauncher"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,7 @@ class ClearCache : ScopedActionDialogBottomFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "ClearCache"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ class ClearData : ScopedActionDialogBottomFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "clear_data"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@ class ComponentState : ScopedActionDialogBottomFragment() {
interface ComponentStatusCallbacks {
fun onSuccess()
}

const val TAG = "ComponentState"
}
}
}
4 changes: 3 additions & 1 deletion app/src/main/java/app/simple/inure/dialogs/action/Extract.kt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ class Extract : ScopedBottomSheetFragment() {
}

fun FragmentManager.launchExtract(packageInfo: PackageInfo, paths: Set<String>) {
newInstance(packageInfo, paths).show(this, "extract")
newInstance(packageInfo, paths).show(this, TAG)
}

const val TAG = "Extract"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ class ForceStop : ScopedActionDialogBottomFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "ForceStop"
}
}
}
6 changes: 4 additions & 2 deletions app/src/main/java/app/simple/inure/dialogs/action/Hide.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ class Hide : ScopedActionDialogBottomFragment() {

fun FragmentManager.showHide(packageInfo: PackageInfo): Hide {
val fragment = newInstance(packageInfo)
fragment.show(this, "hide")
fragment.show(this, TAG)
return fragment
}

const val TAG = "hide"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,14 @@ class PermissionStatus : ScopedBottomSheetFragment() {

fun FragmentManager.showPermissionStatus(packageInfo: PackageInfo, permissionInfo: PermissionInfo): PermissionStatus {
val fragment = newInstance(packageInfo, permissionInfo)
fragment.show(this, "permission_status")
fragment.show(this, TAG)
return fragment
}

interface PermissionStatusCallbacks {
fun onSuccess(grantedStatus: Boolean)
}

const val TAG = "PermissionStatus"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ class Reinstaller : ScopedActionDialogBottomFragment() {

fun FragmentManager.showReinstaller(packageInfo: PackageInfo): Reinstaller {
val reinstaller = newInstance(packageInfo)
reinstaller.show(this, reinstaller.tag)
reinstaller.show(this, TAG)
return reinstaller
}

interface ReinstallerCallbacks {
fun onReinstallSuccess()
}

const val TAG = "Reinstaller"
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/app/simple/inure/dialogs/app/AppMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class AppMenu : ScopedDialogFragment() {
manifest.setOnClickListener {
if (DevelopmentPreferences.get(DevelopmentPreferences.isWebViewXmlViewer)) {
openFragmentSlide(XMLWebView.newInstance(
packageInfo, "AndroidManifest.xml"), "xml")
packageInfo, "AndroidManifest.xml"), XMLWebView.TAG)
} else {
openFragmentSlide(XML.newInstance(
packageInfo, true, "AndroidManifest.xml"), XML.TAG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ChangesReminder : ScopedBottomSheetFragment() {
MainPreferences.setChangeLogReminder(BuildConfig.VERSION_CODE)

sure.setOnClickListener {
openFragmentSlide(WebPage.newInstance(getString(R.string.change_logs)), "changelogs")
openFragmentSlide(WebPage.newInstance(getString(R.string.change_logs)), WebPage.TAG)
dismiss()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ class BatchUninstaller : ScopedBottomSheetFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "BatchUninstaller"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,7 @@ class IntentAction : ScopedDialogFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "IntentAction"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ class UninstalledAppsInfo : ScopedDialogFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "UninstalledAppsInfo"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ class PermissionsMenu : ScopedBottomSheetFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "PermissionsMenu"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ open class ScopedAudioPlayerDialogFragment : DialogFragment(), SharedPreferences
}

open fun openSettings() {
openFragmentSlide(Preferences.newInstance(), "prefs_screen")
openFragmentSlide(Preferences.newInstance(), Preferences.TAG)
}

/**
Expand Down Expand Up @@ -150,4 +150,4 @@ open class ScopedAudioPlayerDialogFragment : DialogFragment(), SharedPreferences
requireActivity().finishAndRemoveTask()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ package app.simple.inure.extensions.fragments
import android.app.Application
import android.content.SharedPreferences
import android.content.pm.PackageInfo
import android.os.*
import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.view.View
import android.view.WindowManager
Expand Down Expand Up @@ -152,7 +155,7 @@ abstract class ScopedBottomSheetFragment : BottomSheetDialogFragment(),
}

protected fun openSettings() {
openFragmentSlide(Preferences.newInstance(), "prefs_screen")
openFragmentSlide(Preferences.newInstance(), Preferences.TAG)
}

/**
Expand Down Expand Up @@ -214,4 +217,4 @@ abstract class ScopedBottomSheetFragment : BottomSheetDialogFragment(),
false
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ open class ScopedDialogFragment : DialogFragment(), SharedPreferences.OnSharedPr
}

open fun openSettings() {
openFragmentSlide(Preferences.newInstance(), "prefs_screen")
openFragmentSlide(Preferences.newInstance(), Preferences.TAG)
}

/**
Expand Down Expand Up @@ -151,4 +151,4 @@ open class ScopedDialogFragment : DialogFragment(), SharedPreferences.OnSharedPr
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ abstract class ScopedFragment : Fragment(), SharedPreferences.OnSharedPreference

open fun openWebPage(source: String) {
clearTransitions()
openFragmentSlide(WebPage.newInstance(string = source), "web_page")
openFragmentSlide(WebPage.newInstance(string = source), WebPage.TAG)
}

/**
Expand All @@ -493,6 +493,7 @@ abstract class ScopedFragment : Fragment(), SharedPreferences.OnSharedPreference
* Override it if you don't want the current panel to intercept the back press
* and let the activity handle it
*/
@Suppress("KDocUnresolvedReference")
open fun setupBackPressedDispatcher() {
if (parentFragmentManager.backStackEntryCount > 0) { // Make sure we have fragments in backstack
requireActivity().onBackPressedDispatcher.addCallback(this) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,5 +486,7 @@ class AudioPlayer : ScopedFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "AudioPlayer"
}
}
2 changes: 2 additions & 0 deletions app/src/main/java/app/simple/inure/ui/association/Text.kt
Original file line number Diff line number Diff line change
Expand Up @@ -271,5 +271,7 @@ class Text : KeyboardScopedFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "Text"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ class BatteryInfo : ScopedFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "BatteryInfo"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ class DeviceInfo : ScopedFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "DeviceInfo"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ class SystemInfo : ScopedFragment() {
fragment.arguments = args
return fragment
}

const val TAG = "system_info"
}
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/app/simple/inure/ui/launcher/Setup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ class Setup : ScopedFragment() {
}

accent.setOnClickListener {
openFragmentSlide(AccentColor.newInstance(), "accent_color")
openFragmentSlide(AccentColor.newInstance(), AccentColor.TAG)
}

typeface.setOnClickListener {
openFragmentSlide(AppearanceTypeFace.newInstance(), "app_typeface")
openFragmentSlide(AppearanceTypeFace.newInstance(), AppearanceTypeFace.TAG)
}

rootSwitchView.setOnSwitchCheckedChangeListener { it ->
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/app/simple/inure/ui/panels/APKs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class APKs : ScopedFragment() {
}

R.drawable.ic_search -> {
openFragmentSlide(ApksSearch.newInstance(), "apks_search")
openFragmentSlide(ApksSearch.newInstance(), ApksSearch.TAG)
}

R.drawable.ic_filter -> {
Expand Down
Loading

0 comments on commit c5e5479

Please sign in to comment.