This repository has been archived by the owner on May 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added new line in Constants.kt * Note card ui component added which will be inflated in lazy column to show all notes (#35) * Added CODEOWNERS files (#33) * Adding CONTRIBUTING.md * Added CONTRIBUTING.md and squashed commits * Updated branch naming convention Updated branch naming convention with github-username * 1. Added database schema (entity) 2. Added database functions (dao) 3. Added how to fetch paging data 4. Added LazyColumn UI with paging data with different states like loading, success, error Signed-off-by: Rajesh Hadiya <[email protected]> * Added CODEOWNERS files. (#19) * Adding CODEOWNERS files. Still needed to add the Default reviewer for the two teams. * Update CODEOWNERS * fix the validation issues on GitHub. * updated owners for all the branches. * updated the Wrong branch combinations. Signed-off-by: Rajesh Hadiya <[email protected]> Co-authored-by: Hritik Kumar Singh <[email protected]> Co-authored-by: Abhinav Suman <[email protected]> * NoteCardView for all notes ui made * Create main.yml * Update main.yml * Update main.yml * Some improvements done generalised the code * Some ui improvements and code to inflate all card views added Signed-off-by: Rajesh Hadiya <[email protected]> Co-authored-by: Rajesh Hadiya <[email protected]> Co-authored-by: Hritik Kumar Singh <[email protected]> Co-authored-by: Abhinav Suman <[email protected]> Co-authored-by: Rajesh Hadiya <[email protected]> Signed-off-by: Rajesh Hadiya <[email protected]> Co-authored-by: Swapnil bhojwani <[email protected]> Co-authored-by: Hritik Kumar Singh <[email protected]> Co-authored-by: Abhinav Suman <[email protected]>
- Loading branch information
1 parent
f0e708c
commit 7d3e5fd
Showing
6 changed files
with
133 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
app/src/main/java/com/hadiyarajesh/notex/ui/component/AllNotesComponents.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package com.hadiyarajesh.notex.ui.component | ||
|
||
import androidx.compose.foundation.layout.* | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Card | ||
import androidx.compose.material3.CardDefaults | ||
import androidx.compose.material3.Divider | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.hadiyarajesh.notex.database.converter.InstantConverter | ||
import com.hadiyarajesh.notex.database.entity.Note | ||
import java.time.Instant | ||
|
||
@Composable | ||
fun NoteCard(note: Note) { | ||
Card( | ||
elevation = CardDefaults.cardElevation(), | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(start = 16.dp, end = 16.dp, top = 16.dp), | ||
shape = RoundedCornerShape(16.dp) | ||
) { | ||
Column( | ||
verticalArrangement = Arrangement.Center, | ||
modifier = Modifier.padding(16.dp) | ||
) { | ||
note.title?.let { | ||
TextSemiBold( | ||
content = it, | ||
null, | ||
MaterialTheme.typography.titleLarge, Color.Black | ||
) | ||
} | ||
Row( | ||
Modifier | ||
.fillMaxWidth() | ||
.padding(top = 16.dp) | ||
) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.height(IntrinsicSize.Min) | ||
.weight(1f) | ||
) { | ||
TextSemiBold( | ||
content = "Succeed", Modifier.padding(end = 8.dp) | ||
) | ||
Divider( | ||
color = Color.Gray, modifier = Modifier | ||
.fillMaxHeight() | ||
.width(1.dp) | ||
) | ||
TextSemiBold(content = "Goal", Modifier.padding(start = 8.dp)) | ||
} | ||
Row( | ||
Modifier | ||
.fillMaxWidth() | ||
.weight(1f), horizontalArrangement = Arrangement.End | ||
) { | ||
TextSemiBold( | ||
content = InstantConverter.getLocalDate(note.createdOn).toString() | ||
) | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
@Preview | ||
@Composable | ||
fun NoteCardPrev() { | ||
NoteCard( | ||
Note( | ||
noteId = 12345, | ||
title = "Note title", | ||
content = "Note content", | ||
archived = false, | ||
createdOn = Instant.now(), | ||
updatedOn = Instant.now() | ||
) | ||
) | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/hadiyarajesh/notex/ui/component/TextComposables.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.hadiyarajesh.notex.ui.component | ||
|
||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.text.font.FontWeight | ||
|
||
|
||
@Composable | ||
fun TextSemiBold( | ||
content: String, | ||
modifier: Modifier? = Modifier, | ||
textStyle: TextStyle? = null, | ||
color: Color? = null | ||
) { | ||
Text( | ||
text = content, fontWeight = FontWeight.SemiBold, | ||
color = color ?: Color.Gray, | ||
modifier = modifier ?: Modifier, | ||
style = textStyle ?: TextStyle.Default | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ object Constants { | |
} | ||
} | ||
|
||
const val TAG = Constants.App.APP_NAME | ||
const val TAG = Constants.App.APP_NAME |