Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishksahu committed Aug 15, 2024
1 parent bc49bd7 commit ef994e7
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 50 deletions.
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ dependencies {
implementation "androidx.security:security-crypto:1.0.0"

// For Audio/Video
implementation 'androidx.media3:media3-exoplayer:1.3.1'
implementation 'androidx.media3:media3-ui:1.3.1'
implementation 'androidx.media3:media3-common:1.3.1'
implementation 'androidx.media3:media3-exoplayer:1.4.0'
implementation 'androidx.media3:media3-ui:1.4.0'
implementation 'androidx.media3:media3-common:1.4.0'

// For Pictures
implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation "com.github.bumptech.glide:compose:1.0.0-beta01"
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.activity:activity-ktx:1.9.0'
implementation 'androidx.activity:activity-ktx:1.9.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3'
implementation 'androidx.lifecycle:lifecycle-runtime-compose-android:2.8.3'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4'
implementation 'androidx.lifecycle:lifecycle-runtime-compose-android:2.8.4'
annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'

// Compose
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3'
implementation 'androidx.activity:activity-compose:1.9.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4'
implementation 'androidx.activity:activity-compose:1.9.1'
implementation platform('androidx.compose:compose-bom:2024.06.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
Expand Down Expand Up @@ -104,7 +104,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.fragment:fragment-ktx:1.8.1"
implementation "androidx.fragment:fragment-ktx:1.8.2"
implementation "androidx.preference:preference-ktx:1.2.1"

debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class AuthActivity : AppCompatActivity() {
sharedPref.getString(getString(R.string.change_theme), getString(R.string.System))!!
)

// for debug builds only, REMOVE BEFORE RELEASE BUILD
// val intent = Intent(applicationContext, MainnActivity::class.java)
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
// startActivity(intent)
// finish()

// check if app pin is set
isHardPinSet = EncPref.getBoolean(Constants.HARD_PIN_SET, applicationContext)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ class MainActivityViewModel(private val application: Application) : AndroidViewM
}
}

// fun isMigrationComplete(): Boolean {
// return sharedPref.getBoolean(Constants.MIGRATION_COMPLETE, false)
// }
fun isMigrationComplete(): Boolean {
return sharedPref.getBoolean(Constants.MIGRATION_COMPLETE, false)
}

fun exportToLog(msg: String, e: Exception) {
Utils.exportToLog(application, msg, e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.compose.animation.AnimatedContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
Expand All @@ -46,6 +54,7 @@ class MainnActivity : AppCompatActivity() {
val viewModel: MainActivityViewModel by viewModels()

override fun onCreate(savedInstanceState: Bundle?) {

super.onCreate(savedInstanceState)

registerFilePickerListener()
Expand Down Expand Up @@ -138,9 +147,9 @@ class MainnActivity : AppCompatActivity() {
) { innerPadding ->
val lazyListDisplay = ItemList(this)
// migrate data from root folder to avoid issues with user created root folder inside
// if (!viewModel.isMigrationComplete()) {
// ShowChangeLog()
// }
if (!viewModel.isMigrationComplete()) {
ShowChangeLog()
}

Column(
modifier = Modifier
Expand Down Expand Up @@ -203,40 +212,40 @@ class MainnActivity : AppCompatActivity() {
}
}

// @Composable
// private fun ShowChangeLog() {
// var migrationMsg by remember { mutableStateOf(true) }
// if (migrationMsg) {
// AlertDialog(
// icon = {
// Icon(
// Icons.Filled.Favorite,
// contentDescription = getString(R.string.migration_headline)
// )
// },
// title = {
// Text(text = getString(R.string.migration_headline))
// },
// text = {
// Text(text = getString(R.string.migration_content))
// },
// onDismissRequest = {
// migrationMsg = false
// },
// confirmButton = {
// TextButton(
// onClick = {
// viewModel.migrateFromRoot()
// migrationMsg = false
// }
// ) {
// Text(getString(R.string.ok))
// }
// }
// )
//
// }
// }
@Composable
private fun ShowChangeLog() {
var migrationMsg by remember { mutableStateOf(true) }
if (migrationMsg) {
AlertDialog(
icon = {
Icon(
Icons.Filled.Favorite,
contentDescription = getString(R.string.migration_headline)
)
},
title = {
Text(text = getString(R.string.migration_headline))
},
text = {
Text(text = getString(R.string.migration_content))
},
onDismissRequest = {
migrationMsg = false
},
confirmButton = {
TextButton(
onClick = {
viewModel.migrateFromRoot()
migrationMsg = false
}
) {
Text(getString(R.string.ok))
}
}
)

}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import org.privacymatters.safespace.experimental.main.MainnActivity
import org.privacymatters.safespace.utils.Constants

class BottomAppBar(private val activity: MainnActivity) {
//Todo: Make bottom app bar fixed width, reduce the gap

private val createFolderShowDialog = mutableStateOf(false)
private val createNoteShowDialog = mutableStateOf(false)
private val renameShowDialog = mutableStateOf(false)
Expand Down

0 comments on commit ef994e7

Please sign in to comment.