move all preference related stuff in prefs subfolder

This commit is contained in:
Philipp Schaefer
2014-05-16 17:58:46 +02:00
parent 7c68567d17
commit 5b41dddb15
11 changed files with 51 additions and 47 deletions

View File

@@ -0,0 +1,34 @@
package com.cradle.iitc_mobile.prefs;
import android.content.Context;
import android.preference.CheckBoxPreference;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
// multiline checkbox preference
public class PluginPreference extends CheckBoxPreference {
public PluginPreference(Context context) {
super(context);
}
protected void onBindView(View view) {
super.onBindView(view);
makeMultiline(view);
}
protected void makeMultiline(View view) {
if (view instanceof ViewGroup) {
ViewGroup grp = (ViewGroup) view;
for (int index = 0; index < grp.getChildCount(); index++) {
makeMultiline(grp.getChildAt(index));
}
} else if (view instanceof TextView) {
TextView t = (TextView) view;
t.setSingleLine(false);
t.setEllipsize(null);
}
}
}