mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 08:19:33 +00:00
remove april check completely
This commit is contained in:
3 files changed
+1
-14
No files matched your search
@@ -92,7 +92,6 @@ import com.geode.launcher.utils.Constants
|
||||
import com.geode.launcher.utils.GamePackageUtils
|
||||
import com.geode.launcher.utils.LaunchUtils
|
||||
import com.geode.launcher.utils.PreferenceUtils
|
||||
import com.geode.launcher.utils.checkIconDate
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.launch
|
||||
import java.net.ConnectException
|
||||
|
||||
@@ -60,7 +60,6 @@ import com.geode.launcher.utils.ApplicationIcon
|
||||
import com.geode.launcher.utils.ApplicationIconDetails
|
||||
import com.geode.launcher.utils.IconUtils
|
||||
import com.geode.launcher.utils.adaptiveIconPainterResource
|
||||
import com.geode.launcher.utils.checkIconDate
|
||||
|
||||
class ApplicationIconActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@@ -232,17 +231,13 @@ fun ApplicationIconScreen(
|
||||
) {
|
||||
val selectedIcon by PreferenceUtils.useStringPreference(PreferenceUtils.Key.SELECTED_ICON)
|
||||
|
||||
val aprilFools = remember { checkIconDate() }
|
||||
|
||||
Column(Modifier
|
||||
.padding(horizontal = 12.dp)
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
) {
|
||||
ApplicationIcon.entries.forEach {
|
||||
val iconData = IconUtils.getIconDetails(it)
|
||||
if (!iconData.checkDate || aprilFools) {
|
||||
IconCard(iconData, selectedIcon == iconData.id)
|
||||
}
|
||||
IconCard(iconData, selectedIcon == iconData.id)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -70,17 +70,11 @@ enum class ApplicationIcon {
|
||||
}
|
||||
}
|
||||
|
||||
fun checkIconDate(): Boolean {
|
||||
val currentDate = Clock.System.todayIn(TimeZone.currentSystemDefault())
|
||||
return currentDate.month == Month.APRIL && currentDate.day <= 7
|
||||
}
|
||||
|
||||
data class ApplicationIconDetails(
|
||||
val id: String,
|
||||
val component: String,
|
||||
@param:DrawableRes val iconId: Int,
|
||||
@param:StringRes val nameId: Int,
|
||||
val checkDate: Boolean = false,
|
||||
)
|
||||
|
||||
object IconUtils {
|
||||
@@ -114,7 +108,6 @@ object IconUtils {
|
||||
component = "MainActivitySapphire",
|
||||
iconId = R.mipmap.ic_launcher_sapphire,
|
||||
nameId = R.string.application_icon_sapphire,
|
||||
checkDate = true
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user