Added Widgets
This commit is contained in:
parent
1586d93ad3
commit
2c97c0706e
17 changed files with 474 additions and 16 deletions
|
|
@ -6,7 +6,7 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
applicationId "orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder"
|
||||
minSdkVersion 15
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 23
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
package="orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder">
|
||||
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
|
|
@ -28,12 +29,26 @@
|
|||
android:value="orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder.BreakReminder" />
|
||||
</activity>
|
||||
<activity android:name=".BreakDeciderActivity" />
|
||||
<activity android:name=".BreakActivity"></activity>
|
||||
<activity android:name=".ProfileActivity"></activity>
|
||||
<activity android:name=".ExerciseTypeActivity"></activity>
|
||||
<activity android:name=".AboutActivity"></activity>
|
||||
<activity android:name=".StatisticsActivity"></activity>
|
||||
<activity android:name=".HelpActivity"></activity>
|
||||
<activity android:name=".BreakActivity" />
|
||||
<activity android:name=".ProfileActivity" />
|
||||
<activity android:name=".ExerciseTypeActivity" />
|
||||
<activity android:name=".AboutActivity" />
|
||||
<activity android:name=".StatisticsActivity" />
|
||||
<activity android:name=".HelpActivity" />
|
||||
|
||||
<receiver
|
||||
android:name=".AppWidget"
|
||||
android:label="Resizable Widget">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/app_widget2x1_info" />
|
||||
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
package orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.appwidget.AppWidgetProvider;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.Settings;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
/**
|
||||
* Implementation of App Widget functionality.
|
||||
*/
|
||||
public class AppWidget extends AppWidgetProvider {
|
||||
|
||||
static String time = "";
|
||||
static RemoteViews views = null;
|
||||
|
||||
static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
|
||||
int appWidgetId) {
|
||||
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
CharSequence widgetText = prefs.getString("name_text", "Help");
|
||||
|
||||
// Construct the RemoteViews object
|
||||
if (views == null)
|
||||
views = new RemoteViews(context.getPackageName(), R.layout.app_widget2x1);
|
||||
|
||||
views.setTextViewText(R.id.appwidget_text, widgetText);
|
||||
if (time.equals(""))
|
||||
views.setTextViewText(R.id.time, "00:00");
|
||||
else
|
||||
views.setTextViewText(R.id.time, time);
|
||||
|
||||
|
||||
//Open App if clicked
|
||||
Intent openApp = new Intent(context, BreakReminder.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, openApp, 0);
|
||||
views.setOnClickPendingIntent(R.id.appwidget_text, pendingIntent);
|
||||
views.setOnClickPendingIntent(R.id.time, pendingIntent);
|
||||
|
||||
// Instruct the widget manager to update the widget
|
||||
appWidgetManager.updateAppWidget(appWidgetId, views);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
|
||||
// There may be multiple widgets active, so update all of them
|
||||
for (int appWidgetId : appWidgetIds) {
|
||||
updateAppWidget(context, appWidgetManager, appWidgetId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnabled(Context context) {
|
||||
// Enter relevant functionality for when the first widget is created
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisabled(Context context) {
|
||||
// Enter relevant functionality for when the last widget is disabled
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
String data = "";
|
||||
Bundle getPrevData = intent.getExtras();
|
||||
if (getPrevData != null) {
|
||||
data = getPrevData.getString("time");
|
||||
if (data != null)
|
||||
time = data;
|
||||
}
|
||||
super.onReceive(context, intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAppWidgetOptionsChanged(Context context, AppWidgetManager appWidgetManager, int appWidgetId, Bundle newOptions) {
|
||||
|
||||
|
||||
System.out.println("Minimal width: " + newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH) + " minimal height: " + newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT));
|
||||
|
||||
// Get min width and height.
|
||||
int minWidth = newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH);
|
||||
int minHeight = newOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT);
|
||||
|
||||
|
||||
getRemoteViews(context, minWidth, minHeight);
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
CharSequence widgetText = prefs.getString("name_text", "Help");
|
||||
views.setTextViewText(R.id.appwidget_text, widgetText);
|
||||
views.setTextViewText(R.id.time, time);
|
||||
|
||||
//Open App if clicked
|
||||
Intent openApp = new Intent(context, BreakReminder.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, openApp, PendingIntent.FLAG_NO_CREATE);
|
||||
views.setOnClickPendingIntent(R.id.appwidget_text, pendingIntent);
|
||||
views.setOnClickPendingIntent(R.id.time, pendingIntent);
|
||||
|
||||
|
||||
// Obtain appropriate widget and update it.
|
||||
appWidgetManager.updateAppWidget(appWidgetId, views);
|
||||
|
||||
super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions);
|
||||
}
|
||||
|
||||
private RemoteViews getRemoteViews(Context context, int minWidth, int minHeight) {
|
||||
// First find out rows and columns based on width provided.
|
||||
int rows = getCellsForSize(minHeight);
|
||||
int columns = getCellsForSize(minWidth);
|
||||
|
||||
|
||||
int minValue = 0;
|
||||
if (columns < rows) {
|
||||
minValue = columns;
|
||||
} else {
|
||||
minValue = rows;
|
||||
}
|
||||
// Now you changing layout base on you column count
|
||||
// In this code from 1 column to 4
|
||||
// you can make code for more columns on your own.
|
||||
switch (minValue) {
|
||||
case 1:
|
||||
views = new RemoteViews(context.getPackageName(), R.layout.app_widget2x1);
|
||||
return views;
|
||||
case 2:
|
||||
views = new RemoteViews(context.getPackageName(), R.layout.app_widget2x2);
|
||||
return views;
|
||||
case 3:
|
||||
views = new RemoteViews(context.getPackageName(), R.layout.app_widget3x3);
|
||||
return views;
|
||||
case 4:
|
||||
views = new RemoteViews(context.getPackageName(), R.layout.app_widget4x4);
|
||||
return views;
|
||||
default:
|
||||
views = new RemoteViews(context.getPackageName(), R.layout.app_widget2x1);
|
||||
return views;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns number of cells needed for given size of the widget.
|
||||
*
|
||||
* @param size Widget size in dp.
|
||||
* @return Size in number of cells.
|
||||
*/
|
||||
private static int getCellsForSize(int size) {
|
||||
int n = 2;
|
||||
while (70 * n - 30 < size) {
|
||||
++n;
|
||||
}
|
||||
return n - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2,6 +2,8 @@ package orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder;
|
|||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
|
@ -38,14 +40,27 @@ public class BreakReminder extends AppCompatActivity
|
|||
private CountDownTimer ct;
|
||||
private String stopTime = "";
|
||||
private int oldTime = 0;
|
||||
|
||||
private boolean addNewProfile = false;
|
||||
private Spinner profileSpinner;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
boolean onPause = sharedPrefs.getBoolean("onPause", false);
|
||||
if (onPause) {
|
||||
System.out.println("ON PAUSE WAS TRUE!!!!");
|
||||
SharedPreferences.Editor editor = sharedPrefs.edit();
|
||||
editor.putBoolean("onPause", false);
|
||||
editor.apply();
|
||||
return;
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
System.out.println("WELCOME TO THE MOTHER FUCKING JUNGLE BIIIIIIIIIIIIIIIIIIIIIIIIIIITCH");
|
||||
|
||||
setContentView(R.layout.activity_break_reminder);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
|
@ -59,7 +74,7 @@ public class BreakReminder extends AppCompatActivity
|
|||
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||
navigationView.setNavigationItemSelectedListener(this);
|
||||
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
String allProfiles = sharedPrefs.getString("profiles", "");
|
||||
if (allProfiles.equals("")) {
|
||||
System.out.println("Es gibt noch keine Profile!!");
|
||||
|
|
@ -157,6 +172,9 @@ public class BreakReminder extends AppCompatActivity
|
|||
bufferZeroMinute = "0";
|
||||
|
||||
ct_text.setText(bufferZeroMinute + time / 1000 / 60 + ":00");
|
||||
|
||||
//FIXME Update Widgets
|
||||
updateWidgets(bufferZeroMinute + time / 1000 / 60 + ":00");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -212,11 +230,39 @@ public class BreakReminder extends AppCompatActivity
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
editor.putBoolean("onPause", true);
|
||||
editor.apply();
|
||||
System.out.println("IM ON PAUSE BITCH 1111111");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
fillProfiles();
|
||||
profileSpinner = (Spinner) findViewById(R.id.spinner);
|
||||
|
||||
//FIXME Add flag if New Profile or Resume
|
||||
if (addNewProfile) {
|
||||
fillProfiles();
|
||||
profileSpinner = (Spinner) findViewById(R.id.spinner);
|
||||
addNewProfile = false;
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
System.out.println("ON PAUSE CALLED!");
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
editor.putBoolean("onPause", false);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -266,7 +312,7 @@ public class BreakReminder extends AppCompatActivity
|
|||
int time = mins * 60 * 1000;
|
||||
|
||||
//FIXME Hardcoded for testing
|
||||
stopTime = (String) "00:05";//ct_text.getText();
|
||||
stopTime = (String) ct_text.getText();
|
||||
oldTime = time;
|
||||
|
||||
if (stopTime == "" && !isRunning) {
|
||||
|
|
@ -319,6 +365,10 @@ 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
|
||||
//String timeLeft = bufferZeroMinute + (millisUntilFinished / 1000) / 60 + ":" + bufferZeroSecond + millisUntilFinished / 1000 % 60;
|
||||
//System.out.println("Time left: " + timeLeft);
|
||||
|
|
@ -339,6 +389,9 @@ public class BreakReminder extends AppCompatActivity
|
|||
public void onFinish() {
|
||||
isRunning = false;
|
||||
ct_text.setText("00:00");
|
||||
|
||||
updateWidgets("00:00");
|
||||
|
||||
//trigger the alarm
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||
String ringPref = sharedPrefs.getString("notifications_new_message_ringtone", "");
|
||||
|
|
@ -409,18 +462,30 @@ public class BreakReminder extends AppCompatActivity
|
|||
}
|
||||
|
||||
private void createNewProfile() {
|
||||
addNewProfile = true;
|
||||
Intent intent = new Intent(this, ProfileActivity.class);
|
||||
this.startActivity(intent);
|
||||
}
|
||||
|
||||
private void updateWidgets(String time) {
|
||||
System.out.println("UPDATING THE WIDGET -------");
|
||||
Intent intent = new Intent(this, AppWidget.class);
|
||||
intent.putExtra("time", time);
|
||||
int ids[] = AppWidgetManager.getInstance(getApplication()).getAppWidgetIds(new ComponentName(this.getApplicationContext(), AppWidget.class));
|
||||
System.out.println("Number of WIDGETS : " + ids.length);
|
||||
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
|
||||
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids);
|
||||
sendBroadcast(intent);
|
||||
}
|
||||
|
||||
public void startBreak() {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String allProfiles = sharedPrefs.getString("profiles", "");
|
||||
String[] profiles = allProfiles.split(";");
|
||||
String currentProfile = sharedPrefs.getString("name_text", "");
|
||||
|
||||
for (int i = 0; i < profiles.length; i++){
|
||||
if(profiles[i].split(",")[0].equals(currentProfile) && profiles[i].split(",")[3].equals("true")){
|
||||
for (int i = 0; i < profiles.length; i++) {
|
||||
if (profiles[i].split(",")[0].equals(currentProfile) && profiles[i].split(",")[3].equals("true")) {
|
||||
Intent intent = new Intent(this, BreakActivity.class);
|
||||
this.startActivity(intent);
|
||||
return;
|
||||
|
|
|
|||
BIN
app/src/main/res/drawable-nodpi/example_appwidget_preview.png
Normal file
BIN
app/src/main/res/drawable-nodpi/example_appwidget_preview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
39
app/src/main/res/layout/app_widget2x1.xml
Normal file
39
app/src/main/res/layout/app_widget2x1.xml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:weightSum="1">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000">
|
||||
|
||||
<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:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center" />
|
||||
|
||||
<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="20sp"
|
||||
android:gravity="center" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
40
app/src/main/res/layout/app_widget2x2.xml
Normal file
40
app/src/main/res/layout/app_widget2x2.xml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:weightSum="1">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="110dp"
|
||||
android:background="#000000">
|
||||
|
||||
<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" />
|
||||
|
||||
<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:textIsSelectable="false"
|
||||
android:gravity="center" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
40
app/src/main/res/layout/app_widget3x3.xml
Normal file
40
app/src/main/res/layout/app_widget3x3.xml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:weightSum="1">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="180dp"
|
||||
android:background="#000000">
|
||||
|
||||
<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" />
|
||||
|
||||
<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:textIsSelectable="false"
|
||||
android:gravity="center" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
40
app/src/main/res/layout/app_widget4x4.xml
Normal file
40
app/src/main/res/layout/app_widget4x4.xml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:weightSum="1">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="250dp"
|
||||
android:background="#000000">
|
||||
|
||||
<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" />
|
||||
|
||||
<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:textIsSelectable="false"
|
||||
android:gravity="center" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
android:layout_centerHorizontal="true"
|
||||
android:clickable="true"
|
||||
android:enabled="true"
|
||||
android:text="@string/_30_00"
|
||||
android:text="@string/break_reminder_time"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textIsSelectable="false"
|
||||
android:textSize="60sp"
|
||||
|
|
|
|||
10
app/src/main/res/values-v14/dimens.xml
Normal file
10
app/src/main/res/values-v14/dimens.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Refer to App Widget Documentation for margin information
|
||||
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
|
||||
-->
|
||||
<dimen name="widget_margin">0dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
|
@ -7,4 +7,10 @@
|
|||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="appbar_padding_top">8dp</dimen>
|
||||
|
||||
<!--
|
||||
Refer to App Widget Documentation for margin information
|
||||
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
|
||||
-->
|
||||
<dimen name="widget_margin">8dp</dimen>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<string name="pref_title_vibrate">Vibrate</string>
|
||||
<string name="play_stop">Play/Stop</string>
|
||||
<string name="reset">Reset</string>
|
||||
<string name="_30_00" translatable="false">30:00</string>
|
||||
<string name="break_reminder_time" translatable="false">30:00</string>
|
||||
<string name="exercise_name">Exercise-name</string>
|
||||
<string name="exercise_time">Exercise time</string>
|
||||
<string name="repetitions">Repetitions</string>
|
||||
|
|
@ -90,6 +90,8 @@
|
|||
<string name="more_info">More Information can be found here:</string>
|
||||
<string name="url" translatable="false"><a href="https://www.secuso.informatik.tu-darmstadt.de/en/research/results/">https://www.secuso.org</a></string>
|
||||
<string name="break_explanation">You have to train your chest hard! Eat healthy</string>
|
||||
<string name="appwidget_text">EXAMPLE</string>
|
||||
<string name="add_widget">Add widget</string>
|
||||
|
||||
<!-- settings for BreakActivity -->
|
||||
|
||||
|
|
|
|||
10
app/src/main/res/xml/app_widget2x1_info.xml
Normal file
10
app/src/main/res/xml/app_widget2x1_info.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialKeyguardLayout="@layout/app_widget2x1"
|
||||
android:initialLayout="@layout/app_widget2x2"
|
||||
android:minHeight="40dp"
|
||||
android:minWidth="110dp"
|
||||
android:previewImage="@drawable/example_appwidget_preview"
|
||||
android:resizeMode="horizontal|vertical"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:widgetCategory="home_screen"></appwidget-provider>
|
||||
10
app/src/main/res/xml/app_widget2x2_info.xml
Normal file
10
app/src/main/res/xml/app_widget2x2_info.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialKeyguardLayout="@layout/app_widget2x2"
|
||||
android:initialLayout="@layout/app_widget2x2"
|
||||
android:minHeight="110dp"
|
||||
android:minWidth="110dp"
|
||||
android:previewImage="@drawable/example_appwidget_preview"
|
||||
android:resizeMode="none"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:widgetCategory="home_screen"></appwidget-provider>
|
||||
10
app/src/main/res/xml/app_widget3x3_info.xml
Normal file
10
app/src/main/res/xml/app_widget3x3_info.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialKeyguardLayout="@layout/app_widget3x3"
|
||||
android:initialLayout="@layout/app_widget3x3"
|
||||
android:minHeight="180dp"
|
||||
android:minWidth="180dp"
|
||||
android:previewImage="@drawable/example_appwidget_preview"
|
||||
android:resizeMode="none"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:widgetCategory="home_screen"></appwidget-provider>
|
||||
10
app/src/main/res/xml/app_widget4x4_info.xml
Normal file
10
app/src/main/res/xml/app_widget4x4_info.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:initialKeyguardLayout="@layout/app_widget4x4"
|
||||
android:initialLayout="@layout/app_widget4x4"
|
||||
android:minHeight="250dp"
|
||||
android:minWidth="250dp"
|
||||
android:previewImage="@drawable/example_appwidget_preview"
|
||||
android:resizeMode="none"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:widgetCategory="home_screen"></appwidget-provider>
|
||||
Loading…
Add table
Add a link
Reference in a new issue