kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix story touch interception which prevented moving between stories.
rodzic
eb18c073c6
commit
aa75f1f8a7
|
@ -154,12 +154,12 @@ class StorySlateView @JvmOverloads constructor(
|
|||
fun onStateChanged(state: State, postId: Long)
|
||||
}
|
||||
|
||||
enum class State(val code: Int) {
|
||||
LOADING(0),
|
||||
ERROR(1),
|
||||
RETRY(2),
|
||||
NOT_FOUND(3),
|
||||
HIDDEN(4);
|
||||
enum class State(val code: Int, val hasClickableContent: Boolean) {
|
||||
LOADING(0, false),
|
||||
ERROR(1, true),
|
||||
RETRY(2, true),
|
||||
NOT_FOUND(3, false),
|
||||
HIDDEN(4, false);
|
||||
|
||||
fun isValidTransitionTo(newState: State): Boolean {
|
||||
if (newState in listOf(HIDDEN, NOT_FOUND)) {
|
||||
|
|
|
@ -222,7 +222,7 @@ class StoryViewerPageFragment :
|
|||
)
|
||||
)
|
||||
|
||||
cardWrapper.setOnInterceptTouchEventListener { storySlate.state == StorySlateView.State.HIDDEN && childFragmentManager.findFragmentById(R.id.story_content_container) !is StoryTextPostPreviewFragment }
|
||||
cardWrapper.setOnInterceptTouchEventListener { !storySlate.state.hasClickableContent && childFragmentManager.findFragmentById(R.id.story_content_container) !is StoryTextPostPreviewFragment }
|
||||
cardWrapper.setOnTouchListener { _, event ->
|
||||
val result = gestureDetector.onTouchEvent(event)
|
||||
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
|
||||
|
|
Ładowanie…
Reference in New Issue