Last active
September 28, 2015 09:44
-
-
Save SelvinPL/e9549885632669c7a37f to your computer and use it in GitHub Desktop.
This file contains 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
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