Skip to content

Commit

Permalink
(lina) Feat: 학기화면 UI 완성
Browse files Browse the repository at this point in the history
  • Loading branch information
imi21123 committed Feb 4, 2024
1 parent 4547aa8 commit e06d286
Show file tree
Hide file tree
Showing 39 changed files with 680 additions and 41 deletions.
4 changes: 1 addition & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 14 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
android:supportsRtl="true"
android:theme="@style/Theme.CampusNote"
tools:targetApi="31">

<activity android:name=".MainActivity"
android:exported="false"/>

<activity
android:name=".semester.SemesterActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="false" />
<activity
android:name=".LoginActivity"
android:exported="true">
Expand All @@ -28,22 +30,23 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:host="oauth"
<data
android:host="oauth"
android:scheme="kakao3fb9a572bb1f2e3cd66d370d2f7888dd" />
</intent-filter>
</activity>

<activity android:name=".signUp.SignUpActivity"
android:exported="false"/>

<activity
android:name=".signUp.SignUpActivity"
android:exported="false" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.notation.campusnote.semester

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.notation.campusnote.R
import com.notation.campusnote.databinding.ActivitySemesterBinding

class SemesterActivity : AppCompatActivity() {
private lateinit var binding: ActivitySemesterBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivitySemesterBinding.inflate(layoutInflater)
setContentView(binding.root)

val semesterList: ArrayList<SemesterList> = arrayListOf()
binding.rvSemester.layoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)
binding.rvSemester.adapter = SemesterRVAdapter(semesterList)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.notation.campusnote.semester

import com.google.gson.annotations.SerializedName

data class SemesterList(
@SerializedName("semester") val semester: String,
@SerializedName("noteNum") val noteNum: Int
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.notation.campusnote.semester

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.notation.campusnote.databinding.ItemSemesterListBinding

class SemesterRVAdapter(private val semesterList: List<SemesterList>):
RecyclerView.Adapter<SemesterRVAdapter.ViewHolder>() {
class ViewHolder(private var binding: ItemSemesterListBinding): RecyclerView.ViewHolder(binding.root) {
val semester = binding.semester
val noteNum = binding.noteNum
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val binding = ItemSemesterListBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return ViewHolder(binding)
}

override fun getItemCount(): Int = semesterList.size

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.semester.text = semesterList[position].semester
holder.noteNum.text = semesterList[position].noteNum.toString()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class SignUp4Fragment : Fragment() {
savedInstanceState: Bundle?
): View? {
_binding = FragmentSignUp4Binding.inflate(inflater, container, false)
binding.
return binding.root
}

Expand Down
43 changes: 29 additions & 14 deletions app/src/main/java/com/notation/campusnote/signUp/SignUpActivity.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.notation.campusnote.signUp

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.notation.campusnote.R
import com.notation.campusnote.databinding.ActivitySignUpBinding
import com.notation.campusnote.semester.SemesterActivity

interface OnFragmentInteractionListener {
fun onFragmentInteraction(isFinalFragment: Boolean)
Expand All @@ -17,6 +19,15 @@ class SignUpActivity : AppCompatActivity(), OnFragmentInteractionListener {
private lateinit var binding: ActivitySignUpBinding
private var currentFragmentIndex = 1 // 현재 프래그먼트 인덱스

// 프래그먼트 로드 함수
private fun loadFragment(fragment: Fragment) {
supportFragmentManager.beginTransaction().apply {
replace(binding.signUpFrame.id, fragment)
addToBackStack(null) // 프래그먼트 교체를 백 스택에 추가
commit()
}
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivitySignUpBinding.inflate(layoutInflater)
Expand All @@ -36,19 +47,26 @@ class SignUpActivity : AppCompatActivity(), OnFragmentInteractionListener {
loadFragment(SignUp2Fragment())
currentFragmentIndex++
}

2 -> {
loadFragment(SignUp3Fragment())
currentFragmentIndex++
}

3 -> {
loadFragment(SignUp4Fragment())
currentFragmentIndex++
// 마지막 프래그먼트에 도달했을 때 인터페이스 호출
onFragmentInteraction(isFinalFragment = true)
}

4 -> {
// 여기에 완료 버튼이 눌렸을 때의 로직을 구현합니다.
// 예: 데이터 저장, 결과 화면으로 전환 등
// 완료 버튼이 눌렸을 때 SemesterActivity 시작
val intent = Intent(this, SemesterActivity::class.java)
// 필요한 경우 intent에 데이터 추가
// 예: intent.putExtra("key", value)
startActivity(intent)
finish() // SignUpActivity 종료 }
}
}
}
Expand All @@ -60,47 +78,44 @@ class SignUpActivity : AppCompatActivity(), OnFragmentInteractionListener {
// 첫 번째 프래그먼트 (SignUp1Fragment)에서 뒤로 가기를 누르면 앱 종료
finish()
}

supportFragmentManager.backStackEntryCount == 1 -> {
// 마지막 프래그먼트에서 뒤로 가기를 누를 경우
binding.signUpNextBtn.background = ContextCompat.getDrawable(this, R.drawable.sign_up_next_btn_background)
binding.signUpNextBtn.background =
ContextCompat.getDrawable(this, R.drawable.sign_up_next_btn_background)
currentFragmentIndex--
super.onBackPressed()
}

supportFragmentManager.backStackEntryCount > 1 -> {
// 백 스택에 두 개 이상의 프래그먼트가 있는 경우 이전 프래그먼트로 돌아감
supportFragmentManager.popBackStack()
currentFragmentIndex--
}

else -> {
// 백 스택이 비어있으면 기본 동작을 수행
super.onBackPressed()
}
}
}

// 프래그먼트 로드 함수
private fun loadFragment(fragment: Fragment) {
supportFragmentManager.beginTransaction().apply {
replace(binding.signUpFrame.id, fragment)
addToBackStack(null) // 프래그먼트 교체를 백 스택에 추가
commit()
}
}

override fun onFragmentInteraction(isFinalFragment: Boolean) {
if (isFinalFragment) {
binding.signUpNextBtn.apply {
text = "완료"
//setBackgroundColor(ContextCompat.getColor(context, R.color.black))
// 또는 배경을 drawable 리소스로 설정하는 경우
background = ContextCompat.getDrawable(context, R.drawable.sign_up_done_btn_background)
background =
ContextCompat.getDrawable(context, R.drawable.sign_up_done_btn_background)
}
} else {
binding.signUpNextBtn.apply {
text = "다음"
//setBackgroundColor(ContextCompat.getColor(context, R.color.your_original_color))
// 또는 배경을 drawable 리소스로 설정하는 경우
background = ContextCompat.getDrawable(context, R.drawable.sign_up_next_btn_background)
background =
ContextCompat.getDrawable(context, R.drawable.sign_up_next_btn_background)
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/btn_edit_semester.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:pathData="M18.4,26.069H26.4M5.6,26.069L11.421,24.896C11.73,24.834 12.014,24.681 12.237,24.458L25.269,11.42C25.893,10.795 25.893,9.781 25.268,9.157L22.507,6.399C21.882,5.775 20.869,5.775 20.245,6.4L7.212,19.44C6.989,19.663 6.837,19.946 6.775,20.254L5.6,26.069Z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#FCFCFC"
android:strokeLineCap="round"/>
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/btn_node_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="28dp"
android:height="28dp"
android:viewportWidth="28"
android:viewportHeight="28">
<path
android:pathData="M16.333,11.667V19.833M11.667,11.667V19.833M7,7V20.767C7,22.073 7,22.726 7.254,23.226C7.478,23.665 7.835,24.022 8.274,24.246C8.772,24.5 9.426,24.5 10.73,24.5H17.27C18.575,24.5 19.227,24.5 19.725,24.246C20.164,24.022 20.522,23.665 20.746,23.226C21,22.727 21,22.074 21,20.77V7M7,7H9.333M7,7H4.667M9.333,7H18.667M9.333,7C9.333,5.913 9.333,5.369 9.511,4.941C9.748,4.369 10.202,3.914 10.774,3.678C11.202,3.5 11.746,3.5 12.833,3.5H15.167C16.254,3.5 16.798,3.5 17.226,3.678C17.798,3.914 18.252,4.369 18.489,4.941C18.667,5.369 18.667,5.913 18.667,7M18.667,7H21M21,7H23.333"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#B1B1B1"
android:strokeLineCap="round"/>
</vector>
16 changes: 16 additions & 0 deletions app/src/main/res/drawable/btn_semester_add.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22dp"
android:height="22dp"
android:viewportWidth="22"
android:viewportHeight="22">
<path
android:pathData="M1,11C1,16.523 5.477,21 11,21C16.523,21 21,16.523 21,11C21,5.477 16.523,1 11,1C5.477,1 1,5.477 1,11Z"
android:fillColor="#FCFCFC"/>
<path
android:strokeWidth="1"
android:pathData="M6.556,11H11M11,11H15.444M11,11V15.444M11,11V6.556M11,21C5.477,21 1,16.523 1,11C1,5.477 5.477,1 11,1C16.523,1 21,5.477 21,11C21,16.523 16.523,21 11,21Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#4076FF"
android:strokeLineCap="round"/>
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/btn_slider.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:pathData="M13.333,24H29M13.333,24C13.333,22.159 11.841,20.667 10,20.667C8.159,20.667 6.667,22.159 6.667,24M13.333,24C13.333,25.841 11.841,27.333 10,27.333C8.159,27.333 6.667,25.841 6.667,24M3,24H6.667M25.333,16H29M25.333,16C25.333,14.159 23.841,12.667 22,12.667C20.159,12.667 18.667,14.159 18.667,16M25.333,16C25.333,17.841 23.841,19.333 22,19.333C20.159,19.333 18.667,17.841 18.667,16M3,16H18.667M17.333,8H29M17.333,8C17.333,6.159 15.841,4.667 14,4.667C12.159,4.667 10.667,6.159 10.667,8M17.333,8C17.333,9.841 15.841,11.333 14,11.333C12.159,11.333 10.667,9.841 10.667,8M3,8H10.667"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#ffffff"
android:strokeLineCap="round"/>
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_calendar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M6.5,5.25H6C5.3,5.25 4.95,5.25 4.682,5.386C4.447,5.506 4.256,5.697 4.136,5.932C4,6.2 4,6.55 4,7.25V7.75M6.5,5.25H11.5M6.5,5.25V4M11.5,5.25H12C12.7,5.25 13.05,5.25 13.317,5.386C13.552,5.506 13.744,5.697 13.864,5.932C14,6.2 14,6.549 14,7.248V7.75M11.5,5.25V4M4,7.75V13.25C4,13.95 4,14.3 4.136,14.567C4.256,14.803 4.447,14.994 4.682,15.114C4.95,15.25 5.299,15.25 5.998,15.25H12.002C12.701,15.25 13.05,15.25 13.317,15.114C13.552,14.994 13.744,14.803 13.864,14.567C14,14.3 14,13.951 14,13.252V7.75M4,7.75H14M11.5,12.75H11.501L11.501,12.751L11.5,12.751V12.75ZM9,12.75H9.001L9.001,12.751L9,12.751V12.75ZM6.5,12.75H6.501L6.501,12.751L6.5,12.751V12.75ZM11.501,10.25V10.251L11.5,10.251V10.25H11.501ZM9,10.25H9.001L9.001,10.251L9,10.251V10.25ZM6.5,10.25H6.501L6.501,10.251L6.5,10.251V10.25Z"
android:strokeLineJoin="round"
android:strokeWidth="1.2"
android:fillColor="#00000000"
android:strokeColor="#B1B1B1"
android:strokeLineCap="round"/>
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_clock.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M9.5,7.444V10.5H12.556M9.5,16C6.462,16 4,13.538 4,10.5C4,7.462 6.462,5 9.5,5C12.538,5 15,7.462 15,10.5C15,13.538 12.538,16 9.5,16Z"
android:strokeLineJoin="round"
android:strokeWidth="1.2"
android:fillColor="#00000000"
android:strokeColor="#B1B1B1"
android:strokeLineCap="round"/>
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_flag.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M5,15.125V12.137M5,12.137C8.273,9.577 10.727,14.695 14,12.136V5.739C10.727,8.298 8.273,3.18 5,5.739V12.137Z"
android:strokeLineJoin="round"
android:strokeWidth="1.2"
android:fillColor="#00000000"
android:strokeColor="#B1B1B1"
android:strokeLineCap="round"/>
</vector>
File renamed without changes.
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_note.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:pathData="M5.25,3H4.8C4.17,3 3.855,3 3.614,3.136C3.402,3.256 3.23,3.447 3.123,3.682C3,3.95 3,4.3 3,5V11C3,11.7 3,12.05 3.123,12.317C3.23,12.553 3.402,12.744 3.614,12.864C3.855,13 4.169,13 4.798,13H5.25M5.25,3H10.2C10.83,3 11.145,3 11.385,3.136C11.597,3.256 11.77,3.447 11.877,3.682C12,3.95 12,4.299 12,4.998V11.002C12,11.701 12,12.05 11.877,12.317C11.77,12.553 11.597,12.744 11.385,12.864C11.145,13 10.831,13 10.202,13H5.25M5.25,3V13M7.5,7.375H9.75M7.5,5.5H9.75"
android:strokeLineJoin="round"
android:strokeWidth="0.8"
android:fillColor="#00000000"
android:strokeColor="#FCFCFC"
android:strokeLineCap="round"/>
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_note_open.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M8,6.388V13M8,6.388C8,5.202 8,4.609 8.182,4.156C8.341,3.758 8.596,3.434 8.91,3.231C9.266,3 9.733,3 10.667,3H12.111C12.422,3 12.578,3 12.697,3.077C12.801,3.145 12.886,3.253 12.939,3.385C13,3.536 13,3.734 13,4.129V10.341C13,10.737 13,10.934 12.939,11.085C12.886,11.218 12.801,11.326 12.697,11.394C12.578,11.471 12.423,11.471 12.112,11.471H10.538C10.017,11.471 9.755,11.471 9.519,11.562C9.309,11.643 9.114,11.775 8.945,11.952C8.536,12.379 8.5,12.412 8,13M8,6.388C8,5.202 8,4.609 7.818,4.156C7.658,3.758 7.403,3.434 7.09,3.231C6.733,3 6.267,3 5.333,3H3.889C3.578,3 3.422,3 3.303,3.077C3.199,3.145 3.114,3.253 3.061,3.385C3,3.536 3,3.734 3,4.129V10.341C3,10.737 3,10.934 3.061,11.085C3.114,11.218 3.199,11.326 3.303,11.394C3.422,11.471 3.577,11.471 3.888,11.471H5.462C5.983,11.471 6.244,11.471 6.481,11.562C6.691,11.643 6.886,11.775 7.055,11.952C7.464,12.379 7.5,12.412 8,13"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#FCFCFC"
android:strokeLineCap="round"/>
</vector>
Loading

0 comments on commit e06d286

Please sign in to comment.