Skip to content

Commit

Permalink
fix bottom dialog theme
Browse files Browse the repository at this point in the history
  • Loading branch information
sdex committed Jan 15, 2024
1 parent 3b3d0d3 commit ca16638
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.view.ContextThemeWrapper
import androidx.core.os.bundleOf
import androidx.core.view.isVisible
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.sdex.activityrunner.R
import com.sdex.activityrunner.app.ActivityModel
import com.sdex.activityrunner.app.launchActivity
import com.sdex.activityrunner.databinding.DialogActivityMenuBinding
Expand All @@ -20,9 +22,14 @@ class ActivityOptionsDialog : BottomSheetDialogFragment() {

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
savedInstanceState: Bundle?,
): View {
_binding = DialogActivityMenuBinding.inflate(inflater, container, false)
val contextThemeWrapper = ContextThemeWrapper(activity, R.style.AppTheme)
_binding = DialogActivityMenuBinding.inflate(
inflater.cloneInContext(contextThemeWrapper),
container,
false
)
return binding.root
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.view.ContextThemeWrapper
import androidx.core.os.bundleOf
import androidx.core.view.isVisible
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.bumptech.glide.request.RequestOptions
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.sdex.activityrunner.R
import com.sdex.activityrunner.databinding.DialogApplicationMenuBinding
import com.sdex.activityrunner.db.cache.ApplicationModel
import com.sdex.activityrunner.extensions.serializable
Expand All @@ -24,9 +26,14 @@ class ApplicationOptionsDialog : BottomSheetDialogFragment() {

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
savedInstanceState: Bundle?,
): View {
_binding = DialogApplicationMenuBinding.inflate(inflater, container, false)
val contextThemeWrapper = ContextThemeWrapper(activity, R.style.AppTheme)
_binding = DialogApplicationMenuBinding.inflate(
inflater.cloneInContext(contextThemeWrapper),
container,
false
)
return binding.root
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.view.ContextThemeWrapper
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.sdex.activityrunner.MainActivity
import com.sdex.activityrunner.R
import com.sdex.activityrunner.databinding.DialogFilterBinding
import com.sdex.activityrunner.db.cache.ApplicationModel
import com.sdex.activityrunner.db.cache.query.GetApplicationsQuery
Expand All @@ -23,9 +25,14 @@ class FilterBottomSheetDialogFragment : BottomSheetDialogFragment() {

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
savedInstanceState: Bundle?,
): View {
_binding = DialogFilterBinding.inflate(inflater, container, false)
val contextThemeWrapper = ContextThemeWrapper(activity, R.style.AppTheme)
_binding = DialogFilterBinding.inflate(
inflater.cloneInContext(contextThemeWrapper),
container,
false
)
return binding.root
}

Expand Down

0 comments on commit ca16638

Please sign in to comment.