Skip to content

Commit

Permalink
nothing important
Browse files Browse the repository at this point in the history
  • Loading branch information
queuejw committed Dec 7, 2024
1 parent 3bc64cc commit de01a6c
Show file tree
Hide file tree
Showing 54 changed files with 1,270 additions and 1,128 deletions.
1 change: 0 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion SpannedGridLayoutManager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ tasks.withType(Javadoc).configureEach {

dependencies {
implementation 'androidx.recyclerview:recyclerview:1.4.0-rc01'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.21'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.0'
}
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId "ru.dimon6018.metrolauncher"
minSdk 21
targetSdk 35
versionCode 59
versionName "Exp. 7743"
versionCode 60
versionName "Exp. n"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled false
Expand Down
29 changes: 27 additions & 2 deletions app/src/main/java/ru/dimon6018/metrolauncher/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ import ru.dimon6018.metrolauncher.helpers.utils.Utils.Companion.sendCrash
import ru.dimon6018.metrolauncher.helpers.utils.Utils.Companion.setUpApps
import ru.dimon6018.metrolauncher.helpers.utils.Utils.Companion.unregisterPackageReceiver

// Main application screen (tiles, apps)
/**
* Main application screen (tiles, apps)
* @see Application
* @see Start
* @see AllApps
*/
class Main : AppCompatActivity() {

private lateinit var pagerAdapter: FragmentStateAdapter
Expand Down Expand Up @@ -117,7 +122,11 @@ class Main : AppCompatActivity() {
}
}

// Turn off animations if developer mode is enabled to prevent some animation issues
/**
* Turn off animations if developer mode is enabled to prevent some animation issues
* @see onCreate
* @see disableAnims
*/
private fun handleDevMode() {
if (isDevMode(this) && PREFS.isAutoShutdownAnimEnabled) {
disableAnims()
Expand All @@ -132,12 +141,20 @@ class Main : AppCompatActivity() {
startActivity(intent)
}

/**
* Called when the application is started.
* Updates the icon cache, application list and checks the application version
* @see onCreate
*/
private suspend fun initializeData() {
pagerAdapter = WinAdapter(this@Main)
setMainViewModel()
checkUpdate()
}

/**
* Configures the user interface according to the settings
*/
private fun setupUI() {
WindowCompat.setDecorFitsSystemWindows(window, false)
if (PREFS.isWallpaperEnabled) {
Expand Down Expand Up @@ -180,6 +197,10 @@ class Main : AppCompatActivity() {
}
}

/**
* Creates OnBackPressedCallback, which is needed to move to the previous ViewPager screen by pressing/gesturing backwards.
* Or disables the search
*/
private fun setupBackPressedDispatcher() {
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
Expand All @@ -199,6 +220,9 @@ class Main : AppCompatActivity() {
}
}

/**
* Creates OnPageChangeCallback for some required actions
*/
private fun createPageChangeCallback() = object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
Expand Down Expand Up @@ -265,6 +289,7 @@ class Main : AppCompatActivity() {
regenerateIcons()
}


private suspend fun regenerateIcons() {
val isCustomIconsInstalled = PREFS.iconPackPackage != "null"
var diskCache = initDiskCache(this)
Expand Down
Loading

0 comments on commit de01a6c

Please sign in to comment.