forked from geode-sdk/android-launcher
i overthought it
This commit is contained in:
3 files changed
+24
No files matched your search
@@ -25,6 +25,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
@@ -189,6 +190,16 @@ fun MainScreen(
|
|||||||
beginLaunch = true
|
beginLaunch = true
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (gdVersion < Constants.SUPPORTED_VERSION_CODE) {
|
||||||
|
ElevatedCard(modifier = Modifier.padding(8.dp)) {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.launcher_game_update_required),
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
modifier = Modifier.padding(8.dp).sizeIn(maxWidth = 512.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gdInstalled -> {
|
gdInstalled -> {
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ import com.geode.launcher.ui.theme.GeodeLauncherTheme
|
|||||||
import com.geode.launcher.ui.theme.LocalTheme
|
import com.geode.launcher.ui.theme.LocalTheme
|
||||||
import com.geode.launcher.ui.theme.Theme
|
import com.geode.launcher.ui.theme.Theme
|
||||||
import com.geode.launcher.ui.theme.Typography
|
import com.geode.launcher.ui.theme.Typography
|
||||||
|
import com.geode.launcher.utils.Constants
|
||||||
|
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 java.net.ConnectException
|
import java.net.ConnectException
|
||||||
@@ -177,12 +179,19 @@ fun UpdateIndicator(
|
|||||||
snackbarHostState.showSnackbar(
|
snackbarHostState.showSnackbar(
|
||||||
context.getString(R.string.preference_check_for_updates_success)
|
context.getString(R.string.preference_check_for_updates_success)
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
val gdInstalled = GamePackageUtils.isGameInstalled(context.packageManager)
|
||||||
|
if (gdInstalled && GamePackageUtils.getGameVersionCode(context.packageManager) < Constants.SUPPORTED_VERSION_CODE) {
|
||||||
|
snackbarHostState.showSnackbar(
|
||||||
|
context.getString(R.string.launcher_game_update_required_short)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
snackbarHostState.showSnackbar(
|
snackbarHostState.showSnackbar(
|
||||||
context.getString(R.string.preference_check_for_updates_none_found)
|
context.getString(R.string.preference_check_for_updates_none_found)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,10 @@
|
|||||||
<string name="launcher_unsupported_version_description">
|
<string name="launcher_unsupported_version_description">
|
||||||
The current version of Geometry Dash is not compatible with the version supported by the launcher. A launcher update is required to fix this.\nLaunch will continue, but crashes may occur!
|
The current version of Geometry Dash is not compatible with the version supported by the launcher. A launcher update is required to fix this.\nLaunch will continue, but crashes may occur!
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
|
<string name="launcher_game_update_required_short">A Geometry Dash update is required.</string>
|
||||||
|
<string name="launcher_game_update_required">The currently installed version of Geometry Dash is out-of-date. Please update to continue receiving Geode updates.</string>
|
||||||
|
|
||||||
<string name="launcher_update_available">A new launcher update is available!</string>
|
<string name="launcher_update_available">A new launcher update is available!</string>
|
||||||
<string name="launcher_update_dismiss">Dismiss</string>
|
<string name="launcher_update_dismiss">Dismiss</string>
|
||||||
<string name="safe_mode_enable_title">Enable safe mode?</string>
|
<string name="safe_mode_enable_title">Enable safe mode?</string>
|
||||||
|
|||||||
Reference in new issue
Block a user