public static float getTextSizePreference(Context context) { if (textSize == -1) { SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); String textSizePref = sharedPrefs.getString( context.getText(R.string.pref_text_size).toString(), context.getText(R.string.text_size_medium_value).toString()); if (textSizePref.equals(context.getText(R.string.text_size_xsmall_value))) { cacheTextsize(context, R.dimen.text_size_xsmall); } else if (textSizePref.equals(context.getText(R.string.text_size_small_value))) { cacheTextsize(context, R.dimen.text_size_small); } else if (textSizePref.equals(context.getText(R.string.text_size_medium_value))) { cacheTextsize(context, R.dimen.text_size_medium); } else if (textSizePref.equals(context.getText(R.string.text_size_large_value))) { cacheTextsize(context, R.dimen.text_size_large); } else { // xlarge cacheTextsize(context, R.dimen.text_size_xlarge); } } return textSize; }
public static List<String> getBufferNames(Context context) { List<String> buffers = getBuffers(context); List<String> bufferNames = new ArrayList<String>(); // TODO: this is inefficient - O(n^2) for (String buffer : buffers) { int idx = Arrays.asList(context.getResources().getStringArray( R.array.pref_buffer_choice_values)).indexOf(buffer); bufferNames.add(context.getResources().getStringArray(R.array.pref_buffer_choices)[idx]); } return bufferNames; }
private static int getColorAt(int i, Context context) { ColorScheme colorScheme = PreferenceHelper.getColorScheme(context); int[] colorArray = colorScheme.getTagColors(context); return colorArray[i]; }
logLine = LogLine.newLogLine("", PreferenceHelper.getExpandedByDefaultPreference(context)); levelTextView.setVisibility(logLine.getLogLevel() == -1 ? View.GONE : View.VISIBLE); int foregroundColor = PreferenceHelper.getColorScheme(context).getForegroundColor(context); float textSize = PreferenceHelper.getTextSizePreference(context); && PreferenceHelper.getShowTimestampAndPidPreference(context) && logLine.getProcessId() != -1; // -1 marks lines like 'beginning of /dev/log...' ? PreferenceHelper.getColorScheme(context).getSelectedColor(context) : context.getResources().getColor(android.R.color.transparent); view.setBackgroundColor(selectedBackground);
@Override public Boolean apply(Context context) { boolean isJellyBean = VersionHelper.getVersionSdkIntCompat() >= VersionHelper.VERSION_JELLYBEAN; return isJellyBean && !PreferenceHelper.getJellybeanRootRan(context); } }, new Callback<Context>(){
} else { PreferenceHelper.setJellybeanRootRan(context);
reader = loader.loadReader(); int maxLines = PreferenceHelper.getDisplayLimitPreference(LogService.this);
public static LogcatReaderLoader create(Context context, boolean recordingMode) { List<String> buffers = PreferenceHelper.getBuffers(context); LogcatReaderLoader loader = new LogcatReaderLoader(buffers, recordingMode); return loader; }
ColorScheme colorScheme = PreferenceHelper.getColorScheme(context);