New ringtone activity layout

This commit is contained in:
Phillip Hsu
2016-08-06 00:06:15 -07:00
parent 6ae9c3511c
commit d845f241e9
9 changed files with 246 additions and 66 deletions
@@ -2,6 +2,8 @@ package com.philliphsu.clock2.timers;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import android.view.ViewGroup;
import com.philliphsu.clock2.R;
import com.philliphsu.clock2.Timer;
@@ -17,13 +19,60 @@ public class TimesUpActivity extends RingtoneActivity<Timer> {
TimerNotificationService.cancelNotification(this, getRingingObject().getId());
}
@Override
public int layoutResource() {
return R.layout.activity_ringtone;
}
@Override
protected Class<? extends RingtoneService> getRingtoneServiceClass() {
return TimerRingtoneService.class;
}
@Override
protected CharSequence getHeaderTitle() {
return getRingingObject().label();
}
@Override
protected void getHeaderContent(ViewGroup parent) {
// Inflate the content and apply the parent's layout params, but don't
// attach it to the parent yet. This is so the return value can be
// the root of the inflated content, and not the parent. Alternatively,
// we could set an id on the root of the content's layout and find it
// from the returned parent.
CountdownChronometer countdown = (CountdownChronometer) getLayoutInflater()
.inflate(R.layout.content_header_timesup_activity, parent, false);
countdown.setBase(SystemClock.elapsedRealtime());
countdown.start();
parent.addView(countdown);
}
@Override
protected int getAutoSilencedDrawable() {
// TODO: correct icon
return R.drawable.ic_half_day_1_black_24dp;
}
@Override
protected int getAutoSilencedText() {
return R.string.timer_auto_silenced_text;
}
@Override
protected int getLeftButtonDrawable() {
// TODO: correct icon
return R.drawable.ic_half_day_1_black_24dp;
}
@Override
protected int getRightButtonDrawable() {
// TODO: correct icon
return R.drawable.ic_half_day_1_black_24dp;
}
@Override
protected void onLeftButtonClick() {
}
@Override
protected void onRightButtonClick() {
}
}