forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Milestone/#2
- Loading branch information
Showing
181 changed files
with
6,247 additions
and
1,423 deletions.
There are no files selected for viewing
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
1,245 changes: 1,232 additions & 13 deletions
1,245
Android/moment-android/app/src/main/java/com/capstone/android/application/MainActivity.kt
Large diffs are not rendered by default.
Oops, something went wrong.
140 changes: 140 additions & 0 deletions
140
...t-android/app/src/main/java/com/capstone/android/application/app/composable/Composable.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,140 @@ | ||
package com.capstone.android.application.app.composable | ||
|
||
import android.util.Log | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.interaction.MutableInteractionSource | ||
import androidx.compose.foundation.layout.Row | ||
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.foundation.text.KeyboardActions | ||
import androidx.compose.foundation.text.KeyboardOptions | ||
import androidx.compose.material.ExperimentalMaterialApi | ||
import androidx.compose.material.TextFieldDefaults | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.ModalBottomSheet | ||
import androidx.compose.material3.SheetState | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.MutableState | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.rememberCoroutineScope | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.focus.FocusDirection | ||
import androidx.compose.ui.focus.FocusManager | ||
import androidx.compose.ui.focus.FocusRequester | ||
import androidx.compose.ui.focus.focusRequester | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.input.KeyboardType | ||
import androidx.compose.ui.text.input.VisualTransformation | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import androidx.core.graphics.toColorInt | ||
import com.capstone.android.application.ui.theme.HintText | ||
import com.capstone.android.application.ui.theme.PretendardFamily | ||
import com.capstone.android.application.ui.theme.black | ||
import com.capstone.android.application.ui.theme.neutral_100 | ||
import com.capstone.android.application.ui.theme.tertiary_500 | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun BottomSheetRecord(sheetState: SheetState, onClicked:() -> Unit,onDismiss:() -> Unit){ | ||
val scope = rememberCoroutineScope() | ||
ModalBottomSheet( | ||
sheetState = sheetState, | ||
onDismissRequest = onDismiss | ||
) { | ||
// LazyColumn( | ||
// modifier = Modifier.padding(bottom = WindowInsets.navigationBars.getBottom(LocalDensity.current).dp/2) , | ||
// horizontalAlignment = Alignment.CenterHorizontally | ||
// ){ | ||
// item { | ||
// Text( | ||
// color = Color("#4992FF".toColorInt()), | ||
// text = "녹음", | ||
// fontSize = 20.sp, | ||
// fontWeight = FontWeight.Bold | ||
// ) | ||
// Spacer(modifier = Modifier.height(4.dp)) | ||
// } | ||
// | ||
// } | ||
} | ||
} | ||
|
||
@OptIn(ExperimentalMaterialApi::class) | ||
@Composable | ||
fun MomentTextField( | ||
hint: String, onValueChanged: (String) -> Unit, onClicked: (Boolean) -> Unit, text: MutableState<String>, | ||
keyboardType: KeyboardType = KeyboardType.Text, changecolor:Color, | ||
focusRequester: FocusRequester, move: String, focusManager: FocusManager | ||
){ | ||
//move | ||
/* manyfirstmove 는 여러개 있는 상황에서 next를 사용해야할 경우 request가 필요 | ||
manynextmove 는 여러개 있는 상황에서 next를 사용해야할 경우 request가 안필요 | ||
manyendmove 는 여러개 있는 상황에서 clear를 사용해야할 경우 request가 안필요 | ||
onemove 는 하나 있는 상황이라 clear를 사용하며 request가 필요*/ | ||
//textclick | ||
BasicTextField( | ||
keyboardOptions = KeyboardOptions(keyboardType = keyboardType), | ||
maxLines = 1, | ||
value = if(text.value.length>20) text.value.removeRange(10,text.value.length) else text.value, | ||
onValueChange = onValueChanged, | ||
singleLine = true, | ||
textStyle = TextStyle( | ||
color = black, | ||
fontFamily = PretendardFamily, | ||
fontWeight = FontWeight.Medium, | ||
fontSize = 18.sp), | ||
keyboardActions = KeyboardActions(onDone = { | ||
if(move =="manyfirstmove" || move == "manynextmove") focusManager.moveFocus( | ||
FocusDirection.Next) | ||
else focusManager.clearFocus() | ||
}), | ||
modifier = if(move == "manyfirstmove" || move == "onemove") Modifier | ||
.fillMaxWidth() | ||
.background( | ||
color = tertiary_500 | ||
) | ||
.padding(horizontal = 8.dp) | ||
.focusRequester(focusRequester) | ||
.clickable { Log.d("tjgus", "MomentTextField: tjgus") } | ||
else Modifier | ||
.fillMaxWidth() | ||
.background( | ||
color = tertiary_500 | ||
) | ||
.padding(horizontal = 8.dp) | ||
.clickable { Log.d("tjgus", "MomentTextField: tjgus") } | ||
|
||
){ | ||
Row(){ | ||
TextFieldDefaults.TextFieldDecorationBox( | ||
value = /*if(text.value.length>20) text.value.removeRange(10,text.value.length) else */text.value, | ||
visualTransformation = VisualTransformation.None, | ||
innerTextField = it, | ||
singleLine = true, | ||
enabled = true, | ||
// same interaction source as the one passed to BasicTextField to read focus state | ||
// for text field styling | ||
placeholder = { if (text.value.isNotEmpty()) HintText(content = "") else HintText(hint) }, | ||
colors = TextFieldDefaults.textFieldColors( | ||
textColor = black | ||
), | ||
interactionSource = remember { MutableInteractionSource() }, | ||
// keep vertical paddings but change the horizontal | ||
contentPadding = TextFieldDefaults.textFieldWithoutLabelPadding( | ||
start = 0.dp, top = 1.dp, end = 1.dp, bottom = 3.dp | ||
) | ||
) | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
|
13 changes: 13 additions & 0 deletions
13
...nt-android/app/src/main/java/com/capstone/android/application/app/screen/BottomNavItem.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,13 @@ | ||
package com.capstone.android.application.app.screen | ||
|
||
import com.capstone.android.application.R | ||
|
||
sealed class BottomNavItem( | ||
val title: Int,val screenRoute: String, val label:String,val selectedDrawableId:Int , val unselectedDrawableId:Int | ||
) { | ||
object Home : BottomNavItem(title = 0 , screenRoute = "Home",label = "홈", selectedDrawableId = R.drawable.ic_nav_home_black, unselectedDrawableId = R.drawable.ic_nav_home_grey) | ||
object Receipt : BottomNavItem(title = 1 , screenRoute = "Receipt",label = "영수증",selectedDrawableId = R.drawable.ic_nav_receipt_black, unselectedDrawableId = R.drawable.ic_nav_receipt_grey) | ||
object Record : BottomNavItem(title = 2 , screenRoute = "Record",label = "녹음",selectedDrawableId = 0, unselectedDrawableId = 0) | ||
object Favorite : BottomNavItem(title = 3 , screenRoute = "Favorite",label = "즐겨찾기",selectedDrawableId = R.drawable.ic_nav_heart_black, unselectedDrawableId = R.drawable.ic_nav_heart_grey) | ||
object Setting : BottomNavItem(title = 4 , screenRoute = "Setting",label = "세팅",selectedDrawableId = R.drawable.ic_nav_setting_black, unselectedDrawableId = R.drawable.ic_nav_setting_grey) | ||
} |
11 changes: 11 additions & 0 deletions
11
...oment-android/app/src/main/java/com/capstone/android/application/app/screen/MainScreen.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,11 @@ | ||
package com.capstone.android.application.app.screen | ||
|
||
sealed class MainScreen( | ||
val title: Int,val screenRoute: String,val rootRoute:String , val label:String | ||
){ | ||
|
||
object ReceiptPost : MainScreen(title = 5, screenRoute = "ReceiptPost", rootRoute = "Receipt", label = "영수증 만들기") | ||
object ReceiptCardChoice : MainScreen(title = 6, screenRoute = "ReceiptCardChoice", rootRoute = "Receipt", label = "카드 선택") | ||
object HomeTrip : MainScreen(title = 7, screenRoute = "HomeTrip", rootRoute = "Home" ,label = "홈 여행") | ||
object RecordDaily : MainScreen(title = 8, screenRoute = "RecordDaily", rootRoute = "Home", label = "일상기록") | ||
} |
55 changes: 55 additions & 0 deletions
55
Android/moment-android/app/src/main/java/com/capstone/android/application/ui/CardActivity.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,55 @@ | ||
package com.capstone.android.application.ui | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.navigation.NavHostController | ||
import androidx.navigation.compose.NavHost | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.compose.rememberNavController | ||
|
||
class CardActivity:ComponentActivity() { | ||
lateinit var navController: NavHostController | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContent{ | ||
navController = rememberNavController() | ||
Column( | ||
modifier = Modifier.fillMaxSize() | ||
) { | ||
Text( | ||
modifier = Modifier.clickable { | ||
navController.navigate("detail") | ||
}, | ||
text = "카드뷰" | ||
) | ||
|
||
NavHost( | ||
navController, | ||
startDestination = "main", | ||
) { | ||
composable("detail"){ | ||
cardDetail() | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
@Composable | ||
fun cardDetail(){ | ||
Column( | ||
modifier = Modifier.fillMaxSize() | ||
) { | ||
Text(text = "카드뷰 상세") | ||
} | ||
} | ||
} |
Oops, something went wrong.