Java Code Examples for com.pluscubed.logcat.helper.PreferenceHelper#getDisplayLimitPreference()
The following examples show how to use
com.pluscubed.logcat.helper.PreferenceHelper#getDisplayLimitPreference() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogcatActivity.java From java-n-IDE-for-Android with Apache License 2.0 | 5 votes |
@Override protected void onProgressUpdate(LogLine... values) { super.onProgressUpdate(values); if (!mFirstLineReceived) { mFirstLineReceived = true; hideProgressBar(); } for (LogLine logLine : values) { mLogListAdapter.addWithFilter(logLine, mSearchingString); addToAutocompleteSuggestions(logLine); } // how many logs to keep in memory? this avoids OutOfMemoryErrors int maxNumLogLines = PreferenceHelper.getDisplayLimitPreference(LogcatActivity.this); // check to see if the list needs to be truncated to avoid out of memory errors if (++counter % UPDATE_CHECK_INTERVAL == 0 && mLogListAdapter.getTrueValues().size() > maxNumLogLines) { int numItemsToRemove = mLogListAdapter.getTrueValues().size() - maxNumLogLines; mLogListAdapter.removeFirst(numItemsToRemove); log.d("truncating %d lines from log list to avoid out of memory errors", numItemsToRemove); } if (mAutoscrollToBottom) { scrollToBottom(); } }
Example 2
Source File: LogcatActivity.java From javaide with GNU General Public License v3.0 | 5 votes |
@Override protected void onProgressUpdate(LogLine... values) { super.onProgressUpdate(values); if (!mFirstLineReceived) { mFirstLineReceived = true; hideProgressBar(); } for (LogLine logLine : values) { mLogListAdapter.addWithFilter(logLine, mSearchingString); addToAutocompleteSuggestions(logLine); } // how many logs to keep in memory? this avoids OutOfMemoryErrors int maxNumLogLines = PreferenceHelper.getDisplayLimitPreference(LogcatActivity.this); // check to see if the list needs to be truncated to avoid out of memory errors if (++counter % UPDATE_CHECK_INTERVAL == 0 && mLogListAdapter.getTrueValues().size() > maxNumLogLines) { int numItemsToRemove = mLogListAdapter.getTrueValues().size() - maxNumLogLines; mLogListAdapter.removeFirst(numItemsToRemove); log.d("truncating %d lines from log list to avoid out of memory errors", numItemsToRemove); } if (mAutoscrollToBottom) { scrollToBottom(); } }
Example 3
Source File: LogcatActivity.java From matlog with GNU General Public License v3.0 | 5 votes |
@Override protected void onProgressUpdate(LogLine... values) { super.onProgressUpdate(values); if (!mFirstLineReceived) { mFirstLineReceived = true; hideProgressBar(); } for (LogLine logLine : values) { mLogListAdapter.addWithFilter(logLine, mSearchingString, false); addToAutocompleteSuggestions(logLine); } mLogListAdapter.notifyDataSetChanged(); // how many logs to keep in memory? this avoids OutOfMemoryErrors int maxNumLogLines = PreferenceHelper.getDisplayLimitPreference(LogcatActivity.this); // check to see if the list needs to be truncated to avoid out of memory errors if (++counter % UPDATE_CHECK_INTERVAL == 0 && mLogListAdapter.getTrueValues().size() > maxNumLogLines) { int numItemsToRemove = mLogListAdapter.getTrueValues().size() - maxNumLogLines; mLogListAdapter.removeFirst(numItemsToRemove); log.d("truncating %d lines from log list to avoid out of memory errors", numItemsToRemove); } if (mAutoscrollToBottom) { scrollToBottom(); } }
Example 4
Source File: SettingsActivity.java From java-n-IDE-for-Android with Apache License 2.0 | 4 votes |
private void setUpPreferences() { displayLimitPreference = (EditTextPreference) findPreference(getString(R.string.pref_display_limit)); int displayLimitValue = PreferenceHelper.getDisplayLimitPreference(getActivity()); displayLimitPreference.setSummary(getString(R.string.pref_display_limit_summary, displayLimitValue, getString(R.string.pref_display_limit_default))); displayLimitPreference.setOnPreferenceChangeListener(this); logLinePeriodPreference = (EditTextPreference) findPreference(getString(R.string.pref_log_line_period)); int logLinePrefValue = PreferenceHelper.getLogLinePeriodPreference(getActivity()); logLinePeriodPreference.setSummary(getString(R.string.pref_log_line_period_summary, logLinePrefValue, getString(R.string.pref_log_line_period_default))); logLinePeriodPreference.setOnPreferenceChangeListener(this); textSizePreference = (ListPreference) findPreference(getString(R.string.pref_text_size)); textSizePreference.setSummary(textSizePreference.getEntry()); textSizePreference.setOnPreferenceChangeListener(this); defaultLevelPreference = (ListPreference) findPreference(getString(R.string.pref_default_log_level)); defaultLevelPreference.setOnPreferenceChangeListener(this); setDefaultLevelPreferenceSummary(defaultLevelPreference.getEntry()); bufferPreference = (MultipleChoicePreference) findPreference(getString(R.string.pref_buffer)); bufferPreference.setOnPreferenceChangeListener(this); setBufferPreferenceSummary(bufferPreference.getValue()); scrubberPreference = (SwitchPreference) getPreferenceScreen().findPreference("scrubber"); scrubberPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { LogLine.isScrubberEnabled = (boolean) newValue; return true; } }); }
Example 5
Source File: SettingsActivity.java From javaide with GNU General Public License v3.0 | 4 votes |
private void setUpPreferences() { displayLimitPreference = (EditTextPreference) findPreference(getString(R.string.pref_display_limit)); int displayLimitValue = PreferenceHelper.getDisplayLimitPreference(getActivity()); displayLimitPreference.setSummary(getString(R.string.pref_display_limit_summary, displayLimitValue, getString(R.string.pref_display_limit_default))); displayLimitPreference.setOnPreferenceChangeListener(this); logLinePeriodPreference = (EditTextPreference) findPreference(getString(R.string.pref_log_line_period)); int logLinePrefValue = PreferenceHelper.getLogLinePeriodPreference(getActivity()); logLinePeriodPreference.setSummary(getString(R.string.pref_log_line_period_summary, logLinePrefValue, getString(R.string.pref_log_line_period_default))); logLinePeriodPreference.setOnPreferenceChangeListener(this); textSizePreference = (ListPreference) findPreference(getString(R.string.pref_text_size)); textSizePreference.setSummary(textSizePreference.getEntry()); textSizePreference.setOnPreferenceChangeListener(this); defaultLevelPreference = (ListPreference) findPreference(getString(R.string.pref_default_log_level)); defaultLevelPreference.setOnPreferenceChangeListener(this); setDefaultLevelPreferenceSummary(defaultLevelPreference.getEntry()); bufferPreference = (MultipleChoicePreference) findPreference(getString(R.string.pref_buffer)); bufferPreference.setOnPreferenceChangeListener(this); setBufferPreferenceSummary(bufferPreference.getValue()); scrubberPreference = (SwitchPreference) getPreferenceScreen().findPreference("scrubber"); scrubberPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { LogLine.isScrubberEnabled = (boolean) newValue; return true; } }); }
Example 6
Source File: SettingsActivity.java From matlog with GNU General Public License v3.0 | 4 votes |
private void setUpPreferences() { setCurrentValue("ui.theme"); setCurrentValue("theme"); displayLimitPreference = (EditTextPreference) findPreference(getString(R.string.pref_display_limit)); int displayLimitValue = PreferenceHelper.getDisplayLimitPreference(getActivity()); displayLimitPreference.setSummary(getString(R.string.pref_display_limit_summary, displayLimitValue, getString(R.string.pref_display_limit_default))); displayLimitPreference.setOnPreferenceChangeListener(this); filterPatternPreference = (EditTextPreference) findPreference(getString(R.string.pref_filter_pattern)); filterPatternPreference.setSummary(getString(R.string.pref_filter_pattern_summary)); filterPatternPreference.setOnPreferenceChangeListener(this); logLinePeriodPreference = (EditTextPreference) findPreference(getString(R.string.pref_log_line_period)); int logLinePrefValue = PreferenceHelper.getLogLinePeriodPreference(getActivity()); logLinePeriodPreference.setSummary(getString(R.string.pref_log_line_period_summary, logLinePrefValue, getString(R.string.pref_log_line_period_default))); logLinePeriodPreference.setOnPreferenceChangeListener(this); textSizePreference = (ListPreference) findPreference(getString(R.string.pref_text_size)); textSizePreference.setSummary(textSizePreference.getEntry()); textSizePreference.setOnPreferenceChangeListener(this); defaultLevelPreference = (ListPreference) findPreference(getString(R.string.pref_default_log_level)); defaultLevelPreference.setOnPreferenceChangeListener(this); setDefaultLevelPreferenceSummary(defaultLevelPreference.getEntry()); mThemePreference = findPreference("ui.theme"); mThemePreference.setOnPreferenceChangeListener(this); bufferPreference = (MultipleChoicePreference) findPreference(getString(R.string.pref_buffer)); bufferPreference.setOnPreferenceChangeListener(this); setBufferPreferenceSummary(bufferPreference.getValue()); mThemePreference.setOnPreferenceChangeListener(this); mAboutPreference = findPreference(getString(R.string.pref_about)); mAboutPreference.setOnPreferenceClickListener(preference -> { // launch about activity Intent intent = new Intent(getActivity(), AboutDialogActivity.class); startActivity(intent); return true; }); mAboutPreference.setSummary(getString(R.string.version, PackageHelper.getVersionName(getActivity()))); scrubberPreference = (SwitchPreference) getPreferenceScreen().findPreference("scrubber"); scrubberPreference.setOnPreferenceChangeListener((preference, newValue) -> { LogLine.isScrubberEnabled = (boolean) newValue; return true; }); }