Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. /**
  2. * Defines the default duration in milliseconds before a press turns into
  3. * a long press
  4. */
  5. private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500;
  6.  
  7. // Long press timeout.
  8. mSelectLongPressTimeoutPreference =
  9. (ListPreference) findPreference(SELECT_LONG_PRESS_TIMEOUT_PREFERENCE);
  10. mSelectLongPressTimeoutPreference.setOnPreferenceChangeListener(this);
  11. if (mLongPressTimeoutValueToTitleMap.size() == 0) {
  12. String[] timeoutValues = getResources().getStringArray(
  13. R.array.long_press_timeout_selector_values);
  14. mLongPressTimeoutDefault = Integer.parseInt(timeoutValues[0]);
  15. String[] timeoutTitles = getResources().getStringArray(
  16. R.array.long_press_timeout_selector_titles);
  17. final int timeoutValueCount = timeoutValues.length;
  18. for (int i = 0; i < timeoutValueCount; i++) {
  19. mLongPressTimeoutValueToTitleMap.put(timeoutValues[i], timeoutTitles[i]);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement