kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix overlap of multiselect in toolbar.
rodzic
b2b6f98294
commit
f2d5bfe51d
|
@ -178,6 +178,13 @@ class MainActivityListHostFragment : Fragment(R.layout.main_activity_list_host_f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun presentToolbarForMultiselect() {
|
||||||
|
_toolbar.visible = false
|
||||||
|
if (_basicToolbar.resolved()) {
|
||||||
|
_basicToolbar.get().visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
previousTopToastPopup = null
|
previousTopToastPopup = null
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
|
@ -212,12 +219,16 @@ class MainActivityListHostFragment : Fragment(R.layout.main_activity_list_host_f
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMultiSelectStarted() {
|
override fun onMultiSelectStarted() {
|
||||||
_toolbar.visible = false
|
presentToolbarForMultiselect()
|
||||||
conversationListTabsViewModel.onMultiSelectStarted()
|
conversationListTabsViewModel.onMultiSelectStarted()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMultiSelectFinished() {
|
override fun onMultiSelectFinished() {
|
||||||
_toolbar.visible = true
|
val currentDestination: NavDestination? = requireView().findViewById<View>(R.id.fragment_container).findNavController().currentDestination
|
||||||
|
if (currentDestination != null) {
|
||||||
|
presentToolbarForDestination(currentDestination)
|
||||||
|
}
|
||||||
|
|
||||||
conversationListTabsViewModel.onMultiSelectFinished()
|
conversationListTabsViewModel.onMultiSelectFinished()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,22 +312,26 @@ class MainActivityListHostFragment : Fragment(R.layout.main_activity_list_host_f
|
||||||
return viewGroup.children.find { it is ActionMenuView }
|
return viewGroup.children.find { it is ActionMenuView }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun presentToolbarForDestination(destination: NavDestination) {
|
||||||
|
when (destination.id) {
|
||||||
|
R.id.conversationListFragment -> {
|
||||||
|
conversationListTabsViewModel.isShowingArchived(false)
|
||||||
|
presentToolbarForConversationListFragment()
|
||||||
|
}
|
||||||
|
R.id.conversationListArchiveFragment -> {
|
||||||
|
conversationListTabsViewModel.isShowingArchived(true)
|
||||||
|
presentToolbarForConversationListArchiveFragment()
|
||||||
|
}
|
||||||
|
R.id.storiesLandingFragment -> {
|
||||||
|
conversationListTabsViewModel.isShowingArchived(false)
|
||||||
|
presentToolbarForStoriesLandingFragment()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private inner class DestinationChangedListener : NavController.OnDestinationChangedListener {
|
private inner class DestinationChangedListener : NavController.OnDestinationChangedListener {
|
||||||
override fun onDestinationChanged(controller: NavController, destination: NavDestination, arguments: Bundle?) {
|
override fun onDestinationChanged(controller: NavController, destination: NavDestination, arguments: Bundle?) {
|
||||||
when (destination.id) {
|
presentToolbarForDestination(destination)
|
||||||
R.id.conversationListFragment -> {
|
|
||||||
conversationListTabsViewModel.isShowingArchived(false)
|
|
||||||
presentToolbarForConversationListFragment()
|
|
||||||
}
|
|
||||||
R.id.conversationListArchiveFragment -> {
|
|
||||||
conversationListTabsViewModel.isShowingArchived(true)
|
|
||||||
presentToolbarForConversationListArchiveFragment()
|
|
||||||
}
|
|
||||||
R.id.storiesLandingFragment -> {
|
|
||||||
conversationListTabsViewModel.isShowingArchived(false)
|
|
||||||
presentToolbarForStoriesLandingFragment()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +340,7 @@ class MainActivityListHostFragment : Fragment(R.layout.main_activity_list_host_f
|
||||||
Material3OnScrollHelper(
|
Material3OnScrollHelper(
|
||||||
requireActivity(),
|
requireActivity(),
|
||||||
listOf(_toolbarBackground),
|
listOf(_toolbarBackground),
|
||||||
listOf(_searchToolbar, _basicToolbar)
|
listOf(_searchToolbar)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,11 +71,11 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/quote_attachment_name"
|
android:id="@+id/quote_attachment_name"
|
||||||
style="@style/Signal.Text.BodyMedium"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||||
android:textColor="@color/core_grey_90"
|
android:textColor="@color/core_grey_90"
|
||||||
tools:text="The-Amazing-Spider-Man.cba" />
|
tools:text="The-Amazing-Spider-Man.cba" />
|
||||||
|
|
||||||
|
@ -89,18 +89,17 @@
|
||||||
android:paddingTop="4dp"
|
android:paddingTop="4dp"
|
||||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||||
android:textColor="@color/core_black"
|
android:textColor="@color/core_black"
|
||||||
android:textSize="14sp"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Photo"
|
tools:text="Photo"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
|
||||||
android:id="@+id/quote_text"
|
android:id="@+id/quote_text"
|
||||||
style="@style/Signal.Text.BodyMedium"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
|
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||||
app:emoji_renderMentions="false"
|
app:emoji_renderMentions="false"
|
||||||
tools:text="With great power comes great responsibility."
|
tools:text="With great power comes great responsibility."
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
@ -174,10 +173,10 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/quote_missing_text"
|
android:id="@+id/quote_missing_text"
|
||||||
style="@style/Signal.Text.MaterialCaption"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/QuoteView_original_missing"
|
android:text="@string/QuoteView_original_missing"
|
||||||
|
android:textAppearance="@style/Signal.Text.MaterialCaption"
|
||||||
android:textColor="@color/core_grey_90" />
|
android:textColor="@color/core_grey_90" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Ładowanie…
Reference in New Issue