Widgets and other stuff
Widgets have now a new style, a new color, a new center of gravity. Optimized size is applied to all widgets, and there texts. A reset time bug after the break menu was found and solved
This commit is contained in:
parent
711f956872
commit
471d669d21
7 changed files with 63 additions and 53 deletions
|
|
@ -348,8 +348,6 @@ public class BreakReminder extends AppCompatActivity
|
|||
|
||||
ct_text.setText(bufferZeroMinute + (millisUntilFinished / 1000) / 60 + ":" + bufferZeroSecond + millisUntilFinished / 1000 % 60);
|
||||
|
||||
//Fixme Update widgets
|
||||
|
||||
updateWidgets(bufferZeroMinute + (millisUntilFinished / 1000) / 60 + ":" + bufferZeroSecond + millisUntilFinished / 1000 % 60);
|
||||
|
||||
//Show how much time is left
|
||||
|
|
@ -404,6 +402,13 @@ public class BreakReminder extends AppCompatActivity
|
|||
notificationManager.cancel(1000);
|
||||
}
|
||||
startBreak();
|
||||
|
||||
String workTime = "" + sharedPrefs.getInt("work_value", 0);
|
||||
if(workTime.length() == 1)
|
||||
workTime = "0" + workTime;
|
||||
|
||||
ct_text.setText(workTime + ":00");
|
||||
updateWidgets(workTime + ":00");
|
||||
}
|
||||
}.start();
|
||||
isRunning = true;
|
||||
|
|
|
|||
7
app/src/main/res/drawable/white_circle.xml
Normal file
7
app/src/main/res/drawable/white_circle.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<corners android:radius="80dip"/>
|
||||
<stroke android:color="@color/white" android:width="2dip"/>
|
||||
<solid android:color="@android:color/transparent"/>
|
||||
</shape>
|
||||
|
|
@ -29,6 +29,7 @@
|
|||
android:text="@string/break_play_stop"
|
||||
android:id="@+id/button_playStopBreak"
|
||||
android:layout_below="@+id/textViewBreak"
|
||||
android:background="@drawable/button_normal"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<Button
|
||||
|
|
@ -38,6 +39,7 @@
|
|||
android:text="@string/break_cancel"
|
||||
android:id="@+id/button_cancel"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/button_normal"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,23 +2,23 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:weightSum="1">
|
||||
android:weightSum="1"
|
||||
android:gravity="center|center_horizontal|center_vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000">
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@drawable/white_circle">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appwidget_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000"
|
||||
android:text="@string/profile_name"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="15sp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center" />
|
||||
|
|
@ -29,10 +29,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/appwidget_text"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#000000"
|
||||
android:text="@string/break_reminder_time"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#ffffff"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center" />
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
|
|
@ -2,39 +2,38 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:weightSum="1">
|
||||
android:weightSum="1"
|
||||
android:gravity="center|center_horizontal|center_vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="110dp"
|
||||
android:background="#000000">
|
||||
android:background="@drawable/white_circle">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appwidget_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000"
|
||||
android:text="@string/profile_name"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="25sp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center" />
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16dp"
|
||||
android:gravity="center"
|
||||
android:layout_above="@+id/time"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/appwidget_text"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#000000"
|
||||
android:text="@string/break_reminder_time"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="40sp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30dp"
|
||||
android:textIsSelectable="false"
|
||||
android:gravity="center" />
|
||||
android:gravity="center"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
|
@ -2,39 +2,38 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:weightSum="1">
|
||||
android:weightSum="1"
|
||||
android:gravity="center|center_horizontal|center_vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="180dp"
|
||||
android:background="#000000">
|
||||
android:background="@drawable/white_circle">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appwidget_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000"
|
||||
android:text="@string/profile_name"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="40sp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center" />
|
||||
android:textColor="@color/white"
|
||||
android:textSize="25dp"
|
||||
android:gravity="center"
|
||||
android:layout_above="@+id/time"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/appwidget_text"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#000000"
|
||||
android:text="@string/break_reminder_time"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="60sp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="60dp"
|
||||
android:textIsSelectable="false"
|
||||
android:gravity="center" />
|
||||
android:gravity="bottom"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
|
@ -2,39 +2,38 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:weightSum="1">
|
||||
android:weightSum="1"
|
||||
android:gravity="center|center_horizontal|center_vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="250dp"
|
||||
android:background="#000000">
|
||||
android:background="@drawable/white_circle">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appwidget_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000"
|
||||
android:text="@string/profile_name"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="60sp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center" />
|
||||
android:textColor="@color/white"
|
||||
android:textSize="35dp"
|
||||
android:gravity="center"
|
||||
android:layout_above="@+id/time"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/appwidget_text"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#000000"
|
||||
android:text="@string/break_reminder_time"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="100sp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="90dp"
|
||||
android:textIsSelectable="false"
|
||||
android:gravity="center" />
|
||||
android:gravity="center"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue