Skip to content

Commit

Permalink
[MERGE] : #55 -> main
Browse files Browse the repository at this point in the history
[CHORE/#55] 테스트 대비 수정사항 반영
  • Loading branch information
blueme0 authored Jun 11, 2024
2 parents 392417f + 743b7ec commit bc97e3c
Show file tree
Hide file tree
Showing 26 changed files with 88 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ class ResultSubmitActivity
}

private fun moveToReview() {
if (resultViewModel.selectedProblemCount.value == 0) {
finish()
return
}

val arr = ArrayList<ReviewAnswer>()
resultViewModel.problemRange.value.forEach { (i, strings) ->
val list = mutableListOf<ResultAnswer>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}문제"
Expand All @@ -62,7 +62,7 @@ class StatisticsTypeDetailActivity
}

private fun requestStatistics() {
when (mode) {
when (cur_mode) {
MODE_ALL -> {
viewModel.getAccumulatedStatisticsByType(type!!)
}
Expand All @@ -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)
Expand Down Expand Up @@ -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 -> {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class StatisticsWrongFragment
navigateTo<StatisticsFragment>()
}
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()
}
Expand Down Expand Up @@ -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 -> ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.chaeda.chaeda.presentation.textbook

import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
Expand All @@ -27,13 +26,6 @@ class TextbookActivity
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
}

initView()
initListener()
setTextChangedListener()
Expand All @@ -58,6 +50,9 @@ class TextbookActivity
tvAdd.setOnSingleClickListener {
startActivity(AddTextbookActivity.getIntent(this@TextbookActivity))
}
llBack.setOnSingleClickListener {
finish()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ class AddTextbookActivity

private fun initListener() {
with(binding) {
llBack.setOnSingleClickListener {
finish()
}

tvAddFile.setOnSingleClickListener {
openFilePicker()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_add_assignment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/background"
app:layout_constraintBottom_toBottomOf="parent"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_add_problem_photo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/background"
app:layout_constraintBottom_toBottomOf="parent"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_add_textbook.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/background"
app:layout_constraintBottom_toBottomOf="parent"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_assignment_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
app:layout_constraintTop_toBottomOf="@id/ll_count"
android:layout_marginTop="22dp"
app:layout_constraintBottom_toTopOf="@id/fab"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_problem_box.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/background"
app:layout_constraintBottom_toBottomOf="parent"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -93,6 +94,7 @@
app:layout_constraintTop_toBottomOf="@id/tv_problems"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3"
android:overScrollMode="never"
android:scrollbars="vertical" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_result_review.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
app:layout_constraintTop_toBottomOf="@id/tv_notice"
android:layout_marginTop="22dp"
app:layout_constraintBottom_toTopOf="@id/fab"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_result_submit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
app:layout_constraintTop_toBottomOf="@id/ll_count"
android:layout_marginTop="22dp"
app:layout_constraintBottom_toTopOf="@id/fab"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_review_folder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/background"
app:layout_constraintBottom_toBottomOf="parent"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_signup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
app:layout_constraintBottom_toTopOf="@id/btn_finish"
app:layout_constraintTop_toBottomOf="@id/tv_signup"
app:layout_constraintVertical_bias="0.0"
android:overScrollMode="never"
tools:layout_editor_absoluteX="0dp">

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_textbook_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/background"
app:layout_constraintBottom_toBottomOf="parent"
android:overScrollMode="never"
>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/fragment_statistics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand Down
Loading

0 comments on commit bc97e3c

Please sign in to comment.