diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/assignment/add/AddAssignmentActivity.kt b/app/src/main/java/com/chaeda/chaeda/presentation/assignment/add/AddAssignmentActivity.kt index e4abbf7..f094a2e 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/assignment/add/AddAssignmentActivity.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/assignment/add/AddAssignmentActivity.kt @@ -48,6 +48,10 @@ class AddAssignmentActivity binding.tvFab.text = "과제 수정하기" } with(binding) { + llBack.setOnSingleClickListener { + finish() + } + fab.setOnSingleClickListener { if (addAssignmentViewModel.assignmentValid.value) { if (isEditable) addAssignmentViewModel.editAssignment(id) diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/review/add/AddProblemPhotoActivity.kt b/app/src/main/java/com/chaeda/chaeda/presentation/review/add/AddProblemPhotoActivity.kt index 7fb5c4e..8f02172 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/review/add/AddProblemPhotoActivity.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/review/add/AddProblemPhotoActivity.kt @@ -75,7 +75,7 @@ class AddProblemPhotoActivity subjects = Subject.values() subject = subjects!![0] - if (tsubject != "") initForResultReview() + if (tsubject != null) initForResultReview() chapters = subject!!.chapters chapter = chapters!![0] diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/review/add/AddProblemViewModel.kt b/app/src/main/java/com/chaeda/chaeda/presentation/review/add/AddProblemViewModel.kt index 1ed4092..3ffe11c 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/review/add/AddProblemViewModel.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/review/add/AddProblemViewModel.kt @@ -110,7 +110,7 @@ class AddProblemViewModel @Inject constructor( } companion object { - private const val DATE_REGEX = "^(\\d{4})-(\\d{2})-(\\d{2})\$" + private const val DATE_REGEX = "^(\\d{4}).(\\d{2}).(\\d{2})\$" const val IMAGE_TYPE_HOMEWORK_THUMBNAIL = "HOMEWORK_THUMBNAIL" const val IMAGE_TYPE_REVIEW_NOTE_PROBLEM = "REVIEW_NOTE_PROBLEM" } diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/signup/SignUpActivity.kt b/app/src/main/java/com/chaeda/chaeda/presentation/signup/SignUpActivity.kt index 720917d..6c3c16b 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/signup/SignUpActivity.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/signup/SignUpActivity.kt @@ -2,6 +2,7 @@ package com.chaeda.chaeda.presentation.signup import android.content.Context import android.content.Intent +import android.graphics.Color import android.os.Bundle import android.text.Editable import android.text.TextWatcher @@ -25,6 +26,13 @@ class SignUpActivity override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + this.window?.apply { +// this.statusBarColor = Color.TRANSPARENT + this.statusBarColor = Color.parseColor("#FFFFFF") +// decorView.systemUiVisibility = +// View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + } + binding.vm = signUpViewModel binding.lifecycleOwner = this initListener() diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/statistics/chapter/StatisticsChapterFragment.kt b/app/src/main/java/com/chaeda/chaeda/presentation/statistics/chapter/StatisticsChapterFragment.kt index b10c77e..918d056 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/statistics/chapter/StatisticsChapterFragment.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/statistics/chapter/StatisticsChapterFragment.kt @@ -6,7 +6,6 @@ import android.util.Log import android.view.View import android.widget.AdapterView import android.widget.ArrayAdapter -import android.widget.Toast import androidx.appcompat.widget.AppCompatTextView import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels @@ -195,7 +194,7 @@ class StatisticsChapterFragment override fun onItemSelected(parent: AdapterView<*>, view: View?, position: Int, id: Long) { // 선택된 아이템의 텍스트 가져오기 chapter = parent.getItemAtPosition(position) as Chapter - Toast.makeText(requireActivity(), "${chapter.koreanName}", Toast.LENGTH_SHORT).show() +// Toast.makeText(requireActivity(), "${chapter.koreanName}", Toast.LENGTH_SHORT).show() // if (selectedItem != "학년 선택하기") signUpViewModel.updateGrade(selectedItem) // else signUpViewModel.updateGrade("") // setGraph(selectedItem) diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/statistics/count/StatisticsCountFragment.kt b/app/src/main/java/com/chaeda/chaeda/presentation/statistics/count/StatisticsCountFragment.kt index ec35ddf..d83450a 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/statistics/count/StatisticsCountFragment.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/statistics/count/StatisticsCountFragment.kt @@ -218,7 +218,7 @@ class StatisticsCountFragment val endOfWeek = date.plusDays(6) binding.tvStandardText.text = when (mode) { MODE_DATE -> "${date.year}년 ${date.monthValue}월 ${date.dayOfMonth}일 (${DAY_OF_WEEK[date.dayOfWeek.value - 1]})" - MODE_WEEK -> "${date.year}년 ${date.monthValue}월 ${date.dayOfMonth}일 ~ ${endOfWeek.year}년 ${endOfWeek.monthValue}월 ${endOfWeek.dayOfMonth}일" + MODE_WEEK -> "${date.year}년 ${date.monthValue}월 ${date.dayOfMonth}일\n~ ${endOfWeek.year}년 ${endOfWeek.monthValue}월 ${endOfWeek.dayOfMonth}일" MODE_MONTH -> "${date.year}년 ${date.monthValue}월" else -> "" } diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/statistics/type/StatisticsTypeDetailActivity.kt b/app/src/main/java/com/chaeda/chaeda/presentation/statistics/type/StatisticsTypeDetailActivity.kt index 2c426bb..827ac4e 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/statistics/type/StatisticsTypeDetailActivity.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/statistics/type/StatisticsTypeDetailActivity.kt @@ -18,6 +18,7 @@ import com.chaeda.domain.enumSet.Concept import com.chaeda.domain.enumSet.Subject import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch +import timber.log.Timber @AndroidEntryPoint class StatisticsTypeDetailActivity @@ -45,14 +46,13 @@ class StatisticsTypeDetailActivity val subjectEnum = Subject.valueOf(chapterEnum.subject) tvConcept.text = conceptEnum.koreanName tvChapter.text = chapterEnum.koreanName - tvChapter.text = subjectEnum.koreanName + tvSubject.text = subjectEnum.koreanName } requestStatistics() } private fun updateView(concept: ConceptDetail) { with(binding) { -// tv tvSolved.text = "${concept.problemCount}문제" tvWrong.text = "${concept.wrongCount}문제" tvEasy.text = "${concept.easyNum}문제" @@ -62,7 +62,7 @@ class StatisticsTypeDetailActivity } private fun requestStatistics() { - when (mode) { + when (cur_mode) { MODE_ALL -> { viewModel.getAccumulatedStatisticsByType(type!!) } @@ -78,6 +78,10 @@ class StatisticsTypeDetailActivity private fun initListener() { with(binding) { + llBack.setOnSingleClickListener { + finish() + } + llCheckAll.setOnSingleClickListener { ivCheckAll.setImageResource(R.drawable.ic_radio_checked) ivCheckMonth.setImageResource(R.drawable.ic_radio_unchecked) @@ -109,14 +113,20 @@ class StatisticsTypeDetailActivity viewModel.statisticsState.collect { state -> when (state) { is StatisticsState.GetWeeklyStatisticsDetail -> { + Timber.tag("chaeda-detail").d("weekly success - ${state.concept}") updateView(state.concept) } is StatisticsState.GetMontlyStatisticsDetail -> { + Timber.tag("chaeda-detail").d("monthly success - ${state.concept}") updateView(state.concept) } is StatisticsState.GetAccumulatedStatisticsDetail -> { + Timber.tag("chaeda-detail").d("accumulated success - ${state.concept}") updateView(state.concept) } + is StatisticsState.Failure -> { + Timber.tag("chaeda-detail").d("failure - ${state.msg}") + } else -> { } diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/statistics/wrong/StatisticsWrongFragment.kt b/app/src/main/java/com/chaeda/chaeda/presentation/statistics/wrong/StatisticsWrongFragment.kt index 2d7244d..3e4c243 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/statistics/wrong/StatisticsWrongFragment.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/statistics/wrong/StatisticsWrongFragment.kt @@ -125,7 +125,7 @@ class StatisticsWrongFragment navigateTo() } val endOfWeek = date.plusDays(6) - tvStandardText.text = "${date.year}년 ${date.monthValue}월 ${date.dayOfMonth}일 ~ ${endOfWeek.year}년 ${endOfWeek.monthValue}월 ${endOfWeek.dayOfMonth}일" + tvStandardText.text = "${date.year}년 ${date.monthValue}월 ${date.dayOfMonth}일\n~ ${endOfWeek.year}년 ${endOfWeek.monthValue}월 ${endOfWeek.dayOfMonth}일" } requestWrongCount() } @@ -198,7 +198,7 @@ class StatisticsWrongFragment private fun setStandardText() { val endOfWeek = date.plusDays(6) binding.tvStandardText.text = when (mode) { - MODE_WEEK -> "${date.year}년 ${date.monthValue}월 ${date.dayOfMonth}일 ~ ${endOfWeek.year}년 ${endOfWeek.monthValue}월 ${endOfWeek.dayOfMonth}일" + MODE_WEEK -> "${date.year}년 ${date.monthValue}월 ${date.dayOfMonth}일\n~ ${endOfWeek.year}년 ${endOfWeek.monthValue}월 ${endOfWeek.dayOfMonth}일" MODE_MONTH -> "${date.year}년 ${date.monthValue}월" else -> "" } diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/textbook/TextbookActivity.kt b/app/src/main/java/com/chaeda/chaeda/presentation/textbook/TextbookActivity.kt index 63b6827..cd1a5d3 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/textbook/TextbookActivity.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/textbook/TextbookActivity.kt @@ -50,6 +50,9 @@ class TextbookActivity tvAdd.setOnSingleClickListener { startActivity(AddTextbookActivity.getIntent(this@TextbookActivity)) } + llBack.setOnSingleClickListener { + finish() + } } } diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/textbook/add/AddTextbookActivity.kt b/app/src/main/java/com/chaeda/chaeda/presentation/textbook/add/AddTextbookActivity.kt index 0b1eb0b..d4a66b5 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/textbook/add/AddTextbookActivity.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/textbook/add/AddTextbookActivity.kt @@ -90,6 +90,10 @@ class AddTextbookActivity private fun initListener() { with(binding) { + llBack.setOnSingleClickListener { + finish() + } + tvAddFile.setOnSingleClickListener { openFilePicker() } diff --git a/app/src/main/java/com/chaeda/chaeda/presentation/textbook/list/TextbookListActivity.kt b/app/src/main/java/com/chaeda/chaeda/presentation/textbook/list/TextbookListActivity.kt index 3276f05..904dc2a 100644 --- a/app/src/main/java/com/chaeda/chaeda/presentation/textbook/list/TextbookListActivity.kt +++ b/app/src/main/java/com/chaeda/chaeda/presentation/textbook/list/TextbookListActivity.kt @@ -7,6 +7,7 @@ import androidx.activity.viewModels import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.LinearLayoutManager import com.chaeda.base.BindingActivity +import com.chaeda.base.util.extension.setOnSingleClickListener import com.chaeda.chaeda.R import com.chaeda.chaeda.databinding.ActivityTextbookListBinding import com.chaeda.chaeda.presentation.textbook.TextbookState @@ -55,15 +56,9 @@ class TextbookListActivity private fun initListener() { with(binding) { -// fab.setOnSingleClickListener { -// // 결과를 전달하기 위해 Intent를 생성합니다. -// val resultIntent = Intent().apply { -// putExtra("textbookId", textbookViewModel.textbookId.value) -// putExtra("textbookName", textbookViewModel.textbookName.value) -// } -// setResult(RESULT_OK, resultIntent) -// finish() -// } + llBack.setOnSingleClickListener { + finish() + } } } diff --git a/app/src/main/res/layout/fragment_statistics.xml b/app/src/main/res/layout/fragment_statistics.xml index 5a93f82..851c254 100644 --- a/app/src/main/res/layout/fragment_statistics.xml +++ b/app/src/main/res/layout/fragment_statistics.xml @@ -88,7 +88,7 @@ android:layout_height="wrap_content" android:text="@string/statistics_count_subtitle" android:fontFamily="@font/nanumsquare_regular" - android:textSize="13sp" + android:textSize="11sp" android:textColor="#717171" app:layout_constraintTop_toBottomOf="@id/tv_count_title" app:layout_constraintStart_toStartOf="@id/tv_count_title" @@ -135,7 +135,7 @@ android:layout_height="wrap_content" android:text="@string/statistics_wrong_subtitle" android:fontFamily="@font/nanumsquare_regular" - android:textSize="13sp" + android:textSize="11sp" android:textColor="#717171" app:layout_constraintTop_toBottomOf="@id/tv_wrong_title" app:layout_constraintStart_toStartOf="@id/tv_wrong_title" @@ -182,7 +182,7 @@ android:layout_height="wrap_content" android:text="@string/statistics_chapter_subtitle" android:fontFamily="@font/nanumsquare_regular" - android:textSize="13sp" + android:textSize="11sp" android:textColor="#717171" app:layout_constraintTop_toBottomOf="@id/tv_chapter_title" app:layout_constraintStart_toStartOf="@id/tv_chapter_title" @@ -205,7 +205,7 @@ android:layout_height="wrap_content" android:text="@string/statistics_detail_comment" android:fontFamily="@font/nanumsquare_regular" - android:textSize="13sp" + android:textSize="11sp" android:textColor="#717171" app:layout_constraintTop_toBottomOf="@id/divider4" app:layout_constraintStart_toStartOf="parent" diff --git a/core/data/src/main/java/com/chaeda/data/datasoure/remote/RemoteStatisticsDataSource.kt b/core/data/src/main/java/com/chaeda/data/datasoure/remote/RemoteStatisticsDataSource.kt index 23accbf..874a2a6 100644 --- a/core/data/src/main/java/com/chaeda/data/datasoure/remote/RemoteStatisticsDataSource.kt +++ b/core/data/src/main/java/com/chaeda/data/datasoure/remote/RemoteStatisticsDataSource.kt @@ -1,5 +1,6 @@ package com.chaeda.data.datasoure.remote +import com.chaeda.data.model.response.statistics.toConceptDetail import com.chaeda.data.service.StatisticsService import com.chaeda.domain.entity.ChapterDetail import com.chaeda.domain.entity.ConceptDetail @@ -42,19 +43,19 @@ class RemoteStatisticsDataSource @Inject constructor( suspend fun getAccumulatedStatisticsByType( subConcept: String ): ConceptDetail { - return statisticsService.getAccumulatedStatisticsByType(subConcept) + return statisticsService.getAccumulatedStatisticsByType(subConcept).toConceptDetail() } suspend fun getMonthlyStatisticsByType( subConcept: String ): ConceptDetail { - return statisticsService.getMonthlyStatisticsByType(subConcept) + return statisticsService.getMonthlyStatisticsByType(subConcept).toConceptDetail() } suspend fun getWeeklyStatisticsByType( subConcept: String ): ConceptDetail { - return statisticsService.getWeeklyStatisticsByType(subConcept) + return statisticsService.getWeeklyStatisticsByType(subConcept).toConceptDetail() } suspend fun getChapterListBySubject( diff --git a/core/data/src/main/java/com/chaeda/data/model/response/statistics/ConceptStatisticsDTO.kt b/core/data/src/main/java/com/chaeda/data/model/response/statistics/ConceptStatisticsDTO.kt new file mode 100644 index 0000000..4c68c52 --- /dev/null +++ b/core/data/src/main/java/com/chaeda/data/model/response/statistics/ConceptStatisticsDTO.kt @@ -0,0 +1,18 @@ +package com.chaeda.data.model.response.statistics + +import com.chaeda.domain.entity.ConceptDetail +import kotlinx.serialization.Serializable + +@Serializable +data class ConceptStatisticsDTO ( + val subConcept: String, + val problemCount: Int, + val wrongCount: Int, + val easyNum: Int, + val middleNum: Int, + val hardNum: Int +) + +fun ConceptStatisticsDTO.toConceptDetail(): ConceptDetail { + return ConceptDetail(null, null, subConcept, problemCount, wrongCount, easyNum, middleNum, hardNum) +} \ No newline at end of file diff --git a/core/data/src/main/java/com/chaeda/data/service/StatisticsService.kt b/core/data/src/main/java/com/chaeda/data/service/StatisticsService.kt index 60dca25..b47bcbf 100644 --- a/core/data/src/main/java/com/chaeda/data/service/StatisticsService.kt +++ b/core/data/src/main/java/com/chaeda/data/service/StatisticsService.kt @@ -1,5 +1,6 @@ package com.chaeda.data.service +import com.chaeda.data.model.response.statistics.ConceptStatisticsDTO import com.chaeda.domain.entity.ChapterDetail import com.chaeda.domain.entity.ConceptDetail import com.chaeda.domain.entity.WrongCountWithConcept @@ -36,17 +37,17 @@ interface StatisticsService { @GET("/statistics/statistics/accumulated/{subConcept}") suspend fun getAccumulatedStatisticsByType( @Path("subConcept") subConcept: String - ): ConceptDetail + ): ConceptStatisticsDTO @GET("/statistics/statistics/monthly/{subConcept}") suspend fun getMonthlyStatisticsByType( @Path("subConcept") subConcept: String - ): ConceptDetail + ): ConceptStatisticsDTO @GET("/statistics/statistics/weekly/{subConcept}") suspend fun getWeeklyStatisticsByType( @Path("subConcept") subConcept: String - ): ConceptDetail + ): ConceptStatisticsDTO // not in use @GET("/statistics/chapter/list")