Skip to content

Commit

Permalink
Merge pull request #76 from aritra-tech/develop
Browse files Browse the repository at this point in the history
v1.3.0
  • Loading branch information
aritra-tech authored Sep 23, 2023
2 parents 3bf6282 + 3068110 commit 5c44a7a
Show file tree
Hide file tree
Showing 40 changed files with 701 additions and 487 deletions.
17 changes: 5 additions & 12 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id ("kotlin-parcelize")
id ("kotlin-kapt")
id ("com.google.dagger.hilt.android")
id ("com.google.gms.google-services")
id ("com.google.devtools.ksp")
}

Expand All @@ -16,8 +15,8 @@ android {
applicationId = "com.aritra.notify"
minSdk = 24
targetSdk = 34
versionCode = 4
versionName = "1.3.0-beta01"
versionCode = 5
versionName = "1.3.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -57,9 +56,9 @@ android {

dependencies {

val lifecycleVersion = "2.6.1"
val lifecycleVersion = "2.6.2"
val roomVersion = "2.5.2"
val navVersion = "2.7.0"
val navVersion = "2.7.2"


implementation ("androidx.core:core-ktx:1.10.1")
Expand Down Expand Up @@ -91,7 +90,7 @@ dependencies {
// Material 3
implementation ("androidx.compose.material3:material3:1.1.1")
implementation ("androidx.compose.material3:material3-window-size-class:1.1.1")
implementation ("androidx.compose.material:material-icons-extended:1.5.0")
implementation ("androidx.compose.material:material-icons-extended:1.5.1")

// Room
implementation ("androidx.room:room-runtime:$roomVersion")
Expand All @@ -115,15 +114,9 @@ dependencies {
// DataStore
implementation ("androidx.datastore:datastore-preferences:1.0.0")

//Swipe
implementation ("me.saket.swipe:swipe:1.2.0")

// Splash API
implementation ("androidx.core:core-splashscreen:1.0.1")

// Firebase
implementation("com.google.firebase:firebase-messaging-ktx:23.2.1")

//Coil
implementation("io.coil-kt:coil-compose:2.4.0")

Expand Down
10 changes: 1 addition & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<application
android:allowBackup="true"
Expand All @@ -20,7 +19,7 @@

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.aritra.notify.provider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
Expand All @@ -38,13 +37,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".NotifyMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/ic_launcher" />
Expand Down
63 changes: 0 additions & 63 deletions app/src/main/java/com/aritra/notify/NotifyMessagingService.kt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.aritra.notify.biometric
package com.aritra.notify.components.biometric

import android.content.Context
import androidx.biometric.BiometricManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.aritra.notify.biometric
package com.aritra.notify.components.biometric

interface BiometricAuthListener {
fun onBiometricAuthSuccess()
Expand Down
81 changes: 14 additions & 67 deletions app/src/main/java/com/aritra/notify/components/note/GridNoteCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,17 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.style.TextOverflow
Expand All @@ -40,35 +28,38 @@ import androidx.compose.ui.unit.sp
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.aritra.notify.R
import com.aritra.notify.components.dialog.TextDialog
import com.aritra.notify.data.models.Note
import com.aritra.notify.ui.screens.notes.homeScreen.NoteScreenViewModel
import com.aritra.notify.domain.models.Note
import com.aritra.notify.utils.Const
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale

@Composable
fun GridNoteCard(
notesModel: Note,
viewModel: NoteScreenViewModel,
navigateToUpdateNoteScreen: (noteId: Int) -> Unit,
isGridView: Boolean
) {
var expanded by remember { mutableStateOf(false) }
val deleteDialogVisible = remember { mutableStateOf(false) }
val painter = rememberSaveable { mutableStateOf(notesModel.imagePath) }
val painter = rememberSaveable { mutableStateOf(notesModel.image) }
val context = LocalContext.current
val date = remember {
SimpleDateFormat(
Const.DATE_TIME_FORMAT,
Locale.getDefault()
).format(notesModel.dateTime ?: Date())
}

OutlinedCard(
border = CardDefaults.outlinedCardBorder().copy(0.dp),
modifier = Modifier
.padding(10.dp)
.fillMaxWidth()
.clickable { navigateToUpdateNoteScreen(notesModel.id) },
shape = RoundedCornerShape(8.dp)
shape = RoundedCornerShape(15.dp)
) {
Column(
modifier = Modifier.padding(12.dp).fillMaxWidth()
modifier = Modifier
.padding(16.dp)
.fillMaxWidth()
) {
AsyncImage(
model = ImageRequest.Builder(context)
Expand All @@ -95,45 +86,6 @@ fun GridNoteCard(
overflow = TextOverflow.Ellipsis
)
}

if (isGridView) {
IconButton(
onClick = { expanded = true }
) {
Icon(Icons.Default.MoreVert, "Options")
}
DropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false },
) {
DropdownMenuItem(
text = { Text("Delete") },
onClick = {
deleteDialogVisible.value = true
expanded = false
},
leadingIcon = {
Icon(
modifier = Modifier.padding(12.dp),
imageVector = Icons.Outlined.Delete,
contentDescription = null
)
}
)
}
if (deleteDialogVisible.value) {
TextDialog(
title = stringResource(R.string.warning),
description = stringResource(R.string.are_you_sure_want_to_delete_these_items_it_cannot_be_recovered),
isOpened = deleteDialogVisible.value,
onDismissCallback = { deleteDialogVisible.value = false },
onConfirmCallback = {
viewModel.deleteNote(notesModel)
deleteDialogVisible.value = false
}
)
}
}
}
Spacer(modifier = Modifier.height(10.dp))
Text(
Expand All @@ -144,13 +96,8 @@ fun GridNoteCard(
overflow = TextOverflow.Ellipsis
)
Spacer(modifier = Modifier.height(10.dp))
val formattedDateTime =
SimpleDateFormat(
Const.DATE_TIME_FORMAT,
Locale.getDefault()
).format(notesModel.dateTime)
Text(
text = formattedDateTime,
text = date,
fontSize = 14.sp,
fontFamily = FontFamily(Font(R.font.poppins_medium)),
color = Color.Gray
Expand Down
Loading

0 comments on commit 5c44a7a

Please sign in to comment.