Skip to content

Commit

Permalink
[Design/#4] 세부 질문 fragment 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
ss99x2002 committed Jul 4, 2023
1 parent faf814f commit a08ed3e
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
android:exported="false"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".presentation.onboarding.QuestActivity"
android:exported="false"
android:screenOrientation="portrait" />
</application>

</manifest>
3 changes: 2 additions & 1 deletion app/src/main/java/com/sopt/umbba_android/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Original file line number Diff line number Diff line change
@@ -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<ActivityQuestBinding>(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()
}
}
Original file line number Diff line number Diff line change
@@ -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<FragmentQuestOneBinding> (R.layout.fragment_quest_one) {

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return super.onCreateView(inflater, container, savedInstanceState)
}
}
18 changes: 18 additions & 0 deletions app/src/main/res/drawable/sel_quest_btn_answer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false">
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<stroke android:width="1dp" android:color="@color/grey_CFCFCF" />
<solid android:color="@color/grey_EAEAEA" />
</shape>
</item>
<item android:state_checked="true">
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<stroke android:color="@color/grey_CFCFCF"
android:width="1dp"/>
<solid android:color="@color/grey_747474"/>
</shape>
</item>
</selector>
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/sel_quest_btn_text_answer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/white">
</item>
<item android:state_checked="false" android:color="@color/black">
</item>
</selector>
1 change: 1 addition & 0 deletions app/src/main/res/drawable/shape_g300_fill_r50_rect.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="50dp" />
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/shape_gd4d4_line_r8_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="8dp" />
<stroke android:color="@color/grey_D4D4D4"
android:width="1dp"/>
<solid android:color="@color/white"/>
</shape>
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_quest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
android:layout_marginHorizontal="24dp"/>

<FrameLayout
android:id="@+id/fragment_question"
android:layout_width="match_parent"
android:layout_height="335dp"
android:layout_marginHorizontal="24dp"
Expand All @@ -67,6 +68,7 @@
android:textColor="@color/white"
android:text="@string/btn_next"
android:background="@drawable/sel_invite_code_btn_next"/>

</androidx.constraintlayout.widget.ConstraintLayout>

</layout>
66 changes: 66 additions & 0 deletions app/src/main/res/layout/fragment_quest_one.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="335dp"
android:background="@drawable/shape_gd4d4_line_r8_rect">

<TextView
android:id="@+id/tv_question"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="18dp"
android:text="어머니와 지금 같이 살고 있어?"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_question"
app:layout_constraintBottom_toBottomOf="parent">

<RadioButton
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginBottom="12dp"
android:text="응!"
android:textSize="16sp"
android:textAlignment="center"
android:background="@drawable/sel_quest_btn_answer"
android:button="@null"
android:textColor="@drawable/sel_quest_btn_text_answer" />

<RadioButton
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginBottom="12dp"
android:text="아니"
android:textSize="16sp"
android:textAlignment="center"
android:background="@drawable/sel_quest_btn_answer"
android:button="@null"
android:textColor="@drawable/sel_quest_btn_text_answer" />

<RadioButton
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="애매해"
android:textSize="16sp"
android:textAlignment="center"
android:background="@drawable/sel_quest_btn_answer"
android:button="@null"
android:textColor="@drawable/sel_quest_btn_text_answer" />
</RadioGroup>
</androidx.constraintlayout.widget.ConstraintLayout>

</layout>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<color name="grey_CFCFCF">#CFCFCF</color>
<color name="grey_EAEAEA">#EAEAEA</color>
<color name="grey_D4D4D4">#D4D4D4</color>
<color name="grey_747474">#747474</color>
<color name="grey_btn">#E5E5E5</color>


Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
</style>

<style name="TextInputLayoutStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">

<!--FilledBox일 경우 밑줄 색상, OutlinedBox일 경우 테두리 색상-->
<item name="boxStrokeColor">@color/sel_invite_code_input_layout</item>
<!--Error-->
Expand All @@ -30,4 +29,6 @@
<item name="android:includeFontPadding">false</item>
<item name="android:textSize">16sp</item>
</style>


</resources>

0 comments on commit a08ed3e

Please sign in to comment.