Skip to content

Commit

Permalink
[chore/#60] 테스트용 데이터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
blueme0 committed Jun 13, 2024
1 parent 30c84dc commit ffc07d8
Show file tree
Hide file tree
Showing 30 changed files with 52 additions and 24 deletions.
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,14 @@ class ResultSubmitActivity

val arr = ArrayList<ReviewAnswer>()
resultViewModel.problemRange.value.forEach { (i, strings) ->
Timber.tag("chaeda-check").d("i: $i, strings: ${strings.toList()}")
Timber.tag("chaeda-check").d("assignmentResult: ${resultViewModel.assignmentResult.value[i]}")
val list = mutableListOf<ResultAnswer>()
strings.forEach {
list.add(ResultAnswer(resultViewModel.assignmentResult.value[i]?.containsKey(it)!!, it))
if (resultViewModel.assignmentResult.value.containsKey(i))
list.add(ResultAnswer(resultViewModel.assignmentResult.value[i]?.containsKey(it)!!, it))
else
list.add(ResultAnswer(false, it))
}
arr.add(ReviewAnswer(i, list))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class AddProblemPhotoActivity
if (tsubject != null) initForResultReview()
chapters = subject!!.chapters
chapter = chapters!![0]
viewModel.updateChapter(chapter!!)

initListener()
initAddBtn()
Expand All @@ -97,9 +98,14 @@ class AddProblemPhotoActivity

with(binding) {
val now = LocalDateTime.now()
etDate.setText(now.format(DateTimeFormatter.ofPattern("yyyy.MM.dd")))
etDate.setText(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
etTextbook.setText(name)
etIndex.setText(index)
with(viewModel) {
updateDateString(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
updateTextbookName(name!!)
updateProblemNum(index!!)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PdfListAdapter (private val itemClick: (ReviewPdf) -> (Unit))

fun onBind(item: ReviewPdf) {
binding.tvTitle.text = item.title
binding.tvContent.text = item.createdDateTime
binding.tvContent.text = item.createdDateTime.split("T")[0]
binding.ivThumbnail.setImageResource(R.drawable.ic_empty_thumbnail)

binding.root.setOnSingleClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import com.chaeda.base.util.extension.setOnSingleClickListener
import com.chaeda.chaeda.R
import com.chaeda.chaeda.databinding.ActivityReviewPdfListBinding
import com.chaeda.chaeda.presentation.review.add.ReviewState
import com.chaeda.domain.entity.ReviewPdf
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import timber.log.Timber
import java.io.File
import java.net.URL

Expand Down Expand Up @@ -91,7 +93,8 @@ class ReviewPdfListActivity

private fun initView() {
pdfAdapter = PdfListAdapter {
viewModel.getReviewPdf(it.id)
// viewModel.getReviewPdf(it.id)
urlDownloading(TEST_DOWNLOAD_PDF)
}

binding.rvPdf.adapter = pdfAdapter
Expand All @@ -105,9 +108,11 @@ class ReviewPdfListActivity
when (state) {
is ReviewState.GetReviewPdfListSuccess -> {
pdfAdapter.setItems(state.list)
pdfAdapter.setItems(listOf(ReviewPdf(1L, "review", "2024-06-12")))
}
is ReviewState.GetReviewPdfSuccess -> {
urlDownloading(state.url)
// urlDownloading(state.url)
urlDownloading(TEST_DOWNLOAD_PDF)
}
else -> { }
}
Expand Down Expand Up @@ -136,6 +141,7 @@ class ReviewPdfListActivity
val columnReason: Int = cursor.getColumnIndex(DownloadManager.COLUMN_REASON)
val status: Int = cursor.getInt(columnIndex)
cursor.close()
Timber.tag("chaeda-download").d("columnReason : $columnReason")
when (status) {
DownloadManager.STATUS_SUCCESSFUL -> Toast.makeText(
this@ReviewPdfListActivity,
Expand All @@ -160,16 +166,19 @@ class ReviewPdfListActivity
}

private fun urlDownloading(url: String) {
Timber.tag("chaeda-download").d("urlDownloading: $url")
if (mDownloadManager == null) {
mDownloadManager = getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
}
val outputFile = File(outputFilePath + getFileName(url))
// val outputFile = File(outputFilePath + getFileName(url))
val outputFile = File(outputFilePath + "review.pdf")
if (!outputFile.getParentFile().exists()) {
outputFile.getParentFile().mkdirs()
}
val uri = Uri.parse(url)
val request = DownloadManager.Request(uri)
request.setTitle(getFileName(url))
// request.setTitle(getFileName(url))
request.setTitle("review.pdf")
request.setDestinationUri(Uri.fromFile(outputFile))
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
request.setAllowedOverMetered(true)
Expand All @@ -194,6 +203,8 @@ class ReviewPdfListActivity

companion object {
fun getIntent(context: Context) = Intent(context, ReviewPdfListActivity::class.java)
private const val TEST_DOWNLOAD_PDF = "https://s3-fullaccel.s3.ap-northeast-2.amazonaws.com/s3test.pdf?response-content-disposition=inline&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEFkaDmFwLW5vcnRoZWFzdC0yIkcwRQIgQeJMXDrTVUmXe8zZe8FYa9%2BczXT4Cl0t3ExgrrP9Q0kCIQC%2FLaQmcKxHthqjv%2F2ZNFTs1CtH9aZNAZbefGfbO2kAYCrxAgjS%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDc2NzM5NzkyNjYyNyIM9f%2FAyWxfC027oKpOKsUCgk6D0JnmC%2Fbx048z%2B7ZKXwc63q7Ee72jpzxCn4thqMX0dnPL2Dp3T46VJyHHhxwpXZs4WDfCztgD9YxRPXEAp6aVGGH%2FsO76lVT6igvjBdzr1aZ531njYubJZR4ISVXa%2ByoFT4WE%2FkhxbP14M88GvVZRHjMtGO03oJ4ur3ZaeLB04f4qMoisLcaEGKTjXfnmp9F8audPE%2FXXmJJwdwNTGDQHKcIREUK%2BMTgMSQFXyen%2FsXBq1NTBJfNw6v97sW6u1MoMJh%2BuVhMSMLx0bb7w%2BXOyMvXscu4850zEpMM8uRogZl%2B2e4ATbFqWx98TGK%2FP9Cvvv9NO0HBpmIadMdlYf9k2%2BfYwuvnWjX3xZhvZ6x7%2FDAMkYJ56Elay2StfRaXHXlzLVuy2%2FEALzlomgIhlreZ8c%2FrZmCzqWZY2OPgo2b0RblFQ7DDsjNGyBjqzAtE4E968FGp%2B4oip%2FrQKNFqQoubt%2FXx2ub9sigWWAnK6yUAnZL1S25BNNFYTuuOJ0g5LOz2s0RNdAQHYrnh29HtRjhadq6TJF022eYc8yUKb9a80WXdLfrGl%2FT8kl4b9HaNESLYUcQ6dMdufDN9ka%2Fg5Nx22G6vBm540bS3P3fmWBLvvDHWCUwY%2F%2BPRrEZgHYP7Kw80y3Js69tZGYJzJdo%2FSRQuoiq3RX7yCXbfxJbVWbQOXRRnC%2FO6X4sJuhTL6KQLUhkNcBBaSRjyZlyEM95gmAyPxqDjtvCe1R3CfBv%2B2BIfspcuv4QterAX3oD09n0nrT8%2BEzzoy7xrY0SUY1U6%2Fwf2CpxQIbWbndYNOh5e6dVZzb5t%2FOP0SG7cS8rgVX%2FdcnTGIXQVb80x5uBXwkn5cXIs%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240527T094435Z&X-Amz-SignedHeaders=host&X-Amz-Expires=7200&X-Amz-Credential=ASIA3FLD3C3RXLOIJY7W%2F20240527%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=35adc1687804d93e07dbf18aa6c4df4601d3f0ec15ca675283cdc2f5d35b490a"
// private const val TEST_DOWNLOAD_PDF = "https://drive.google.com/file/d/1wHbsqcfI9E9NRMuLgh4DYYcDHaba3xqN/view?usp=drive_link"
// private const val TEST_DOWNLOAD_PDF = "https://bigfile.mail.naver.com/download?fid=PqR0W6k9WzU9KAujK3ejFAMlKxEjKogZFAgrKxUmKAg/KxvjKxbZKAblFoKla3e4KoMZKrMqKzumK4UmMouXp6MdF6pSK6JCF6UrpzMdM2=="
private const val TEST_DOWNLOAD_PDF = "https://bigfile.mail.naver.com/download?fid=P9R0W6k9WzU9aAujK3ejaxu9FAbjKogZFAgrKxUmKxUwKAujKxbZKAblFoKla3YrKogqKxU/KA3Sp6tmFrKrFrElK4ulax3CFo2lFxK9pt=="
}
}
Binary file modified app/src/main/res/drawable/ic_homework_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_add_problem_photo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
android:background="@drawable/shape_rect8_fill_brown"
android:textAlignment="center"
android:gravity="center"
android:text="문제 사진 불러오기"
android:text="문제 사진 촬영하기"
app:layout_constraintTop_toBottomOf="@id/et_date"
android:layout_marginTop="33dp"
android:fontFamily="@font/nanumsquare_bold"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
6 changes: 0 additions & 6 deletions app/src/main/res/mipmap-anydpi/ic_launcher.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/mipmap-anydpi/ic_launcher_round.xml

This file was deleted.

Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Binary file not shown.
4 changes: 4 additions & 0 deletions app/src/main/res/values/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Chaeda</string>
<string name="app_name">채다</string>
<string name="statistics_main_introduce">채다 서비스에서 제공하는\n통계 정보들은 아래와 같습니다.</string>
<string name="statistics_count_title">풀이한 문항 수 비교</string>
<string name="statistics_count_subtitle">특정 날짜, 주차, 월을 기준으로\n사용자가 풀이한 문제 수를 그래프로 비교합니다.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class RemoteStatisticsDataSource @Inject constructor(
suspend fun getWrongCountByChapter(
chapter: String
): List<ConceptDetail> {
return statisticsService.getWrongCountByChapter(chapter)
val list = mutableListOf<ConceptDetail>()
statisticsService.getWrongCountByChapter(chapter).forEach {
list.add(it.toConceptDetail())
}
return list
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ interface StatisticsService {
@GET("/statistics/statistics/accumulated/{chapter}/list")
suspend fun getWrongCountByChapter(
@Path("chapter") chapter: String
): List<ConceptDetail>
): List<ConceptStatisticsDTO>
}

0 comments on commit ffc07d8

Please sign in to comment.