Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<activity android:name=".MainActivity" />

<activity android:name=".oldui.MainActivity" />
<activity android:name=".oldui.UpdateCheckingActivity" />
<activity android:name=".oldui.SettingsActivity" />
<activity android:name=".oldui.AboutUsActivity" />
<activity android:name=".oldui.LicenseActivity" />
Expand Down
83 changes: 83 additions & 0 deletions app/src/main/kotlin/com/jeeldobariya/passcodes/AuthActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
Expand All @@ -38,12 +39,16 @@ import com.jeeldobariya.passcodes.core.feature_flags.featureFlagsDatastore
import com.jeeldobariya.passcodes.design_system.theme.PasscodesTheme
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import androidx.core.net.toUri
import androidx.compose.material3.AlertDialog

class AuthActivity : AppCompatActivity() {

private lateinit var biometricPrompt: BiometricPrompt
private lateinit var promptInfo: BiometricPrompt.PromptInfo

private var showDeprecationDialog = mutableStateOf(true)

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand All @@ -55,11 +60,89 @@ class AuthActivity : AppCompatActivity() {

setContent {
PasscodesTheme {

if (showDeprecationDialog.value) {
DeprecationDialog(
onDismiss = { showDeprecationDialog.value = false },
onUpdate = {
Intent(Intent.ACTION_VIEW,
Constant.WEBSITE_URL.toUri()).also {
startActivity(it)
}
}
)
}

AuthScreenContent()
}
}
}

@Composable
private fun DeprecationDialog(onDismiss: () -> Unit, onUpdate: () -> Unit) {
AlertDialog(
onDismissRequest = { /* Rigid: user must choose an action */ },
title = {
Column {
Text(
text = " 🛑 End of Support Notice",
style = MaterialTheme.typography.headlineSmall,
fontWeight = FontWeight.ExtraBold
)
}
},
text = {
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
Text(
text = "As of now & forwards, we are officially deprecating all versions v2.x.x and prior.",
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurface
)

Text(
text = "To ensure your data remains secure and you keep access to your passcodes, please update to the latest version immediately.",
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant
)

Text(
text = "Version 3.0.0 is coming soon",
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold), // Explicit bold
color = MaterialTheme.colorScheme.primary // Use primary to highlight the upcoming good news
)

Text(
text = "END OF SUPPORT: May 25, 2026",
style = MaterialTheme.typography.labelLarge,
color = MaterialTheme.colorScheme.error,
fontWeight = FontWeight.Bold
)
}
},
confirmButton = {
Column(modifier = Modifier.fillMaxWidth()) {
Button(
onClick = onUpdate,
modifier = Modifier.fillMaxWidth()
) {
Text("Download Latest Version")
}
TextButton(
onClick = onDismiss,
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "Continue with Legacy Version (Unsafe)",
color = MaterialTheme.colorScheme.error,
fontSize = 12.sp
)
}
}
},
dismissButton = null
)
}

@Composable
private fun AuthScreenContent() {
Scaffold { padding ->
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/kotlin/com/jeeldobariya/passcodes/Constants.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.jeeldobariya.passcodes

object Constant {

const val GH_DOMAIN_URL = "https://passcodesapp.github.io"
const val REPOSITORY_SIGNATURE = "PasscodesApp/Passcodes"

// Main URL Constants
const val DOCS_WEBSITE_URL = "https://passcodesapp.github.io/Passcodes-Docs"
const val TELEGRAM_COMMUNITY_URL = "https://t.me/passcodescommunity"
const val WEBSITE_URL = "$GH_DOMAIN_URL/Passcodes-Website"
const val DOCS_WEBSITE_URL = "$GH_DOMAIN_URL/Passcodes-Docs"
const val DISCORD_COMMUNITY_URL = "https://discord.gg/zPbk2gp3Sg"
const val REPOSITORY_URL = "https://github.com/$REPOSITORY_SIGNATURE"

// URL Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MainActivity : ComponentActivity() {
checkForUpdateUseCase(
currentVersion = BuildConfig.VERSION_NAME,
githubReleaseApiUrl = Constant.GITHUB_RELEASE_API_URL,
telegramCommunityUrl = Constant.TELEGRAM_COMMUNITY_URL
discordUrl = Constant.DISCORD_COMMUNITY_URL
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AboutUsActivity : AppCompatActivity() {
}

binding.cardTelegramCommunity.setOnClickListener {
openBrowser(Constant.TELEGRAM_COMMUNITY_URL)
openBrowser(Constant.DISCORD_COMMUNITY_URL)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.jeeldobariya.passcodes.oldui
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat
import androidx.lifecycle.lifecycleScope
Expand Down Expand Up @@ -41,16 +42,14 @@ class MainActivity : AppCompatActivity() {
val result = checkForUpdateUseCase(
currentVersion = BuildConfig.VERSION_NAME,
githubReleaseApiUrl = Constant.GITHUB_RELEASE_API_URL,
telegramCommunityUrl = Constant.TELEGRAM_COMMUNITY_URL
discordUrl = Constant.DISCORD_COMMUNITY_URL
)

when (result) {
UpdateCheckingResult.ON_UNOFFICIAL_RELEASE,
UpdateCheckingResult.ON_PRE_RELEASE
-> {
Intent(this@MainActivity, UpdateCheckingActivity::class.java).also {
startActivity(it)
}
UpdateCheckingResult.ON_PRE_RELEASE -> {
Toast.makeText(this@MainActivity, "You are on a Unofficial Release", Toast.LENGTH_LONG).show()
Toast.makeText(this@MainActivity, "Update as soon as possible!!", Toast.LENGTH_LONG).show()
}
else -> Log.e("UpdateChecking", result.toString())
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,9 @@ private fun AboutGridSection() {
)
}

TelegramCard(
text = stringResource(R.string.view_telegram_community_text),
DiscordCard(
onClick = {
Intent(Intent.ACTION_VIEW, Constant.TELEGRAM_COMMUNITY_URL.toUri()).also {
Intent(Intent.ACTION_VIEW, Constant.DISCORD_COMMUNITY_URL.toUri()).also {
context.startActivity(it)
}
}
Expand Down Expand Up @@ -229,8 +228,8 @@ private fun AboutCard(
}

@Composable
private fun TelegramCard(
text: String,
private fun DiscordCard(
text: String = "Join Discord",
onClick: () -> Unit
) {
Card(
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_about_us.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,17 @@
android:padding="16dp">

<ImageView
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginBottom="8dp"
android:contentDescription="Join Telegram Community"
android:contentDescription="Join Discord Community"
android:src="@drawable/ic_send"
app:tint="?attr/colorPrimary" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/view_telegram_community_text"
android:text="Join Discord"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.LabelLarge" />
</LinearLayout>
Expand Down
49 changes: 0 additions & 49 deletions app/src/main/res/layout/activity_update_checking.xml

This file was deleted.

Loading