@@ -2,8 +2,10 @@ package net.megaproxy487
22
33import android.Manifest
44import android.app.Activity
5+ import android.content.ActivityNotFoundException
56import android.content.Intent
67import android.content.pm.PackageManager
8+ import android.net.Uri
79import android.net.VpnService
810import android.os.Build
911import android.os.Bundle
@@ -23,6 +25,8 @@ import androidx.compose.foundation.layout.BoxWithConstraints
2325import androidx.compose.foundation.layout.heightIn
2426import androidx.compose.ui.platform.LocalDensity
2527import androidx.compose.foundation.layout.Column
28+ import androidx.compose.foundation.layout.ExperimentalLayoutApi
29+ import androidx.compose.foundation.layout.FlowRow
2630import androidx.compose.foundation.layout.Row
2731import androidx.compose.foundation.layout.Spacer
2832import androidx.compose.foundation.layout.fillMaxSize
@@ -235,7 +239,7 @@ private fun ProfileSelectorLabel(
235239 }
236240}
237241
238- @OptIn(ExperimentalMaterial3Api ::class )
242+ @OptIn(ExperimentalMaterial3Api ::class , ExperimentalLayoutApi :: class )
239243@Composable
240244internal fun MainScreen (
241245 activity : Activity ,
@@ -667,12 +671,27 @@ internal fun MainScreen(
667671 connectionStats?.let { stats ->
668672 ConnectionStatsCard (stats, quic = transportProtocol == VpnTransportProtocol .HTTP_3 )
669673 }
670- Text (
671- stringResource(R .string.version_and_commit, BuildConfig .VERSION_NAME , BuildConfig .GIT_COMMIT_HASH ),
672- style = MaterialTheme .typography.bodySmall,
673- color = MaterialTheme .colorScheme.onSurfaceVariant,
674- modifier = Modifier .align(Alignment .CenterHorizontally ).padding(top = 8 .dp),
675- )
674+ FlowRow (
675+ horizontalArrangement = Arrangement .Center ,
676+ modifier = Modifier .fillMaxWidth().padding(top = 8 .dp),
677+ ) {
678+ Text (
679+ stringResource(R .string.version_and_commit, BuildConfig .VERSION_NAME , BuildConfig .GIT_COMMIT_HASH ),
680+ style = MaterialTheme .typography.bodySmall,
681+ color = MaterialTheme .colorScheme.onSurfaceVariant,
682+ modifier = Modifier .align(Alignment .CenterVertically ),
683+ )
684+ TextButton (onClick = {
685+ try {
686+ activity.startActivity(Intent (Intent .ACTION_VIEW ,
687+ Uri .parse(" https://github.com/andre487/AndroidMegaProxy" )))
688+ } catch (_: ActivityNotFoundException ) {
689+ error = activity.uiText(R .string.no_browser)
690+ }
691+ }) {
692+ Text (stringResource(R .string.update_github), style = MaterialTheme .typography.bodySmall)
693+ }
694+ }
676695 }
677696 }
678697 }
0 commit comments