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

#19 [ui] 데일리 루틴 뷰 구현 #34

Merged
merged 22 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fcbcde5
[ui] 데일리루틴 엠티뷰 빈 박스 만들기
minemi00 Jan 10, 2024
121c7f4
[ui] 데일리루틴 달성완료 박스 만들기
minemi00 Jan 10, 2024
cd20751
Merge branch 'develop' of https://github.com/Team-Sopetit/Sopetit-And…
minemi00 Jan 10, 2024
15ff717
[ui] 리스트 개수별 상자 띄우기
minemi00 Jan 10, 2024
6d2cc9f
[ui] 라디오버튼 셀렉터 만들기
minemi00 Jan 10, 2024
a27312a
[ui] 상자 간격 문제 해결
minemi00 Jan 10, 2024
9fbf126
[ui] 데일리루틴 삭제 뷰 작업
minemi00 Jan 10, 2024
361d6c5
[ui] 확인용 액티비티 만들기
minemi00 Jan 10, 2024
1a198aa
[add] string 추출하기
minemi00 Jan 10, 2024
fc539e7
[chore] manifest에 액티비티 추가
minemi00 Jan 10, 2024
b5480a1
Merge branch 'develop' of https://github.com/Team-Sopetit/Sopetit-And…
minemi00 Jan 10, 2024
057eab6
[chore] 상단바 안보이게 수정하기
minemi00 Jan 10, 2024
ec98ae8
[refact] 라디오버튼 셀렉트 리팩토링
minemi00 Jan 10, 2024
d3dee0c
[chore] 폴더링 및 네이밍 수정
minemi00 Jan 11, 2024
21c90c2
[chore] 폴더링 및 네이밍 한번 더 수정
minemi00 Jan 11, 2024
207d04c
[add] 데일리루틴 뷰모델이랑 편집 뷰모델 분리
minemi00 Jan 11, 2024
c56d07d
[chore] manifest 돌려놓기
minemi00 Jan 11, 2024
1a772e5
[chore] 삭제 비활성화 버튼 추가 및 버튼 패딩 수정
minemi00 Jan 11, 2024
f2a247b
Merge branch 'develop' of https://github.com/Team-Sopetit/Sopetit-And…
minemi00 Jan 11, 2024
31d99f6
[chore] 코드리뷰 반영
minemi00 Jan 11, 2024
09d6019
Merge branch 'develop' of https://github.com/Team-Sopetit/Sopetit-And…
minemi00 Jan 11, 2024
95c084d
[chore] 파일명 변경
minemi00 Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
android:exported="false"
android:screenOrientation="portrait" />


<activity
android:name=".ui.dailyroutine.dailyroutineedit.DailyRoutineEditActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name=".ui.dailyroutine.DailyRoutineActivity"
android:exported="false"
android:screenOrientation="portrait" />

<activity
android:name=".ui.storytelling.StoryTellingActivity"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.sopetit.softie.ui.dailyroutine

import android.os.Bundle
import com.sopetit.softie.R
import com.sopetit.softie.databinding.ActivitySampleBinding
import com.sopetit.softie.util.binding.BindingActivity

class DailyRoutineActivity : BindingActivity<ActivitySampleBinding>(R.layout.activity_sample) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initFragment()
}

