Skip to content

Commit

Permalink
nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
queuejw committed Jun 28, 2024
1 parent 192a378 commit 554c7c2
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 78 deletions.
8 changes: 4 additions & 4 deletions SpannedGridLayoutManager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'org.jetbrains.kotlin.android'

android {
namespace 'com.arasthel.spannedgridlayoutmanager'
compileSdk 34

compileSdk 35
setBuildToolsVersion('35.0.0')
defaultConfig {
minSdkVersion 23
targetSdkVersion 34
minSdk 23
targetSdk 35
}
buildTypes {
release {
Expand Down
14 changes: 7 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ plugins {
id 'com.google.devtools.ksp'
}


android {
namespace 'ru.dimon6018.metrolauncher'
compileSdk 34

compileSdk 35
buildFeatures {
buildConfig = true
}
setBuildToolsVersion('35.0.0')
defaultConfig {
applicationId "ru.dimon6018.metrolauncher"
minSdk 23
targetSdk 34
versionCode 44
versionName "1.0 Pre-Alpha 5.0.1"
targetSdk 35
versionCode 45
versionName "1.0 Pre-Alpha 5.0.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled false
Expand All @@ -39,7 +40,6 @@ android {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
setBuildToolsVersion('35.0.0-rc04')
}
dependencies {

Expand All @@ -50,7 +50,7 @@ dependencies {
implementation 'com.google.android.material:material:1.13.0-alpha03'
implementation 'androidx.recyclerview:recyclerview:1.4.0-alpha01'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.fragment:fragment-ktx:1.8.0'
implementation 'androidx.fragment:fragment-ktx:1.8.1'
implementation "androidx.dynamicanimation:dynamicanimation:1.1.0-alpha03"
implementation "androidx.room:room-runtime:2.6.1"
implementation "androidx.room:room-ktx:2.6.1"
Expand Down
11 changes: 6 additions & 5 deletions app/src/main/java/ru/dimon6018/metrolauncher/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,11 @@ class Main : AppCompatActivity() {
})
text?.setOnEditorActionListener(OnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_GO) {
if(filteredList != null) {
runApp( filteredList!![0].appPackage!!)
if(filteredList != null && filteredList!!.isNotEmpty()) {
filteredList!!.forEach {
Log.d("list", it.appPackage!!)
}
runApp(filteredList!!.first().appPackage!!)
hideSearchResults()
}
return@OnEditorActionListener true
Expand Down Expand Up @@ -383,9 +386,7 @@ class Main : AppCompatActivity() {
filteredList!!.add(item)
}
}
if (filteredList!!.isNotEmpty()) {
searchAdapter?.setData(filteredList!!)
}
searchAdapter?.setData(filteredList!!)
}
private fun setAppTheme() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
Expand Down
36 changes: 21 additions & 15 deletions app/src/main/java/ru/dimon6018/metrolauncher/content/NewAllApps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,16 @@ class NewAllApps: Fragment() {
}
registerBroadcast()
super.onResume()
if(recyclerView?.alpha != 1f) {
recyclerView?.apply {
val anim = ObjectAnimator.ofFloat(this, "alpha", 0f, 1f)
anim.duration = 100
anim.start()
anim.doOnEnd {
recyclerView?.alpha = 1f
}
}
}
}
private fun disableSearch() {
if(!isListLoaded) {
Expand Down Expand Up @@ -672,7 +682,7 @@ class NewAllApps: Fragment() {
ObjectAnimator.ofFloat(itemView, "rotationY", 0f, -90f),
ObjectAnimator.ofFloat(itemView, "alpha", 1f, 0f)
)
animatorSet.setDuration((200 + (i * 2)).toLong())
animatorSet.duration = (200 + (i * 2)).toLong()
animatorSet.start()
}
val animatorSet = AnimatorSet()
Expand All @@ -681,36 +691,32 @@ class NewAllApps: Fragment() {
ObjectAnimator.ofFloat(recyclerView!!, "translationX", 0f, -600f),
ObjectAnimator.ofFloat(recyclerView!!, "alpha", 1f, 0f)
)
animatorSet.setDuration(325)
animatorSet.duration = 325
animatorSet.start()
animatorSet.doOnEnd {
recyclerView!!.alpha = 0f
ObjectAnimator.ofFloat(recyclerView!!, "rotationY", 0f, 0f).start()
ObjectAnimator.ofFloat(recyclerView!!, "translationX", 0f, 0f).start()
}
startAppDelay(item)
}
private fun startAppDelay(item: App) {
CoroutineScope(mainDispatcher).launch {
delay(300)
runApp(item.appPackage!!)
delay(100)
val animatorSetItems = AnimatorSet()
animatorSetItems.duration = 100
for(i in 0..<recyclerView!!.childCount) {
val itemView = recyclerView!!.getChildAt(i) ?: continue
val animatorSet = AnimatorSet()
animatorSet.playTogether(
animatorSetItems.playTogether(
ObjectAnimator.ofFloat(itemView, "rotationY", -90f, 0f),
ObjectAnimator.ofFloat(itemView, "rotation", 45f, 0f),
ObjectAnimator.ofFloat(itemView, "translationX", -500f, 0f),
ObjectAnimator.ofFloat(itemView, "alpha", 0f, 1f)
)
animatorSet.setDuration(100)
animatorSet.start()
animatorSetItems.start()
}
val animatorSet = AnimatorSet()
animatorSet.playTogether(
ObjectAnimator.ofFloat(recyclerView!!, "rotationY", -90f, 0f),
ObjectAnimator.ofFloat(recyclerView!!, "translationX", -600f, -0f),
ObjectAnimator.ofFloat(recyclerView!!, "alpha", 0f, 1f)
)
animatorSet.setDuration(100)
animatorSet.start()
delay(100)
cancel()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ class NewStart: Fragment(), OnStartDragListener {
animator.repeatMode = ValueAnimator.REVERSE
animator.repeatCount = ValueAnimator.INFINITE
animator.setPropertyName("rotation")
animator.setTarget(v)
animator.target = v
return animator
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,19 @@ class Prefs(context: Context) {
}
val isUpdateNotificationEnabled: Boolean
get() = prefs.getBoolean(UPDATE_NOTIFICATION, false)

// is only used to save update data
fun setVersionCode(int: Int) {
prefs.edit().putInt(VERSION_CODE, int).apply()
}
// is only used to save update data
fun setUpdateMessage(value: String) {
prefs.edit().putString(UPDATE_MESSAGE, value).apply()
}
// is only used to save update data
val updateMessage: String
get() = prefs.getString(UPDATE_MESSAGE, "").toString()

// is only used to save update data
val versionCode: Int
get() = prefs.getInt(VERSION_CODE, 0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package ru.dimon6018.metrolauncher.content.oobe

import android.app.Activity
import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.WindowCompat
import androidx.fragment.app.commit
import com.google.android.material.textview.MaterialTextView
import ru.dimon6018.metrolauncher.Application.Companion.PREFS
import ru.dimon6018.metrolauncher.R
import ru.dimon6018.metrolauncher.content.oobe.fragments.ConfigureFragment
Expand All @@ -16,13 +16,11 @@ import ru.dimon6018.metrolauncher.helpers.utils.Utils.Companion.applyWindowInset

class WelcomeActivity: AppCompatActivity() {

private var textLabel: TextView? = null
private var main: CoordinatorLayout? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.oobe)
textLabel = findViewById(R.id.appbarTextView)
WindowCompat.setDecorFitsSystemWindows(window, false)
main = findViewById(R.id.coordinator)
main?.apply { applyWindowInsets(this) }
Expand All @@ -38,7 +36,7 @@ class WelcomeActivity: AppCompatActivity() {
}
companion object {
fun setText(activity: Activity, text: String) {
activity.findViewById<TextView>(R.id.appbarTextView)!!.text = text
activity.findViewById<MaterialTextView>(R.id.appbarTextView)!!.text = text
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ package ru.dimon6018.metrolauncher.content.oobe.fragments

import android.animation.AnimatorSet
import android.animation.ObjectAnimator
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import com.google.android.material.button.MaterialButton
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import ru.dimon6018.metrolauncher.Application
import ru.dimon6018.metrolauncher.Main
import ru.dimon6018.metrolauncher.R
import ru.dimon6018.metrolauncher.content.oobe.WelcomeActivity
import kotlin.system.exitProcess

class AlmostDoneFragment: Fragment() {

Expand All @@ -33,37 +29,26 @@ class AlmostDoneFragment: Fragment() {
val next: MaterialButton = view.findViewById(R.id.next)
WelcomeActivity.setText(requireActivity(), getString(R.string.welcomeAlmostDone))
next.setOnClickListener {
lifecycleScope.launch {
enterAnimation(true)
delay(200)
Application.PREFS!!.setLauncherState(1)
requireActivity().startActivity(Intent(activity, Main::class.java))
}
Application.PREFS!!.setLauncherState(1)
exitProcess(0)
}
return view
}
private fun enterAnimation(exit: Boolean) {
private fun enterAnimation() {
if(main == null) {
return
}
val animatorSet = AnimatorSet()
if(exit) {
animatorSet.playTogether(
ObjectAnimator.ofFloat(main!!, "translationX", 0f, -1000f),
ObjectAnimator.ofFloat(main!!, "alpha", 1f, 0f),
)
} else {
animatorSet.playTogether(
animatorSet.playTogether(
ObjectAnimator.ofFloat(main!!, "translationX", 1000f, 0f),
ObjectAnimator.ofFloat(main!!, "alpha", 0f, 1f),
)
}
ObjectAnimator.ofFloat(main!!, "alpha", 0f, 1f)
)
animatorSet.setDuration(300)
animatorSet.start()
}

override fun onResume() {
enterAnimation(false)
enterAnimation()
super.onResume()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.google.android.material.card.MaterialCardView
import com.google.android.material.textview.MaterialTextView
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import leakcanary.LeakCanary
Expand Down Expand Up @@ -238,6 +239,7 @@ class SettingsActivity : AppCompatActivity() {
aboutBtn!!.alpha = 1f
leaks!!.alpha = 1f
expBtn!!.alpha = 1f
cancel()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AnimationSettingsActivity: AppCompatActivity() {
}
transitionAnim.setOnCheckedChangeListener { _, isChecked ->
PREFS!!.setTransitionAnim(isChecked)
PREFS!!.setPrefsChanged(true)
}
allAppsAnim.setOnCheckedChangeListener { _, isChecked ->
PREFS!!.setAllAppsAnim(isChecked)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ class UpdateActivity: AppCompatActivity() {
}
updateDetails!!.setOnClickListener {
WPDialog(this).setTopDialog(true)
.setTitle(getString(R.string.details))
.setMessage(getUpdateMessage())
.setPositiveButton(getString(android.R.string.ok), null).show()
.setTitle(getString(R.string.details))
.setMessage(getUpdateMessage())
.setPositiveButton(getString(android.R.string.ok), null).show()
}
check!!.setOnClickListener {
if(!checkStoragePermissions()) {
Expand Down Expand Up @@ -423,9 +423,9 @@ class UpdateActivity: AppCompatActivity() {
refreshUi()
withContext(mainDispatcher) {
WPDialog(this@UpdateActivity).setTopDialog(true)
.setTitle(getString(R.string.error))
.setMessage(getString(R.string.downloading_error))
.setPositiveButton(getString(android.R.string.ok), null).show()
.setTitle(getString(R.string.error))
.setMessage(getString(R.string.downloading_error))
.setPositiveButton(getString(android.R.string.ok), null).show()
}
cancel()
return@launch
Expand Down Expand Up @@ -497,9 +497,9 @@ class UpdateActivity: AppCompatActivity() {
withContext(mainDispatcher) {
refreshUi()
WPDialog(this@UpdateActivity).setTopDialog(true)
.setTitle(getString(R.string.error))
.setMessage(getString(R.string.downloading_error))
.setPositiveButton(getString(android.R.string.ok), null).show()
.setTitle(getString(R.string.error))
.setMessage(getString(R.string.downloading_error))
.setPositiveButton(getString(android.R.string.ok), null).show()
}
}
cancel()
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/oobe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:layout_height="wrap_content"
android:fitsSystemWindows="true">

<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/appbarTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/oobe_fragment_almostdone.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<string name="custom">настроить</string>
<string name="customise_your_phone_settings">Настроить телефон</string>
<string name="recommended_tip">Выберите рекомендуемые настройки, чтобы использовать передачу данных по сотовой сети и автоматически загружать обновления лаунчера. Рекомендуемые настройки также будут отправлять информацию о телефоне и использовании лаунчера для улучшения MPL.</string>
<string name="oobe_done">Вы закончили настройку лаунчера. Спасибо, что решили попробовать MPL. Приятного использования!</string>
<string name="oobe_done">Вы закончили настройку лаунчера. Спасибо, что решили попробовать MPL. Приятного использования! \n MPL будет перезапущен.</string>
<string name="recovry_browser_subtitle">Найдите информацию об ошибке в Интернете</string>
<string name="recovry_browser_title">Открыть браузер</string>
<string name="recovery_system_settings_title">Открытить системные параметры</string>
Expand Down Expand Up @@ -221,4 +221,5 @@
<string name="search_error">Произошла ошибка. Попробуйте повторить поиск.</string>
<string name="auto_shutdown_anims">Автоматически выключать анимации, если включен режим разработчика</string>
<string name="animations_dev_mode">Анимации могут не работать, если вы выключили их в опциях для разработчиков.</string>
<string name="ready_to_download_lawnicons">Обновление для Lawnicons готово к скачиванию</string>
</resources>
Loading

0 comments on commit 554c7c2

Please sign in to comment.