mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-19 20:28:26 +00:00
Bottom sheet styles were actually fixed.
This commit is contained in:
parent
2c42bdd1a5
commit
88efb2c08c
@ -30,7 +30,7 @@
|
||||
<!-- <item name="colorControlHighlight">@color/accent</item>-->
|
||||
<item name="alertDialogTheme">@style/AppCompatAlertDialogStyleLight</item>
|
||||
<item name="android:alertDialogTheme">@style/AppCompatDialogStyleLight</item>
|
||||
<item name="bottomSheetDialogTheme">@style/Theme.MaterialComponents.Light.BottomSheetDialog</item>
|
||||
<!-- <item name="bottomSheetDialogTheme">@style/Theme.MaterialComponents.Light.BottomSheetDialog</item>-->
|
||||
<!--<item name="android:windowContentOverlay">@drawable/compat_actionbar_shadow_background</item>-->
|
||||
|
||||
<item name="attachment_type_selector_background">@color/white</item>
|
||||
|
@ -29,11 +29,7 @@
|
||||
<item name="buttonBarPositiveButtonStyle">@style/Session.AlertDialog.PositiveButtonStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="SessionBottomSheetDialogTheme" parent="Theme.Design.BottomSheetDialog">
|
||||
<item name="bottomSheetStyle">@style/SessionBottomSheetStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="SessionBottomSheetStyle" parent="Widget.Design.BottomSheet.Modal">
|
||||
<style name="Widget.Session.BottomSheetDialog" parent="Widget.Design.BottomSheet.Modal">
|
||||
<item name="android:background">@drawable/default_bottom_sheet_background</item>
|
||||
</style>
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
<item name="actionBarStyle">@style/Widget.Session.ActionBar</item>
|
||||
|
||||
<item name="alertDialogTheme">@style/Session.AlertDialog</item>
|
||||
<item name="bottomSheetDialogTheme">@style/SessionBottomSheetDialogTheme</item>
|
||||
<item name="bottomSheetStyle">@style/Widget.Session.BottomSheetDialog</item>
|
||||
<item name="preferenceTheme">@style/Session.SettingsTheme</item>
|
||||
<item name="statusBarBackground">@color/accent</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||
|
@ -25,11 +25,7 @@ public class ConversationOptionsBottomSheet : BottomSheetDialogFragment() {
|
||||
var onDeleteTapped: (() -> Unit)? = null
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
//FIXME AC: For some reason this fragment (created from HomeActivity)
|
||||
// is not using the activity's theme. So we have to enforce it.
|
||||
return LayoutInflater.from(ContextThemeWrapper(requireContext(), R.style.Theme_Session_DayNight))
|
||||
.inflate(R.layout.fragment_conversation_bottom_sheet, container, false)
|
||||
// return inflater.inflate(R.layout.fragment_conversation_bottom_sheet, container, false)
|
||||
return inflater.inflate(R.layout.fragment_conversation_bottom_sheet, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
@ -37,7 +37,7 @@ class MultiDeviceRemovalBottomSheet : BottomSheetDialogFragment() {
|
||||
}
|
||||
|
||||
private val explanation by lazy {
|
||||
if (TextSecurePreferences.getMasterHexEncodedPublicKey(context!!) != null) {
|
||||
if (TextSecurePreferences.getMasterHexEncodedPublicKey(requireContext()) != null) {
|
||||
"You’re seeing this because this is a secondary device in a multi-device setup. To improve reliability and stability, we’ve decided to temporarily disable Session’s multi-device functionality. Device linking has been disabled, and existing secondary clients will be erased on $removalDateDescription.\n\nTo read more about this change, visit the Session FAQ at getsession.org/faq."
|
||||
} else {
|
||||
"You’re seeing this because you have a secondary device linked to your Session ID. To improve reliability and stability, we’ve decided to temporarily disable Session’s multi-device functionality. Device linking has been disabled, and existing secondary clients will be erased on $removalDateDescription.\n\nTo read more about this change, visit the Session FAQ at getsession.org/faq"
|
||||
@ -49,7 +49,7 @@ class MultiDeviceRemovalBottomSheet : BottomSheetDialogFragment() {
|
||||
val removalDateStartIndex = explanation.indexOf(removalDateDescription)
|
||||
val removalDateEndIndex = removalDateStartIndex + removalDateDescription.count()
|
||||
result.setSpan(StyleSpan(Typeface.BOLD), removalDateStartIndex, removalDateEndIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
result.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, context!!.theme)), removalDateStartIndex, removalDateEndIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
result.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, requireContext().theme)), removalDateStartIndex, removalDateEndIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
val link = "getsession.org/faq"
|
||||
val linkStartIndex = explanation.indexOf(link)
|
||||
val linkEndIndex = linkStartIndex + link.count()
|
||||
@ -59,20 +59,15 @@ class MultiDeviceRemovalBottomSheet : BottomSheetDialogFragment() {
|
||||
try {
|
||||
onLinkTapped?.invoke()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(context!!, R.string.invalid_url, Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(requireContext(), R.string.invalid_url, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}, linkStartIndex, linkEndIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
result.setSpan(StyleSpan(Typeface.BOLD), linkStartIndex, linkEndIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
result.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, context!!.theme)), linkStartIndex, linkEndIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
result.setSpan(ForegroundColorSpan(resources.getColorWithID(R.color.accent, requireContext().theme)), linkStartIndex, linkEndIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
result
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(STYLE_NORMAL, R.style.SessionBottomSheetDialogTheme)
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_multi_device_removal_bottom_sheet, container, false)
|
||||
}
|
||||
|
@ -12,11 +12,6 @@ class OpenGroupSuggestionBottomSheet : BottomSheetDialogFragment() {
|
||||
var onJoinTapped: (() -> Unit)? = null
|
||||
var onDismissTapped: (() -> Unit)? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(STYLE_NORMAL, R.style.SessionBottomSheetDialogTheme)
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
return inflater.inflate(R.layout.fragment_open_group_suggestion_bottom_sheet, container, false)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user