New preferences for timers

This commit is contained in:
Phillip Hsu
2016-08-08 18:58:07 -07:00
parent 74ec0fd883
commit 3e542f585e
5 changed files with 18 additions and 14 deletions
@@ -3,6 +3,7 @@ package com.philliphsu.clock2.timers;
import android.app.Notification;
import android.content.Intent;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.support.v4.app.NotificationCompat;
@@ -54,8 +55,9 @@ public class TimerRingtoneService extends RingtoneService<Timer> {
@Override
protected Uri getRingtoneUri() {
// TODO: Read Timer ringtone preference
return Settings.System.DEFAULT_ALARM_ALERT_URI;
String ringtone = PreferenceManager.getDefaultSharedPreferences(this).getString(
getString(R.string.key_timer_ringtone), Settings.System.ALARM_ALERT);
return Uri.parse(ringtone);
}
@Override
@@ -82,8 +84,8 @@ public class TimerRingtoneService extends RingtoneService<Timer> {
@Override
protected boolean doesVibrate() {
// TODO: Create new preference.
return false;
return PreferenceManager.getDefaultSharedPreferences(this).getBoolean(
getString(R.string.key_timer_vibrate), false);
}
@Override
@@ -22,7 +22,7 @@ import butterknife.OnClick;
*/
public class TimerViewHolder extends BaseViewHolder<Timer> {
private static final String TAG = "TimerViewHolder";
private static final int MAX_PROGRESS = 10000;
private static final int MAX_PROGRESS = 100000;
private final AsyncTimersTableUpdateHandler mAsyncTimersTableUpdateHandler;
private TimerController mController;