How can I use SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN with SOFT_INPUT_ADJUST_RESIZE

68 views Asked by At

I want to extend my view to statusbar but when I use SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN the SOFT_INPUT_ADJUST_RESIZE will not work anymore! any suggestions?

I've tried this code but so far no luck!

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Window window = this.getWindow();
        View decorView = window.getDecorView();
        int flags = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
        decorView.setSystemUiVisibility(flags);

        window.setStatusBarColor(Color.TRANSPARENT);

        window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
    }
}
0

There are 0 answers