Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat : 온보딩 3단계 키워드 알림 설정 페이지 구현 #155

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5b61a37
feat : 온보딩 알림 설정 - 화면 생성
huiwoo-jo Feb 12, 2024
9994ce2
design : 온보딩 알림 - 타이틀 설정
huiwoo-jo Feb 12, 2024
bb17132
chore : SettingAlarmViewModel 생성
huiwoo-jo Feb 12, 2024
e8c3f6b
refactor : 온보딩 알림 설정 viewModel 연결
huiwoo-jo Feb 12, 2024
359f14c
design : 온보딩 알림 설정 - 알림설정 박스 색상 변경
huiwoo-jo Feb 12, 2024
cd1e685
style : 온보딩 알림 - 사용하지 않는 라이브러리 정리
huiwoo-jo Feb 12, 2024
b9c7020
design : 온보딩 알림설정 - 부분 색상 설정
huiwoo-jo Feb 12, 2024
a7b7ca8
refactor : 온보딩 키워드 알림 - initDataBinding 수정
huiwoo-jo Feb 17, 2024
dc7dd90
refactor : 온보딩 알림 - switch의 drawable 위치 수정
huiwoo-jo Feb 17, 2024
a8a2d8e
rename : 온보딩 알림 설정 - 명확한 이름으로 변경
huiwoo-jo Feb 17, 2024
41b48c9
Merge branch 'feat/onboarding-#3' of https://github.com/TeamDMU/DMU-A…
huiwoo-jo Feb 17, 2024
b8d60bb
refactor : 색상 부분 설정 함수 분리
huiwoo-jo Feb 17, 2024
36551d7
chore : 텍스트 부분 색상 지정 함수명 변경
huiwoo-jo Feb 17, 2024
e453c7b
refactor : 온보딩 키워드 알림 - id 수정
huiwoo-jo Feb 22, 2024
c7932d7
design : 온보딩 키워들 알림 - constraint 종속성 수정
huiwoo-jo Feb 22, 2024
deecc0f
refactor : 온보딩 키워드 알림 - viemodel 데이터 추가
huiwoo-jo Feb 22, 2024
0c0f367
refactor : 온보딩 키워드 알림 - 버전 분기 설정
huiwoo-jo Feb 22, 2024
80c7d46
Merge branch 'develop' into feat/onboarding-#3
huiwoo-jo Mar 6, 2024
e667ddc
fix : string 충돌 제거
huiwoo-jo Mar 6, 2024
cbe48f9
Merge branch 'feat/onboarding-#3' of https://github.com/TeamDMU/DMU-A…
huiwoo-jo Mar 6, 2024
22eb659
fix : 함수 호출 방식 수정
huiwoo-jo Mar 6, 2024
eabd63c
refactor : 미사용 함수 및 뷰바인딩 제거
huiwoo-jo Mar 6, 2024
6b368e7
rename : onboardingPermission 네임에 Activity 추가
huiwoo-jo Mar 12, 2024
d27a68d
refactor : 무의미 공백 제거
huiwoo-jo Mar 12, 2024
427ac9b
refactor : 온보딩 3단계 타이틀 텍스트 컬러 설정
huiwoo-jo Mar 12, 2024
4762307
refactor : 온보딩 키워드 알림 - 데이터 바인딩 제거
huiwoo-jo Mar 12, 2024
04a8fc6
refactor : 온보딩 키워드 알림 - 대학 공지 알림 연동
huiwoo-jo Mar 12, 2024
c645835
refactor : 온보딩 키워드 알림 - 완료 버튼 string 수정
huiwoo-jo Mar 12, 2024
4e7eb45
Merge branch 'develop' into feat/onboarding-#3
huiwoo-jo Mar 12, 2024
2afa00b
feat : 온보딩 알림 설정 - 화면 생성
huiwoo-jo Feb 12, 2024
e62d998
design : 온보딩 알림 - 타이틀 설정
huiwoo-jo Feb 12, 2024
dd4c8ff
chore : SettingAlarmViewModel 생성
huiwoo-jo Feb 12, 2024
485a6f5
refactor : 온보딩 알림 설정 viewModel 연결
huiwoo-jo Feb 12, 2024
c6155be
design : 온보딩 알림 설정 - 알림설정 박스 색상 변경
huiwoo-jo Feb 12, 2024
d0dadfc
style : 온보딩 알림 - 사용하지 않는 라이브러리 정리
huiwoo-jo Feb 12, 2024
b2de0d4
design : 온보딩 알림설정 - 부분 색상 설정
huiwoo-jo Feb 12, 2024
ddd2d2d
refactor : 온보딩 키워드 알림 - initDataBinding 수정
huiwoo-jo Feb 17, 2024
8c68b0f
rename : 온보딩 알림 설정 - 명확한 이름으로 변경
huiwoo-jo Feb 17, 2024
c4015f1
refactor : 온보딩 알림 - switch의 drawable 위치 수정
huiwoo-jo Feb 17, 2024
9e1772f
refactor : 색상 부분 설정 함수 분리
huiwoo-jo Feb 17, 2024
0a5c15d
chore : 텍스트 부분 색상 지정 함수명 변경
huiwoo-jo Feb 17, 2024
78d178e
refactor : 온보딩 키워드 알림 - id 수정
huiwoo-jo Feb 22, 2024
b51d68e
design : 온보딩 키워들 알림 - constraint 종속성 수정
huiwoo-jo Feb 22, 2024
b9b9458
refactor : 온보딩 키워드 알림 - viemodel 데이터 추가
huiwoo-jo Feb 22, 2024
8c3d35d
refactor : 온보딩 키워드 알림 - 버전 분기 설정
huiwoo-jo Feb 22, 2024
c8d1bdd
fix : string 충돌 제거
huiwoo-jo Mar 6, 2024
648bce6
fix : 함수 호출 방식 수정
huiwoo-jo Mar 6, 2024
f4d5613
refactor : 미사용 함수 및 뷰바인딩 제거
huiwoo-jo Mar 6, 2024
ec074a5
rename : onboardingPermission 네임에 Activity 추가
huiwoo-jo Mar 12, 2024
e567d8e
refactor : 무의미 공백 제거
huiwoo-jo Mar 12, 2024
769ed24
refactor : 온보딩 3단계 타이틀 텍스트 컬러 설정
huiwoo-jo Mar 12, 2024
d5a7010
refactor : 온보딩 키워드 알림 - 데이터 바인딩 제거
huiwoo-jo Mar 12, 2024
1d13019
refactor : 온보딩 키워드 알림 - 대학 공지 알림 연동
huiwoo-jo Mar 12, 2024
34f3fe5
refactor : 온보딩 키워드 알림 - 완료 버튼 string 수정
huiwoo-jo Mar 12, 2024
184e6d0
Merge branch 'feat/onboarding-#3' of https://github.com/TeamDMU/DMU-A…
huiwoo-jo Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.YouDongKnowMe">
<activity
android:name=".ui.view.permission.OnboardingPermissionActivity"
android:exported="false" />
<activity
android:name=".ui.view.license.LicenseActivity"
android:exported="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class BaseActivity<T : ViewDataBinding, R : BaseViewModel> : AppCompatA
spanTextView: TextView,
startIdx: Int,
endIdx: Int
){
) {
SpannableStringBuilder(spanTextView.text).apply {
setSpan(
ForegroundColorSpan(getColor(com.dongyang.android.youdongknowme.R.color.main)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.dongyang.android.youdongknowme.R
import com.dongyang.android.youdongknowme.data.local.entity.KeywordEntity
import com.dongyang.android.youdongknowme.databinding.ActivityKeywordBinding
import com.dongyang.android.youdongknowme.standard.base.BaseActivity
import com.dongyang.android.youdongknowme.ui.view.main.MainActivity
import com.dongyang.android.youdongknowme.ui.view.permission.OnboardingPermissionActivity
import com.google.android.material.chip.Chip
import com.google.android.material.chip.ChipGroup
import org.koin.androidx.viewmodel.ext.android.viewModel
Expand All @@ -16,10 +16,8 @@ class KeywordActivity : BaseActivity<ActivityKeywordBinding, KeywordViewModel>()
override val layoutResourceId: Int = R.layout.activity_keyword
override val viewModel: KeywordViewModel by viewModel()

override fun initStartView() {
binding.vm = viewModel
}

override fun initStartView() = Unit

override fun initDataBinding() {
// 효율을 위해 단 한번만 옵저빙하여 이미 구독중인 항목을 선택 처리
viewModel.localKeywordList.observe(this, object : Observer<List<KeywordEntity>> {
Expand Down Expand Up @@ -47,7 +45,7 @@ class KeywordActivity : BaseActivity<ActivityKeywordBinding, KeywordViewModel>()
viewModel.subscribeCheckedKeyword()
if (viewModel.isFirstLaunch.value == true) {
viewModel.setFirstLaunch(false)
val intent = Intent(this@KeywordActivity, MainActivity::class.java)
val intent = Intent(this@KeywordActivity, OnboardingPermissionActivity::class.java)
startActivity(intent)
}
finish()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OnboardingKeywordActivity : BaseActivity<ActivityOnboardingKeywordBinding,
binding.vm = viewModel

// 부분 색상 지정
setSpanText(baseContext, binding.tvOnboardingKeywordTitleMain,startIdx = 0, endIdx = 3)
setSpanText(binding.tvOnboardingKeywordTitleMain,startIdx = 0, endIdx = 3)
}

override fun initDataBinding() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.dongyang.android.youdongknowme.ui.view.permission

import android.content.Intent
import android.os.Build
import com.dongyang.android.youdongknowme.R
import com.dongyang.android.youdongknowme.databinding.ActivityOnboardingPermissionBinding
import com.dongyang.android.youdongknowme.standard.base.BaseActivity
import com.dongyang.android.youdongknowme.ui.view.main.MainActivity
import com.dongyang.android.youdongknowme.ui.view.setting.SettingViewModel
import org.koin.androidx.viewmodel.ext.android.viewModel

class OnboardingPermissionActivity : BaseActivity<ActivityOnboardingPermissionBinding, SettingViewModel>() {

override val layoutResourceId: Int = R.layout.activity_onboarding_permission
override val viewModel: SettingViewModel by viewModel()

override fun initStartView() {
viewModel.setIsAccessSchoolAlarm(false)
viewModel.setIsAccessDepartAlarm(false)

viewModel.checkAccessAlarm()
viewModel.getUserDepartment()

setSpanText(binding.tvPermissionTitleMain,startIdx = 0, endIdx = 9)
}

override fun initDataBinding() = Unit

override fun initAfterBinding() {
binding.btnPermissionComplete.setOnClickListener {
val intent = Intent(this@OnboardingPermissionActivity, MainActivity::class.java)
startActivity(intent)
finish()
}

binding.switchPermission.setOnCheckedChangeListener { compoundButton, _ ->
if (compoundButton.isChecked) {
viewModel.setIsAccessSchoolAlarm(true)
viewModel.setIsAccessDepartAlarm(true)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
binding.mvSwitchPermission.outlineAmbientShadowColor = getColor(R.color.blue300)
binding.mvSwitchPermission.outlineSpotShadowColor = getColor(R.color.blue300)
}
binding.switchPermission.setTextColor(getColor(R.color.blue300))
} else {
viewModel.setIsAccessSchoolAlarm(false)
viewModel.setIsAccessDepartAlarm(false)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
binding.mvSwitchPermission.outlineAmbientShadowColor = getColor(R.color.gray300)
binding.mvSwitchPermission.outlineSpotShadowColor = getColor(R.color.gray300)
}
binding.switchPermission.setTextColor(getColor(R.color.gray300))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import com.dongyang.android.youdongknowme.standard.base.BaseViewModel
/* 설정 뷰모델 */
class SettingViewModel(private val settingRepository: SettingRepository) : BaseViewModel() {

private val _isAccessSchoolAlarm: MutableLiveData<Boolean> = MutableLiveData(true)
private val _isAccessSchoolAlarm: MutableLiveData<Boolean> = MutableLiveData(false)
val isAccessSchoolAlarm: LiveData<Boolean> get() = _isAccessSchoolAlarm

private val _isAccessDepartAlarm: MutableLiveData<Boolean> = MutableLiveData(true)
private val _isAccessDepartAlarm: MutableLiveData<Boolean> = MutableLiveData(false)
val isAccessDepartAlarm: LiveData<Boolean> get() = _isAccessDepartAlarm

private val _myDepartment: MutableLiveData<String> = MutableLiveData()
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/res/layout/activity_keyword.xml
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,4 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

<data>

<variable
name="vm"
type="com.dongyang.android.youdongknowme.ui.view.keyword.KeywordViewModel" />
/>
</data>
</layout>
94 changes: 94 additions & 0 deletions app/src/main/res/layout/activity_onboarding_permission.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.view.permission.OnboardingPermissionActivity">

<TextView
android:id="@+id/tv_permission_title_main"
style="@style/PretendardBold32"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="60dp"
android:text="@string/alarm_title_main"
android:textColor="@color/gray500"
app:layout_constraintBottom_toTopOf="@id/tv_permission_title_sub"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_permission_title_sub"
style="@style/PretendardBold24"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:text="@string/alarm_title_sub"
android:textColor="@color/gray500"
app:layout_constraintBottom_toTopOf="@id/onboarding_permission_step"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_permission_title_main" />

<include
android:id="@+id/onboarding_permission_step"
layout="@layout/layout_onboarding_step"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:paddingHorizontal="56dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_permission_title_sub"
app:stepValue="@{@string/setting_notice}" />

<com.google.android.material.card.MaterialCardView
android:id="@+id/mv_switch_permission"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:outlineSpotShadowColor="@color/gray300"
android:padding="16dp"
app:cardCornerRadius="16dp"
app:cardElevation="26dp"
app:layout_constraintTop_toBottomOf="@id/onboarding_permission_step"
app:layout_constraintBottom_toTopOf="@id/btn_permission_complete"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:strokeWidth="1dp">

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_permission"
style="@style/PretendardBold16"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableStart="@drawable/ic_alarm"
android:drawableTint="@color/gray300"
android:padding="16dp"
android:layout_margin="16dp"
android:text="@string/setting_keyword_alarm"
android:textAlignment="center"
android:textColor="@color/gray300" />
</com.google.android.material.card.MaterialCardView>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_permission_complete"
style="@style/PretendardRegular20"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginHorizontal="16dp"
android:layout_marginBottom="20dp"
android:background="@drawable/btn_gray_to_blue_10dp_enabled"
android:text="@string/alarm_complete"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<string name="setting_sw">컴퓨터소프트웨어공학과</string>
<string name="setting_department">학과 설정</string>
<string name="setting_keyword">키워드</string>
<string name="setting_keyword_alarm">키워드 알림 설정</string>
<string name="setting_keyword_choice">키워드 선택</string>
<string name="setting_app_info">앱 정보</string>
<string name="setting_app_help">문의하기</string>
Expand Down Expand Up @@ -104,6 +105,9 @@
<string name="loading_text">처리중</string>

<!-- alarm -->
<string name="alarm_title_main">키워드 알림 설정으로</string>
<string name="alarm_title_sub">중요한 공지사항을 놓치지 마세요!</string>
<string name="alarm_complete">시작하기</string>
<string name="alarm_title">키워드 알림함</string>
<string name="alarm_action_button_text">편집</string>

Expand Down
Loading