private fun initFragment() {
val currentFragment = supportFragmentManager.findFragmentById(R.id.fcv_empty_fragment)
if (currentFragment == null) {
supportFragmentManager.beginTransaction()
.add(R.id.fcv_empty_fragment, DailyRoutineFragment())
.commit()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.sopetit.softie.ui.dailyroutine

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import com.sopetit.softie.R
import com.sopetit.softie.databinding.FragmentDailyRoutineBinding
import com.sopetit.softie.ui.dailyroutine.dailyroutineedit.DailyRoutineEditActivity
import com.sopetit.softie.util.binding.BindingFragment

class DailyRoutineFragment :
BindingFragment<FragmentDailyRoutineBinding>(R.layout.fragment_daily_routine) {

private val dailyRoutineViewModel by viewModels<DailyRoutineViewModel>()

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

binding.lifecycleOwner = this
binding.dailyRoutineViewModel = dailyRoutineViewModel

moveEdit()
}

private fun moveEdit() {
binding.tvDailyRoutineEdit.setOnClickListener {
val intent = Intent(requireActivity(), DailyRoutineEditActivity::class.java)
startActivity(intent)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.sopetit.softie.ui.dailyroutine

import androidx.lifecycle.ViewModel

class DailyRoutineViewModel : ViewModel() {
val routineAddList = listOf<Int>(1, 2)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.sopetit.softie.ui.dailyroutine.dailyroutineedit

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.activity.viewModels
import com.sopetit.softie.R
import com.sopetit.softie.databinding.ActivityDailyRoutineEditBinding
import com.sopetit.softie.ui.dailyroutine.DailyRoutineActivity
import com.sopetit.softie.util.binding.BindingActivity

class DailyRoutineEditActivity :
BindingActivity<ActivityDailyRoutineEditBinding>(R.layout.activity_daily_routine_edit) {
private val dailyRoutineEditViewModel by viewModels<DailyRoutineEditViewModel>()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

binding.lifecycleOwner = this
binding.dailyRoutineEditViewModel = dailyRoutineEditViewModel

moveDaily()
selectBtn()
}

private fun moveDaily() {
binding.tvDailyRoutineEditCancel.setOnClickListener {
val intent = Intent(this, DailyRoutineActivity::class.java)
startActivity(intent)
}
}

private fun selectBtn() {
with(binding) {
setButtonClickListener(btnDailyRoutineEditRadioEmptyFirst)
setButtonClickListener(btnDailyRoutineEditRadioEmptySecond)
setButtonClickListener(btnDailyRoutineEditRadioEmptyThird)
}
}

private fun setButtonClickListener(button: View) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수화 좋아요~~

button.setOnClickListener {
it.isSelected = !it.isSelected
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.sopetit.softie.ui.dailyroutine.dailyroutineedit

import androidx.lifecycle.ViewModel

class DailyRoutineEditViewModel : ViewModel() {
val routineAddList = listOf<Int>(1, 2)
}
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_daily.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:pathData="M22.892,2.908H17.169V13.169L9.769,5.77L5.723,9.816L13.122,17.215L2.861,17.215V22.938H12.835L5.723,30.051L9.77,34.097L17.169,26.698V37.246H22.892V26.986L30.004,34.097L34.05,30.051L26.938,22.938H37.2V17.215L26.652,17.215L34.051,9.816L30.004,5.77L22.892,12.881V2.908Z"
android:fillColor="#FFDC43"
android:fillType="evenOdd"/>
<path
android:pathData="M17.169,2.908V2.158C16.755,2.158 16.419,2.493 16.419,2.908H17.169ZM22.892,2.908H23.642C23.642,2.493 23.306,2.158 22.892,2.158V2.908ZM17.169,13.169L16.639,13.699C16.853,13.914 17.176,13.978 17.456,13.862C17.736,13.746 17.919,13.472 17.919,13.169H17.169ZM9.769,5.77L10.3,5.239C10.159,5.099 9.968,5.02 9.769,5.02C9.571,5.02 9.38,5.099 9.239,5.239L9.769,5.77ZM5.723,9.816L5.192,9.286C4.899,9.579 4.899,10.054 5.192,10.347L5.723,9.816ZM13.122,17.215L13.122,17.965C13.425,17.965 13.698,17.783 13.815,17.502C13.931,17.222 13.866,16.9 13.652,16.685L13.122,17.215ZM2.861,17.215L2.861,16.465C2.447,16.465 2.111,16.801 2.111,17.215H2.861ZM2.861,22.938H2.111C2.111,23.353 2.447,23.688 2.861,23.688V22.938ZM12.835,22.938L13.365,23.469C13.58,23.254 13.644,22.932 13.528,22.652C13.412,22.371 13.138,22.188 12.835,22.188V22.938ZM5.723,30.051L5.193,29.52C5.052,29.661 4.973,29.852 4.973,30.051C4.973,30.249 5.052,30.44 5.193,30.581L5.723,30.051ZM9.77,34.097L9.239,34.628C9.532,34.921 10.007,34.921 10.3,34.628L9.77,34.097ZM17.169,26.698H17.919C17.919,26.395 17.736,26.121 17.456,26.005C17.176,25.889 16.853,25.953 16.639,26.168L17.169,26.698ZM17.169,37.246H16.419C16.419,37.66 16.755,37.996 17.169,37.996V37.246ZM22.892,37.246V37.996C23.306,37.996 23.642,37.66 23.642,37.246H22.892ZM22.892,26.986L23.422,26.455C23.208,26.241 22.885,26.177 22.605,26.293C22.325,26.409 22.142,26.682 22.142,26.986H22.892ZM30.004,34.097L29.473,34.628C29.614,34.768 29.805,34.847 30.004,34.847C30.202,34.847 30.393,34.768 30.534,34.628L30.004,34.097ZM34.05,30.051L34.581,30.581C34.874,30.288 34.874,29.813 34.581,29.52L34.05,30.051ZM26.938,22.938V22.188C26.635,22.188 26.362,22.371 26.246,22.652C26.129,22.932 26.194,23.254 26.408,23.469L26.938,22.938ZM37.2,22.938V23.688C37.614,23.688 37.95,23.353 37.95,22.938H37.2ZM37.2,17.215H37.95C37.95,17.017 37.871,16.826 37.73,16.685C37.59,16.544 37.399,16.465 37.2,16.465L37.2,17.215ZM26.652,17.215L26.121,16.685C25.907,16.9 25.843,17.222 25.959,17.502C26.075,17.783 26.348,17.965 26.652,17.965L26.652,17.215ZM34.051,9.816L34.581,10.347C34.874,10.054 34.874,9.579 34.581,9.286L34.051,9.816ZM30.004,5.77L30.534,5.239C30.394,5.099 30.203,5.02 30.004,5.02C29.805,5.02 29.614,5.099 29.474,5.239L30.004,5.77ZM22.892,12.881H22.142C22.142,13.185 22.325,13.458 22.605,13.574C22.885,13.69 23.208,13.626 23.422,13.412L22.892,12.881ZM17.169,3.658H22.892V2.158H17.169V3.658ZM17.919,13.169V2.908H16.419V13.169H17.919ZM9.239,6.3L16.639,13.699L17.699,12.639L10.3,5.239L9.239,6.3ZM6.253,10.347L10.3,6.3L9.239,5.239L5.192,9.286L6.253,10.347ZM13.652,16.685L6.253,9.286L5.192,10.347L12.591,17.746L13.652,16.685ZM2.861,17.965L13.122,17.965L13.122,16.465L2.861,16.465L2.861,17.965ZM3.611,22.938V17.215H2.111V22.938H3.611ZM12.835,22.188H2.861V23.688H12.835V22.188ZM6.253,30.581L13.365,23.469L12.305,22.408L5.193,29.52L6.253,30.581ZM10.3,33.567L6.253,29.52L5.193,30.581L9.239,34.628L10.3,33.567ZM16.639,26.168L9.239,33.567L10.3,34.628L17.699,27.229L16.639,26.168ZM17.919,37.246V26.698H16.419V37.246H17.919ZM22.892,36.496H17.169V37.996H22.892V36.496ZM22.142,26.986V37.246H23.642V26.986H22.142ZM30.534,33.567L23.422,26.455L22.362,27.516L29.473,34.628L30.534,33.567ZM33.52,29.52L29.473,33.567L30.534,34.628L34.581,30.581L33.52,29.52ZM26.408,23.469L33.52,30.581L34.581,29.52L27.469,22.408L26.408,23.469ZM37.2,22.188H26.938V23.688H37.2V22.188ZM36.45,17.215V22.938H37.95V17.215H36.45ZM26.652,17.965L37.2,17.965L37.2,16.465L26.652,16.465L26.652,17.965ZM33.52,9.286L26.121,16.685L27.182,17.746L34.581,10.347L33.52,9.286ZM29.474,6.3L33.52,10.347L34.581,9.286L30.534,5.239L29.474,6.3ZM23.422,13.412L30.534,6.3L29.474,5.239L22.362,12.351L23.422,13.412ZM22.142,2.908V12.881H23.642V2.908H22.142Z"
android:fillColor="#EBCA39"/>
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_daily_fin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<group>
<clip-path
android:pathData="M0,0h12v12h-12z"/>
<path
android:pathData="M3,1.5C2.735,1.5 2.48,1.605 2.293,1.793C2.105,1.98 2,2.235 2,2.5V10.5C2,10.633 2.053,10.76 2.146,10.854C2.24,10.947 2.367,11 2.5,11C2.633,11 2.76,10.947 2.854,10.854C2.947,10.76 3,10.633 3,10.5V8H9.902C10.003,8 10.103,7.972 10.189,7.919C10.276,7.866 10.346,7.79 10.392,7.7C10.438,7.609 10.458,7.508 10.45,7.407C10.443,7.306 10.407,7.209 10.347,7.127L8.618,4.75L10.346,2.374C10.406,2.291 10.441,2.195 10.45,2.093C10.458,1.992 10.437,1.891 10.391,1.801C10.345,1.71 10.275,1.634 10.189,1.581C10.102,1.528 10.003,1.5 9.901,1.5H3Z"
android:fillColor="#9FA4A9"/>
</group>
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_daily_plus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M10.5,20C10.5,20.398 10.658,20.779 10.939,21.061C11.221,21.342 11.602,21.5 12,21.5C12.398,21.5 12.779,21.342 13.061,21.061C13.342,20.779 13.5,20.398 13.5,20V13.5H20C20.398,13.5 20.779,13.342 21.061,13.061C21.342,12.779 21.5,12.398 21.5,12C21.5,11.602 21.342,11.221 21.061,10.939C20.779,10.658 20.398,10.5 20,10.5H13.5V4C13.5,3.602 13.342,3.221 13.061,2.939C12.779,2.658 12.398,2.5 12,2.5C11.602,2.5 11.221,2.658 10.939,2.939C10.658,3.221 10.5,3.602 10.5,4V10.5H4C3.602,10.5 3.221,10.658 2.939,10.939C2.658,11.221 2.5,11.602 2.5,12C2.5,12.398 2.658,12.779 2.939,13.061C3.221,13.342 3.602,13.5 4,13.5H10.5V20Z"
android:fillColor="#CACDD2"/>
</group>
</vector>
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/ic_radio_click.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:strokeWidth="1"
android:pathData="M10,10m-9.5,0a9.5,9.5 0,1 1,19 0a9.5,9.5 0,1 1,-19 0"
android:fillColor="#F76D6D"
android:strokeColor="#F76D6D"/>
<path
android:pathData="M12.971,6.97C13.111,6.836 13.299,6.762 13.493,6.763C13.688,6.765 13.874,6.842 14.013,6.978C14.152,7.114 14.232,7.299 14.238,7.493C14.243,7.688 14.172,7.877 14.041,8.02L10.051,13.01C9.982,13.084 9.899,13.143 9.807,13.184C9.715,13.226 9.616,13.248 9.515,13.25C9.414,13.251 9.314,13.233 9.22,13.195C9.127,13.158 9.042,13.101 8.971,13.03L6.325,10.384C6.251,10.315 6.192,10.233 6.151,10.141C6.11,10.049 6.088,9.949 6.086,9.849C6.084,9.748 6.103,9.648 6.141,9.554C6.178,9.461 6.234,9.376 6.306,9.305C6.377,9.234 6.462,9.178 6.555,9.14C6.648,9.102 6.748,9.084 6.849,9.085C6.95,9.087 7.049,9.109 7.141,9.15C7.233,9.191 7.316,9.25 7.385,9.324L9.479,11.417L12.952,6.992C12.958,6.984 12.964,6.977 12.971,6.97Z"
android:fillColor="#ffffff"/>
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/ic_radio_empty.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:strokeWidth="1"
android:pathData="M10,10m-9.5,0a9.5,9.5 0,1 1,19 0a9.5,9.5 0,1 1,-19 0"
android:fillColor="#E9EBED"
android:strokeColor="#CACDD2"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/selector_daily_edit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@drawable/ic_radio_click"/>
<item android:state_selected="false" android:drawable="@drawable/ic_radio_empty"/>
</selector>
8 changes: 8 additions & 0 deletions app/src/main/res/drawable/shape_gray100_fill_10_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<corners android:radius="10dp" />
<solid android:color="@color/gray100" />

</shape>
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/shape_gray200_line_20_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<corners android:radius="20dp" />
<solid android:color="@android:color/transparent" />
<stroke
android:color="@color/gray200"
android:width="1dp"
android:dashWidth="10dp"
android:dashGap="5dp" />
</shape>
8 changes: 8 additions & 0 deletions app/src/main/res/drawable/shape_main1_fill_10_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<corners android:radius="10dp" />
<solid android:color="@color/main1" />

</shape>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<corners android:radius="20dp"/>
<solid android:color="@color/white"/>
<stroke android:color="@color/gray100"
android:width="1dp"/>

</shape>
Loading