kopia lustrzana https://github.com/ryukoposting/Signal-Android
Hide tab bar during multiselect.
rodzic
be241524db
commit
fa515be258
|
@ -1019,6 +1019,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode
|
||||||
if (megaphoneContainer.resolved()) {
|
if (megaphoneContainer.resolved()) {
|
||||||
ViewUtil.fadeOut(megaphoneContainer.get(), 250);
|
ViewUtil.fadeOut(megaphoneContainer.get(), 250);
|
||||||
}
|
}
|
||||||
|
requireCallback().onMultiSelectStarted();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void endActionModeIfActive() {
|
private void endActionModeIfActive() {
|
||||||
|
@ -1036,6 +1037,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode
|
||||||
if (megaphoneContainer.resolved()) {
|
if (megaphoneContainer.resolved()) {
|
||||||
ViewUtil.fadeIn(megaphoneContainer.get(), 250);
|
ViewUtil.fadeIn(megaphoneContainer.get(), 250);
|
||||||
}
|
}
|
||||||
|
requireCallback().onMultiSelectFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateEmptyState(boolean isConversationEmpty) {
|
void updateEmptyState(boolean isConversationEmpty) {
|
||||||
|
@ -1565,6 +1567,8 @@ public class ConversationListFragment extends MainFragment implements ActionMode
|
||||||
void updateProxyStatus(@NonNull WebSocketConnectionState state);
|
void updateProxyStatus(@NonNull WebSocketConnectionState state);
|
||||||
void onSearchOpened();
|
void onSearchOpened();
|
||||||
void onSearchClosed();
|
void onSearchClosed();
|
||||||
|
void onMultiSelectStarted();
|
||||||
|
void onMultiSelectFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,7 @@ import android.graphics.Typeface
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import org.signal.imageeditor.core.Renderer
|
import org.signal.imageeditor.core.Renderer
|
||||||
import org.signal.imageeditor.core.RendererContext
|
import org.signal.imageeditor.core.RendererContext
|
||||||
import org.thoughtcrime.securesms.util.FutureTaskListener
|
|
||||||
import org.thoughtcrime.securesms.util.LocaleUtil
|
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.concurrent.ExecutionException
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RenderContext TypefaceProvider that provides typefaces using TextFont.
|
* RenderContext TypefaceProvider that provides typefaces using TextFont.
|
||||||
|
@ -20,7 +17,7 @@ class FontTypefaceProvider : RendererContext.TypefaceProvider {
|
||||||
|
|
||||||
override fun getSelectedTypeface(context: Context, renderer: Renderer, invalidate: RendererContext.Invalidate): Typeface {
|
override fun getSelectedTypeface(context: Context, renderer: Renderer, invalidate: RendererContext.Invalidate): Typeface {
|
||||||
return getTypeface()
|
return getTypeface()
|
||||||
//TODO [cody] Need to rework Fonts.kt to not hit network on main, reverting to old typeface for now
|
// TODO [cody] Need to rework Fonts.kt to not hit network on main, reverting to old typeface for now
|
||||||
// val typeface = cachedTypeface
|
// val typeface = cachedTypeface
|
||||||
// if (typeface != null && cachedLocale == LocaleUtil.getFirstLocale()) {
|
// if (typeface != null && cachedLocale == LocaleUtil.getFirstLocale()) {
|
||||||
// return typeface
|
// return typeface
|
||||||
|
|
|
@ -195,6 +195,14 @@ class MainActivityListHostFragment : Fragment(R.layout.main_activity_list_host_f
|
||||||
conversationListTabsViewModel.onSearchClosed()
|
conversationListTabsViewModel.onSearchClosed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onMultiSelectStarted() {
|
||||||
|
conversationListTabsViewModel.onMultiSelectStarted()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onMultiSelectFinished() {
|
||||||
|
conversationListTabsViewModel.onMultiSelectFinished()
|
||||||
|
}
|
||||||
|
|
||||||
private fun initializeProfileIcon(recipient: Recipient) {
|
private fun initializeProfileIcon(recipient: Recipient) {
|
||||||
Log.d(TAG, "Initializing profile icon")
|
Log.d(TAG, "Initializing profile icon")
|
||||||
val icon = requireView().findViewById<ImageView>(R.id.toolbar_icon)
|
val icon = requireView().findViewById<ImageView>(R.id.toolbar_icon)
|
||||||
|
|
|
@ -86,7 +86,7 @@ class ConversationListTabsFragment : Fragment(R.layout.conversation_list_tabs) {
|
||||||
storiesUnreadIndicator.visible = state.unreadStoriesCount > 0
|
storiesUnreadIndicator.visible = state.unreadStoriesCount > 0
|
||||||
storiesUnreadIndicator.text = formatCount(state.unreadStoriesCount)
|
storiesUnreadIndicator.text = formatCount(state.unreadStoriesCount)
|
||||||
|
|
||||||
requireView().visible = !state.isSearchOpen
|
requireView().visible = state.visibilityState.isVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun runLottieAnimations(vararg toAnimate: LottieAnimationView) {
|
private fun runLottieAnimations(vararg toAnimate: LottieAnimationView) {
|
||||||
|
|
|
@ -4,5 +4,14 @@ data class ConversationListTabsState(
|
||||||
val tab: ConversationListTab = ConversationListTab.CHATS,
|
val tab: ConversationListTab = ConversationListTab.CHATS,
|
||||||
val unreadChatsCount: Long = 0L,
|
val unreadChatsCount: Long = 0L,
|
||||||
val unreadStoriesCount: Long = 0L,
|
val unreadStoriesCount: Long = 0L,
|
||||||
val isSearchOpen: Boolean = false
|
val visibilityState: VisibilityState = VisibilityState()
|
||||||
)
|
) {
|
||||||
|
data class VisibilityState(
|
||||||
|
val isSearchOpen: Boolean = false,
|
||||||
|
val isMultiSelectOpen: Boolean = false
|
||||||
|
) {
|
||||||
|
fun isVisible(): Boolean {
|
||||||
|
return !isSearchOpen && !isMultiSelectOpen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -36,11 +36,19 @@ class ConversationListTabsViewModel(repository: ConversationListTabRepository) :
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onSearchOpened() {
|
fun onSearchOpened() {
|
||||||
store.update { it.copy(isSearchOpen = true) }
|
store.update { it.copy(visibilityState = it.visibilityState.copy(isSearchOpen = true)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onSearchClosed() {
|
fun onSearchClosed() {
|
||||||
store.update { it.copy(isSearchOpen = false) }
|
store.update { it.copy(visibilityState = it.visibilityState.copy(isSearchOpen = false)) }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onMultiSelectStarted() {
|
||||||
|
store.update { it.copy(visibilityState = it.visibilityState.copy(isMultiSelectOpen = true)) }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onMultiSelectFinished() {
|
||||||
|
store.update { it.copy(visibilityState = it.visibilityState.copy(isMultiSelectOpen = false)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
class Factory(private val repository: ConversationListTabRepository) : ViewModelProvider.Factory {
|
class Factory(private val repository: ConversationListTabRepository) : ViewModelProvider.Factory {
|
||||||
|
|
Ładowanie…
Reference in New Issue