-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Free-Pre/feature/initial_setting
[FEAT/#2]초기설정 화면구현
- Loading branch information
Showing
24 changed files
with
640 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,9 @@ android { | |
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
viewBinding{ | ||
enabled true | ||
} | ||
} | ||
|
||
dependencies { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/example/free_pre_android/FirstPeriodActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.free_pre_android | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.example.free_pre_android.databinding.ActivityFirstPeriodBinding | ||
|
||
class FirstPeriodActivity : AppCompatActivity() { | ||
private lateinit var viewBinding: ActivityFirstPeriodBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
viewBinding = ActivityFirstPeriodBinding.inflate(layoutInflater) | ||
setContentView(viewBinding.root) | ||
|
||
viewBinding.btnYes.setOnClickListener { | ||
val intent = Intent(this,RecentPeriodActivity::class.java) | ||
startActivity(intent) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/example/free_pre_android/NicknameActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.example.free_pre_android | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.example.free_pre_android.databinding.ActivityNicknameBinding | ||
|
||
class NicknameActivity : AppCompatActivity() { | ||
private lateinit var viewBinding: ActivityNicknameBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
viewBinding = ActivityNicknameBinding.inflate(layoutInflater) | ||
setContentView(viewBinding.root) | ||
|
||
viewBinding.btnNext.setOnClickListener { | ||
val intent = Intent(this, FirstPeriodActivity::class.java) | ||
startActivity(intent) | ||
} | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
app/src/main/java/com/example/free_pre_android/RecentPeriodActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.example.free_pre_android | ||
|
||
import android.content.Intent | ||
import android.graphics.Color | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.example.free_pre_android.databinding.ActivityRecentPeriodBinding | ||
|
||
class RecentPeriodActivity : AppCompatActivity() { | ||
private lateinit var viewBinding: ActivityRecentPeriodBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
viewBinding = ActivityRecentPeriodBinding.inflate(layoutInflater) | ||
setContentView(viewBinding.root) | ||
|
||
//초기화면 | ||
supportFragmentManager | ||
.beginTransaction() | ||
.replace(viewBinding.frameFragment.id,RecentPeriodStartFragment()) | ||
.commitAllowingStateLoss() | ||
//startBtn 색 채우기(초기) | ||
viewBinding.startBtn.setBackgroundResource(R.drawable.primary_light_filled_round_bg) | ||
//viewBinding.startBtn.setTextColor(application.resources.getColor(R.color.primary_dark)) | ||
viewBinding.startBtn.setTextColor(Color.parseColor("#1A2A46")) //dark | ||
|
||
//start 버튼 누를 시 | ||
viewBinding.startBtn.setOnClickListener{ | ||
supportFragmentManager | ||
.beginTransaction() | ||
.replace(viewBinding.frameFragment.id,RecentPeriodStartFragment()) | ||
.commitAllowingStateLoss() | ||
|
||
//startBtn 색 채우기-start 버튼 | ||
viewBinding.startBtn.setBackgroundResource(R.drawable.primary_light_filled_round_bg) | ||
viewBinding.startBtn.setTextColor(Color.parseColor("#1A2A46")) //dark | ||
|
||
//endBtn 색 없애기 - end 버튼 | ||
viewBinding.endBtn.setBackgroundResource(R.drawable.primary_light_dark_round_bg) | ||
viewBinding.endBtn.setTextColor(Color.parseColor("#FDE3F4")) | ||
} | ||
//end 버튼 누를 시 | ||
viewBinding.endBtn.setOnClickListener { | ||
supportFragmentManager | ||
.beginTransaction() | ||
.replace(viewBinding.frameFragment.id,RecentPeriodEndFragment()) | ||
.commitAllowingStateLoss() | ||
|
||
//endBtn 색 채우기-end 버튼 | ||
viewBinding.endBtn.setBackgroundResource(R.drawable.primary_light_filled_round_bg) | ||
viewBinding.endBtn.setTextColor(Color.parseColor("#1A2A46")) //dark | ||
|
||
//startBtn 색 없애기 -start 버튼 | ||
viewBinding.startBtn.setBackgroundResource(R.drawable.primary_light_dark_round_bg) | ||
viewBinding.startBtn.setTextColor(Color.parseColor("#FDE3F4")) | ||
|
||
} | ||
|
||
viewBinding.btnSave.setOnClickListener { | ||
val intent = Intent(this,MainActivity::class.java) | ||
startActivity(intent) | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/example/free_pre_android/RecentPeriodEndFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.example.free_pre_android | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
|
||
|
||
class RecentPeriodEndFragment : Fragment() { | ||
|
||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_recent_peroid_end, container, false) | ||
} | ||
|
||
|
||
|
||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/example/free_pre_android/RecentPeriodStartFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.free_pre_android | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
|
||
|
||
class RecentPeriodStartFragment : Fragment() { | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_recent_peroid_start, container, false) | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<item android:top="-10dp" | ||
android:right="-10dp" | ||
android:left="-10dp"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@null"/> | ||
|
||
<stroke android:width="10dp" | ||
android:color="@color/primary_dark"/> | ||
</shape> | ||
|
||
</item> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> | ||
<solid android:color="@color/primary_light"/> | ||
<stroke android:width="8dp" | ||
android:color="@color/primary_dark"/> | ||
<corners | ||
android:radius="40dp"></corners> | ||
|
||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:top="-10dp" | ||
android:bottom="-10dp" | ||
android:left="-10dp"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@color/primary_light"/> | ||
|
||
<stroke android:width="10dp" | ||
android:color="@color/primary_dark"/> | ||
</shape> | ||
|
||
</item> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> | ||
<solid android:color="@color/primary_dark"/> | ||
<stroke android:color="@color/primary_dark"/> | ||
|
||
<corners | ||
android:radius="20dp"/> | ||
|
||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> | ||
<solid android:color="@color/primary_dark"/> | ||
<stroke android:width="8dp" | ||
android:color="@color/primary_light"/> | ||
<corners | ||
android:radius="40dp"></corners> | ||
|
||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> | ||
<solid android:color="@color/primary_light"/> | ||
<corners | ||
android:radius="40dp"></corners> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:top="-10dp" | ||
android:right="-10dp" | ||
android:left="-10dp"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@null"/> | ||
|
||
<stroke android:width="8dp" | ||
android:color="@color/primary_light"/> | ||
</shape> | ||
|
||
</item> | ||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<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=".FirstPeriodActivity" | ||
android:background="@color/primary_light"> | ||
|
||
<TextView | ||
android:id="@+id/txt_start_first_period" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
android:layout_marginTop="143dp" | ||
android:text="Did you start\nyour first period?" | ||
android:textColor="@color/primary_dark" | ||
android:textSize="36dp" | ||
android:textStyle="bold" | ||
android:gravity="center"> | ||
</TextView> | ||
|
||
<Button | ||
android:id="@+id/btn_yes" | ||
android:layout_width="148dp" | ||
android:layout_height="148dp" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/txt_start_first_period" | ||
app:layout_constraintEnd_toStartOf="@id/btn_no" | ||
android:layout_marginStart="24dp" | ||
android:layout_marginTop="65dp" | ||
android:background="@drawable/primary_dark_round_bg" | ||
android:text="yes" | ||
android:textAllCaps="false" | ||
android:textColor="@color/primary_light" | ||
android:textSize="48dp"> | ||
</Button> | ||
|
||
<Button | ||
android:id="@+id/btn_no" | ||
android:layout_width="148dp" | ||
android:layout_height="148dp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/txt_start_first_period" | ||
app:layout_constraintStart_toEndOf="@id/btn_yes" | ||
android:layout_marginEnd="24dp" | ||
android:layout_marginTop="65dp" | ||
android:background="@drawable/primary_dark_round_bg" | ||
android:text="no" | ||
android:textAllCaps="false" | ||
android:textColor="@color/primary_light" | ||
android:textSize="48dp"> | ||
</Button> | ||
|
||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
Oops, something went wrong.