diff --git a/app/build.gradle b/app/build.gradle index 7ec64c3..44b58d6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,6 +30,9 @@ android { kotlinOptions { jvmTarget = '1.8' } + viewBinding{ + enabled true + } } dependencies { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e5d87cd..39dcd92 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,8 +12,17 @@ android:supportsRtl="true" android:theme="@style/Theme.FreePreAndroid" tools:targetApi="31"> + + + diff --git a/app/src/main/java/com/example/free_pre_android/FirstPeriodActivity.kt b/app/src/main/java/com/example/free_pre_android/FirstPeriodActivity.kt new file mode 100644 index 0000000..6c65a3f --- /dev/null +++ b/app/src/main/java/com/example/free_pre_android/FirstPeriodActivity.kt @@ -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) + } + } +} diff --git a/app/src/main/java/com/example/free_pre_android/MainActivity.kt b/app/src/main/java/com/example/free_pre_android/MainActivity.kt index eb855c2..028baac 100644 --- a/app/src/main/java/com/example/free_pre_android/MainActivity.kt +++ b/app/src/main/java/com/example/free_pre_android/MainActivity.kt @@ -2,8 +2,10 @@ package com.example.free_pre_android import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import com.example.free_pre_android.databinding.ActivityMainBinding class MainActivity : AppCompatActivity() { + private lateinit var viewBinding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) diff --git a/app/src/main/java/com/example/free_pre_android/NicknameActivity.kt b/app/src/main/java/com/example/free_pre_android/NicknameActivity.kt new file mode 100644 index 0000000..92537f1 --- /dev/null +++ b/app/src/main/java/com/example/free_pre_android/NicknameActivity.kt @@ -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) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/free_pre_android/RecentPeriodActivity.kt b/app/src/main/java/com/example/free_pre_android/RecentPeriodActivity.kt new file mode 100644 index 0000000..9931647 --- /dev/null +++ b/app/src/main/java/com/example/free_pre_android/RecentPeriodActivity.kt @@ -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) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/free_pre_android/RecentPeriodEndFragment.kt b/app/src/main/java/com/example/free_pre_android/RecentPeriodEndFragment.kt new file mode 100644 index 0000000..0c5f84b --- /dev/null +++ b/app/src/main/java/com/example/free_pre_android/RecentPeriodEndFragment.kt @@ -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) + } + + + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/free_pre_android/RecentPeriodStartFragment.kt b/app/src/main/java/com/example/free_pre_android/RecentPeriodStartFragment.kt new file mode 100644 index 0000000..4694372 --- /dev/null +++ b/app/src/main/java/com/example/free_pre_android/RecentPeriodStartFragment.kt @@ -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) + } + + +} \ No newline at end of file diff --git a/app/src/main/res/drawable/primary_dark_bottom_line.xml b/app/src/main/res/drawable/primary_dark_bottom_line.xml new file mode 100644 index 0000000..eb48dac --- /dev/null +++ b/app/src/main/res/drawable/primary_dark_bottom_line.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/primary_dark_light_round_bg.xml b/app/src/main/res/drawable/primary_dark_light_round_bg.xml new file mode 100644 index 0000000..fa96de9 --- /dev/null +++ b/app/src/main/res/drawable/primary_dark_light_round_bg.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/primary_dark_right_line.xml b/app/src/main/res/drawable/primary_dark_right_line.xml new file mode 100644 index 0000000..03f952a --- /dev/null +++ b/app/src/main/res/drawable/primary_dark_right_line.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/primary_dark_round_bg.xml b/app/src/main/res/drawable/primary_dark_round_bg.xml new file mode 100644 index 0000000..130eb6c --- /dev/null +++ b/app/src/main/res/drawable/primary_dark_round_bg.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/primary_light_dark_round_bg.xml b/app/src/main/res/drawable/primary_light_dark_round_bg.xml new file mode 100644 index 0000000..83b6ff4 --- /dev/null +++ b/app/src/main/res/drawable/primary_light_dark_round_bg.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/primary_light_filled_round_bg.xml b/app/src/main/res/drawable/primary_light_filled_round_bg.xml new file mode 100644 index 0000000..7893f10 --- /dev/null +++ b/app/src/main/res/drawable/primary_light_filled_round_bg.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/primary_light_line.xml b/app/src/main/res/drawable/primary_light_line.xml new file mode 100644 index 0000000..d7d8056 --- /dev/null +++ b/app/src/main/res/drawable/primary_light_line.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_first_period.xml b/app/src/main/res/layout/activity_first_period.xml new file mode 100644 index 0000000..f86243b --- /dev/null +++ b/app/src/main/res/layout/activity_first_period.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_nickname.xml b/app/src/main/res/layout/activity_nickname.xml new file mode 100644 index 0000000..4b6a24f --- /dev/null +++ b/app/src/main/res/layout/activity_nickname.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_recent_period.xml b/app/src/main/res/layout/activity_recent_period.xml new file mode 100644 index 0000000..c21ae48 --- /dev/null +++ b/app/src/main/res/layout/activity_recent_period.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + +