Fix thumbnail not being clickable on initial media receive.
This commit is contained in:
parent
295d4b9466
commit
8bb3d71472
2 changed files with 8 additions and 1 deletions
|
@ -679,7 +679,7 @@ public class ThumbnailView extends FrameLayout {
|
|||
private class ThumbnailClickDispatcher implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
boolean controlsVisible = transferControlViewStub.getVisibility() == View.VISIBLE;
|
||||
boolean controlsVisible = transferControlViewStub.getVisibility() == View.VISIBLE && !transferControlViewStub.get().isGone();
|
||||
if (thumbnailClickListener != null && !controlsVisible) {
|
||||
thumbnailClickListener.onClick(view, slide);
|
||||
} else if (parentClickListener != null) {
|
||||
|
|
|
@ -41,6 +41,8 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
|||
private var state = TransferControlViewState()
|
||||
private val progressUpdateDebouncer: ThrottledDebouncer = ThrottledDebouncer(100)
|
||||
|
||||
private var mode: Mode = Mode.GONE
|
||||
|
||||
init {
|
||||
tag = uuid
|
||||
binding = TransferControlsViewBinding.inflate(LayoutInflater.from(context), this)
|
||||
|
@ -70,6 +72,10 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
|||
state = newState
|
||||
}
|
||||
|
||||
fun isGone(): Boolean {
|
||||
return mode == Mode.GONE
|
||||
}
|
||||
|
||||
private fun applyState(currentState: TransferControlViewState) {
|
||||
val mode = deriveMode(currentState)
|
||||
verboseLog("New state applying, mode = $mode")
|
||||
|
@ -92,6 +98,7 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
|||
Mode.RETRY_UPLOADING -> displayRetry(currentState, true)
|
||||
Mode.GONE -> displayChildrenAsGone()
|
||||
}
|
||||
this.mode = mode
|
||||
}
|
||||
|
||||
private fun deriveMode(currentState: TransferControlViewState): Mode {
|
||||
|
|
Loading…
Add table
Reference in a new issue