Skip to content

Commit

Permalink
πŸ”€ :: release v1.0.0
Browse files Browse the repository at this point in the history
πŸ”€ :: release v1.0.0
  • Loading branch information
shw0471 authored Dec 28, 2021
2 parents 3601a99 + 5b0168f commit 28d229f
Show file tree
Hide file tree
Showing 35 changed files with 1,290 additions and 34 deletions.
20 changes: 16 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

android {
compileSdk 30
compileSdk 31

defaultConfig {
applicationId "com.semicolon.semicolondesign"
minSdk 21
targetSdk 30
targetSdk 31
versionCode 1
versionName "1.0"

Expand All @@ -33,17 +33,29 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerVersion kotlin_version
}
buildFeatures {
compose true
}
}

dependencies {
implementation project(path: ':design')

implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

//compose
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation 'androidx.activity:activity-compose:1.4.0'
}
11 changes: 10 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.SemicolonDesign" />
android:theme="@style/Theme.SemicolonDesign">
<activity
android:name=".TestActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
235 changes: 235 additions & 0 deletions app/src/main/java/com/semicolon/semicolondesign/TestActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
package com.semicolon.semicolondesign

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.semicolon.design.button.*

class TestActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Column(
modifier = Modifier.verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
DefaultFillButton(text = "λ²„νŠΌ") { makeToast("κΈ°λ³Έ 꽉찬 λ²„νŠΌ 눌림") }
DefaultFillButton(text = "λ²„νŠΌ", isEnabled = false) {}
ColoredFillButton(text = "λ²„νŠΌ") { makeToast("컬러 꽉찬 λ²„νŠΌ 눌림") }
ColoredFillButton(text = "λ²„νŠΌ", isEnabled = false) {}

DefaultLargeButton(text = "λ²„νŠΌ") { makeToast("κΈ°λ³Έ 큰 λ²„νŠΌ 눌림") }
DefaultLargeButton(text = "λ²„νŠΌ", isEnabled = false) {}
ColoredLargeButton(text = "λ²„νŠΌ") { makeToast("색깔 큰 λ²„νŠΌ 눌림") }
ColoredLargeButton(text = "λ²„νŠΌ", isEnabled = false) {}
PaleColoredLargeButton(text = "λ²„νŠΌ") { makeToast("μ—°ν•œ 큰 λ²„νŠΌ 눌림") }
PaleColoredLargeButton(text = "λ²„νŠΌ", isEnabled = false) {}
OutlinedLargeButton(text = "λ²„νŠΌ") { makeToast("ν…Œλ‘λ¦¬ 큰 λ²„νŠΌ 눌림") }
OutlinedLargeButton(text = "λ²„νŠΌ", isEnabled = false) {}

Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
DefaultMediumButton(text = "λ²„νŠΌ") { makeToast("κΈ°λ³Έ 쀑간 λ²„νŠΌ 눌림") }
DefaultMediumButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
ColoredMediumButton(text = "λ²„νŠΌ") { makeToast("색깔 쀑간 λ²„νŠΌ 눌림") }
ColoredMediumButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
PaleColoredMediumButton(text = "λ²„νŠΌ") { makeToast("μ—°ν•œ 쀑간 λ²„νŠΌ 눌림") }
PaleColoredMediumButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
OutlinedMediumButton(text = "λ²„νŠΌ") { makeToast("ν…Œλ‘λ¦¬ 쀑간 λ²„νŠΌ 눌림") }
OutlinedMediumButton(text = "λ²„νŠΌ", isEnabled = false) {}
}

Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
ClearDefaultSmallButton(text = "λ²„νŠΌ") { makeToast("λ°°κ²½x κΈ°λ³Έ μž‘μ€ λ²„νŠΌ 눌림") }
ClearDefaultSmallButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
ClearDefaultSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.LEFT
) {
makeToast("μ™Όμͺ½ μ•„μ΄μ½˜ λ°°κ²½x κΈ°λ³Έ μž‘μ€ λ²„νŠΌ 눌림")
}
ClearDefaultSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.RIGHT
) {
makeToast("였λ₯Έμͺ½ μ•„μ΄μ½˜ λ°°κ²½x κΈ°λ³Έ μž‘μ€ λ²„νŠΌ 눌림")
}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
ClearColoredSmallButton(text = "λ²„νŠΌ") { makeToast("λ°°κ²½x 색깔 μž‘μ€ λ²„νŠΌ 눌림") }
ClearColoredSmallButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
ClearColoredSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.LEFT
) {
makeToast("μ™Όμͺ½ μ•„μ΄μ½˜ λ°°κ²½x 색깔 μž‘μ€ λ²„νŠΌ 눌림")
}
ClearColoredSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.RIGHT
) {
makeToast("였λ₯Έμͺ½ μ•„μ΄μ½˜ λ°°κ²½x 색깔 μž‘μ€ λ²„νŠΌ 눌림")
}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
LinkSmallButton(text = "λ²„νŠΌ") { makeToast("링크 μž‘μ€ λ²„νŠΌ 눌림") }
LinkSmallButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
LinkSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_north_east),
iconPosition = IconPosition.LEFT
) {
makeToast("μ™Όμͺ½ μ•„μ΄μ½˜ 링크 μž‘μ€ λ²„νŠΌ 눌림")
}
LinkSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_north_east),
iconPosition = IconPosition.RIGHT
) {
makeToast("였λ₯Έμͺ½ μ•„μ΄μ½˜ 링크 μž‘μ€ λ²„νŠΌ 눌림")
}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
DefaultSmallButton(text = "λ²„νŠΌ") { makeToast("κΈ°λ³Έ μž‘μ€ λ²„νŠΌ 눌림") }
DefaultSmallButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
DefaultSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.LEFT
) {
makeToast("μ™Όμͺ½ μ•„μ΄μ½˜ κΈ°λ³Έ μž‘μ€ λ²„νŠΌ 눌림")
}
DefaultSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.RIGHT
) {
makeToast("였λ₯Έμͺ½ μ•„μ΄μ½˜ κΈ°λ³Έ μž‘μ€ λ²„νŠΌ 눌림")
}
DefaultSmallButton(
text = "λ²„νŠΌ",
isLoading = true
) {
makeToast("λ‘œλ”©μ€‘ κΈ°λ³Έ μž‘μ€ λ²„νŠΌ 눌림")
}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
ColoredSmallButton(text = "λ²„νŠΌ") { makeToast("색깔 μž‘μ€ λ²„νŠΌ 눌림") }
ColoredSmallButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
ColoredSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.LEFT
) {
makeToast("μ™Όμͺ½ μ•„μ΄μ½˜ 색깔 μž‘μ€ λ²„νŠΌ 눌림")
}
ColoredSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.RIGHT
) {
makeToast("였λ₯Έμͺ½ μ•„μ΄μ½˜ 색깔 μž‘μ€ λ²„νŠΌ 눌림")
}
ColoredSmallButton(
text = "λ²„νŠΌ",
isLoading = true
) {
makeToast("λ‘œλ”©μ€‘ 색깔 μž‘μ€ λ²„νŠΌ 눌림")
}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
PaleColoredSmallButton(text = "λ²„νŠΌ") { makeToast("μ—°ν•œ 색깔 μž‘μ€ λ²„νŠΌ 눌림") }
PaleColoredSmallButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
PaleColoredSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.LEFT
) {
makeToast("μ™Όμͺ½ μ•„μ΄μ½˜ μ—°ν•œ 색깔 μž‘μ€ λ²„νŠΌ 눌림")
}
PaleColoredSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.RIGHT
) {
makeToast("였λ₯Έμͺ½ μ•„μ΄μ½˜ μ—°ν•œ 색깔 μž‘μ€ λ²„νŠΌ 눌림")
}
PaleColoredSmallButton(
text = "λ²„νŠΌ",
isLoading = true
) {
makeToast("λ‘œλ”©μ€‘ μ—°ν•œ 색깔 μž‘μ€ λ²„νŠΌ 눌림")
}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
OutlinedSmallButton(text = "λ²„νŠΌ") { makeToast("ν…Œλ‘λ¦¬ μž‘μ€ λ²„νŠΌ 눌림") }
OutlinedSmallButton(text = "λ²„νŠΌ", isEnabled = false) {}
}
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
OutlinedSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.LEFT
) {
makeToast("μ™Όμͺ½ μ•„μ΄μ½˜ ν…Œλ‘λ¦¬ μž‘μ€ λ²„νŠΌ 눌림")
}
OutlinedSmallButton(
text = "λ²„νŠΌ",
icon = painterResource(id = R.drawable.ic_favorite),
iconPosition = IconPosition.RIGHT
) {
makeToast("였λ₯Έμͺ½ μ•„μ΄μ½˜ ν…Œλ‘λ¦¬ μž‘μ€ λ²„νŠΌ 눌림")
}
OutlinedSmallButton(
text = "λ²„νŠΌ",
isLoading = true
) {
makeToast("λ‘œλ”©μ€‘ ν…Œλ‘λ¦¬ μž‘μ€ λ²„νŠΌ 눌림")
}
}

ToggleSwitch()
ToggleButton(items = arrayOf("λ²„νŠΌ", "λ²„νŠΌ"))
ToggleButton(items = arrayOf("λ²„νŠΌ", "λ²„νŠΌ", "λ²„νŠΌ"))
ToggleButton(items = arrayOf("λ²„νŠΌ", "λ²„νŠΌ", "λ²„νŠΌ", "λ²„νŠΌ"))
ToggleButton(items = arrayOf())
}
}
}

private fun makeToast(message: String) =
Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
}
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/ic_favorite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_north_east.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M9,5v2h6.59L4,18.59L5.41,20L17,8.41V15h2V5H9z"/>
</vector>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
buildscript {
ext {
compose_version = '1.0.5'
kotlin_version = '1.6.0'
kotlin_version = '1.5.31'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
10 changes: 10 additions & 0 deletions design/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerVersion kotlin_version
}
buildFeatures {
compose true
}
}

dependencies {
Expand All @@ -42,6 +49,9 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
}

afterEvaluate {
Expand Down
Loading

0 comments on commit 28d229f

Please sign in to comment.