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

수료 제출 #100

Open
wants to merge 79 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
8dc2212
Greeting Text implemented
aprilgom Dec 3, 2022
f4deec9
New Greetings text
aprilgom Dec 3, 2022
2b08bc4
Greetings from added
aprilgom Dec 3, 2022
74e771f
Greeting aligned
aprilgom Dec 3, 2022
4d64e07
App run
aprilgom Dec 3, 2022
c9e4768
Image added
aprilgom Dec 3, 2022
d398266
Image Composable with Text
aprilgom Dec 3, 2022
e08a854
Image Composable with Text
aprilgom Dec 3, 2022
da78c0b
Image Scale
aprilgom Dec 3, 2022
502be96
Padding
aprilgom Dec 3, 2022
158e723
Text resources extracted
aprilgom Dec 3, 2022
f5fb422
Texts aligned center
aprilgom Dec 3, 2022
6f8e79a
preview
aprilgom Dec 3, 2022
4225df2
preview
aprilgom Dec 3, 2022
e54d63a
build
aprilgom Dec 3, 2022
7dec83e
ComposableInfoCard
aprilgom Dec 3, 2022
63d8418
ComposableInfoCard
aprilgom Dec 3, 2022
072d7a5
app build
aprilgom Dec 3, 2022
4fb6c2f
image and texts placed
aprilgom Dec 3, 2022
d4dd74a
fill max
aprilgom Dec 3, 2022
d6b88a8
Layout infra
aprilgom Dec 4, 2022
02cc5e1
Vertical Layout
aprilgom Dec 4, 2022
f432c56
Button added
aprilgom Dec 4, 2022
c359744
Image placed
aprilgom Dec 4, 2022
67d60ea
Logic build
aprilgom Dec 4, 2022
2165dc4
Init
aprilgom Dec 5, 2022
bdd1bc7
App implemented
aprilgom Dec 5, 2022
0d2a343
Init
aprilgom Dec 6, 2022
7fe7b39
Init
aprilgom Dec 6, 2022
7d65fc0
Title placed
aprilgom Dec 6, 2022
bef9333
using state in compose
aprilgom Dec 6, 2022
ceb7639
save state with remember
aprilgom Dec 7, 2022
eba908e
appearance modified
aprilgom Dec 7, 2022
ec2e616
calculating tips
aprilgom Dec 7, 2022
23c1760
tip amount displayed
aprilgom Dec 7, 2022
05a7ff2
state hoisted
aprilgom Dec 7, 2022
16ca461
folder modified
aprilgom Dec 7, 2022
6cfefc6
Tip percent field placed
aprilgom Dec 7, 2022
35675cd
ImeAction added
aprilgom Dec 7, 2022
b870ab6
Focus added
aprilgom Dec 7, 2022
7abc7ac
RoundUp Switch added
aprilgom Dec 7, 2022
3d418a5
test written
aprilgom Dec 7, 2022
145e16f
Instrument test done
aprilgom Dec 7, 2022
2bce1ef
TitleBox
aprilgom Dec 7, 2022
2980e29
App prototype
aprilgom Dec 7, 2022
643fdeb
App implemented
aprilgom Dec 7, 2022
3153012
Folder moved
aprilgom Dec 7, 2022
74973c4
App implemented
aprilgom Dec 7, 2022
783f9c7
icon patched
aprilgom Dec 7, 2022
ae2e4e2
debug icon patched
aprilgom Dec 7, 2022
d679c11
color
aprilgom Dec 13, 2022
03de14a
shape
aprilgom Dec 13, 2022
5f432ec
font
aprilgom Dec 13, 2022
12f6460
topappbar
aprilgom Dec 13, 2022
2a3e81b
expand button added
aprilgom Dec 13, 2022
1206997
hobby added
aprilgom Dec 13, 2022
6157b93
expand
aprilgom Dec 13, 2022
7dac85d
spring animation added
aprilgom Dec 13, 2022
5413c7a
onStart
aprilgom Dec 13, 2022
5545c17
life span log
aprilgom Dec 13, 2022
4904dd3
saveable test
aprilgom Dec 13, 2022
4cc76d6
saveable roll back
aprilgom Dec 13, 2022
b8c8761
view model added
aprilgom Dec 13, 2022
03a4cf7
view model added
aprilgom Dec 13, 2022
0175cf3
view model design
aprilgom Dec 13, 2022
e244191
Guess word check
aprilgom Dec 13, 2022
f53f8ea
Score update and skip
aprilgom Dec 13, 2022
b6acb28
Final score dialog
aprilgom Dec 13, 2022
72f05ef
view model init
aprilgom Dec 13, 2022
75cb7e8
log deleted
aprilgom Dec 13, 2022
10cf2af
viewModel implement raw
aprilgom Dec 13, 2022
f84847f
viewModel refactored
aprilgom Dec 13, 2022
0c2a300
useless comment removed
aprilgom Dec 13, 2022
007ff6d
NavHost
aprilgom Dec 15, 2022
2a3e806
Navigate between routes
aprilgom Dec 15, 2022
5b6c669
share
aprilgom Dec 15, 2022
c2a0da0
AppBar
aprilgom Dec 15, 2022
6f18694
test written
aprilgom Dec 15, 2022
bf6a69c
Screen Test written
aprilgom Dec 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

