Skip to content

Commit

Permalink
fix(subject): sửa lại code padding màn subject
Browse files Browse the repository at this point in the history
  • Loading branch information
nqmgaming committed Dec 29, 2024
1 parent 959ac24 commit bd524c3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ fun SearchStudySetBySubject(
) {
LazyColumn(
modifier = Modifier
.fillMaxSize(),
.fillMaxSize()
.padding(horizontal = 16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
item {
SearchTextField(
searchQuery = searchQuery,
onSearchQueryChange = { searchQuery = it },
placeholder = stringResource(R.string.txt_search_study_sets),
modifier = Modifier.padding(horizontal = 16.dp)
)
}
items(studySets?.itemCount ?: 0, key = { it }) { index ->
Expand All @@ -168,7 +168,6 @@ fun SearchStudySetBySubject(
)
) {
StudySetItem(
modifier = Modifier.padding(horizontal = 16.dp),
studySet = studySet,
onStudySetClick = { onStudySetClick(studySet) }
)
Expand Down Expand Up @@ -207,8 +206,7 @@ fun SearchStudySetBySubject(
Column(
modifier = Modifier
.fillMaxWidth()
.padding(innerPadding)
.padding(horizontal = 16.dp),
.padding(innerPadding),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(10.dp)
) {
Expand Down Expand Up @@ -243,8 +241,7 @@ fun SearchStudySetBySubject(
Column(
modifier = Modifier
.fillMaxWidth()
.padding(innerPadding)
.padding(horizontal = 16.dp),
.padding(innerPadding),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(10.dp)
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.pwhs.quickmem.presentation.app.library.component

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
Expand All @@ -10,7 +9,6 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme.colorScheme
import androidx.compose.material3.MaterialTheme.typography
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.TextFieldDefaults.colors
Expand Down Expand Up @@ -97,20 +95,12 @@ fun SearchTextField(
}
}

@Preview(showSystemUi = true)
@Preview(showBackground = true)
@Composable
private fun SearchTextFieldPreview() {
QuickMemTheme {
Scaffold(
topBar = {
SearchTextField(
placeholder = "Search..."
)
}
) {
Column(
modifier = Modifier.padding(it)
) { }
}
SearchTextField(
placeholder = "Search..."
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview

@Composable
Expand All @@ -21,17 +22,27 @@ fun QuickMemAlertDialog(
text: String,
confirmButtonTitle: String,
dismissButtonTitle: String,
buttonColor: Color = colorScheme.primary
buttonColor: Color = colorScheme.primary,
) {
AlertDialog(
containerColor = Color.White,
modifier = modifier,
onDismissRequest = onDismissRequest,
title = {
Text(text = title, style = typography.titleLarge)
Text(
text = title,
style = typography.titleLarge.copy(
fontWeight = FontWeight.Bold,
color = colorScheme.onBackground
)
)
},
text = {
Text(text = text)
Text(
text = text,
style = typography.bodyMedium,
color = colorScheme.onBackground
)
},
confirmButton = {
Button(
Expand Down

0 comments on commit bd524c3

Please sign in to comment.