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

[FIX/#38] 리듬뷰 / 화면 꺼짐 방지 추가 #39

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import android.net.Uri
import android.os.Bundle
import android.view.View
import com.kkkk.core.base.BaseFragment
import com.kkkk.core.extension.colorOf
import com.kkkk.core.extension.setOnSingleClickListener
import com.kkkk.core.extension.setStatusBarColor
import com.kkkk.core.extension.toast
import dagger.hilt.android.AndroidEntryPoint
import kr.genti.presentation.R
Expand All @@ -21,6 +23,7 @@ class ProfileFragment : BaseFragment<FragmentProfileBinding>(R.layout.fragment_p

initWebBtnListener()
initReportBtnListener()
setStatusBarColor(R.color.gray_100)
}

private fun initWebBtnListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.github.mikephil.charting.data.LineDataSet
import com.github.mikephil.charting.formatter.ValueFormatter
import com.kkkk.core.base.BaseFragment
import com.kkkk.core.extension.colorOf
import com.kkkk.core.extension.setStatusBarColor
import com.kkkk.core.extension.stringOf
import com.kkkk.core.extension.toast
import com.kkkk.core.state.UiState
Expand All @@ -37,6 +38,7 @@ class RecordFragment : BaseFragment<FragmentRecordBinding>(R.layout.fragment_rec
binding.vm = viewModel
observeReportMonth()
observeChartEntry()
setStatusBarColor(R.color.white)
}

private fun observeReportMonth() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.hardware.SensorManager
import android.media.MediaPlayer
import android.os.Bundle
import android.view.View
import android.view.WindowManager
import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.flowWithLifecycle
Expand Down Expand Up @@ -56,6 +57,7 @@ class RhythmFragment : BaseFragment<FragmentRhythmBinding>(R.layout.fragment_rhy
observeRhythmUrlState()
observeDownloadState()
observeRecordSaveState()
setStatusBarColor(R.color.white)
}

private fun initChangeLevelBtnListener() {
Expand All @@ -70,6 +72,7 @@ class RhythmFragment : BaseFragment<FragmentRhythmBinding>(R.layout.fragment_rhy
if (::mediaPlayer.isInitialized) {
mediaPlayer.start()
switchPlayingState(true)
requireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
} else {
toast(stringOf(R.string.error_msg))
}
Expand All @@ -81,6 +84,7 @@ class RhythmFragment : BaseFragment<FragmentRhythmBinding>(R.layout.fragment_rhy
if (::mediaPlayer.isInitialized) {
mediaPlayer.pause()
switchPlayingState(false)
requireActivity().window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
rhythmSaveDialog = RhythmSaveDialog()
rhythmSaveDialog?.show(parentFragmentManager, DIALOG_RHYTHM_SAVE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package com.kkkk.presentation.main.study

import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import com.google.android.material.tabs.TabLayoutMediator
import com.kkkk.core.base.BaseFragment
import com.kkkk.core.extension.colorOf
import com.kkkk.core.extension.setStatusBarColor
import dagger.hilt.android.AndroidEntryPoint
import kr.genti.presentation.R
import kr.genti.presentation.databinding.FragmentStudyBinding
Expand All @@ -21,6 +22,7 @@ class StudyFragment : BaseFragment<FragmentStudyBinding>(R.layout.fragment_study

setTabLayout()
setViewPager()
setStatusBarColor(R.color.white)
}

private fun setTabLayout() {
Expand Down
6 changes: 4 additions & 2 deletions presentation/src/main/res/layout/fragment_study.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/gray_100">

<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_study"
android:paddingTop="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/vp_study"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/vp_study"
app:tabIndicatorColor="@color/purple_50"
app:tabIndicatorFullWidth="true"
app:tabIndicatorHeight="4dp"
Expand Down
7 changes: 4 additions & 3 deletions presentation/src/main/res/layout/item_study_exercise.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_gray200_line_8_rect">
android:background="@drawable/shape_white_fill_gray200_line_8_rect">

<ImageView
android:id="@+id/iv_study_exercise_thumbnail"
Expand All @@ -34,7 +34,7 @@

<TextView
android:id="@+id/tv_study_exercise_title"
style="@style/TextAppearance.Stempo.Head1"
style="@style/TextAppearance.Stempo.Head4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="18dp"
Expand All @@ -50,7 +50,7 @@

<TextView
android:id="@+id/tv_study_exercise_content"
style="@style/TextAppearance.Stempo.Head4"
style="@style/TextAppearance.Stempo.Body2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="18dp"
Expand All @@ -65,6 +65,7 @@
tools:text="보조설명 보조설명 보조설명 보조설명 보조설명" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.cardview.widget.CardView>

</androidx.constraintlayout.widget.ConstraintLayout>
16 changes: 8 additions & 8 deletions presentation/src/main/res/layout/item_study_information.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_gray200_line_8_rect"
android:background="@drawable/shape_white_fill_gray200_line_8_rect"
android:paddingHorizontal="18dp"
android:paddingVertical="20dp">

Expand All @@ -16,28 +16,28 @@
android:ellipsize="end"
android:gravity="start"
android:maxLines="2"
tools:text="뇌성마비 아동의 인지 기능 향상을 위한 양극 경두개직류 경두개직류류류류류률류류류류률률류류류류류"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@id/tv_study_exercise_content"
app:layout_constraintEnd_toStartOf="@id/iv_study_information_thumbnail"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:text="뇌성마비 아동의 인지 기능 향상을 위한 양극 경두개직류 경두개직류류류류류률류류류류률률류류류류류" />

<TextView
android:id="@+id/tv_study_exercise_content"
style="@style/TextAppearance.Stempo.Head4"
style="@style/TextAppearance.Stempo.Body2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:gravity="start"
android:maxLines="2"
tools:text="서울아산병원 재활의학과 고은재 교수는 올해 열린 대한재활의학대회에서 수상을 할뻔 했지만 미끄러졌어요"
android:textColor="@color/gray_600"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/tv_study_information_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_study_information_title" />
app:layout_constraintTop_toBottomOf="@id/tv_study_information_title"
tools:text="서울아산병원 재활의학과 고은재 교수는 올해 열린 대한재활의학대회에서 수상을 할뻔 했지만 미끄러졌어요" />

<ImageView
android:id="@+id/iv_study_information_thumbnail"
Expand All @@ -46,10 +46,10 @@
android:layout_marginStart="18dp"
android:background="@drawable/shape_gray200_line_8_rect"
android:scaleType="fitCenter"
tools:src="@drawable/img_default_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_study_information_title"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/img_default_content" />

</androidx.constraintlayout.widget.ConstraintLayout>
Loading