Skip to content

Instantly share code, notes, and snippets.

@SelvinPL
Last active September 28, 2015 09:44
Show Gist options
  • Save SelvinPL/e9549885632669c7a37f to your computer and use it in GitHub Desktop.
Save SelvinPL/e9549885632669c7a37f to your computer and use it in GitHub Desktop.
private int _styleId = SOMEDEFAULTSTYLE;
public void setCustomStyle(int styleId) {
_styleId = styleId;
if(mEditText != null){
if(styleId == 1) {
mEditText.setTextAppearance(getActivity(), android.R.style.TextAppearance_Small);
}
else if(styleId == 2) {
mEditText.setTextAppearance(getActivity(), android.R.style.TextAppearance_Medium);
}
else if(styleId == 3) {
mEditText.setTextAppearance(getActivity(), android.R.style.TextAppearance_Large);
}
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
/* old code here*/
mEditText = (EditText) rootView.findViewById(R.id.editText);
setCustomStyle(_styleId);
/* rest of the old code */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment