mirror of
https://github.com/Tencent/QMUI_Android.git
synced 2026-10-17 04:31:16 +08:00
handle keyboard
This commit is contained in:
@@ -25,13 +25,13 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.qmuiteam.qmui.arch.scheme.ActivitySchemeRefreshable;
|
||||
import com.qmuiteam.qmui.util.QMUIDisplayHelper;
|
||||
import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import static com.qmuiteam.qmui.arch.SwipeBackLayout.DRAG_DIRECTION_BOTTOM_TO_TOP;
|
||||
import static com.qmuiteam.qmui.arch.SwipeBackLayout.DRAG_DIRECTION_LEFT_TO_RIGHT;
|
||||
import static com.qmuiteam.qmui.arch.SwipeBackLayout.DRAG_DIRECTION_NONE;
|
||||
@@ -326,6 +326,11 @@ public class QMUIActivity extends InnerBaseActivity implements ActivitySchemeRef
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean interceptSelfKeyboardInset() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finish() {
|
||||
if (!QMUISwipeBackActivityManager.getInstance().canSwipeBack()) {
|
||||
|
||||
@@ -1403,6 +1403,11 @@ public abstract class QMUIFragment extends Fragment implements
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean interceptSelfKeyboardInset() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshFromScheme(@Nullable Bundle bundle) {
|
||||
|
||||
|
||||
@@ -244,6 +244,9 @@ public class SwipeBackLayout extends QMUIWindowInsetLayout implements IWindowIns
|
||||
|
||||
@Override
|
||||
public void onHandleKeyboard(int keyboardInset) {
|
||||
if(mOnKeyboardInsetHandler != null && mOnKeyboardInsetHandler.interceptSelfKeyboardInset()){
|
||||
return;
|
||||
}
|
||||
if(mOnKeyboardInsetHandler == null || !mOnKeyboardInsetHandler.handleKeyboardInset(keyboardInset)){
|
||||
QMUIViewHelper.setPaddingBottom(this, keyboardInset);
|
||||
}
|
||||
@@ -862,6 +865,7 @@ public class SwipeBackLayout extends QMUIWindowInsetLayout implements IWindowIns
|
||||
|
||||
public interface OnKeyboardInsetHandler {
|
||||
boolean handleKeyboardInset(int inset);
|
||||
boolean interceptSelfKeyboardInset();
|
||||
}
|
||||
|
||||
public static class ViewMoveAuto implements ViewMoveAction {
|
||||
|
||||
Reference in New Issue
Block a user