Fix background color on forward sheet bottom bar.

fork-5.53.8
Alex Hart 2022-04-04 13:44:38 -03:00 zatwierdzone przez Cody Henthorne
rodzic 91c581b475
commit c5906b6f3a
5 zmienionych plików z 24 dodań i 3 usunięć

Wyświetl plik

@ -1,9 +1,11 @@
package org.thoughtcrime.securesms.components
import android.app.Dialog
import android.graphics.Color
import android.os.Bundle
import android.view.ContextThemeWrapper
import android.view.View
import androidx.annotation.ColorInt
import androidx.annotation.StyleRes
import androidx.core.view.ViewCompat
import com.google.android.material.bottomsheet.BottomSheetBehavior
@ -26,6 +28,9 @@ abstract class FixedRoundedCornerBottomSheetDialogFragment : BottomSheetDialogFr
@StyleRes
protected open val themeResId: Int = R.style.Widget_Signal_FixedRoundedCorners
@ColorInt
protected var backgroundColor: Int = Color.TRANSPARENT
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(STYLE_NORMAL, themeResId)
@ -44,7 +49,8 @@ abstract class FixedRoundedCornerBottomSheetDialogFragment : BottomSheetDialogFr
val dialogBackground = MaterialShapeDrawable(shapeAppearanceModel)
val bottomSheetStyle = ThemeUtil.getThemedResourceId(ContextThemeWrapper(requireContext(), themeResId), R.attr.bottomSheetStyle)
dialogBackground.setTint(ThemeUtil.getThemedColor(ContextThemeWrapper(requireContext(), bottomSheetStyle), R.attr.backgroundTint))
backgroundColor = ThemeUtil.getThemedColor(ContextThemeWrapper(requireContext(), bottomSheetStyle), R.attr.backgroundTint)
dialogBackground.setTint(backgroundColor)
dialog.behavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
override fun onStateChanged(bottomSheet: View, newState: Int) {

Wyświetl plik

@ -39,6 +39,10 @@ class MultiselectForwardBottomSheet : FixedRoundedCornerBottomSheetDialogFragmen
return requireView().parent.parent.parent as ViewGroup
}
override fun getDialogBackgroundColor(): Int {
return backgroundColor
}
override fun setResult(bundle: Bundle) {
setFragmentResult(MultiselectForwardFragment.RESULT_SELECTION, bundle)
}

Wyświetl plik

@ -47,7 +47,10 @@ import org.thoughtcrime.securesms.util.fragments.findListener
import org.thoughtcrime.securesms.util.views.SimpleProgressDialog
import org.thoughtcrime.securesms.util.visible
class MultiselectForwardFragment : Fragment(R.layout.multiselect_forward_fragment), SafetyNumberChangeDialog.Callback, ChooseStoryTypeBottomSheet.Callback {
class MultiselectForwardFragment :
Fragment(R.layout.multiselect_forward_fragment),
SafetyNumberChangeDialog.Callback,
ChooseStoryTypeBottomSheet.Callback {
private val viewModel: MultiselectForwardViewModel by viewModels(factoryProducer = this::createViewModelFactory)
private val disposables = LifecycleDisposable()
@ -101,6 +104,9 @@ class MultiselectForwardFragment : Fragment(R.layout.multiselect_forward_fragmen
val shareSelectionRecycler: RecyclerView = bottomBar.findViewById(R.id.selected_list)
val shareSelectionAdapter = ShareSelectionAdapter()
val sendButton: View = bottomBar.findViewById(R.id.share_confirm)
val backgroundHelper: View = bottomBar.findViewById(R.id.background_helper)
backgroundHelper.setBackgroundColor(callback.getDialogBackgroundColor())
title?.setText(requireArguments().getInt(ARG_TITLE))
@ -354,6 +360,7 @@ class MultiselectForwardFragment : Fragment(R.layout.multiselect_forward_fragmen
fun onSearchInputFocused()
fun setResult(bundle: Bundle)
fun getContainer(): ViewGroup
fun getDialogBackgroundColor(): Int
}
companion object {

Wyświetl plik

@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.conversation.mutiselect.forward
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.fragment.app.setFragmentResult
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.components.FullScreenDialogFragment
@ -28,6 +29,10 @@ class MultiselectForwardFullScreenDialogFragment : FullScreenDialogFragment(), M
}
}
override fun getDialogBackgroundColor(): Int {
return ContextCompat.getColor(requireContext(), R.color.signal_background_primary)
}
override fun getContainer(): ViewGroup {
return requireView().findViewById(R.id.full_screen_dialog_content) as ViewGroup
}

Wyświetl plik

@ -10,7 +10,6 @@
android:id="@+id/background_helper"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="?android:windowBackground"
app:layout_constraintBottom_toBottomOf="@id/selected_list"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"