Skip to content

Commit

Permalink
의약품 상세 정보 화면에서 툴바 접히는 기능 수정중
Browse files Browse the repository at this point in the history
  • Loading branch information
pknujsp committed Jul 24, 2023
1 parent 885249a commit 6b1111f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.android.mediproject.feature.medicine.main

import android.content.res.ColorStateList
import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.core.view.doOnPreDraw
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import com.android.mediproject.core.common.dialog.LoadingDialog
import com.android.mediproject.core.common.uiutil.SystemBarColorAnalyzer
import com.android.mediproject.core.common.uiutil.SystemBarController
Expand Down Expand Up @@ -46,14 +45,9 @@ class MedicineInfoFragment : BaseFragment<FragmentMedicineInfoBinding, MedicineI
viewModel = fragmentViewModel
medicineInfoArgs = navArgs

toolbar.setNavigationOnClickListener {
findNavController().popBackStack()
}

root.doOnPreDraw {
topAppBar.addOnOffsetChangedListener { appBarLayout, verticalOffset ->
SystemBarColorAnalyzer.convert()
}
toolbar.bar.setBackgroundColor(Color.TRANSPARENT)
topAppBar.addOnOffsetChangedListener { _, _ ->
SystemBarColorAnalyzer.convert()
}
}

Expand Down Expand Up @@ -98,11 +92,14 @@ class MedicineInfoFragment : BaseFragment<FragmentMedicineInfoBinding, MedicineI

launch {
SystemBarColorAnalyzer.statusBarColor.collect {
binding.toolbar.setNavigationIconTint(if (it == SystemBarStyler.SystemBarColor.WHITE) Color.WHITE else Color.BLACK)
(if (it == SystemBarStyler.SystemBarColor.WHITE) Color.WHITE else Color.BLACK).also { color ->
binding.toolbar.backButton.imageTintList =
ColorStateList.valueOf(color)
binding.toolbar.title.setTextColor(color)
}
}
}
}
androidx.appcompat.R.style.Base_Widget_AppCompat_Toolbar_Button_Navigation
}

private fun setBarStyle() = binding.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/medicineInfo"
app:titleCollapseMode="scale"
app:titleEnabled="true"
app:titleEnabled="false"
app:toolbarId="@id/toolbar">

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -142,12 +142,15 @@

</androidx.constraintlayout.widget.ConstraintLayout>

<com.google.android.material.appbar.MaterialToolbar
<com.android.mediproject.core.ui.base.view.Bar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="pin"
app:navigationIcon="@drawable/left_arrow_black" />
app:navigationIcon="@drawable/left_arrow_black"
app:setTheme="white"
app:showBackButton="true"
app:title="@string/medicineInfo" />

</com.google.android.material.appbar.CollapsingToolbarLayout>

Expand Down

0 comments on commit 6b1111f

Please sign in to comment.