mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-19 13:01:17 +01:00
bug fix
This commit is contained in:
parent
dd54a3079f
commit
6398b829c1
@ -16,7 +16,7 @@ public class LockableConstraintLayout extends ConstraintLayout {
|
||||
|
||||
@Nullable
|
||||
private LockCallback callback;
|
||||
private boolean lock = true;
|
||||
private boolean lock = false;
|
||||
private float yPos = 0.0f;
|
||||
|
||||
/**
|
||||
@ -42,7 +42,7 @@ public class LockableConstraintLayout extends ConstraintLayout {
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if (ev.getY() < yPos && callback != null) {
|
||||
if (ev.getY() < yPos && callback != null) {// scroll down
|
||||
lock = callback.aquireLock();
|
||||
}
|
||||
yPos = ev.getY();
|
||||
|
@ -8,7 +8,7 @@ import android.widget.LinearLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* {@link LinearLayout} implementation with child scroll lock
|
||||
* Vertical {@link LinearLayout} implementation with child scroll lock
|
||||
*
|
||||
* @author nuclearfog
|
||||
*/
|
||||
@ -16,7 +16,7 @@ public class LockableLinearLayout extends LinearLayout {
|
||||
|
||||
@Nullable
|
||||
private LockCallback callback;
|
||||
private boolean lock = true;
|
||||
private boolean lock = false;
|
||||
private float yPos = 0.0f;
|
||||
|
||||
/**
|
||||
@ -35,6 +35,22 @@ public class LockableLinearLayout extends LinearLayout {
|
||||
setOrientation(VERTICAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public LockableLinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
setOrientation(VERTICAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public LockableLinearLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
setOrientation(VERTICAL);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
|
Loading…
Reference in New Issue
Block a user