From a08ed3ecf4e3b66a8bd358f56b211f4973bc83e3 Mon Sep 17 00:00:00 2001 From: ss99x2002 Date: Tue, 4 Jul 2023 17:22:00 +0900 Subject: [PATCH] =?UTF-8?q?[Design/#4]=20=EC=84=B8=EB=B6=80=20=EC=A7=88?= =?UTF-8?q?=EB=AC=B8=20fragment=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 3 + app/src/main/AndroidManifest.xml | 4 ++ .../com/sopt/umbba_android/MainActivity.kt | 3 +- .../presentation/onboarding/QuestActivity.kt | 17 ++++- .../onboarding/QuestSubFragment.kt | 21 ++++++ .../res/drawable/sel_quest_btn_answer.xml | 18 +++++ .../drawable/sel_quest_btn_text_answer.xml | 7 ++ .../res/drawable/shape_g300_fill_r50_rect.xml | 1 + .../res/drawable/shape_gd4d4_line_r8_rect.xml | 7 ++ app/src/main/res/layout/activity_quest.xml | 2 + .../main/res/layout/fragment_quest_one.xml | 66 +++++++++++++++++++ app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/styles.xml | 3 +- 13 files changed, 150 insertions(+), 3 deletions(-) create mode 100644 app/src/main/java/com/sopt/umbba_android/presentation/onboarding/QuestSubFragment.kt create mode 100644 app/src/main/res/drawable/sel_quest_btn_answer.xml create mode 100644 app/src/main/res/drawable/sel_quest_btn_text_answer.xml create mode 100644 app/src/main/res/drawable/shape_gd4d4_line_r8_rect.xml create mode 100644 app/src/main/res/layout/fragment_quest_one.xml diff --git a/app/build.gradle b/app/build.gradle index c5ea7487..44d8514a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -99,4 +99,7 @@ dependencies { def hilt_version = "2.42" implementation "com.google.dagger:hilt-android:$hilt_version" kapt "com.google.dagger:hilt-android-compiler:$hilt_version" + + //viewpager2 + implementation "androidx.viewpager2:viewpager2:1.0.0" } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 07cf552c..c5950dfc 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,6 +28,10 @@ android:exported="false" android:screenOrientation="portrait" android:windowSoftInputMode="adjustResize" /> + \ No newline at end of file diff --git a/app/src/main/java/com/sopt/umbba_android/MainActivity.kt b/app/src/main/java/com/sopt/umbba_android/MainActivity.kt index 4f78ed69..c6eb0a75 100644 --- a/app/src/main/java/com/sopt/umbba_android/MainActivity.kt +++ b/app/src/main/java/com/sopt/umbba_android/MainActivity.kt @@ -4,11 +4,12 @@ import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import com.sopt.umbba_android.presentation.onboarding.InviteCodeActivity +import com.sopt.umbba_android.presentation.onboarding.QuestActivity class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) - startActivity(Intent(this, InviteCodeActivity::class.java)) + startActivity(Intent(this, QuestActivity::class.java)) } } \ No newline at end of file diff --git a/app/src/main/java/com/sopt/umbba_android/presentation/onboarding/QuestActivity.kt b/app/src/main/java/com/sopt/umbba_android/presentation/onboarding/QuestActivity.kt index 6d204ffc..11499786 100644 --- a/app/src/main/java/com/sopt/umbba_android/presentation/onboarding/QuestActivity.kt +++ b/app/src/main/java/com/sopt/umbba_android/presentation/onboarding/QuestActivity.kt @@ -1,4 +1,19 @@ package com.sopt.umbba_android.presentation.onboarding -class QuestActivity { +import android.os.Bundle +import com.sopt.umbba_android.R +import androidx.fragment.app.Fragment +import com.sopt.umbba_android.databinding.ActivityQuestBinding +import com.sopt.umbba_android.util.binding.BindingActivity + +class QuestActivity : BindingActivity(R.layout.activity_quest) { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + changeFragment(QuestSubFragment()) + } + private fun changeFragment(fragment:Fragment){ + supportFragmentManager.beginTransaction() + .add(R.id.fragment_question,fragment) + .commit() + } } \ No newline at end of file diff --git a/app/src/main/java/com/sopt/umbba_android/presentation/onboarding/QuestSubFragment.kt b/app/src/main/java/com/sopt/umbba_android/presentation/onboarding/QuestSubFragment.kt new file mode 100644 index 00000000..8efbf63d --- /dev/null +++ b/app/src/main/java/com/sopt/umbba_android/presentation/onboarding/QuestSubFragment.kt @@ -0,0 +1,21 @@ +package com.sopt.umbba_android.presentation.onboarding + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import com.sopt.umbba_android.R +import com.sopt.umbba_android.databinding.FragmentQuestOneBinding +import com.sopt.umbba_android.util.binding.BindingFragment + +class QuestSubFragment : BindingFragment (R.layout.fragment_quest_one) { + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + return super.onCreateView(inflater, container, savedInstanceState) + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/sel_quest_btn_answer.xml b/app/src/main/res/drawable/sel_quest_btn_answer.xml new file mode 100644 index 00000000..0fb596a8 --- /dev/null +++ b/app/src/main/res/drawable/sel_quest_btn_answer.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/sel_quest_btn_text_answer.xml b/app/src/main/res/drawable/sel_quest_btn_text_answer.xml new file mode 100644 index 00000000..bc8948d8 --- /dev/null +++ b/app/src/main/res/drawable/sel_quest_btn_text_answer.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_g300_fill_r50_rect.xml b/app/src/main/res/drawable/shape_g300_fill_r50_rect.xml index 0e0b51fa..b7b8886c 100644 --- a/app/src/main/res/drawable/shape_g300_fill_r50_rect.xml +++ b/app/src/main/res/drawable/shape_g300_fill_r50_rect.xml @@ -1,3 +1,4 @@ + diff --git a/app/src/main/res/drawable/shape_gd4d4_line_r8_rect.xml b/app/src/main/res/drawable/shape_gd4d4_line_r8_rect.xml new file mode 100644 index 00000000..75596d43 --- /dev/null +++ b/app/src/main/res/drawable/shape_gd4d4_line_r8_rect.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_quest.xml b/app/src/main/res/layout/activity_quest.xml index d4ccf907..73a29f9f 100644 --- a/app/src/main/res/layout/activity_quest.xml +++ b/app/src/main/res/layout/activity_quest.xml @@ -50,6 +50,7 @@ android:layout_marginHorizontal="24dp"/> + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_quest_one.xml b/app/src/main/res/layout/fragment_quest_one.xml new file mode 100644 index 00000000..260a33a6 --- /dev/null +++ b/app/src/main/res/layout/fragment_quest_one.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 112ad257..8f75aa89 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -13,6 +13,7 @@ #CFCFCF #EAEAEA #D4D4D4 + #747474 #E5E5E5 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 798d93ca..634bcfc9 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -9,7 +9,6 @@ + + \ No newline at end of file