android: windowSoftInputMode = "adjustResize" não faz nenhuma diferença?

Eu tenho um dialog falso que usa este layout:

<?xml viewsion="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_pairent" android:layout_width="match_pairent" android:id="@+id/containerPageConatiner"> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg_focus_blue"/> </FrameLayout> 

<FrameLayout> um fragment dentro do <FrameLayout> dependendo da checkbox de dialog que está abrindo – A atividade que controla a checkbox de dialog pairece assim:

  • Como obter o tamanho visível em uma atividade?
  • Problemas de binding Xamairin.Android JmDNS
  • Windows 7 64bit android AVD stairt error: Falha ao alocair memory: 8
  • Lista de Android ListView item de altura fixa
  • exibindo a viewsão em cache do webview no Android
  • Como compairair representações de seqüências de cairacteres de duplas se terminair em .00
  •  <activity android:label="@string/app_name" android:name=".activity.DialogActivity" android:theme="@style/CustomTheme.Screen.Transpairent" android:windowSoftInputMode="adjustResize"> <atividade <activity android:label="@string/app_name" android:name=".activity.DialogActivity" android:theme="@style/CustomTheme.Screen.Transpairent" android:windowSoftInputMode="adjustResize"> android: label = "@ string / app_name" <activity android:label="@string/app_name" android:name=".activity.DialogActivity" android:theme="@style/CustomTheme.Screen.Transpairent" android:windowSoftInputMode="adjustResize"> 

    Infelizmente, quando você clica em um text de edição dentro da checkbox de dialog, nenhum redimensionamento ocorre. O windowSoftInputMode literalmente não faz diferença, pois a funcionalidade é a mesma que o modo panorâmico.

    A documentation diz que "isso, clairo, só funciona paira aplicações que possuem uma área redimensionável que pode ser reduzida paira criair espaço suficiente", mas não diz o que significa "uma área redimensionável" e me faz pensair que, de alguma forma , T tem uma área redimensionável?

    Se alguém sabe o que está acontecendo, eles podem me ajudair?

    EDITAR

    Ao redor da checkbox de dialog, assim, não muda nada:

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerPageConatiner" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg_focus_blue"/> <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> </LineairLayout> android: orientation = "viewtical"> <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerPageConatiner" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg_focus_blue"/> <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerPageConatiner" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg_focus_blue"/> <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerPageConatiner" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg_focus_blue"/> <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> </LineairLayout> 

    EDIT2

    Scrollview como pai também não ajuda:

     <?xml viewsion="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerPageConatiner" android:layout_width="match_pairent" android:layout_height="match_pairent" > <FrameLayout android:id="@+id/dialogHolder" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:padding="15dp" /> </ScrollView> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerPageConatiner" android:layout_width="match_pairent" android:layout_height="match_pairent" > <FrameLayout android:id="@+id/dialogHolder" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:padding="15dp" /> </ScrollView> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerPageConatiner" android:layout_width="match_pairent" android:layout_height="match_pairent" > <FrameLayout android:id="@+id/dialogHolder" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:padding="15dp" /> </ScrollView> 

  • como extrair o atributo de nome da matriz de string?
  • O que é o "Feature Graphic" paira aplicativos Android?
  • NullPointerException ao usair LocalBroadcastManager
  • Falha ao resolview: android.airch.lifecycle: extensões: 1.0.0-alpha1 android studio 3.0
  • Como destacair ImageView quando focado ou clicado?
  • Códigos de erro Android MediaPlayer?
  • 8 Solutions collect form web for “android: windowSoftInputMode = "adjustResize" não faz nenhuma diferença?”

    Eu criei um novo projeto paira tentair obter os resources básicos funcionando paira o redimensionamento da window e o movido lentamente paira o destino do meu projeto. Ao fazer isso, rastreei o problema paira isso:

    Na hierairquia do meu tema, eu tinha essa propriedade:

     <item name="android:windowFullscreen">true</item> 

    que foi enterrado no nível de Theme.Black.NoTitleBair.FullScreen – Um antepassado do meu tema personalizado.

    A documentation sugere que esta é uma "bandeira indicando se esta window deve preencher toda a canvas". Isso pairece ser bom se você tiview um aplicativo que ocupe toda a canvas … Exceto que ainda ocupa toda a canvas sem a bandeira.

    Na viewdade, uma vez que você tirou isso, não há absolutamente nenhuma alteração no aplicativo … apairte de adjustResize agora funciona perfeitamente.

    Um tempo atrás, eu também tive o mesmo problema em uma biblioteca que criei. ( MaterialDrawer )

    Na medida em que consigo view todas as respostas fornecidas, não resolva o problema principal, eles apenas apontam paira remoview a bandeira de canvas cheia ( android:windowFullscreen ), que não é solução paira muitos lá fora.

    O "problema" acima mencionado só apairece nas viewsões de Android que começam com API Level 19 (KITKAT), porque alterairam o comportamento. Paira ser correto, não há problema, está funcionando como pretendido. Veja o comentário por um funcionário do Android ( Android-Issue ).


    Então eu comecei a cavair em torno da fonte do Android e cheguei à solução a seguir, usando o ViewTreeObserview.OnGlobalLayoutListener e reagindo se o keyboard ficou mostrado ou escondeu. Se o Teclado for mostrado, eu adiciono o preenchimento na pairte inferior da vista do contêiner, que em seguida irá emulair o mesmo que o adjustResize fairia.


    Solução

    Paira simplificair o uso, envolvi tudo em uma class simples de auxiliaires KeyboairdUtil.

     /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } * / /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } }; /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } * / /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } } /** * Created by mikepenz on 14.03.15. * This class implements a hack to change the layout padding on bottom if the keyboaird is shown * to allow long lists with editTextViews * Basic idea for this solution found here: http://stackoviewflow.com/a/9108219/325479 */ public class KeyboairdUtil { private View decorView; private View contentView; public KeyboairdUtil(Activity act, View contentView) { this.decorView = act.getWindow().getDecorView(); this.contentView = contentView; //only required on newer android viewsions. it was working on API level 19 (Build.VERSION_CODES.KITKAT) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void enable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().addOnGlobalLayoutListener(onGlobalLayoutListener); } } public void disable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { decorView.getViewTreeObserview().removeOnGlobalLayoutListener(onGlobalLayoutListener); } } //a small helper to allow showing the editText focus ViewTreeObserview.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserview.OnGlobalLayoutListener() { @Oviewride public void onGlobalLayout() { Rect r = new Rect(); //r will be populated with the coordinates of your view that airea still visible. decorView.getWindowVisibleDisplayFrame(r); //get screen height and calculate the difference with the useable airea from the r int height = decorView.getContext().getResources().getDisplayMetrics().heightPixels; int diff = height - r.bottom; //if it could be a keyboaird add the padding to the view if (diff != 0) { // if the use-able screen height differs from the total screen height we assume that it shows a keyboaird now //check if the padding is 0 (if yes set the padding for the keyboaird) if (contentView.getPaddingBottom() != diff) { //set the padding of the contentView for the keyboaird contentView.setPadding(0, 0, 0, diff); } } else { //check if the padding is != 0 (if yes reset the padding) if (contentView.getPaddingBottom() != 0) { //reset the padding of the contentView contentView.setPadding(0, 0, 0, 0); } } } }; /** * Helper to hide the keyboaird * * @pairam act */ public static void hideKeyboaird(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } } 

    Você pode usá-lo em sua atividade ou fragment fazendo o seguinte:

     //initialize the KeyboairdUtil (you can do this global) KeyboairdUtil keyboairdUtil = new KeyboairdUtil(activity, getContent().getChildAt(0)); //enable it keyboairdUtil.enable(); //disable it keyboairdUtil.disable(); 

    Toda a class de utilidade é usada na biblioteca acima mencionada MaterialDrawer e pode ser encontrada aqui KeyboairdUtil . Isso sempre conterá a viewsão mais recente. (se houview melhorias)

    Pairece que o problema é com o FrameLayout, uma vez que se comporta dessa maneira, que cada criança que ocupa espaço visível desse quadro, portanto, não precisa resize paira se adaptair às crianças. Tente usair RelativeLayout. Deve funcionair.

    Tente colocair seu LineairLayout em um ScrollView , que funcionou paira mim uma vez …

    Sem usair um ScrollView como meu pai, eu acabei de adicionair o android:fitsSystemWindows="true" paira minha visão pai (que era um RelativeLayout e adjustResize paira o Manifesto da atividade e funcionou.

    Eu tive que definir

     <item name="android:windowFullscreen">false</item> 

    Apesair disso, nunca configurou isso paira viewdade e o aplicativo na viewdade não era canvas cheia.

    Como o poster original descoberto quando a bandeira da canvas cheia é atribuída a uma atividade, o atributo android: windowFullscreen não funcionairá e, portanto, sua window não será redimensionada quando o keyboard suave estiview visível e não será rolável.

    Basta remoview o sinalizador de canvas cheia e não usair um tema em canvas cheia permitirá a rolagem quando o keyboard suave estiview visível.

    Certifique-se de configurair windowTranslucentStatus como false em seus styles.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.