Skip to content

Commit

Permalink
#178 [ui] 새 루틴 선택 뷰 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
emjayMJkim committed Jun 24, 2024
1 parent 70a1d15 commit 99d262e
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.sopetit.softie.databinding.ActivityOnboardingBinding
import com.sopetit.softie.ui.LoadingIndicator
import com.sopetit.softie.ui.onboarding.bearnaming.BearNamingFragment
import com.sopetit.softie.ui.onboarding.bearselection.BearSelectionFragment
import com.sopetit.softie.ui.onboarding.routinechoice.RoutineChoiceFragment
import com.sopetit.softie.ui.onboarding.newroutinechoice.NewRoutineChoiceFragment
import com.sopetit.softie.ui.onboarding.themechoice.ChoiceThemeFragment
import com.sopetit.softie.util.binding.BindingActivity
import com.sopetit.softie.util.binding.BindingAdapter.setImage
Expand Down Expand Up @@ -141,7 +141,7 @@ class OnboardingActivity :
private fun initChangeRoutineChoice() {
viewModel.routineChoiceView.observe(this) { routineChoiceView ->
if (routineChoiceView) {
changeFragment(RoutineChoiceFragment())
changeFragment(NewRoutineChoiceFragment())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.sopetit.softie.ui.onboarding.newroutinechoice

import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import com.sopetit.softie.R
import com.sopetit.softie.databinding.FragmentOnboardingChoiceRoutineNewBinding
import com.sopetit.softie.util.binding.BindingFragment

class NewRoutineChoiceFragment :
BindingFragment<FragmentOnboardingChoiceRoutineNewBinding>(R.layout.fragment_onboarding_choice_routine_new) {

private val routineViewModel by viewModels<NewRoutineChoiceViewModel>()

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.routineViewModel = routineViewModel
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.sopetit.softie.ui.onboarding.newroutinechoice

import androidx.lifecycle.ViewModel

class NewRoutineChoiceViewModel : ViewModel() {
}
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/shape_gray300_fill_10_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/gray300"/>
<corners android:radius="10dp"/>

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

<data>

<import type="android.view.View" />

<variable
name="viewModel"
type="com.sopetit.softie.ui.onboarding.OnboardingViewModel" />

<variable
name="routineViewModel"
type="com.sopetit.softie.ui.onboarding.newroutinechoice.NewRoutineChoiceViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background">

<ImageView
android:id="@+id/iv_onboarding_choice_routine_title_bear"
android:layout_width="53dp"
android:layout_height="50dp"
android:layout_marginTop="34dp"
android:layout_marginStart="22dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<ImageView
android:id="@+id/iv_onboarding_choice_routine_speech_background"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginTop="29dp"
android:layout_marginStart="14dp"
android:layout_marginEnd="23dp"
android:background="@drawable/ic_speech_long"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_onboarding_choice_routine_title_bear"
app:layout_constraintEnd_toEndOf="parent" />

<TextView
android:id="@+id/tv_onboarding_choice_routine_speech"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="14dp"
android:text="@string/onboarding_choice_routine_speech"
android:textColor="@color/gray800"
android:textAppearance="@style/bubble16"
app:layout_constraintTop_toTopOf="@id/iv_onboarding_choice_routine_speech_background"
app:layout_constraintBottom_toBottomOf="@id/iv_onboarding_choice_routine_speech_background"
app:layout_constraintStart_toStartOf="@id/iv_onboarding_choice_routine_speech_background"
app:layout_constraintEnd_toEndOf="@id/iv_onboarding_choice_routine_speech_background" />

<TableLayout
android:id="@+id/tab_onboarding_choice_routine"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginHorizontal="22dp"
app:layout_constraintTop_toBottomOf="@id/iv_onboarding_choice_routine_speech_background"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewpager_onboarding_choice_routine"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tab_onboarding_choice_routine"
app:layout_constraintBottom_toBottomOf="parent" />

<androidx.appcompat.widget.AppCompatButton
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/onboarding_routine_choice_btn"
style="@style/body1"
android:paddingVertical="19dp"
android:textColor="@color/gray0"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="24dp"
android:background="@drawable/shape_gray300_fill_10_rect"
android:outlineProvider="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<string name="onboarding_routine_back_btn">테마 다시 고를래</string>
<string name="onboarding_routine_select_btn">친구 만날 준비 끝!</string>
<string name="onboarding_routine_notice">최대 3개 선택 가능합니다</string>
<string name="onboarding_routine_choice_btn">루틴을 3개 선택해 주세요</string>

<!-- story telling -->
<string name="story_telling_intro">오늘도 고된 하루였어..</string>
Expand Down

0 comments on commit 99d262e

Please sign in to comment.