Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public void onComplete() {
finish();
}
});
if (snooze==0){
findViewById(R.id.snooze_alarm).setVisibility(View.INVISIBLE);
findViewById(R.id.snooze_bar).setVisibility(View.INVISIBLE);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,26 +475,24 @@ public void onCheckedChanged(CompoundButton b, boolean checked) {
final ViewGroup edit_snooze = newItem(c);
addView(edit_snooze);
setImage(edit_snooze, R.drawable.ic_snooze);
setText(edit_snooze, c.getString(R.string.minute_abbriv, s.snooze));
setText(edit_snooze, s.snooze==0?c.getString(R.string.off):c.getString(R.string.minute_abbriv, s.snooze));
final SeekBar snooze_bar = new SeekBar(c);
setView(edit_snooze, snooze_bar, 1.0f);
// Range 1 - 60 increments of 1.
snooze_bar.setMax(59);
snooze_bar.setProgress(s.snooze - 1);
// Range 0 - 60 increments of 1. 0 means off
snooze_bar.setMax(60);
snooze_bar.setProgress(s.snooze);
snooze_bar.setOnSeekBarChangeListener(
new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar s, int prog, boolean user) {
final int snooze = prog + 1;
setText(edit_snooze, c.getString(R.string.minute_abbriv, snooze));
setText(edit_snooze, prog==0?c.getString(R.string.off):c.getString(R.string.minute_abbriv, prog));
}
@Override
public void onStartTrackingTouch(SeekBar s) {}
@Override
public void onStopTrackingTouch(SeekBar s) {
final int snooze = s.getProgress() + 1;
ContentValues val = new ContentValues();
val.put(AlarmClockProvider.SettingsEntry.SNOOZE, snooze);
val.put(AlarmClockProvider.SettingsEntry.SNOOZE, s.getProgress());
c.getContentResolver().update(settings, val, null, null);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/snooze_bar"
android:orientation="horizontal"
android:layout_weight="1"
android:layout_width="fill_parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<string name="alarm_tone">Weckton</string>
<string name="fade_description">Von %1$d%% bis %2$d%% über %3$d Sekunden</string>
<string name="ok">OK</string>
<string name="off">aus</string>
<string name="cancel">Abbrechen</string>
<string name="delete">Löschen</string>
<string name="snooze">SNOOZE</string>
Expand Down
1 change: 1 addition & 0 deletions android/alarmclock/klock/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<string name="alarm_tone">Alarm tone</string>
<string name="fade_description">%1$d%% to %2$d%% over %3$d seconds</string>
<string name="ok">OK</string>
<string name="off">off</string>
<string name="cancel">Cancel</string>
<string name="done">Done</string>
<string name="snooze">SNOOZE</string>
Expand Down