New ringtone activity layout
This commit is contained in:
parent
29194f241f
commit
6b7c9cedee
@ -62,6 +62,16 @@ public class AlarmActivity extends RingtoneActivity<Alarm> {
|
|||||||
return R.string.alarm_auto_silenced_text;
|
return R.string.alarm_auto_silenced_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLeftButtonText() {
|
||||||
|
return R.string.snooze;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getRightButtonText() {
|
||||||
|
return R.string.dismiss;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLeftButtonDrawable() {
|
protected int getLeftButtonDrawable() {
|
||||||
// TODO: correct icon
|
// TODO: correct icon
|
||||||
|
|||||||
@ -8,9 +8,7 @@ import android.os.Bundle;
|
|||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.support.annotation.DrawableRes;
|
import android.support.annotation.DrawableRes;
|
||||||
import android.support.annotation.StringRes;
|
import android.support.annotation.StringRes;
|
||||||
import android.support.design.widget.FloatingActionButton;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.GridLayout;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
@ -44,9 +42,9 @@ public abstract class RingtoneActivity<T extends Parcelable> extends AppCompatAc
|
|||||||
@Bind(R.id.auto_silenced_container) LinearLayout mAutoSilencedContainer;
|
@Bind(R.id.auto_silenced_container) LinearLayout mAutoSilencedContainer;
|
||||||
@Bind(R.id.auto_silenced_text) TextView mAutoSilencedText;
|
@Bind(R.id.auto_silenced_text) TextView mAutoSilencedText;
|
||||||
@Bind(R.id.ok) Button mOkButton;
|
@Bind(R.id.ok) Button mOkButton;
|
||||||
@Bind(R.id.buttons_container) GridLayout mButtonsContainer;
|
@Bind(R.id.buttons_container) LinearLayout mButtonsContainer;
|
||||||
@Bind(R.id.btn_left) FloatingActionButton mLeftButton;
|
@Bind(R.id.btn_text_left) TextView mLeftButton;
|
||||||
@Bind(R.id.btn_right) FloatingActionButton mRightButton;
|
@Bind(R.id.btn_text_right) TextView mRightButton;
|
||||||
|
|
||||||
protected abstract Class<? extends RingtoneService> getRingtoneServiceClass();
|
protected abstract Class<? extends RingtoneService> getRingtoneServiceClass();
|
||||||
|
|
||||||
@ -64,6 +62,12 @@ public abstract class RingtoneActivity<T extends Parcelable> extends AppCompatAc
|
|||||||
@StringRes
|
@StringRes
|
||||||
protected abstract int getAutoSilencedText();
|
protected abstract int getAutoSilencedText();
|
||||||
|
|
||||||
|
@StringRes
|
||||||
|
protected abstract int getLeftButtonText();
|
||||||
|
|
||||||
|
@StringRes
|
||||||
|
protected abstract int getRightButtonText();
|
||||||
|
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
protected abstract int getLeftButtonDrawable();
|
protected abstract int getLeftButtonDrawable();
|
||||||
|
|
||||||
@ -95,8 +99,10 @@ public abstract class RingtoneActivity<T extends Parcelable> extends AppCompatAc
|
|||||||
getHeaderContent((LinearLayout) findViewById(R.id.header));
|
getHeaderContent((LinearLayout) findViewById(R.id.header));
|
||||||
mAutoSilencedText.setCompoundDrawablesWithIntrinsicBounds(0, getAutoSilencedDrawable(), 0, 0);
|
mAutoSilencedText.setCompoundDrawablesWithIntrinsicBounds(0, getAutoSilencedDrawable(), 0, 0);
|
||||||
mAutoSilencedText.setText(getAutoSilencedText());
|
mAutoSilencedText.setText(getAutoSilencedText());
|
||||||
mLeftButton.setImageResource(getLeftButtonDrawable());
|
mLeftButton.setText(getLeftButtonText());
|
||||||
mRightButton.setImageResource(getRightButtonDrawable());
|
mRightButton.setText(getRightButtonText());
|
||||||
|
mLeftButton.setCompoundDrawablesWithIntrinsicBounds(0, getLeftButtonDrawable(), 0, 0);
|
||||||
|
mRightButton.setCompoundDrawablesWithIntrinsicBounds(0, getRightButtonDrawable(), 0, 0);
|
||||||
|
|
||||||
Intent intent = new Intent(this, getRingtoneServiceClass())
|
Intent intent = new Intent(this, getRingtoneServiceClass())
|
||||||
.putExtra(EXTRA_RINGING_OBJECT, mRingingObject);
|
.putExtra(EXTRA_RINGING_OBJECT, mRingingObject);
|
||||||
|
|||||||
@ -67,6 +67,16 @@ public class TimesUpActivity extends RingtoneActivity<Timer> {
|
|||||||
return R.string.timer_auto_silenced_text;
|
return R.string.timer_auto_silenced_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLeftButtonText() {
|
||||||
|
return R.string.add_one_minute;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getRightButtonText() {
|
||||||
|
return R.string.stop;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLeftButtonDrawable() {
|
protected int getLeftButtonDrawable() {
|
||||||
// TODO: correct icon
|
// TODO: correct icon
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
android:orientation="vertical"
|
||||||
android:background="@color/colorPrimary">
|
android:background="@color/colorPrimary">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -24,20 +25,20 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/auto_silenced_container"
|
android:id="@+id/auto_silenced_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/auto_silenced_text"
|
android:id="@+id/auto_silenced_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:keepScreenOn="true"
|
android:drawableTop="@drawable/ic_half_day_1_black_24dp"
|
||||||
android:gravity="center_horizontal"
|
android:drawablePadding="8dp"
|
||||||
|
android:text="@string/alarm_auto_silenced_text"
|
||||||
style="@style/TextAppearance.AppCompat.Large.Inverse"
|
style="@style/TextAppearance.AppCompat.Large.Inverse"
|
||||||
android:layout_marginBottom="8dp"/>
|
android:layout_marginBottom="16dp"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/ok"
|
android:id="@+id/ok"
|
||||||
@ -48,30 +49,47 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<android.support.v7.widget.GridLayout
|
<LinearLayout
|
||||||
android:id="@+id/buttons_container"
|
android:id="@+id/buttons_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:layout_marginBottom="72dp"
|
android:orientation="horizontal">
|
||||||
app:columnCount="2">
|
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<FrameLayout
|
||||||
android:id="@+id/btn_left"
|
android:id="@+id/btn_left"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
app:layout_columnWeight="1"
|
android:layout_weight="1"
|
||||||
app:layout_gravity="center"
|
android:background="?selectableItemBackground">
|
||||||
app:elevation="0dp"/>
|
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<TextView
|
||||||
|
android:id="@+id/btn_text_left"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
style="@style/TextAppearance.AppCompat.Medium.Inverse"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
android:id="@+id/btn_right"
|
android:id="@+id/btn_right"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
app:layout_columnWeight="1"
|
android:layout_weight="1"
|
||||||
app:layout_gravity="center"
|
android:background="?selectableItemBackground">
|
||||||
app:elevation="0dp"/>
|
|
||||||
|
|
||||||
</android.support.v7.widget.GridLayout>
|
<TextView
|
||||||
|
android:id="@+id/btn_text_right"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
style="@style/TextAppearance.AppCompat.Medium.Inverse"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clickable="true"
|
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginTop="8dp">
|
android:layout_marginTop="8dp">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user