Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release NotyKT v1.3.1 #327

Merged
merged 44 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a179a90
[Android]: Bump lifecycleVersion from 2.3.1 to 2.4.0 in /noty-android
dependabot[bot] Oct 28, 2021
efdbf65
Fix surface color on Login and Signup
yogeshpaliyal Oct 29, 2021
4837d36
Fix About card shadow cut
yogeshpaliyal Oct 29, 2021
11cffa4
Code formatting
yogeshpaliyal Oct 29, 2021
46b9a3e
Remove focus from fields on share as Image
yogeshpaliyal Oct 29, 2021
7a301af
Increase touch region area for Input fields
yogeshpaliyal Oct 29, 2021
9c35e1a
Merge pull request #295 from yogeshpaliyal/improve/dark_mode
PatilShreyas Oct 30, 2021
0ee9f1b
Send Medifier for BasicTextField in BasicNotyTextField
yogeshpaliyal Oct 30, 2021
8ed29b3
Merge pull request #296 from yogeshpaliyal/fix/share
PatilShreyas Oct 31, 2021
bae72db
Use decorationBox instead of manually handling text field
PatilShreyas Oct 31, 2021
9a184d4
Create common composable component for confirmation dialog
PatilShreyas Oct 31, 2021
d3dd682
Show logout confirmation dialog on login screen
PatilShreyas Oct 31, 2021
70e0fe0
Show delete confirmation on note detail screen before deleting a note
PatilShreyas Oct 31, 2021
491cf40
Use LaunchedEffect for handling navigation to Login
PatilShreyas Oct 31, 2021
ae1ba27
Use LaunchedEffect for handling navigation to Notes screen via Login …
PatilShreyas Oct 31, 2021
09d06fd
Merge pull request #298 from PatilShreyas/feature/confirmation-dialogs
PatilShreyas Nov 1, 2021
6c2241b
Merge pull request #300 from PatilShreyas/fix/navigation-issues
PatilShreyas Nov 3, 2021
a58d78e
--remove: jcenter
sairajphonepe Nov 8, 2021
37dbf8d
Merge branch 'v1.3.1-dev' of https://github.com/sairajsawant/NotyKT i…
sairajphonepe Nov 8, 2021
9cf010f
Merge pull request #310 from sairajsawant/remove-jcenter
PatilShreyas Nov 8, 2021
8f6be29
Merge pull request #288 from PatilShreyas/dependabot/gradle/noty-andr…
PatilShreyas Nov 10, 2021
a5f33e0
[Android]: Bump lifecycleVersion from 2.3.1 to 2.4.0 in /noty-android
dependabot[bot] Nov 11, 2021
54fe66e
Merge pull request #312 from PatilShreyas/dependabot/gradle/noty-andr…
PatilShreyas Nov 11, 2021
8d7c4ff
[Android]: Bump daggerHiltVersion from 2.40 to 2.40.1 in /noty-android
dependabot[bot] Nov 12, 2021
f7e3b72
[Android]: Bump lifecycleVersion from 2.3.1 to 2.4.0 in /noty-android
dependabot[bot] Nov 12, 2021
738f1b3
Merge pull request #314 from PatilShreyas/dependabot/gradle/noty-andr…
PatilShreyas Nov 12, 2021
296e9ac
Merge branch 'master' of github.com:PatilShreyas/NotyKT into fix/fiel…
PatilShreyas Nov 13, 2021
2fda433
[Android]: Bump daggerHiltVersion from 2.40 to 2.40.1 in /noty-android
dependabot[bot] Nov 15, 2021
7826f55
[Android]: Bump lottie-compose from 4.2.0 to 4.2.1 in /noty-android
dependabot[bot] Nov 15, 2021
a08d8fd
[Android]: Bump lottie from 4.2.0 to 4.2.1 in /noty-android
dependabot[bot] Nov 15, 2021
9a822d3
Merge pull request #321 from PatilShreyas/dependabot/gradle/noty-andr…
PatilShreyas Nov 15, 2021
9c90a61
Merge pull request #320 from PatilShreyas/dependabot/gradle/noty-andr…
PatilShreyas Nov 15, 2021
95797e5
Merge pull request #318 from PatilShreyas/dependabot/gradle/noty-andr…
PatilShreyas Nov 15, 2021
9c44693
Merge pull request #316 from PatilShreyas/dependabot/gradle/noty-andr…
PatilShreyas Nov 15, 2021
de9d944
Provide prop "helperText" to common text field
PatilShreyas Nov 16, 2021
f9b1b7e
Provide helperText for username and password fields
PatilShreyas Nov 16, 2021
e616ba5
Fix icon image bounds on Login screen
PatilShreyas Nov 16, 2021
4cb7a3c
Remove unnecessary property setting to surface
PatilShreyas Nov 16, 2021
6704d4e
Fix: overriding ViewModelProvider.Factory implementation
PatilShreyas Nov 16, 2021
664838a
Merge branch 'v1.3.1-dev' of github.com:PatilShreyas/NotyKT into fix/…
PatilShreyas Nov 16, 2021
6b3b9a4
Merge branch 'master' of github.com:PatilShreyas/NotyKT into fix/fiel…
PatilShreyas Nov 16, 2021
2610656
Merge pull request #326 from PatilShreyas/fix/field-helpertext
PatilShreyas Nov 16, 2021
d028b3e
Update changelog.md
PatilShreyas Nov 16, 2021
de0df87
Update changelog: fix issue ID of a log for release v1.3.1
PatilShreyas Nov 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/pages/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ You can see [GitHub releases](https://github.com/PatilShreyas/NotyKT/releases) w

---

## _v1.3.1_ (2021-11-16)

This release includes few improvements and fixes in the Jetpack Compose Application to make it better.

### 🐛 Bug Fixes

- [[#281](https://github.com/PatilShreyas/NotyKT/issues/281)] Earlier, After signup, navigating back takes to log in screen. Now it closes the app.
- [[#282](https://github.com/PatilShreyas/NotyKT/issues/282)] Show proper cards with proper shadow in About screen. (_Contributed by [@yogeshpaliyal](https://github.com/yogeshpaliyal)_)
- [[#284](https://github.com/PatilShreyas/NotyKT/issues/284)] Removed focus (cursor) from fields while sharing image of a note. (_Contributed by [@yogeshpaliyal](https://github.com/yogeshpaliyal)_)
- [[#286](https://github.com/PatilShreyas/NotyKT/issues/286)] Improved dark mode visibility. (_Contributed by [@yogeshpaliyal](https://github.com/yogeshpaliyal)_)
- [[#294](https://github.com/PatilShreyas/NotyKT/issues/294)] Earlier, flickering (recompositions) were happening after performing navigation through screens.

### ✅ Improvements

- [[#280](https://github.com/PatilShreyas/NotyKT/issues/280)] Provided helper message for input fields like username and password for better UX in Login/Signup screens.
- [[#283](https://github.com/PatilShreyas/NotyKT/issues/283)] Improved touch region area of note input fields. (_Contributed by [@yogeshpaliyal](https://github.com/yogeshpaliyal)_)
- [[#287](https://github.com/PatilShreyas/NotyKT/issues/287)] Show confirmation dialog before deleting a note.
- [[#297](https://github.com/PatilShreyas/NotyKT/issues/297)] Show confirmation dialog before logging out.

### 🎯 Codebase Improvements

- Used `decorationBox` property of Composable TextField to show/hide placeholder instead of manually handling in a box.
- Removed `jcenter()` from Gradle repositories (_Contributed by [@sairajsawant](https://github.com/sairajsawant)_)

_**Many Thanks to superstar ⭐ contributors [@yogeshpaliyal](https://github.com/yogeshpaliyal), [@sairajsawant](https://github.com/sairajsawant) for contributing PRs and [@kasem-sm](https://github.com/kasem-sm) for raising issues**_

---

## _v1.3.0_ (2021-10-24)

This release includes new feature and some fixes in the Jetpack Compose Application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@

package dev.shreyaspatil.noty.composeapp.component.dialog

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.material.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.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -87,3 +96,82 @@ fun FailureDialog(failureMessage: String, onDismissed: () -> Unit = {}) {
}
}
}

@Composable
fun ConfirmationDialog(
title: String,
message: String,
onConfirmedYes: () -> Unit,
onConfirmedNo: () -> Unit,
onDismissed: () -> Unit
) {
var isDismissed by remember { mutableStateOf(false) }

if (!isDismissed) {
Dialog(onDismissRequest = {}) {
Surface {
Column(
horizontalAlignment = Alignment.Start,
modifier = Modifier.padding(
top = 16.dp,
bottom = 8.dp,
start = 16.dp,
end = 16.dp
)
) {
Text(
text = title,
color = MaterialTheme.colors.onSurface,
style = MaterialTheme.typography.body1,
fontWeight = FontWeight.Bold
)

Text(
text = message,
color = MaterialTheme.colors.onSurface,
style = MaterialTheme.typography.body2,
fontWeight = FontWeight.Normal,
modifier = Modifier.padding(vertical = 8.dp)
)

Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.End,
verticalAlignment = Alignment.CenterVertically
) {
TextButton(
onClick = {
onConfirmedYes()
isDismissed = true
},
modifier = Modifier
.padding(horizontal = 4.dp),

) {
Text(
style = typography.button,
color = MaterialTheme.colors.primary,
text = "Yes"
)
}
TextButton(
onClick = {
onConfirmedNo()
isDismissed = true
},
modifier = Modifier
.padding(horizontal = 4.dp),

) {
Text(
style = typography.button,
color = MaterialTheme.colors.primary,
text = "No"
)
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ package dev.shreyaspatil.noty.composeapp.component.text

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand All @@ -46,18 +50,28 @@ fun NotyTextField(
color: Color = MaterialTheme.colors.onPrimary,
leadingIcon: @Composable() (() -> Unit)? = null,
isError: Boolean = false,
helperText: String = "",
visualTransformation: VisualTransformation = VisualTransformation.None
) {
OutlinedTextField(
value = value,
label = { Text(text = label) },
modifier = modifier,
onValueChange = onValueChange,
leadingIcon = leadingIcon,
textStyle = TextStyle(color, fontSize = fontSize),
isError = isError,
visualTransformation = visualTransformation
)
Surface(modifier) {
Column {
OutlinedTextField(
value = value,
label = { Text(text = label) },
modifier = Modifier.fillMaxWidth(),
onValueChange = onValueChange,
leadingIcon = leadingIcon,
textStyle = TextStyle(color, fontSize = fontSize),
isError = isError,
visualTransformation = visualTransformation,
shape = RoundedCornerShape(8.dp)
)
if (helperText.isNotEmpty()) {
Spacer(modifier = Modifier.padding(2.dp))
Text(text = helperText, style = MaterialTheme.typography.caption)
}
}
}
}

@ExperimentalAnimationApi
Expand All @@ -68,24 +82,25 @@ fun BasicNotyTextField(
label: String = "",
textStyle: TextStyle = TextStyle(fontSize = 16.sp, fontWeight = FontWeight.Normal),
onTextChange: (String) -> Unit,
maxLines: Int = Int.MAX_VALUE
maxLines: Int = Int.MAX_VALUE,
) {

Box(modifier = modifier.padding(4.dp)) {
AnimatedVisibility(visible = value.isBlank()) {
Text(
text = label,
color = getTextFieldHintColor(),
fontSize = textStyle.fontSize,
fontWeight = textStyle.fontWeight
)
BasicTextField(
modifier = modifier,
value = value,
onValueChange = onTextChange,
textStyle = textStyle.copy(color = MaterialTheme.colors.onPrimary),
maxLines = maxLines,
cursorBrush = SolidColor(MaterialTheme.colors.primary),
decorationBox = { inlineTextField ->
AnimatedVisibility(visible = value.isBlank()) {
Text(
text = label,
color = getTextFieldHintColor(),
fontSize = textStyle.fontSize,
fontWeight = textStyle.fontWeight
)
}
inlineTextField()
}
BasicTextField(
value = value,
onValueChange = onTextChange,
textStyle = textStyle.copy(color = MaterialTheme.colors.onPrimary),
maxLines = maxLines,
cursorBrush = SolidColor(MaterialTheme.colors.primary)
)
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ fun PasswordTextField(
modifier = modifier,
leadingIcon = { Icon(Icons.Outlined.Password, "Password") },
visualTransformation = PasswordVisualTransformation(),
isError = !isValid && startedTyping
isError = !isValid && startedTyping,
helperText = "Minimum 8 characters required"
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fun UsernameTextField(
},
modifier = modifier,
leadingIcon = { Icon(Icons.Outlined.Person, "User") },
isError = !isValid && startedTyping
isError = !isValid && startedTyping,
helperText = "Minimum 4 characters required"
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
Expand Down Expand Up @@ -71,7 +70,7 @@ class MainActivity : AppCompatActivity() {
val darkMode by preferenceManager.uiModeFlow.collectAsState(initial = isSystemInDarkTheme())

NotyTheme(darkTheme = darkMode) {
Surface(color = MaterialTheme.colors.background) {
Surface {
NotyNavigation()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -106,7 +107,7 @@ fun AboutAppBar(navController: NavController) {
@Composable
fun AboutColumn() {
LazyColumn(
modifier = Modifier.padding(8.dp),
modifier = Modifier.padding(8.dp).fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally
) {
item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.sizeIn
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand All @@ -49,6 +50,7 @@ import dev.shreyaspatil.noty.composeapp.component.dialog.LoaderDialog
import dev.shreyaspatil.noty.composeapp.component.text.PasswordTextField
import dev.shreyaspatil.noty.composeapp.component.text.TextFieldValue
import dev.shreyaspatil.noty.composeapp.component.text.UsernameTextField
import dev.shreyaspatil.noty.composeapp.navigation.NOTY_NAV_HOST_ROUTE
import dev.shreyaspatil.noty.composeapp.ui.Screen
import dev.shreyaspatil.noty.composeapp.ui.theme.typography
import dev.shreyaspatil.noty.core.ui.UIDataState
Expand All @@ -64,21 +66,15 @@ fun LoginScreen(navController: NavHostController, loginViewModel: LoginViewModel
when (viewState) {
is UIDataState.Loading -> LoaderDialog()
is UIDataState.Failed -> FailureDialog(viewState.message)
is UIDataState.Success -> {
navController.navigate(Screen.Notes.route) {
launchSingleTop = true
popUpTo(Screen.Login.route) { inclusive = true }
}
}
}

LazyColumn {
LazyColumn(
modifier = Modifier
.fillMaxSize()
.background(MaterialTheme.colors.surface)
) {
item {
ConstraintLayout(
Modifier
.fillMaxSize()
.background(MaterialTheme.colors.surface)
) {
ConstraintLayout() {
val (
logoRef,
titleRef,
Expand All @@ -91,14 +87,13 @@ fun LoginScreen(navController: NavHostController, loginViewModel: LoginViewModel
Image(
contentDescription = "App Logo",
painter = painterResource(id = noty_app_logo),
modifier = Modifier
.sizeIn(100.dp, 100.dp)
modifier = Modifier.size(92.dp)
.constrainAs(logoRef) {
top.linkTo(parent.top, margin = 60.dp)
start.linkTo(parent.start, 16.dp)
end.linkTo(parent.end, 16.dp)
},
contentScale = ContentScale.Inside
contentScale = ContentScale.FillBounds
)

Text(
Expand Down Expand Up @@ -184,4 +179,13 @@ fun LoginScreen(navController: NavHostController, loginViewModel: LoginViewModel
}
}
}

LaunchedEffect(viewState?.isSuccess) {
if (viewState?.isSuccess == true) {
navController.navigate(Screen.Notes.route) {
launchSingleTop = true
popUpTo(NOTY_NAV_HOST_ROUTE)
}
}
}
}