am 0fde6bb9
: Merge "[FRP] Shrink lock screen when keyboard pops up" into lmp-mr1-dev automerge: e0f637a
* commit '0fde6bb98a6e22088a53560f60b17cc824b8098f': [FRP] Shrink lock screen when keyboard pops up
This commit is contained in:
@@ -26,6 +26,7 @@ import android.os.Bundle;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowInsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup Wizard's version of ChooseLockPassword screen. It inherits the logic and basic structure
|
* Setup Wizard's version of ChooseLockPassword screen. It inherits the logic and basic structure
|
||||||
@@ -92,12 +93,15 @@ public class SetupChooseLockPassword extends ChooseLockPassword
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment {
|
public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment
|
||||||
|
implements View.OnApplyWindowInsetsListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
final View view = inflater.inflate(R.layout.setup_template, container, false);
|
final View view = inflater.inflate(R.layout.setup_template, container, false);
|
||||||
|
View scrollView = view.findViewById(R.id.bottom_scroll_view);
|
||||||
|
scrollView.setOnApplyWindowInsetsListener(this);
|
||||||
ViewGroup setupContent = (ViewGroup) view.findViewById(R.id.setup_content);
|
ViewGroup setupContent = (ViewGroup) view.findViewById(R.id.setup_content);
|
||||||
inflater.inflate(R.layout.setup_choose_lock_password, setupContent, true);
|
inflater.inflate(R.layout.setup_choose_lock_password, setupContent, true);
|
||||||
return view;
|
return view;
|
||||||
@@ -129,5 +133,20 @@ public class SetupChooseLockPassword extends ChooseLockPassword
|
|||||||
SetupChooseLockPassword activity = (SetupChooseLockPassword) getActivity();
|
SetupChooseLockPassword activity = (SetupChooseLockPassword) getActivity();
|
||||||
activity.mNavigationBar.getNextButton().setText(text);
|
activity.mNavigationBar.getNextButton().setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WindowInsets onApplyWindowInsets(View view, WindowInsets insets) {
|
||||||
|
SetupChooseLockPassword activity = (SetupChooseLockPassword) getActivity();
|
||||||
|
final int bottomMargin = Math.max(insets.getSystemWindowInsetBottom()
|
||||||
|
- activity.mNavigationBar.getView().getHeight(), 0);
|
||||||
|
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||||
|
lp.setMargins(lp.leftMargin, lp.topMargin, lp.rightMargin, bottomMargin);
|
||||||
|
view.setLayoutParams(lp);
|
||||||
|
return insets.replaceSystemWindowInsets(
|
||||||
|
insets.getSystemWindowInsetLeft(),
|
||||||
|
insets.getSystemWindowInsetTop(),
|
||||||
|
insets.getSystemWindowInsetRight(),
|
||||||
|
0 /* bottom */);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user