This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean dispatchTouchEvent(MotionEvent ev) { | |
if (getCurrentFocus() != null) { | |
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); | |
if (imm != null) { | |
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); | |
} | |
} | |
return super.dispatchTouchEvent(ev); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<item name="android:windowDisablePreview">true</item> | |
<item name="android:windowIsTranslucent">true</item> | |
add this to app theme in style.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function customizes the header of the tab | |
* | |
* @param tabName Name of the tab | |
* @return TextView -> header of the tab | |
*/ | |
private TextView getTabHeader(int tabName) { | |
TextView textView = new TextView(this); | |
textView.setText(tabName); | |
textView.setGravity(Gravity.CENTER); |