Skip to content

Commit

Permalink
Merge pull request #21 from Team-Umbba/design/#19
Browse files Browse the repository at this point in the history
[Design/#19] 홈 화면 UI 구현
  • Loading branch information
ss99x2002 authored Jul 9, 2023
2 parents 5c69973 + 1a3c9e8 commit b08ad2f
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package com.sopt.umbba_android.presentation
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.fragment.app.Fragment
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityMainBinding
import com.sopt.umbba_android.presentation.home.HomeFragment
import com.sopt.umbba_android.presentation.qna.QuestionAnswerActivity
import com.sopt.umbba_android.util.binding.BindingActivity

class MainActivity : AppCompatActivity() {
class MainActivity :BindingActivity<ActivityMainBinding>(R.layout.activity_main){
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
startActivity(Intent(this, QuestionAnswerActivity::class.java))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.sopt.umbba_android.presentation.home

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import coil.load
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.FragmentHomeBinding
import com.sopt.umbba_android.util.binding.BindingFragment

class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setBackground()
}
private fun setBackground(){
with(binding){
ivBackground.load("https://i.ibb.co/sRV9Vr4/iv-maru.jpg")
}
}
}
Binary file added app/src/main/res/drawable/iv_maru.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/src/main/res/drawable/shape_grey_fill_r84_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="84dp" />
<solid android:color="@color/grey_code_btn" />
</shape>
12 changes: 7 additions & 5 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
<FrameLayout
android:id="@+id/fragment_fv"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
42 changes: 22 additions & 20 deletions app/src/main/res/layout/activity_question_answer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@
android:textAppearance="@style/AndroidSubHead1SemiBold20"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_answer_other"
android:layout_width="match_parent"
android:layout_height="172dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:background="@drawable/shape_grey_fill_r17_rect"
app:layout_constraintTop_toBottomOf="@id/tv_question_other">

<TextView
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_answer_other"
android:layout_width="match_parent"
android:layout_height="172dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:background="@drawable/shape_grey_fill_r17_rect"
app:layout_constraintTop_toBottomOf="@id/tv_question_other">

<TextView
android:id="@+id/tv_answer_other"
android:layout_width="match_parent"
android:layout_height="0dp"
Expand All @@ -68,17 +69,18 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_from_other"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:text="@string/question_answer_from_mom"
android:textAppearance="@style/BrandTypeSmallSemiBold16"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

<TextView
android:id="@+id/tv_from_other"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:text="@string/question_answer_from_mom"
android:textAppearance="@style/BrandTypeSmallSemiBold16"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

<TextView
android:id="@+id/tv_question_me"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_set_time.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
android:layout_height="60dp"
android:layout_marginHorizontal="24dp"
android:layout_marginVertical="24dp"
android:background="@drawable/sel_invite_code_btn_next"
android:background="@drawable/sel_btn_next"
android:enabled="true"
android:text="@string/invite_code_next"
android:text="@string/btn_next"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent" />
Expand Down
40 changes: 39 additions & 1 deletion app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:paddingHorizontal="40dp"
android:background="@drawable/shape_grey_fill_r84_rect"
android:textAppearance="@style/BrandTypeBigRegular20"
android:text="#1 가장 오래된 기억"
android:gravity="center"
android:textColor="@color/white"
android:layout_marginTop="40dp"
android:layout_marginStart="24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_answer"
android:layout_width="match_parent"
android:layout_height="60dp"
android:textSize="16sp"
android:text="@string/home_question_answer"
android:textColor="@color/white"
android:background="@drawable/shape_black_fill_r50_rect"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginHorizontal="24dp"
android:layout_marginBottom="12dp"/>
</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 @@ -70,4 +70,5 @@
<string name="question_answer_parent_question">할머니와 엄마의 꿈은 달랐어?</string>
<string name="question_answer_quesiton_me">당신과 어머니의 꿈은 달라?</string>
<string name="content_example">sdlkfjslkdjfklsdjfksdf\nsldkfjsldkjflksdjf</string>
<string name="home_question_answer">질문 답변하기</string>
</resources>

0 comments on commit b08ad2f

Please sign in to comment.