TextView setHorizontallyScrolling - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setHorizontallyScrolling method.

This code example shows how to use the following methods:setHorizontallyScrolling, setInputType, setSingleLine
	static final LogCategory log = new LogCategory("MyPrefScreen");
	 
	void initNumberEdit(String key,int min,int max,int def,int desc_string_id){
		EditTextPreference pref = (EditTextPreference)findPreference(key);
		EditText et = pref.getEditText();
		et.setHorizontallyScrolling(true);
		et.setSingleLine(true);
		et.setInputType(InputType.TYPE_CLASS_NUMBER);
 
		final int _min = min;
		final int _max = max;
		final int _def = def;
		final int _desc_string_id = desc_string_id;
		 
		pref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
			@Override 
			public boolean onPreferenceChange(Preference preference, Object newValue) {
				if(!MyApp.checkInteger(newValue,_min,_max)){
					Toast.makeText(MyPrefScreen.this,R.string.number_range_error,Toast.LENGTH_SHORT).show();
					return false; 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related TextView setHorizontallyScrolling Questions & Answers:

setHorizontallyScrolling Method Overview
Sets whether the text should be allowed to be wider than the View is.
See Code Examples for other Android TextView Methods: