Skip to content

Commit

Permalink
#91 앱 출시 모드 설정 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
pknujsp committed Jun 10, 2023
1 parent d8c07c9 commit e090b7a
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 14 deletions.
15 changes: 11 additions & 4 deletions app/src/main/java/com/android/mediproject/DevDialogFragment.kt
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
package com.android.mediproject

import android.os.Bundle
import android.text.Html
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.android.mediproject.databinding.ViewNetworkStateBinding
import androidx.core.text.toSpannable
import com.android.mediproject.databinding.ViewDevStateBinding
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class DevDialogFragment : BottomSheetDialogFragment() {

private var _binding: ViewNetworkStateBinding? = null
private var _binding: ViewDevStateBinding? = null

private val binding get() = _binding!!

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View = ViewNetworkStateBinding.inflate(layoutInflater, container, false).also {
): View = ViewDevStateBinding.inflate(layoutInflater, container, false).also {
_binding = it
}.root

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

binding.apply {
val text = Html.fromHtml(getString(R.string.messageDevelopment), Html.FROM_HTML_MODE_COMPACT).toSpannable()
messageTextView.text = text
}

binding.okButton.setOnClickListener {
dismiss()
requireActivity().finish()
}
}
}
2 changes: 2 additions & 0 deletions app/src/main/java/com/android/mediproject/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>(ActivityMa
return true
}
})

DevDialogFragment().show(supportFragmentManager, DevDialogFragment::class.java.name)
}
}

Expand Down
31 changes: 31 additions & 0 deletions app/src/main/res/layout/view_dev_state.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/ModalBottomSheetDialog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/white"
android:gravity="center"
android:orientation="vertical"
android:paddingHorizontal="24dp"
android:paddingVertical="24dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

<TextView
android:id="@+id/messageTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:lineSpacingMultiplier="1.2"
android:bufferType="spannable"
android:textSize="20sp" />

<Button
android:id="@+id/okButton"
style="@style/Widget.Material3.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/main"
android:text="@string/confirm" />

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/layout/view_network_state.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

<Button
android:id="@+id/okButton"
style="@style/Widget.Material3.Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/main"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<resources>
<string name="app_name">MediLenz</string>
<string name="messageDevelopment">현재 버전은 <strong>초기 개발 버전</strong>으로 예상치 못한 오류 및 강제 종료가 발생할 수 있습니다</string>
<!-- Strings used for fragments for navigation -->
</resources>
2 changes: 0 additions & 2 deletions core/ui/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

<style name="MediBaseTheme" parent="Theme.Material3.Light.NoActionBar">
<item name="colorPrimary">@color/main</item>
<item name="colorSurfaceVariant">@color/white</item>
<item name="colorSurface">@color/white</item>
</style>

<style name="ButtonChip" parent="@style/Widget.Material3.Chip.Assist" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.android.mediproject.core.common.util.delayTextChangedCallback
import com.android.mediproject.core.model.local.navargs.TOHOME
import com.android.mediproject.core.model.local.navargs.TOMYPAGE
import com.android.mediproject.core.ui.base.BaseFragment
import com.android.mediproject.core.ui.base.view.Bar
import com.android.mediproject.feature.intro.databinding.FragmentLoginBinding
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineDispatcher
Expand Down Expand Up @@ -48,7 +47,6 @@ class LoginFragment :
private val jobs = mutableListOf<Job>()



override fun onAttach(context: Context) {
super.onAttach(context)
systemBarStyler.setStyle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginHorizontal="18dp"
android:layout_marginTop="15dp"
android:animateLayoutChanges="true"
android:background="@drawable/medicine_primary_info_background"
android:elevation="4dp"
Expand Down Expand Up @@ -165,6 +164,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:backgroundTint="@color/white"
app:tabIndicatorColor="@color/design_default_color_primary"
app:tabTextColor="@color/black" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.android.mediproject.feature.search.result.ai

import android.annotation.SuppressLint
import android.content.Context
import android.os.Bundle
import android.text.Html
import android.view.View
Expand Down Expand Up @@ -30,6 +31,11 @@ class AiSearchResultFragment :

@Inject lateinit var systemBarStyler: SystemBarStyler

override fun onAttach(context: Context) {
super.onAttach(context)
systemBarStyler.setStyle(SystemBarStyler.StatusBarColor.BLACK, SystemBarStyler.NavigationBarColor.BLACK)
}

@SuppressLint("UseCompatLoadingForDrawables")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Expand Down Expand Up @@ -86,11 +92,6 @@ class AiSearchResultFragment :
}
}

override fun onStart() {
super.onStart()
systemBarStyler.setStyle(SystemBarStyler.StatusBarColor.BLACK, SystemBarStyler.NavigationBarColor.BLACK)
}

private fun onChangedResult(isEmpty: Boolean, isLoading: Boolean) {
binding.apply {
listViewGroup.messageTextView.isVisible = isEmpty && !isLoading
Expand Down

0 comments on commit e090b7a

Please sign in to comment.