mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 16:32:39 +00:00
remove april check completely
This commit is contained in:
3 files changed
-13
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.GamePackageUtils
|
||||||
import com.geode.launcher.utils.LaunchUtils
|
import com.geode.launcher.utils.LaunchUtils
|
||||||
import com.geode.launcher.utils.PreferenceUtils
|
import com.geode.launcher.utils.PreferenceUtils
|
||||||
import com.geode.launcher.utils.checkIconDate
|
|
||||||
import kotlinx.coroutines.CancellationException
|
import kotlinx.coroutines.CancellationException
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.net.ConnectException
|
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.ApplicationIconDetails
|
||||||
import com.geode.launcher.utils.IconUtils
|
import com.geode.launcher.utils.IconUtils
|
||||||
import com.geode.launcher.utils.adaptiveIconPainterResource
|
import com.geode.launcher.utils.adaptiveIconPainterResource
|
||||||
import com.geode.launcher.utils.checkIconDate
|
|
||||||
|
|
||||||
class ApplicationIconActivity : ComponentActivity() {
|
class ApplicationIconActivity : ComponentActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
@@ -232,18 +231,14 @@ fun ApplicationIconScreen(
|
|||||||
) {
|
) {
|
||||||
val selectedIcon by PreferenceUtils.useStringPreference(PreferenceUtils.Key.SELECTED_ICON)
|
val selectedIcon by PreferenceUtils.useStringPreference(PreferenceUtils.Key.SELECTED_ICON)
|
||||||
|
|
||||||
val aprilFools = remember { checkIconDate() }
|
|
||||||
|
|
||||||
Column(Modifier
|
Column(Modifier
|
||||||
.padding(horizontal = 12.dp)
|
.padding(horizontal = 12.dp)
|
||||||
.clip(RoundedCornerShape(16.dp))
|
.clip(RoundedCornerShape(16.dp))
|
||||||
) {
|
) {
|
||||||
ApplicationIcon.entries.forEach {
|
ApplicationIcon.entries.forEach {
|
||||||
val iconData = IconUtils.getIconDetails(it)
|
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(
|
data class ApplicationIconDetails(
|
||||||
val id: String,
|
val id: String,
|
||||||
val component: String,
|
val component: String,
|
||||||
@param:DrawableRes val iconId: Int,
|
@param:DrawableRes val iconId: Int,
|
||||||
@param:StringRes val nameId: Int,
|
@param:StringRes val nameId: Int,
|
||||||
val checkDate: Boolean = false,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
object IconUtils {
|
object IconUtils {
|
||||||
@@ -114,7 +108,6 @@ object IconUtils {
|
|||||||
component = "MainActivitySapphire",
|
component = "MainActivitySapphire",
|
||||||
iconId = R.mipmap.ic_launcher_sapphire,
|
iconId = R.mipmap.ic_launcher_sapphire,
|
||||||
nameId = R.string.application_icon_sapphire,
|
nameId = R.string.application_icon_sapphire,
|
||||||
checkDate = true
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user