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
61 changes: 35 additions & 26 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import java.io.FileInputStream
import java.util.Properties
import org.gradle.api.GradleException
// import org.gradle.api.GradleException
import com.android.build.api.dsl.ApplicationExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.android.application)
Expand All @@ -10,6 +11,12 @@ plugins {
alias(libs.plugins.oss.licenses)
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_21
}
}

android {
(this as ApplicationExtension).apply {
compileSdk = 36
Expand All @@ -20,7 +27,7 @@ android {
minSdk = 26
targetSdk = 34
versionCode = 2
versionName = "v1.1.1-Alpha"
versionName = "v1.1.2-rc.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -86,17 +93,17 @@ android {
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

// Use manifestPlaceholders.put() for key-value pairs
manifestPlaceholders.put("appIcon", "@mipmap/ic_launcher")
manifestPlaceholders.put("appLabel", "@string/app_name")
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"
manifestPlaceholders["appLabel"] = "@string/app_name"
}

getByName("debug") {
applicationIdSuffix = ".dev"
versionNameSuffix = "-Dev"
isMinifyEnabled = false

manifestPlaceholders.put("appIcon", "@mipmap/dev_ic_launcher")
manifestPlaceholders.put("appLabel", "Passcodes Dev")
manifestPlaceholders["appIcon"] = "@mipmap/dev_ic_launcher"
manifestPlaceholders["appLabel"] = "Passcodes Dev"
}

create("staging") {
Expand All @@ -115,14 +122,14 @@ android {
isDebuggable = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

manifestPlaceholders.put("appIcon", "@mipmap/dev_ic_launcher")
manifestPlaceholders.put("appLabel", "Passcodes Staging")
manifestPlaceholders["appIcon"] = "@mipmap/dev_ic_launcher"
manifestPlaceholders["appLabel"] = "Passcodes Staging"
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

buildFeatures {
Expand All @@ -135,41 +142,43 @@ android {
val location = "$projectDir/schemas"
arg("room.schemaLocation", location)
}

kotlinOptions {
jvmTarget = "11"
}
}

dependencies {
// Standard Kotlin Libraries
implementation(libs.kotlin.stdlib)

// UI/Google Services
implementation(libs.material)
implementation(libs.oss.license)
implementation(libs.appcompat)

implementation(libs.room.ktx)
// Data/Persistence (Room Bundle)
implementation(libs.bundles.room)
ksp(libs.room.compiler)

// Networking/Parsing
implementation(libs.okhttp)
implementation(libs.json)

implementation(libs.coroutines.core)
implementation(libs.coroutines.android)
// Concurrency (Coroutines Bundle)
implementation(libs.bundles.coroutines)

implementation(libs.lifecycle.runtime)
implementation(libs.lifecycle.viewmodel)
// Android Architecture Components (Lifecycle Bundle)
implementation(libs.bundles.lifecycle)

// Dependency Injection
implementation(libs.koin)
implementation(libs.koin.viewmodel)

// test
testImplementation(libs.junit)
testImplementation(libs.truth)

// --- Testing ---

// Local Unit Testing (Unit Test Bundle)
testImplementation(libs.bundles.unit.test)

// Android Instrumented Testing (Android Test Bundle)
androidTestImplementation(libs.bundles.android.test)
androidTestImplementation(libs.room.testing)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.coroutines.test)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.truth) // Keeping truth explicit for androidTest, though it's in both bundles.
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.jeeldobariya.passcodes.ui

sealed interface LoadPasswordAction {
data object RefreshPassswordData: LoadPasswordAction
data object RefreshPassword: LoadPasswordAction
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class LoadPasswordActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()

viewModel.onAction(LoadPasswordAction.RefreshPassswordData)
viewModel.onAction(LoadPasswordAction.RefreshPassword)
}

// Added all the onclick event listeners
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ package com.jeeldobariya.passcodes.ui
import com.jeeldobariya.passcodes.database.Password

data class LoadPasswordState(
val passwordEntityList: List<Password> = emptyList<Password>(),
val passwordEntityList: List<Password> = emptyList(),
val isError: Boolean = false
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LoadPasswordViewModel(

fun onAction(action: LoadPasswordAction) {
when (action) {
LoadPasswordAction.RefreshPassswordData -> { refreshData() }
LoadPasswordAction.RefreshPassword -> { refreshData() }
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.jeeldobariya.passcodes.ui

sealed interface ViewPasswordAction {
data class LoadPassswordData(val passwordId: Int): ViewPasswordAction
data object RefreshPassswordData: ViewPasswordAction
data class LoadPassword(val passwordId: Int): ViewPasswordAction
data object RefreshPassword: ViewPasswordAction
// data object NavigateUpdatePasswordAction: ViewPasswordAction
data object DeletePasswordAction: ViewPasswordAction
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ViewPasswordActivity : AppCompatActivity() {
return // Exit onCreate if ID is invalid
}

viewModel.onAction(ViewPasswordAction.LoadPassswordData(passwordEntityId))
viewModel.onAction(ViewPasswordAction.LoadPassword(passwordEntityId))

collectLatestLifecycleFlow(viewModel.state) { state ->
binding.tvDomain.text =
Expand Down Expand Up @@ -78,7 +78,7 @@ class ViewPasswordActivity : AppCompatActivity() {

override fun onResume() {
super.onResume()
viewModel.onAction(ViewPasswordAction.RefreshPassswordData)
viewModel.onAction(ViewPasswordAction.RefreshPassword)
}

// Added all the onclick event listeners
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ViewPasswordViewModel(

fun onAction(action: ViewPasswordAction) {
when (action) {
is ViewPasswordAction.LoadPassswordData -> { refreshData(action.passwordId) }
ViewPasswordAction.RefreshPassswordData -> { refreshData(passwordEntityId) }
is ViewPasswordAction.LoadPassword -> { refreshData(action.passwordId) }
ViewPasswordAction.RefreshPassword -> { refreshData(passwordEntityId) }
ViewPasswordAction.DeletePasswordAction -> { deletePasswordEntity() }
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/layout/activity_about_us.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:contentDescription="View Security Guidelines"
android:src="@drawable/ic_security"
app:tint="?attr/colorPrimary"
android:layout_marginBottom="8dp" />
Expand Down Expand Up @@ -106,6 +107,7 @@
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:contentDescription="Release Notes"
android:src="@drawable/ic_history"
app:tint="?attr/colorPrimary"
android:layout_marginBottom="8dp" />
Expand Down Expand Up @@ -136,6 +138,7 @@
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:contentDescription="Document Icon"
android:src="@drawable/ic_article"
app:tint="?attr/colorPrimary"
android:layout_marginBottom="8dp" />
Expand Down Expand Up @@ -166,6 +169,7 @@
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:contentDescription="Report Bug"
android:src="@drawable/ic_bug_report"
app:tint="?attr/colorPrimary"
android:layout_marginBottom="8dp" />
Expand Down Expand Up @@ -199,6 +203,7 @@
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_marginBottom="8dp"
android:contentDescription="Join Telegram Community"
android:src="@drawable/ic_send"
app:tint="?attr/colorPrimary" />
<TextView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_load_password.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:paddingBottom="12sp"
android:text="@string/textview_loadpassword_headline"
android:textAlignment="center"
android:textSize="32dp" />
android:textSize="32sp" />

<ListView
android:id="@+id/password_list"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
android:layout_margin="4dp"
android:text="@string/app_name"
android:textAlignment="center"
android:textSize="32dp" />
android:textSize="32sp" />

<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="@string/app_version"
android:textAlignment="center"
android:textSize="12dp" />
android:textSize="12sp" />
</LinearLayout>

<LinearLayout
Expand All @@ -49,23 +49,23 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/password_manager_button_text"
android:textSize="14dp" />
android:textSize="14sp" />

<com.google.android.material.button.MaterialButton
android:id="@+id/setting_btn"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/setting_button_text"
android:textSize="14dp" />
android:textSize="14sp" />

<com.google.android.material.button.MaterialButton
android:id="@+id/about_us_btn"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/about_us_button_text"
android:textSize="14dp" />
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>

10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_password_manager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:paddingBottom="12sp"
android:text="@string/textview_passwordmanager_headline"
android:textAlignment="center"
android:textSize="32dp" />
android:textSize="32sp" />

<LinearLayout
android:layout_width="wrap_content"
Expand All @@ -28,29 +28,29 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/save_password_button_text"
android:textSize="14dp" />
android:textSize="14sp" />

<com.google.android.material.button.MaterialButton
android:id="@+id/load_password_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/load_password_button_text"
android:textSize="14dp" />
android:textSize="14sp" />

<com.google.android.material.button.MaterialButton
android:id="@+id/import_password_btn"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/import_password_button_text"
android:textSize="14dp" />
android:textSize="14sp" />

<com.google.android.material.button.MaterialButton
android:id="@+id/export_password_btn"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/export_password_button_text"
android:textSize="14dp" />
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_save_password.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="@string/textview_savepassword_headline"
android:textSize="32dp" />
android:textSize="32sp" />
</LinearLayout>

<LinearLayout
Expand Down Expand Up @@ -107,7 +107,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/save_password_button_text"
android:textSize="14dp" />
android:textSize="14sp" />
</LinearLayout>

</LinearLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_update_password.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="@string/textview_updatepassword_headline"
android:textSize="32dp" />
android:textSize="32sp" />
</LinearLayout>

<LinearLayout
Expand All @@ -35,7 +35,7 @@
android:layout_height="wrap_content"
android:layout_margin="12sp"
android:textAlignment="center"
android:textSize="16dp" />
android:textSize="16sp" />

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -110,7 +110,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/update_password_button_text"
android:textSize="14dp" />
android:textSize="14sp" />
</LinearLayout>

</LinearLayout>
Loading