123 changes: 123 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.example.happybirthday

import android.os.Bundle
Expand All @@ -30,6 +31,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
Expand All @@ -38,23 +40,61 @@ import com.example.happybirthday.ui.theme.HappyBirthdayTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent { }
setContent {
HappyBirthdayTheme {
Surface(color = MaterialTheme.colors.background) {
BirthdayGreetingWithImage(
message = getString(R.string.happy_birthday_text),
from = getString(R.string.signature_text)
)
}
}
}
}
}

// 7. 텍스트 정렬 및 패딩 추가
@Composable
fun BirthdayGreetingWithText(message: String, from: String) {
// Create a column so that texts don't overlap
Column { }
fun BirthdayGreetingWithImage(message: String, from: String) {
val image = painterResource(id = R.drawable.androidparty)
Box{
Image(
painter = image,
contentDescription = null,
modifier = Modifier
.fillMaxHeight()
.fillMaxHeight(),
contentScale = ContentScale.Crop
)
BirthdayGreetingWithText(message = message, from = from)
}
}

// 5. Box 레이아웃 추
@Preview(showBackground = true)
@Composable
fun BirthdayGreetingWithImage(message: String, from: String) { }
private fun BirthdayCardPreview() {
HappyBirthdayTheme{
BirthdayGreetingWithImage("Happy Birthday Sam", "- from Emma")
}
}

// 4. 이미지 컴포저블 추가
@Preview(showBackground = false)
@Composable
private fun BirthdayCardPreview() { }

private fun BirthdayGreetingWithText(message: String, from: String) {
Column(){
Text(
text = message,
fontSize = 36.sp,
modifier = Modifier
.fillMaxWidth()
.wrapContentWidth(Alignment.CenterHorizontally)
.padding(start = 16.dp, top = 16.dp),
)
Text(
text = from,
fontSize = 24.sp,
modifier = Modifier
.fillMaxWidth()
.wrapContentWidth(Alignment.CenterHorizontally)
.padding(start = 16.dp, end = 16.dp)
)
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
-->
<resources>
<string name="app_name">Happy Birthday</string>
<string name="happy_birthday_text">Happy Birthday Sam</string>
<string name="signature_text">from emma</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.*
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
Expand All @@ -24,12 +23,24 @@ import com.example.composearticle.ui.theme.ComposeArticleTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent { }
setContent {
ComposeArticleApp()
}
}
}

@Composable
fun ComposeArticleApp() { }
fun ComposeArticleApp() {
val image = painterResource(id = R.drawable.bg_compose_background)
ComposeArticleTheme() {
ArticleCard(
title = stringResource(R.string.title),
shortDescription = stringResource(R.string.shortdescription),
longDescription = stringResource(R.string.longdescription),
imagePainter = image
)
}
}

@Composable
private fun ArticleCard(
Expand All @@ -39,10 +50,51 @@ private fun ArticleCard(
imagePainter: Painter,
modifier: Modifier = Modifier,
) {
Column() { }
Column() {

Image(
imagePainter,
contentDescription = null,
modifier = Modifier.fillMaxWidth()
)
Text(
title,
fontSize = 24.sp,
modifier = Modifier
.padding(
start = 16.dp,
end = 16.dp,
top = 16.dp,
bottom = 16.dp
)
)

Text(
shortDescription,
modifier = Modifier
.padding(
start = 16.dp,
end = 16.dp
),
textAlign = TextAlign.Justify
)
Text(
longDescription,
modifier = Modifier
.padding(
start = 16.dp,
end = 16.dp,
top = 16.dp,
bottom = 16.dp
),
textAlign = TextAlign.Justify
)
}
}


@Preview(showBackground = true)
@Composable
fun DefaultPreview() { }
fun DefaultPreview() {
ComposeArticleApp()
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
<string name="title_jetpack_compose_tutorial">Jetpack Compose tutorial</string>
<string name="compose_short_desc">Jetpack Compose is a modern toolkit for building native Android UI. Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.</string>
<string name="compose_long_desc">In this tutorial, you build a simple UI component with declarative functions. You call Compose functions to say what elements you want and the Compose compiler does the rest. Compose is built around Composable functions. These functions let you define your app\'s UI programmatically because they let you describe how it should look and provide data dependencies, rather than focus on the process of the UI\'s construction, such as initializing an element and then attaching it to a parent. To create a Composable function, you add the @Composable annotation to the function name.</string>
<string name="title">Jetpack Compose tutorial</string>
<string name="shortdescription">Jetpack Compose is a modern toolkit for building native Android UI. Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.</string>
<string name="longdescription">In this tutorial, you build a simple UI component with declarative functions. You call Compose functions to say what elements you want and the Compose compiler does the rest. Compose is built around Composable functions. These functions let you define your app\'s UI programmatically because they let you describe how it should look and provide data dependencies, rather than focus on the process of the UI\'s construction, such as initializing an element and then attaching it to a parent. To create a Composable function, you add the @Composable annotation to the function name.</string>
</resources>
Loading