Added Images. Added Settings page. Exercise Time is now settable through the settings page. Added a "keep_screen_on_during_exercise" setting as well.
14
.idea/misc.xml
generated
|
|
@ -27,19 +27,7 @@
|
|||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
<OptionsSetting value="true" id="Checkout" />
|
||||
<OptionsSetting value="true" id="Update" />
|
||||
<OptionsSetting value="true" id="Status" />
|
||||
<OptionsSetting value="true" id="Edit" />
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
applicationId "org.secuso.privacyfriendlybreakreminder"
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 24
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 25
|
||||
versionCode 2
|
||||
versionName "2.0"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
|
@ -18,12 +18,22 @@ android {
|
|||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
}
|
||||
|
||||
repositories{
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||
compile 'com.android.support:appcompat-v7:25.3.1'
|
||||
compile 'com.android.support:design:25.3.1'
|
||||
compile 'com.github.bumptech.glide:glide:3.7.0'
|
||||
compile 'com.android.support:support-v4:25.3.1'
|
||||
compile 'com.android.support:support-annotations:25.3.1'
|
||||
compile 'com.android.support:cardview-v7:25.3.1'
|
||||
|
|
@ -31,4 +41,5 @@ dependencies {
|
|||
compile 'com.nex3z:flow-layout:1.0.0'
|
||||
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile 'com.shawnlin:number-picker:2.4.4'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,19 +7,21 @@
|
|||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:largeHeap="true"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
<activity
|
||||
android:name=".activities.old.SettingsActivity"
|
||||
android:name=".activities.SettingsActivity"
|
||||
android:label="@string/title_activity_settings"
|
||||
android:parentActivityName=".activities.old.BreakReminder"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:parentActivityName=".activities.TimerActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.old.BreakReminder" />
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.TimerActivity" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
|
|
@ -48,6 +50,7 @@
|
|||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activities.tutorial.TutorialActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
|
|
@ -68,12 +71,14 @@
|
|||
android:name=".activities.ManageExerciseSetsActivity"
|
||||
android:label="@string/activity_title_manage_exercise_sets"
|
||||
android:parentActivityName=".activities.TimerActivity"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.TimerActivity" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activities.ExerciseActivity"
|
||||
android:label=""
|
||||
|
|
@ -83,8 +88,10 @@
|
|||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.TimerActivity" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activities.EditExerciseSetActivity"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:label="@string/activity_title_edit_exercise_set"
|
||||
android:parentActivityName=".activities.ManageExerciseSetsActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import android.support.v7.widget.Toolbar;
|
|||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
|
@ -39,6 +40,8 @@ import static org.secuso.privacyfriendlybreakreminder.activities.adapter.Exercis
|
|||
|
||||
public class EditExerciseSetActivity extends AppCompatActivity implements android.support.v4.app.LoaderManager.LoaderCallbacks<ExerciseSet> {
|
||||
|
||||
|
||||
private static final String TAG = EditExerciseSetActivity.class.getSimpleName();
|
||||
// extras
|
||||
public static final String EXTRA_EXERCISE_SET_ID = "EXTRA_EXERCISE_SET_ID";
|
||||
public static final String EXTRA_EXERCISE_SET_NAME = "EXTRA_EXERCISE_SET_NAME";
|
||||
|
|
@ -207,11 +210,6 @@ public class EditExerciseSetActivity extends AppCompatActivity implements androi
|
|||
exerciseSet.setName(exerciseSetNameText.getText().toString());
|
||||
mDbHelper.updateExerciseSet(exerciseSet);
|
||||
}
|
||||
|
||||
// TODO: save changes to database
|
||||
// man könnte den unterschied, der gespeichert werden muss rausfinden, indem man nur die änderungen speichert..
|
||||
// man könnte auch einfach alle dateneinträge zu dem set löschen und neu eintragen
|
||||
// man könnte das exerciseSet clonable machen und eine original kopie abspeichern und dann mit dem aus dem adapter vergleichen
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -260,6 +258,8 @@ public class EditExerciseSetActivity extends AppCompatActivity implements androi
|
|||
i.putExtra(ChooseExerciseActivity.EXTRA_SELECTED_EXERCISES , getSelectedExerciseIds());
|
||||
startActivityForResult(i, PICK_EXERCISE_REQUEST);
|
||||
break;
|
||||
default:
|
||||
Log.d(TAG, "Unknown Button clicked.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import org.secuso.privacyfriendlybreakreminder.activities.tutorial.PrefManager;
|
|||
import org.secuso.privacyfriendlybreakreminder.database.SQLiteHelper;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.data.Exercise;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.data.ExerciseSet;
|
||||
import org.secuso.privacyfriendlybreakreminder.dialog.ExerciseDialog;
|
||||
import org.secuso.privacyfriendlybreakreminder.exercises.ExerciseLocale;
|
||||
|
||||
import java.util.Locale;
|
||||
|
|
@ -60,11 +61,16 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
private ProgressBar progressBarBig;
|
||||
private TextView breakTimerTextBig;
|
||||
private ConstraintLayout bigProgressBarLayout;
|
||||
private ImageButton exerciseInfoButton;
|
||||
|
||||
private boolean isActivityVisible = false;
|
||||
private boolean isBreakFinished = false;
|
||||
|
||||
private boolean repeatStatus;
|
||||
private boolean continuousStatus;
|
||||
private boolean showBigTimer = false;
|
||||
private boolean showControlButtons = true;
|
||||
private boolean keepScreenOn = true;
|
||||
|
||||
// exerciseSet info
|
||||
private long exerciseSetId;
|
||||
|
|
@ -73,7 +79,7 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
private int currentExercisePart = 0;
|
||||
|
||||
// timer
|
||||
private final long exerciseTime = 20 * 1000;
|
||||
private long exerciseTime = 20 * 1000;
|
||||
private long pauseDuration;
|
||||
private CountDownTimer exerciseTimer;
|
||||
private CountDownTimer breakTimer;
|
||||
|
|
@ -96,6 +102,12 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
pauseDuration = pref.getLong(PrefManager.PAUSE_TIME, 5 * 60 * 1000);
|
||||
repeatStatus = pref.getBoolean(PrefManager.REPEAT_STATUS, false);
|
||||
continuousStatus = pref.getBoolean(PrefManager.CONTINUOUS_STATUS, false);
|
||||
try {
|
||||
exerciseTime = Long.parseLong(pref.getString(PrefManager.EXERCISE_DURATION, "30")) * 1000;
|
||||
} catch(NumberFormatException e) {
|
||||
exerciseTime = 30L * 1000;
|
||||
}
|
||||
keepScreenOn = pref.getBoolean(PrefManager.KEEP_SCREEN_ON_DURING_EXERCISE, true);
|
||||
|
||||
initResources();
|
||||
|
||||
|
|
@ -105,7 +117,9 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
ab.setHomeAsUpIndicator(R.drawable.ic_close_white);
|
||||
}
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
if(keepScreenOn) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
getSupportLoaderManager().initLoader(0, null, this);
|
||||
}
|
||||
|
|
@ -124,6 +138,7 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
continuousButton = (ImageButton) findViewById(R.id.button_continuous);
|
||||
prevButton = (ImageButton) findViewById(R.id.button_prev);
|
||||
nextButton = (ImageButton) findViewById(R.id.button_next);
|
||||
exerciseInfoButton = (ImageButton) findViewById(R.id.exercise_info_button);
|
||||
|
||||
progressBarBig = (ProgressBar) findViewById(R.id.progressBarBig);
|
||||
breakTimerTextBig = (TextView) findViewById(R.id.breakTimerTextBig);
|
||||
|
|
@ -137,7 +152,11 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
showConfirmationDialog();
|
||||
if(!isBreakFinished) {
|
||||
showConfirmationDialog();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
|
@ -160,54 +179,62 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
showConfirmationDialog();
|
||||
if(isBreakFinished) {
|
||||
showConfirmationDialog();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finish() {
|
||||
Intent intent = new Intent(ExerciseActivity.this, TimerActivity.class);
|
||||
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||
|
||||
super.finish();
|
||||
ExerciseActivity.this.startActivity(intent);
|
||||
ExerciseActivity.this.overridePendingTransition(0, 0);
|
||||
}
|
||||
|
||||
private void showConfirmationDialog() {
|
||||
new AlertDialog.Builder(this)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
Intent intent = new Intent(ExerciseActivity.this, TimerActivity.class);
|
||||
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||
|
||||
ExerciseActivity.this.finish();
|
||||
ExerciseActivity.this.startActivity(intent);
|
||||
ExerciseActivity.this.overridePendingTransition(0, 0);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
dialogInterface.dismiss();
|
||||
}
|
||||
})
|
||||
.setMessage(R.string.dialog_leave_break_confirmation)
|
||||
.create().show();
|
||||
if(isActivityVisible) {
|
||||
new AlertDialog.Builder(this)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
ExerciseActivity.this.finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
dialogInterface.dismiss();
|
||||
}
|
||||
})
|
||||
.setMessage(R.string.dialog_leave_break_confirmation)
|
||||
.create().show();
|
||||
}
|
||||
}
|
||||
|
||||
private void showEndDialog() {
|
||||
new AlertDialog.Builder(this)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
Intent intent = new Intent(ExerciseActivity.this, TimerActivity.class);
|
||||
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||
|
||||
ExerciseActivity.this.finish();
|
||||
ExerciseActivity.this.startActivity(intent);
|
||||
ExerciseActivity.this.overridePendingTransition(0, 0);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
dialogInterface.dismiss();
|
||||
}
|
||||
})
|
||||
.setTitle(R.string.dialog_end_break_confirmation_title)
|
||||
.setMessage(R.string.dialog_end_break_confirmation)
|
||||
.create().show();
|
||||
if(isActivityVisible) {
|
||||
new AlertDialog.Builder(this)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
ExerciseActivity.this.finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
dialogInterface.dismiss();
|
||||
}
|
||||
})
|
||||
.setTitle(R.string.dialog_end_break_confirmation_title)
|
||||
.setMessage(R.string.dialog_end_break_confirmation)
|
||||
.create().show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -228,6 +255,28 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
isActivityVisible = true;
|
||||
|
||||
if(isBreakFinished) {
|
||||
showEndDialog();
|
||||
}
|
||||
|
||||
if(keepScreenOn) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
isActivityVisible = false;
|
||||
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(Loader<ExerciseSet> loader, ExerciseSet set) {
|
||||
if(set != null) {
|
||||
|
|
@ -447,17 +496,32 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
return false;
|
||||
}
|
||||
|
||||
private void showExercise(Exercise e, int image) {
|
||||
private void showExercise(final Exercise e, int image) {
|
||||
int[] images = e.getImageResIds(this);
|
||||
|
||||
if (image < 0 || image >= images.length) {
|
||||
image = 0;
|
||||
}
|
||||
|
||||
View.OnClickListener infoClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
pauseExerciseTimer();
|
||||
ExerciseDialog.showExerciseDialog(ExerciseActivity.this, e, new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialogInterface) {
|
||||
resumeExerciseTimer();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
executionText.setText(e.getExecution());
|
||||
descriptionText.setText(e.getDescription());
|
||||
sectionText.setText(e.getSection());
|
||||
exerciseImage.setImageResource(e.getImageResIds(this)[image]);
|
||||
exerciseImage.setOnClickListener(infoClickListener);
|
||||
exerciseInfoButton.setOnClickListener(infoClickListener);
|
||||
|
||||
if(continuousStatus)
|
||||
startExerciseTimer();
|
||||
|
|
@ -529,6 +593,7 @@ public class ExerciseActivity extends AppCompatActivity implements android.suppo
|
|||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
isBreakFinished = true;
|
||||
remainingBreakDuration = 0;
|
||||
isBreakTimerRunning = false;
|
||||
updateBreakTimer(remainingBreakDuration);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,113 @@
|
|||
|
||||
package org.secuso.privacyfriendlybreakreminder.activities;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.media.Ringtone;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.PersistableBundle;
|
||||
import android.preference.ListPreference;
|
||||
import android.preference.Preference;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.preference.RingtonePreference;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.helper.BaseActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.R;
|
||||
|
||||
public class SettingsActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* A preference value change listener that updates the preference's summary
|
||||
* to reflect its new value.
|
||||
*/
|
||||
private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object value) {
|
||||
String stringValue = value.toString();
|
||||
|
||||
if (preference instanceof ListPreference) {
|
||||
// For list preferences, look up the correct display value in
|
||||
// the preference's 'entries' list.
|
||||
ListPreference listPreference = (ListPreference) preference;
|
||||
int index = listPreference.findIndexOfValue(stringValue);
|
||||
|
||||
// Set the summary to reflect the new value.
|
||||
preference.setSummary(
|
||||
index >= 0
|
||||
? listPreference.getEntries()[index]
|
||||
: null);
|
||||
|
||||
} else {
|
||||
// For all other preferences, set the summary to the value's
|
||||
// simple string representation.
|
||||
preference.setSummary(stringValue);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Binds a preference's summary to its value. More specifically, when the
|
||||
* preference's value is changed, its summary (line of text below the
|
||||
* preference title) is updated to reflect the value. The summary is also
|
||||
* immediately updated upon calling this method. The exact display format is
|
||||
* dependent on the type of preference.
|
||||
*
|
||||
* @see #sBindPreferenceSummaryToValueListener
|
||||
*/
|
||||
private static void bindPreferenceSummaryToValue(Preference preference) {
|
||||
// Set the listener to watch for value changes.
|
||||
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
|
||||
|
||||
// Trigger the listener immediately with the preference's
|
||||
// current value.
|
||||
sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
|
||||
PreferenceManager
|
||||
.getDefaultSharedPreferences(preference.getContext())
|
||||
.getString(preference.getKey(), ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getNavigationDrawerID() {
|
||||
return R.id.nav_settings;
|
||||
}
|
||||
|
||||
|
||||
public static class GeneralPreferenceFragment extends PreferenceFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.pref_general);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
||||
// to their values. When their values change, their summaries are
|
||||
// updated to reflect the new value, per the Android Design
|
||||
// guidelines.
|
||||
bindPreferenceSummaryToValue(findPreference("pref_exercise_time"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
if (id == android.R.id.home) {
|
||||
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -23,7 +23,6 @@ import android.view.View;
|
|||
import android.widget.AdapterView;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.NumberPicker;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
|
@ -37,6 +36,8 @@ import org.secuso.privacyfriendlybreakreminder.database.SQLiteHelper;
|
|||
import org.secuso.privacyfriendlybreakreminder.database.data.ExerciseSet;
|
||||
import org.secuso.privacyfriendlybreakreminder.service.TimerService;
|
||||
|
||||
import com.shawnlin.numberpicker.NumberPicker;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
|
@ -65,17 +66,17 @@ public class TimerActivity extends BaseActivity implements android.support.v4.ap
|
|||
private int mShortAnimationDuration;
|
||||
private boolean currentStatusIsPickerVisible = false;
|
||||
|
||||
private static final String[] SECONDS_MINUTES = new String[60];
|
||||
private static final String[] HOURS = new String[24];
|
||||
|
||||
static {
|
||||
for(int i = 0; i < SECONDS_MINUTES.length; ++i) {
|
||||
SECONDS_MINUTES[i] = String.format(Locale.US, "%02d", i);
|
||||
}
|
||||
for(int i = 0; i < HOURS.length; ++i) {
|
||||
HOURS[i] = String.format(Locale.US, "%02d", i);
|
||||
}
|
||||
}
|
||||
// private static final String[] SECONDS_MINUTES = new String[60];
|
||||
// private static final String[] HOURS = new String[24];
|
||||
//
|
||||
// static {
|
||||
// for(int i = 0; i < SECONDS_MINUTES.length; ++i) {
|
||||
// SECONDS_MINUTES[i] = String.format(Locale.US, "%02d", i);
|
||||
// }
|
||||
// for(int i = 0; i < HOURS.length; ++i) {
|
||||
// HOURS[i] = String.format(Locale.US, "%02d", i);
|
||||
// }
|
||||
// }
|
||||
|
||||
// Service
|
||||
private TimerService mTimerService = null;
|
||||
|
|
@ -145,7 +146,6 @@ public class TimerActivity extends BaseActivity implements android.support.v4.ap
|
|||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
TimerService.startService(this);
|
||||
registerReceiver(timerReceiver, new IntentFilter(TimerService.TIMER_BROADCAST));
|
||||
|
||||
if(mTimerService != null && !mTimerService.isRunning()) {
|
||||
|
|
@ -164,6 +164,7 @@ public class TimerActivity extends BaseActivity implements android.support.v4.ap
|
|||
}
|
||||
|
||||
private void initServiceBinding() {
|
||||
TimerService.startService(this);
|
||||
Intent intent = new Intent(this, TimerService.class);
|
||||
bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
|
|
@ -202,36 +203,57 @@ public class TimerActivity extends BaseActivity implements android.support.v4.ap
|
|||
secondsBreakPicker = (NumberPicker) findViewById(R.id.seconds_break_picker);
|
||||
minutesBreakPicker = (NumberPicker) findViewById(R.id.minutes_break_picker);
|
||||
|
||||
secondsPicker.setDisplayedValues(SECONDS_MINUTES);
|
||||
secondsPicker.setMinValue(0);
|
||||
secondsPicker.setMaxValue(SECONDS_MINUTES.length - 1);
|
||||
setPickerAttributes(secondsPicker);
|
||||
setPickerAttributes(minutesPicker);
|
||||
setPickerAttributes(hoursPicker);
|
||||
setPickerAttributes(secondsBreakPicker);
|
||||
setPickerAttributes(minutesBreakPicker);
|
||||
|
||||
secondsPicker.setValue(pref.getInt(PrefManager.PREF_PICKER_SECONDS, 0));
|
||||
secondsBreakPicker.setDisplayedValues(SECONDS_MINUTES);
|
||||
secondsBreakPicker.setMinValue(0);
|
||||
secondsBreakPicker.setMaxValue(SECONDS_MINUTES.length - 1);
|
||||
secondsBreakPicker.setValue(pref.getInt(PrefManager.PREF_BREAK_PICKER_SECONDS, 0));
|
||||
|
||||
minutesPicker.setDisplayedValues(SECONDS_MINUTES);
|
||||
minutesPicker.setMinValue(0);
|
||||
minutesPicker.setMaxValue(SECONDS_MINUTES.length - 1);
|
||||
minutesPicker.setValue(pref.getInt(PrefManager.PREF_PICKER_MINUTES, 30));
|
||||
minutesBreakPicker.setDisplayedValues(SECONDS_MINUTES);
|
||||
minutesBreakPicker.setMinValue(0);
|
||||
minutesBreakPicker.setMaxValue(SECONDS_MINUTES.length - 1);
|
||||
minutesBreakPicker.setValue(pref.getInt(PrefManager.PREF_BREAK_PICKER_MINUTES, 0));
|
||||
|
||||
hoursPicker.setDisplayedValues(HOURS);
|
||||
hoursPicker.setMinValue(0);
|
||||
hoursPicker.setMaxValue(HOURS.length - 1);
|
||||
hoursPicker.setValue(pref.getInt(PrefManager.PREF_PICKER_HOURS, 1));
|
||||
secondsBreakPicker.setValue(pref.getInt(PrefManager.PREF_BREAK_PICKER_SECONDS, 0));
|
||||
minutesBreakPicker.setValue(pref.getInt(PrefManager.PREF_BREAK_PICKER_MINUTES, 5));
|
||||
|
||||
// secondsPicker.setDisplayedValues(SECONDS_MINUTES);
|
||||
// secondsPicker.setMinValue(0);
|
||||
// secondsPicker.setMaxValue(SECONDS_MINUTES.length - 1);
|
||||
// secondsPicker.setValue(pref.getInt(PrefManager.PREF_PICKER_SECONDS, 0));
|
||||
// secondsBreakPicker.setDisplayedValues(SECONDS_MINUTES);
|
||||
// secondsBreakPicker.setMinValue(0);
|
||||
// secondsBreakPicker.setMaxValue(SECONDS_MINUTES.length - 1);
|
||||
// secondsBreakPicker.setValue(pref.getInt(PrefManager.PREF_BREAK_PICKER_SECONDS, 0));
|
||||
//
|
||||
// minutesPicker.setDisplayedValues(SECONDS_MINUTES);
|
||||
// minutesPicker.setMinValue(0);
|
||||
// minutesPicker.setMaxValue(SECONDS_MINUTES.length - 1);
|
||||
// minutesPicker.setValue(pref.getInt(PrefManager.PREF_PICKER_MINUTES, 30));
|
||||
// minutesBreakPicker.setDisplayedValues(SECONDS_MINUTES);
|
||||
// minutesBreakPicker.setMinValue(0);
|
||||
// minutesBreakPicker.setMaxValue(SECONDS_MINUTES.length - 1);
|
||||
// minutesBreakPicker.setValue(pref.getInt(PrefManager.PREF_BREAK_PICKER_MINUTES, 0));
|
||||
//
|
||||
// hoursPicker.setDisplayedValues(HOURS);
|
||||
// hoursPicker.setMinValue(0);
|
||||
// hoursPicker.setMaxValue(HOURS.length - 1);
|
||||
// hoursPicker.setValue(pref.getInt(PrefManager.PREF_PICKER_HOURS, 1));
|
||||
|
||||
setDividerColor(secondsPicker, R.color.transparent);
|
||||
setDividerColor(minutesPicker, R.color.transparent);
|
||||
setDividerColor(hoursPicker, R.color.transparent);
|
||||
setDividerColor(secondsBreakPicker, R.color.transparent);
|
||||
setDividerColor(minutesBreakPicker, R.color.transparent);
|
||||
//setDividerColor(secondsPicker, R.color.transparent);
|
||||
//setDividerColor(minutesPicker, R.color.transparent);
|
||||
//setDividerColor(hoursPicker, R.color.transparent);
|
||||
//setDividerColor(secondsBreakPicker, R.color.transparent);
|
||||
//setDividerColor(minutesBreakPicker, R.color.transparent);
|
||||
}
|
||||
|
||||
private void setPickerAttributes(NumberPicker np) {
|
||||
np.setTextColorResource(R.color.middlegrey);
|
||||
np.setSelectedTextColorResource(R.color.colorAccent);
|
||||
np.setDividerColorResource(R.color.transparent);
|
||||
//np.setDividerDistance(25);
|
||||
np.setSelectedTextSize(R.dimen.picker_selected_text_size);
|
||||
np.setTextSize(R.dimen.picker_text_size);
|
||||
np.setFormatter(NumberPicker.getTwoDigitFormatter());
|
||||
np.setWheelItemCount(5);
|
||||
}
|
||||
|
||||
private void updateProgress(long millisUntilFinished) {
|
||||
|
|
@ -254,10 +276,6 @@ public class TimerActivity extends BaseActivity implements android.support.v4.ap
|
|||
//animation.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
switch(view.getId()) {
|
||||
|
|
@ -411,21 +429,21 @@ public class TimerActivity extends BaseActivity implements android.support.v4.ap
|
|||
}
|
||||
}
|
||||
|
||||
private void setDividerColor(NumberPicker picker, @ColorRes int color) {
|
||||
java.lang.reflect.Field[] pickerFields = NumberPicker.class.getDeclaredFields();
|
||||
for (java.lang.reflect.Field pf : pickerFields) {
|
||||
if (pf.getName().equals("mSelectionDivider")) {
|
||||
pf.setAccessible(true);
|
||||
try {
|
||||
ColorDrawable colorDrawable = new ColorDrawable(ContextCompat.getColor(this, color));
|
||||
pf.set(picker, colorDrawable);
|
||||
} catch (IllegalArgumentException | Resources.NotFoundException | IllegalAccessException e) {
|
||||
Log.e(TAG, e.getMessage(), e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// private void setDividerColor(NumberPicker picker, @ColorRes int color) {
|
||||
// java.lang.reflect.Field[] pickerFields = NumberPicker.class.getDeclaredFields();
|
||||
// for (java.lang.reflect.Field pf : pickerFields) {
|
||||
// if (pf.getName().equals("mSelectionDivider")) {
|
||||
// pf.setAccessible(true);
|
||||
// try {
|
||||
// ColorDrawable colorDrawable = new ColorDrawable(ContextCompat.getColor(this, color));
|
||||
// pf.set(picker, colorDrawable);
|
||||
// } catch (IllegalArgumentException | Resources.NotFoundException | IllegalAccessException e) {
|
||||
// Log.e(TAG, e.getMessage(), e);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Loader<List<ExerciseSet>> onCreateLoader(int id, final Bundle args) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import android.widget.ImageView;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import org.secuso.privacyfriendlybreakreminder.R;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.ChooseExerciseActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.data.Exercise;
|
||||
|
|
@ -121,7 +123,8 @@ public class ExerciseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||
}
|
||||
};
|
||||
|
||||
vh.image.setImageResource(exercise.getImageResIds(mContext)[0]);
|
||||
Glide.with(mContext).load(exercise.getImageResIds(mContext)[0]).into(vh.image);
|
||||
//vh.image.setImageResource(exercise.getImageResIds(mContext)[0]);
|
||||
|
||||
if(checkedIds != null)
|
||||
vh.checkbox.setChecked(checkedIds.contains(exercise.getId()));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.secuso.privacyfriendlybreakreminder.activities.adapter;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import org.secuso.privacyfriendlybreakreminder.R;
|
|||
import org.secuso.privacyfriendlybreakreminder.activities.AboutActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.HelpActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.ManageExerciseSetsActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.old.SettingsActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.SettingsActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.TimerActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.tutorial.TutorialActivity;
|
||||
|
||||
|
|
@ -158,12 +158,12 @@ public abstract class BaseActivity extends AppCompatActivity implements OnNaviga
|
|||
intent = new Intent(this, HelpActivity.class);
|
||||
createBackStack(intent);
|
||||
break;
|
||||
/*case R.id.nav_settings:
|
||||
case R.id.nav_settings:
|
||||
intent = new Intent(this, SettingsActivity.class);
|
||||
intent.putExtra( PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.GeneralPreferenceFragment.class.getName() );
|
||||
intent.putExtra( PreferenceActivity.EXTRA_NO_HEADERS, true );
|
||||
//intent.putExtra( PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.GeneralPreferenceFragment.class.getName() );
|
||||
//intent.putExtra( PreferenceActivity.EXTRA_NO_HEADERS, true );
|
||||
createBackStack(intent);
|
||||
break;*/
|
||||
break;
|
||||
default:
|
||||
}
|
||||
overridePendingTransition(0,0);
|
||||
|
|
|
|||
|
|
@ -1,404 +0,0 @@
|
|||
|
||||
package org.secuso.privacyfriendlybreakreminder.activities.old;
|
||||
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.media.Ringtone;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.ListPreference;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.preference.RingtonePreference;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MenuItem;
|
||||
import android.support.v4.app.NavUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.helper.AppCompatPreferenceActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.preferences.DynamicListPreference;
|
||||
import org.secuso.privacyfriendlybreakreminder.preferences.ExerciseListPreference;
|
||||
import org.secuso.privacyfriendlybreakreminder.R;
|
||||
import org.secuso.privacyfriendlybreakreminder.preferences.SeekBarPreference;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A {@link PreferenceActivity} that presents a set of application settings. On
|
||||
* handset devices, settings are presented as a single list. On tablets,
|
||||
* settings are split by category, with category headers shown to the left of
|
||||
* the list of settings.
|
||||
* <p/>
|
||||
* See <a href="http://developer.android.com/design/patterns/settings.html">
|
||||
* Android Design: Settings</a> for design guidelines and the <a
|
||||
* href="http://developer.android.com/guide/topics/ui/settings.html">Settings
|
||||
* API Guide</a> for more information on developing a Settings UI.
|
||||
*/
|
||||
public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||
/**
|
||||
* A preference value change listener that updates the preference's summary
|
||||
* to reflect its new value.
|
||||
*/
|
||||
private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object value) {
|
||||
String stringValue = value.toString();
|
||||
|
||||
if (preference instanceof ListPreference) {
|
||||
// For list preferences, look up the correct display value in
|
||||
// the preference's 'entries' list.
|
||||
ListPreference listPreference = (ListPreference) preference;
|
||||
int index = listPreference.findIndexOfValue(stringValue);
|
||||
|
||||
// Set the summary to reflect the new value.
|
||||
preference.setSummary(
|
||||
index >= 0
|
||||
? listPreference.getEntries()[index]
|
||||
: null);
|
||||
|
||||
} else if (preference instanceof RingtonePreference) {
|
||||
// For ringtone preferences, look up the correct display value
|
||||
// using RingtoneManager.
|
||||
if (TextUtils.isEmpty(stringValue)) {
|
||||
// Empty values correspond to 'silent' (no ringtone).
|
||||
preference.setSummary(R.string.pref_ringtone_silent);
|
||||
|
||||
} else {
|
||||
Ringtone ringtone = RingtoneManager.getRingtone(
|
||||
preference.getContext(), Uri.parse(stringValue));
|
||||
|
||||
if (ringtone == null) {
|
||||
// Clear the summary if there was a lookup error.
|
||||
preference.setSummary(null);
|
||||
} else {
|
||||
// Set the summary to reflect the new ringtone display
|
||||
// name.
|
||||
String name = ringtone.getTitle(preference.getContext());
|
||||
preference.setSummary(name);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// For all other preferences, set the summary to the value's
|
||||
// simple string representation.
|
||||
preference.setSummary(stringValue);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper method to determine if the device has an extra-large screen. For
|
||||
* example, 10" tablets are extra-large.
|
||||
*/
|
||||
private static boolean isXLargeTablet(Context context) {
|
||||
return (context.getResources().getConfiguration().screenLayout
|
||||
& Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Binds a preference's summary to its value. More specifically, when the
|
||||
* preference's value is changed, its summary (line of text below the
|
||||
* preference title) is updated to reflect the value. The summary is also
|
||||
* immediately updated upon calling this method. The exact display format is
|
||||
* dependent on the type of preference.
|
||||
*
|
||||
* @see #sBindPreferenceSummaryToValueListener
|
||||
*/
|
||||
private static void bindPreferenceSummaryToValue(Preference preference) {
|
||||
// Set the listener to watch for value changes.
|
||||
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
|
||||
|
||||
// Trigger the listener immediately with the preference's
|
||||
// current value.
|
||||
sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
|
||||
PreferenceManager
|
||||
.getDefaultSharedPreferences(preference.getContext())
|
||||
.getString(preference.getKey(), ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setupActionBar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the {@link android.app.ActionBar}, if the API is available.
|
||||
*/
|
||||
private void setupActionBar() {
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
// Show the Up button in the action bar.
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMenuItemSelected(int featureId, MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
if (id == android.R.id.home) {
|
||||
if (isXLargeTablet(this)) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
if (!super.onMenuItemSelected(featureId, item)) {
|
||||
NavUtils.navigateUpFromSameTask(this);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onMenuItemSelected(featureId, item);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean onIsMultiPane() {
|
||||
return isXLargeTablet(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public void onBuildHeaders(List<Header> target) {
|
||||
loadHeadersFromResource(R.xml.pref_headers, target);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method stops fragment injection in malicious applications.
|
||||
* Make sure to deny any unknown fragments here.
|
||||
*/
|
||||
protected boolean isValidFragment(String fragmentName) {
|
||||
return PreferenceFragment.class.getName().equals(fragmentName)
|
||||
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|
||||
|| NotificationPreferenceFragment.class.getName().equals(fragmentName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This fragment shows general preferences only. It is used when the
|
||||
* activity is showing a two-pane settings UI.
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public static class GeneralPreferenceFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
private SeekBarPreference _seekBarWork;
|
||||
private SeekBarPreference _seekBarBreak;
|
||||
|
||||
private DynamicListPreference dlp;
|
||||
private ExerciseListPreference elp;
|
||||
|
||||
private String currentProfile = "";
|
||||
private Bundle bundle;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
bundle = savedInstanceState;
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.pref_general);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
// Get widgets :
|
||||
_seekBarWork = (SeekBarPreference) this.findPreference("work_value");
|
||||
_seekBarBreak = (SeekBarPreference) this.findPreference("break_value");
|
||||
|
||||
dlp = (DynamicListPreference) this.findPreference("current_profile");
|
||||
elp = (ExerciseListPreference) this.findPreference("exercise");
|
||||
|
||||
// Set listener :
|
||||
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
//Get profile name
|
||||
currentProfile = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getString("name_text", "");
|
||||
|
||||
// Set seekbar summary :
|
||||
int radius = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getInt("work_value", 50) + 1;
|
||||
_seekBarWork.setSummary(this.getString(R.string.settings_summary).replace("$1", "" + radius));
|
||||
|
||||
radius = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getInt("break_value", 10) + 1;
|
||||
_seekBarBreak.setSummary(this.getString(R.string.settings_summary).replace("$1", "" + radius));
|
||||
|
||||
|
||||
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
||||
// to their values. When their values change, their summaries are
|
||||
// updated to reflect the new value, per the Android Design
|
||||
// guidelines.
|
||||
bindPreferenceSummaryToValue(findPreference("name_text"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
if (id == android.R.id.home) {
|
||||
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
if (key.equals("current_profile")) {
|
||||
ListPreference listPref = (ListPreference) findPreference("current_profile");
|
||||
int i = Integer.parseInt(listPref.getValue());
|
||||
|
||||
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
editor.putString("current_profile", "" + i);
|
||||
editor.putBoolean("change_profiles", true);
|
||||
String[] allProfile = sharedPreferences.getString("profiles", "").split(";");
|
||||
|
||||
// Deactivate the onPrefListener in SettingsActivity
|
||||
getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
|
||||
editor.putString("name_text", allProfile[i].split(",")[0]);
|
||||
editor.putInt("work_value", Integer.parseInt(allProfile[i].split(",")[1]) - 1);
|
||||
editor.putInt("break_value", Integer.parseInt(allProfile[i].split(",")[2]) - 1);
|
||||
editor.putBoolean("cont_value", Boolean.parseBoolean(allProfile[i].split(",")[3]));
|
||||
editor.putString("exercise_value", allProfile[i].split(",")[4]);
|
||||
editor.apply();
|
||||
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
// FIXME Has to be done because the summary of the name
|
||||
onDestroy();
|
||||
onCreate(bundle);
|
||||
return;
|
||||
}
|
||||
|
||||
// Set seekbar summary :
|
||||
int radius = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getInt("work_value", 50) + 1;
|
||||
_seekBarWork.setSummary(this.getString(R.string.settings_summary).replace("$1", "" + radius));
|
||||
radius = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getInt("break_value", 10) + 1;
|
||||
_seekBarBreak.setSummary(this.getString(R.string.settings_summary).replace("$1", "" + radius));
|
||||
|
||||
//FIXME Update the preferences of the selected profile
|
||||
if (!key.equals("profiles")) {
|
||||
getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
|
||||
updateProfilesPreference();
|
||||
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
private void updateProfilesPreference() {
|
||||
int work_radius = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getInt("work_value", 50) + 1;
|
||||
int break_radius = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getInt("break_value", 10) + 1;
|
||||
String newProfileName = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getString("name_text", "");
|
||||
String allProfiles = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getString("profiles", "");
|
||||
boolean cont = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getBoolean("cont_value", false);
|
||||
String exercises = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getString("exercise_value", "-1");
|
||||
|
||||
if (allProfiles.contains(newProfileName + "," + work_radius + "," + break_radius + "," + cont + "," + exercises) && newProfileName.equals(currentProfile)) {
|
||||
//Nothing changes
|
||||
System.out.println("No changes for a profile in edit settings");
|
||||
} else {
|
||||
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).edit();
|
||||
if (newProfileName.equals("")) {
|
||||
// Profile name empty
|
||||
Toast.makeText(this.getActivity(), R.string.settings_emptyName, Toast.LENGTH_LONG).show();
|
||||
editor.putString("name_text", currentProfile);
|
||||
editor.apply();
|
||||
findPreference("name_text").setSummary(currentProfile);
|
||||
|
||||
} else if (currentProfile != newProfileName && prefContainsName(newProfileName)) {
|
||||
// Profile name exists already
|
||||
Toast.makeText(this.getActivity(), R.string.settings_doubleName, Toast.LENGTH_LONG).show();
|
||||
editor.putString("name_text", currentProfile);
|
||||
editor.apply();
|
||||
findPreference("name_text").setSummary(currentProfile);
|
||||
} else {
|
||||
|
||||
String[] profiles = allProfiles.split(";");
|
||||
|
||||
for (int i = 0; i < profiles.length; i++) {
|
||||
if (profiles[i].split(",")[0].equals(currentProfile)) {
|
||||
profiles[i] = newProfileName + "," + work_radius + "," + break_radius + "," + cont + "," + exercises;
|
||||
break;
|
||||
}
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : profiles) {
|
||||
builder.append(s + ";");
|
||||
}
|
||||
|
||||
editor.putBoolean("change_profiles", true);
|
||||
editor.putString("profiles", builder.toString());
|
||||
editor.apply();
|
||||
|
||||
currentProfile = newProfileName;
|
||||
findPreference("name_text").setSummary(currentProfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private boolean prefContainsName(String profileName) {
|
||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this.getActivity());
|
||||
String allProfiles = sharedPrefs.getString("profiles", "");
|
||||
String[] profiles = allProfiles.split(";");
|
||||
for (String profile : profiles) {
|
||||
if (profile.split(",")[0].equalsIgnoreCase(profileName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
|
||||
currentProfile = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getString("name_text", "");
|
||||
super.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This fragment shows notification preferences only. It is used when the
|
||||
* activity is showing a two-pane settings UI.
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public static class NotificationPreferenceFragment extends PreferenceFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.pref_notification);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
||||
// to their values. When their values change, their summaries are
|
||||
// updated to reflect the new value, per the Android Design
|
||||
// guidelines.
|
||||
bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
if (id == android.R.id.home) {
|
||||
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,19 +20,16 @@ public class PrefManager {
|
|||
public static final String PAUSE_TIME = "PAUSE TIME";
|
||||
public static final String REPEAT_STATUS = "REPEAT_STATUS";
|
||||
public static final String CONTINUOUS_STATUS = "CONTINUOUS_STATUS";
|
||||
public static final String EXERCISE_DURATION = "pref_exercise_time";
|
||||
public static final String KEEP_SCREEN_ON_DURING_EXERCISE = "pref_keep_screen_on_during_exercise";
|
||||
|
||||
|
||||
private SharedPreferences pref;
|
||||
private SharedPreferences defaultPref;
|
||||
|
||||
// Shared preferences file name
|
||||
private static final String PREF_NAME = "welcome";
|
||||
|
||||
private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
|
||||
|
||||
public PrefManager(Context context) {
|
||||
pref = context.getSharedPreferences(PREF_NAME, 0);
|
||||
defaultPref = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
pref = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
}
|
||||
|
||||
public void setFirstTimeLaunch(boolean isFirstTime) {
|
||||
|
|
@ -43,7 +40,7 @@ public class PrefManager {
|
|||
boolean isFirstTimeLaunch = pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
|
||||
|
||||
if(isFirstTimeLaunch)
|
||||
defaultPref.edit()
|
||||
pref.edit()
|
||||
.putLong(DEFAULT_EXERCISE_SET, 0L)
|
||||
.putLong(PAUSE_TIME, 5 * 60 * 1000)
|
||||
.putBoolean(REPEAT_STATUS, false)
|
||||
|
|
@ -53,6 +50,8 @@ public class PrefManager {
|
|||
.putInt(PREF_PICKER_SECONDS, 0)
|
||||
.putInt(PREF_PICKER_MINUTES, 0)
|
||||
.putInt(PREF_PICKER_HOURS, 1)
|
||||
.putString(EXERCISE_DURATION, "30")
|
||||
.putBoolean(KEEP_SCREEN_ON_DURING_EXERCISE, true)
|
||||
.apply();
|
||||
|
||||
return isFirstTimeLaunch;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ public class SQLiteHelper extends SQLiteAssetHelper {
|
|||
public SQLiteHelper(Context context) {
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
mContext = context;
|
||||
super.setForcedUpgrade();
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class Exercise {
|
|||
|
||||
for(int i = 0; i < result.length; ++i) {
|
||||
result[i] = context.getResources().getIdentifier(
|
||||
"exercise_" + imageIDSplit[i],
|
||||
"breakreminder_" + imageIDSplit[i],
|
||||
"drawable",
|
||||
context.getPackageName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.secuso.privacyfriendlybreakreminder.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
|
@ -22,8 +23,11 @@ public final class ExerciseDialog {
|
|||
*/
|
||||
private ExerciseDialog() {}
|
||||
|
||||
public static void showExerciseDialog(@NonNull final Context context, @NonNull final Exercise e) {
|
||||
showExerciseDialog(context, e, null);
|
||||
}
|
||||
|
||||
public static void showExerciseDialog(@NonNull final Context context,@NonNull final Exercise e) {
|
||||
public static void showExerciseDialog(@NonNull final Context context, @NonNull final Exercise e, DialogInterface.OnDismissListener onDismissListener) {
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(FragmentActivity.LAYOUT_INFLATER_SERVICE);
|
||||
View v = inflater.inflate(R.layout.dialog_exercise, null);
|
||||
|
||||
|
|
@ -56,6 +60,7 @@ public final class ExerciseDialog {
|
|||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setView(v);
|
||||
builder.setOnDismissListener(onDismissListener);
|
||||
builder.show();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ import java.io.FileDescriptor;
|
|||
import java.util.Locale;
|
||||
import java.util.Timer;
|
||||
|
||||
import static android.app.PendingIntent.FLAG_CANCEL_CURRENT;
|
||||
import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
|
||||
|
||||
public class TimerService extends Service {
|
||||
|
||||
|
|
@ -35,7 +37,7 @@ public class TimerService extends Service {
|
|||
public static final String NOTIFICATION_BROADCAST = TAG + ".NOTIFICATION_BROADCAST";
|
||||
public static final String TIMER_BROADCAST = TAG + ".TIMER_BROADCAST";
|
||||
|
||||
private static final int UPDATE_INTERVAL = 25;
|
||||
private static final int UPDATE_INTERVAL = 100;
|
||||
private static final int NOTIFICATION_ID = 31337;
|
||||
|
||||
private TimerServiceBinder mBinder = new TimerServiceBinder();
|
||||
|
|
@ -83,11 +85,12 @@ public class TimerService extends Service {
|
|||
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
|
||||
builder.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText("Take a break now! Click here to do your chosen exercises.")
|
||||
.setContentIntent(PendingIntent.getActivity(this, 0, new Intent(this, ExerciseActivity.class), FLAG_UPDATE_CURRENT))
|
||||
.setContentText(getString(R.string.take_a_break_now))
|
||||
.setContentIntent(PendingIntent.getActivity(this, 0, new Intent(this, ExerciseActivity.class), FLAG_CANCEL_CURRENT))
|
||||
.setColor(ContextCompat.getColor(this, R.color.colorAccent))
|
||||
.setPriority(NotificationCompat.PRIORITY_MAX)
|
||||
.setWhen(0)
|
||||
.setOngoing(false)
|
||||
.setAutoCancel(true)
|
||||
.setSmallIcon(R.mipmap.ic_launcher)
|
||||
.setDefaults(Notification.DEFAULT_LIGHTS)
|
||||
|
|
@ -97,7 +100,6 @@ public class TimerService extends Service {
|
|||
notificationManager.notify(NOTIFICATION_ID, builder.build());
|
||||
|
||||
// TODO: show decider activity?!
|
||||
// maybe rather show a dialog
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -227,6 +229,8 @@ public class TimerService extends Service {
|
|||
return START_STICKY;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Notification buildNotification() {
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
|
||||
builder.setContentTitle(getString(R.string.app_name));
|
||||
|
|
@ -240,7 +244,12 @@ public class TimerService extends Service {
|
|||
String time = String.format(Locale.US, "%02d:%02d:%02d", hours, minutes, seconds);
|
||||
|
||||
builder.setContentText(time);
|
||||
builder.setContentIntent(PendingIntent.getActivity(this, 0, new Intent(this, TimerActivity.class), FLAG_UPDATE_CURRENT));
|
||||
|
||||
|
||||
Intent intent = new Intent(this, TimerActivity.class);
|
||||
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP);
|
||||
|
||||
builder.setContentIntent(PendingIntent.getActivity(this, 0, intent, FLAG_UPDATE_CURRENT));
|
||||
builder.setColor(ContextCompat.getColor(this, R.color.colorAccent));
|
||||
builder.setPriority(NotificationCompat.PRIORITY_HIGH);
|
||||
builder.setWhen(0);
|
||||
|
|
@ -264,6 +273,14 @@ public class TimerService extends Service {
|
|||
return mBinder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUnbind(Intent intent) {
|
||||
if(isReset()){
|
||||
stopSelf();
|
||||
}
|
||||
return super.onUnbind(intent);
|
||||
}
|
||||
|
||||
public static void startService(Context context) {
|
||||
context.startService(new Intent(context.getApplicationContext(), TimerService.class));
|
||||
}
|
||||
|
|
@ -272,6 +289,10 @@ public class TimerService extends Service {
|
|||
return remainingDuration;
|
||||
}
|
||||
|
||||
public boolean isReset() {
|
||||
return !isRunning() && !isPaused();
|
||||
}
|
||||
|
||||
public class TimerServiceBinder extends Binder {
|
||||
public TimerService getService() {
|
||||
return TimerService.this;
|
||||
|
|
|
|||
BIN
app/src/main/res/drawable/BreakReminder_0.png
Normal file
|
After Width: | Height: | Size: 9 KiB |
BIN
app/src/main/res/drawable/BreakReminder_1.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable/BreakReminder_10.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/BreakReminder_11.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable/BreakReminder_12.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/BreakReminder_13.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/BreakReminder_14.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/BreakReminder_15.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/BreakReminder_16.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/BreakReminder_17.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/BreakReminder_18.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/BreakReminder_19.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/BreakReminder_2.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable/BreakReminder_20.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable/BreakReminder_21.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/BreakReminder_22.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable/BreakReminder_23.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable/BreakReminder_24.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/BreakReminder_25.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
app/src/main/res/drawable/BreakReminder_26.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/BreakReminder_27.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/BreakReminder_28.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/BreakReminder_29.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable/BreakReminder_3.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable/BreakReminder_30.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/BreakReminder_31.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable/BreakReminder_32.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/BreakReminder_33.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable/BreakReminder_34.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
app/src/main/res/drawable/BreakReminder_35.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable/BreakReminder_36.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable/BreakReminder_37.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable/BreakReminder_38.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
app/src/main/res/drawable/BreakReminder_39.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable/BreakReminder_4.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable/BreakReminder_40.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable/BreakReminder_41.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/BreakReminder_42.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/BreakReminder_43.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/BreakReminder_44.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/BreakReminder_45.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/BreakReminder_46.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable/BreakReminder_47.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/BreakReminder_48.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/BreakReminder_49.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/BreakReminder_5.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable/BreakReminder_50.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable/BreakReminder_51.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable/BreakReminder_52.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/BreakReminder_53.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable/BreakReminder_54.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable/BreakReminder_55.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable/BreakReminder_56.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
app/src/main/res/drawable/BreakReminder_6.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable/BreakReminder_7.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable/BreakReminder_8.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/drawable/BreakReminder_9.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 933 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
|
@ -16,7 +16,6 @@
|
|||
android:shape="ring"
|
||||
android:thicknessRatio="12">
|
||||
<solid android:color="@color/lightblue"/>
|
||||
<corners android:radius="2dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
|
@ -12,11 +12,10 @@
|
|||
<item android:id="@android:id/progress">
|
||||
<shape
|
||||
android:innerRadiusRatio="2"
|
||||
android:useLevel="true"
|
||||
android:shape="ring"
|
||||
android:useLevel="true"
|
||||
android:thicknessRatio="6">
|
||||
<solid android:color="@color/lightblue"/>
|
||||
<corners android:radius="2dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
108
app/src/main/res/layout-v21/layout_exercise_set.xml
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_margin="0dp"
|
||||
android:padding="0dp">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/exercise_set_card"
|
||||
android:longClickable="true"
|
||||
android:clickable="true"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:padding="0dp"
|
||||
android:visibility="visible"
|
||||
app:cardCornerRadius="2dp"
|
||||
app:cardElevation="4dp"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/delete_check_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/edit_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:tint="@color/colorAccent"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_mode_edit_black_24dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exercise_set_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Exercise Set Name"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exercise_none_available"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/set_contains_no_exercises"
|
||||
android:textColor="@color/black"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/exercise_set_name" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/exercise_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/exercise_set_name"
|
||||
app:layout_constraintRight_toLeftOf="@+id/delete_check_box"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintVertical_bias="0.521">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
@ -41,21 +41,10 @@
|
|||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="org.secuso.privacyfriendlybreakreminder.activities.ManageExerciseSetsActivity">
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/add_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
app:fabSize="normal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:srcCompat="@drawable/ic_edit_white_24dp" />
|
||||
tools:context="org.secuso.privacyfriendlybreakreminder.activities.ManageExerciseSetsActivity"
|
||||
android:id="@+id/constraintLayout2">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/exercise_list"
|
||||
|
|
@ -67,6 +56,7 @@
|
|||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:clickable="false"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
@ -93,4 +83,18 @@
|
|||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/add_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
app:fabSize="normal"
|
||||
app:layout_anchor="@id/constraintLayout2"
|
||||
app:layout_anchorGravity="bottom|right|end"
|
||||
app:srcCompat="@drawable/ic_edit_white_24dp" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
|
@ -160,28 +160,58 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/exercise_image"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="180dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:id="@+id/exercise_image_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/progressBarLayout"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/progressBarLayout"
|
||||
app:srcCompat="@drawable/exercise_0" />
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginRight="32dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintDimensionRatio="w,1:1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/exercise_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:srcCompat="@drawable/breakreminder_0"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="0dp"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:layout_constraintDimensionRatio="h,1:1" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/exercise_info_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:padding="4dp"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
app:layout_constraintRight_toRightOf="@+id/exercise_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/exercise_image"
|
||||
app:srcCompat="@drawable/ic_about" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/execution_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/execution"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toRightOf="@+id/progressBarLayout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/section_card" />
|
||||
|
||||
|
|
@ -189,10 +219,8 @@
|
|||
android:id="@+id/execution"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="sitting or standing"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toRightOf="@+id/progressBarLayout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/execution_title" />
|
||||
|
||||
|
|
@ -200,20 +228,18 @@
|
|||
android:id="@+id/description_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/description"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/exercise_image" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/exercise_image_container" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="- do something\n- do something else\n- then do the first something again"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/description_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/description_title" />
|
||||
|
||||
|
|
@ -249,8 +275,6 @@
|
|||
android:id="@+id/bigProgressBarLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
|
@ -262,7 +286,7 @@
|
|||
android:id="@+id/progressBarBig"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="250dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:max="100"
|
||||
android:onClick="onClick"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
<android.support.design.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="org.secuso.privacyfriendlybreakreminder.activities.EditExerciseSetActivity">
|
||||
|
||||
<include layout="@layout/layout_toolbar"/>
|
||||
|
|
@ -22,19 +21,6 @@
|
|||
android:id="@+id/main_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/add_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
app:fabSize="normal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loading_spinner"
|
||||
style="?android:attr/progressBarStyle"
|
||||
|
|
@ -74,6 +60,19 @@
|
|||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/add_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
app:fabSize="normal"
|
||||
app:layout_anchor="@id/main_content"
|
||||
app:layout_anchorGravity="bottom|end"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
|
|
|
|||
43
app/src/main/res/layout/activity_settings.xml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="org.secuso.privacyfriendlybreakreminder.activities.EditExerciseSetActivity">
|
||||
|
||||
<include layout="@layout/layout_toolbar"/>
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:id="@+id/main_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<fragment
|
||||
android:name="org.secuso.privacyfriendlybreakreminder.activities.SettingsActivity$GeneralPreferenceFragment"
|
||||
android:id="@+id/activity_settings_general_preference_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/nav_view"
|
||||
tools:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/nav_header"
|
||||
app:menu="@menu/nav_drawer" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
@ -25,11 +25,6 @@
|
|||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context="org.secuso.privacyfriendlybreakreminder.activities.TimerActivity">
|
||||
|
||||
<!-- <include android:id="@+id/exercise" layout="@layout/layout_exercise_set"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5" /> -->
|
||||
<android.support.v7.widget.AppCompatSpinner
|
||||
android:id="@+id/spinner_choose_exercise_set"
|
||||
android:layout_width="0dp"
|
||||
|
|
@ -112,47 +107,81 @@
|
|||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<NumberPicker
|
||||
<com.shawnlin.numberpicker.NumberPicker
|
||||
android:id="@+id/hours_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:background="@color/transparent"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:theme="@style/AppTheme.NumberPicker"
|
||||
android:descendantFocusability="blocksDescendants" />
|
||||
app:np_max="23"
|
||||
app:np_min="0"/>
|
||||
|
||||
<!-- <NumberPicker
|
||||
android:id="@+id/hours_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="110dp"
|
||||
android:clickable="false"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:focusable="false"
|
||||
android:theme="@style/AppTheme.NumberPicker" /> -->
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=":"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="24sp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="@dimen/picker_selected_text_size"
|
||||
android:layout_marginStart="-3dp"
|
||||
android:layout_marginEnd="-2dp"
|
||||
android:textStyle="bold"
|
||||
android:theme="@style/AppTheme.NumberPicker" />
|
||||
|
||||
<NumberPicker
|
||||
<com.shawnlin.numberpicker.NumberPicker
|
||||
android:id="@+id/minutes_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:theme="@style/AppTheme.NumberPicker"
|
||||
android:descendantFocusability="blocksDescendants" />
|
||||
android:background="@color/transparent"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:np_max="59"
|
||||
app:np_min="0"/>
|
||||
|
||||
<!-- <NumberPicker
|
||||
android:id="@+id/minutes_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:theme="@style/AppTheme.NumberPicker" /> -->
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=":"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="24sp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="@dimen/picker_selected_text_size"
|
||||
android:layout_marginStart="-3dp"
|
||||
android:layout_marginEnd="-2dp"
|
||||
android:textStyle="bold"
|
||||
android:theme="@style/AppTheme.NumberPicker" />
|
||||
|
||||
<NumberPicker
|
||||
<com.shawnlin.numberpicker.NumberPicker
|
||||
android:id="@+id/seconds_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:background="@color/transparent"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:np_max="59"
|
||||
app:np_min="0"/>
|
||||
|
||||
<!-- <NumberPicker
|
||||
android:id="@+id/seconds_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:clipChildren="false"
|
||||
android:theme="@style/AppTheme.NumberPicker"
|
||||
android:descendantFocusability="blocksDescendants" />
|
||||
android:descendantFocusability="blocksDescendants" /> -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -173,30 +202,52 @@
|
|||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<NumberPicker
|
||||
<com.shawnlin.numberpicker.NumberPicker
|
||||
android:id="@+id/minutes_break_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:background="@color/transparent"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:np_max="59"
|
||||
app:np_min="0"/>
|
||||
|
||||
<!-- <NumberPicker
|
||||
android:id="@+id/minutes_break_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:theme="@style/AppTheme.NumberPicker"
|
||||
android:descendantFocusability="blocksDescendants" />
|
||||
android:descendantFocusability="blocksDescendants" /> -->
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="-3dp"
|
||||
android:layout_marginEnd="-2dp"
|
||||
android:text=":"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="24sp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="@dimen/picker_selected_text_size"
|
||||
android:textStyle="bold"
|
||||
android:theme="@style/AppTheme.NumberPicker" />
|
||||
|
||||
<NumberPicker
|
||||
<com.shawnlin.numberpicker.NumberPicker
|
||||
android:id="@+id/seconds_break_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:background="@color/transparent"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:np_max="59"
|
||||
app:np_min="0"/>
|
||||
|
||||
<!-- <NumberPicker
|
||||
android:id="@+id/seconds_break_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:theme="@style/AppTheme.NumberPicker"
|
||||
android:descendantFocusability="blocksDescendants" />
|
||||
android:descendantFocusability="blocksDescendants" /> -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/exercise_layout"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:padding="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
app:layout_constraintDimensionRatio="h,1:1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="120dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/exercise_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="h,1:1"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:tint="@color/colorAccent"
|
||||
android:visibility="gone"
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@
|
|||
android:id="@+id/nav_tutorial"
|
||||
android:icon="@drawable/ic_menu_tutorial"
|
||||
android:title="@string/title_activity_tutorial" />
|
||||
<!-- <item
|
||||
<item
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_settings_black_24dp"
|
||||
android:title="@string/title_activity_settings" /> -->
|
||||
android:title="@string/title_activity_settings" />
|
||||
<item
|
||||
android:id="@+id/nav_help"
|
||||
android:icon="@drawable/ic_help"
|
||||
|
|
|
|||
|
|
@ -48,12 +48,12 @@
|
|||
<string name="pref_title_display_name">Profil Name</string>
|
||||
<string name="pref_title_stayOn">Bildschirm bleibt an</string>
|
||||
<string name="pref_title_ringtone">Klingelton</string>
|
||||
<string name="tutorial_profile_description">Beim Klicken auf das aktuell ausgewählte Profils (\'Zufall\'), werden alle verfügbare Profile angezeigt.\n Sie können ein neues Profil durch das Klicken auf \'Neues Profil...\' erstellen.\n Die verfügbaren Profile können Sie in den Einstellungen ändern.\nAm Anfang existieren 3 voreingestellte Profile</string>
|
||||
<string name="tutorial_profile_description">Beim Klicken auf das aktuell ausgewählte Profils (\'Zufall\'), werden alle verfügbare Profile angezeigt.\n Sie können ein neues Profil durch das Klicken auf \'Neues Profil…\' erstellen.\n Die verfügbaren Profile können Sie in den Einstellungen ändern.\nAm Anfang existieren 3 voreingestellte Profile</string>
|
||||
<string name="tutorial_clock_description">Beim Klicken auf eins der beiden Symbole, startet die Uhr oder hält diese an</string>
|
||||
<string name="pref_title_timeLeft">Verbleibende Zeit</string>
|
||||
<string name="pref_title_vibrate">Vibration</string>
|
||||
<string name="profile_name">Profil Name</string>
|
||||
<string name="privacy_friendly">Diese Applikation gehört der Gruppe von Privacy Friendly Apps, entwickelt von der Technische Universität Darmstadt. Quellcode lizensiert unter GPLv3. Bilder Copyright TU Darmstadt und Google Inc.</string>
|
||||
<string name="privacy_friendly">Diese Applikation gehört der Gruppe von Privacy Friendly Apps, entwickelt von der Technische Universität Darmstadt. Quellcode lizenziert unter GPLv3. Bilder Copyright TU Darmstadt und Google Inc.</string>
|
||||
<string name="save">Speichern</string>
|
||||
<string name="settings_break_summary">Derzeitiger Wert ist $1</string>
|
||||
<string name="settings_dialog_message">Wählen Sie ihre Arbeitszeit aus</string>
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
<item>Haftungsausschluss</item>
|
||||
</string-array>
|
||||
|
||||
<string name="new_profile">Neues Profil...</string>
|
||||
<string name="new_profile">Neues Profil…</string>
|
||||
<string name="all_exercises">Arme.Beine.Kopf.Nacken.Becken.Wirbelsäule.Rumpf.</string>
|
||||
<string name="about">Über</string>
|
||||
<string name="tutorial_help">Hilfe öffnen</string>
|
||||
|
|
@ -119,4 +119,47 @@
|
|||
<string name="help_support_clock_title">Interaktive Uhr</string>
|
||||
<string name="help_support_next">Beim Klicken auf \'Next\' wird eine andere Übung aus der aktuellen Körperregion ausgewählt. Zugleich wird die Uhr wieder auf die letzte volle Minute gesetzt. Somit geht keine Zeit für die Übungen verloren.</string>
|
||||
<string name="help_support_title">Bedienungsanleitung</string>
|
||||
<string name="action_settings">Einstellungen</string>
|
||||
<string name="activity_edit_exercise_set_name_hint">Geben Sie einen Namen ein…</string>
|
||||
<string name="exercise_section_torso">Torso</string>
|
||||
<string name="activity_edit_no_empty_name">Bitte geben Sie einen Namen an.</string>
|
||||
<string name="activity_timer_choose_break">Wähle eine Pausendauer:</string>
|
||||
<string name="activity_timer_choose_time">Wähle die Arbeitsdauer:</string>
|
||||
<string name="activity_title_about">Über</string>
|
||||
<string name="activity_title_break_reminder">Break Reminder</string>
|
||||
<string name="activity_title_choose_exercises">Wähle Übungen</string>
|
||||
<string name="activity_title_edit_exercise_set">Übungsset bearbeiten</string>
|
||||
<string name="activity_title_exercise">Übung</string>
|
||||
<string name="activity_title_help">Hilfe</string>
|
||||
<string name="activity_title_manage_exercise_sets">Übungsset</string>
|
||||
<string name="activity_title_new_exercise_set">Neues Übungsset</string>
|
||||
<string name="discard">verwerfen</string>
|
||||
<string name="execution">Ausführung</string>
|
||||
<string name="exercise">Übung</string>
|
||||
<string name="exercise_section_arms">Arme</string>
|
||||
<string name="exercise_section_head">Kopf</string>
|
||||
<string name="exercise_section_legs">Beine</string>
|
||||
<string name="exercise_section_neck">Nacken</string>
|
||||
<string name="exercise_section_pelvis">Becken</string>
|
||||
<string name="exercise_section_spinal">Wirbel</string>
|
||||
<string name="keep_editing">bearbeiten</string>
|
||||
<string name="no">Nein</string>
|
||||
<string name="okay">Okay</string>
|
||||
<string name="no_exercise_sets">Keine Übungssets vorhanden. Bitte erstellen Sie ein neues Übungsset.</string>
|
||||
<string name="remaining_time">Verbleibende Zeit:</string>
|
||||
<string name="set_contains_no_exercises">Dieses Übungsset enthält keine Übungen.</string>
|
||||
<string name="skip">Überspringen</string>
|
||||
<string name="slide1_heading">Willkommen!</string>
|
||||
<string name="title_activity_edit_exercise_set">Übungsset editieren</string>
|
||||
<string name="title_activity_tutorial">Tutorial</string>
|
||||
<string name="toast_please_select_an_item_to_delete">Bitte wählen Sie mindestens einen Eintrag zum Löschen aus.</string>
|
||||
<string name="toast_please_specify_a_name">Bitte geben Sie einen Namen an.</string>
|
||||
<string name="yes">Ja</string>
|
||||
<string name="take_a_break_now">Machen Sie eine Pause! Tippen Sie hier um Ihre ausgewählten Übungen auszuführen.</string>
|
||||
<string name="description">Beschreibung</string>
|
||||
<string name="dialog_add_exercise_set_name">Übungssetname</string>
|
||||
<string name="dialog_leave_break_confirmation">Möchten sie die Pause beenden?</string>
|
||||
<string name="dialog_end_break_confirmation_title">Pausenzeit ist um!</string>
|
||||
<string name="dialog_end_break_confirmation">Möchsten Sie zurück zum Hauptmenü?</string>
|
||||
<string name="dialog_discard_confirmation">Sind Sie sicher, dass Sie die Änderungen verwerfen möchten?</string>
|
||||
</resources>
|
||||
|
|
@ -119,5 +119,6 @@
|
|||
<string name="help_support_clock_title">Horloge interactive</string>
|
||||
<string name="help_support_clock_descr"> En appuyant sur l\'horloge à chaque étape de cette application, l\'horloge peut être démarré et arrêté .</string>
|
||||
<string name="help_support_next">En cliquant sur le bouton \'next\', l\'application va choisir un nouvel exercice dans la région du corps actuel. Dans le même temps l\'horloge sera remise à zéro sur la minute d\'avant, que le temps sera dépenser pleinement sur les exercices.</string>
|
||||
<string name="activity_title_break_reminder">Break Reminder</string>
|
||||
|
||||
</resources>
|
||||
|
|
@ -118,4 +118,5 @@
|
|||
<string name="help_support_next">При нажатии на кнопку \'Next\', приложение будет выбрать новое упражнение в текущей области тела. В то же время часы будут сброшены на следующую полную минуту, чтобы провестить время полностью на упражнениях.</string>
|
||||
<string name="help_support_clock_title">Интерактивные часы</string>
|
||||
<string name="help_support_clock_descr">При нажатии на часы возможно их запустить или остановить.</string>
|
||||
<string name="activity_title_break_reminder">Break Reminder</string>
|
||||
</resources>
|
||||
|
|
@ -23,4 +23,7 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
|
|||
<dimen name="desc_padding">40dp</dimen>
|
||||
<dimen name="app_bar_height">180dp</dimen>
|
||||
<dimen name="text_margin">16dp</dimen>
|
||||
|
||||
<dimen name="picker_text_size">16sp</dimen>
|
||||
<dimen name="picker_selected_text_size">18sp</dimen>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@
|
|||
<string name="activity_title_new_exercise_set">New Exercise Set</string>
|
||||
<string name="dialog_add_exercise_set_setname">exercise set name</string>
|
||||
<string name="dialog_add_exercise_set_title">Add New Exercise Set</string>
|
||||
<string name="activity_title_break_reminder" translatable="false">@string/app_name</string>
|
||||
<string name="activity_title_break_reminder">Break Reminder</string>
|
||||
<string name="dialog_add_exercise_set_name">Exercise Set Name</string>
|
||||
<string name="keep_editing">keep editing</string>
|
||||
<string name="discard">discard</string>
|
||||
|
|
@ -202,95 +202,7 @@
|
|||
<string name="slide3_heading">Github and Guide</string>
|
||||
<string name="slide3_text">The sourcecode of this app is available at GitHub. For further explanations have a look at the Privacy Friendly App Guide.</string>
|
||||
<string name="title_activity_edit_exercise_set">Edit Exercise Set</string>
|
||||
<string name="large_text">
|
||||
"Material is the metaphor.\n\n"
|
||||
|
||||
"A material metaphor is the unifying theory of a rationalized space and a system of motion."
|
||||
"The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
|
||||
"technologically advanced and open to imagination and magic.\n"
|
||||
"Surfaces and edges of the material provide visual cues that are grounded in reality. The "
|
||||
"use of familiar tactile attributes helps users quickly understand affordances. Yet the "
|
||||
"flexibility of the material creates new affordances that supercede those in the physical "
|
||||
"world, without breaking the rules of physics.\n"
|
||||
"The fundamentals of light, surface, and movement are key to conveying how objects move, "
|
||||
"interact, and exist in space and in relation to each other. Realistic lighting shows "
|
||||
"seams, divides space, and indicates moving parts.\n\n"
|
||||
|
||||
"Bold, graphic, intentional.\n\n"
|
||||
|
||||
"The foundational elements of print based design typography, grids, space, scale, color, "
|
||||
"and use of imagery guide visual treatments. These elements do far more than please the "
|
||||
"eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
|
||||
"imagery, large scale typography, and intentional white space create a bold and graphic "
|
||||
"interface that immerse the user in the experience.\n"
|
||||
"An emphasis on user actions makes core functionality immediately apparent and provides "
|
||||
"waypoints for the user.\n\n"
|
||||
|
||||
"Motion provides meaning.\n\n"
|
||||
|
||||
"Motion respects and reinforces the user as the prime mover. Primary user actions are "
|
||||
"inflection points that initiate motion, transforming the whole design.\n"
|
||||
"All action takes place in a single environment. Objects are presented to the user without "
|
||||
"breaking the continuity of experience even as they transform and reorganize.\n"
|
||||
"Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
|
||||
"Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
|
||||
|
||||
"3D world.\n\n"
|
||||
|
||||
"The material environment is a 3D space, which means all objects have x, y, and z "
|
||||
"dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
|
||||
"positive z-axis extending towards the viewer. Every sheet of material occupies a single "
|
||||
"position along the z-axis and has a standard 1dp thickness.\n"
|
||||
"On the web, the z-axis is used for layering and not for perspective. The 3D world is "
|
||||
"emulated by manipulating the y-axis.\n\n"
|
||||
|
||||
"Light and shadow.\n\n"
|
||||
|
||||
"Within the material environment, virtual lights illuminate the scene. Key lights create "
|
||||
"directional shadows, while ambient light creates soft shadows from all angles.\n"
|
||||
"Shadows in the material environment are cast by these two light sources. In Android "
|
||||
"development, shadows occur when light sources are blocked by sheets of material at "
|
||||
"various positions along the z-axis. On the web, shadows are depicted by manipulating the "
|
||||
"y-axis only. The following example shows the card with a height of 6dp.\n\n"
|
||||
|
||||
"Resting elevation.\n\n"
|
||||
|
||||
"All material objects, regardless of size, have a resting elevation, or default elevation "
|
||||
"that does not change. If an object changes elevation, it should return to its resting "
|
||||
"elevation as soon as possible.\n\n"
|
||||
|
||||
"Component elevations.\n\n"
|
||||
|
||||
"The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
|
||||
"does not vary from 6dp in one app to 16dp in another app).\n"
|
||||
"Components may have different resting elevations across platforms, depending on the depth "
|
||||
"of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
|
||||
|
||||
"Responsive elevation and dynamic elevation offsets.\n\n"
|
||||
|
||||
"Some component types have responsive elevation, meaning they change elevation in response "
|
||||
"to user input (e.g., normal, focused, and pressed) or system events. These elevation "
|
||||
"changes are consistently implemented using dynamic elevation offsets.\n"
|
||||
"Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
|
||||
"to the component’s resting state. They ensure that elevation changes are consistent "
|
||||
"across actions and component types. For example, all components that lift on press have "
|
||||
"the same elevation change relative to their resting elevation.\n"
|
||||
"Once the input event is completed or cancelled, the component will return to its resting "
|
||||
"elevation.\n\n"
|
||||
|
||||
"Avoiding elevation interference.\n\n"
|
||||
|
||||
"Components with responsive elevations may encounter other components as they move between "
|
||||
"their resting elevations and dynamic elevation offsets. Because material cannot pass "
|
||||
"through other material, components avoid interfering with one another any number of ways, "
|
||||
"whether on a per component basis or using the entire app layout.\n"
|
||||
"On a component level, components can move or be removed before they cause interference. "
|
||||
"For example, a floating action button (FAB) can disappear or move off screen before a "
|
||||
"user picks up a card, or it can move if a snackbar appears.\n"
|
||||
"On the layout level, design your app layout to minimize opportunities for interference. "
|
||||
"For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
|
||||
"when a user tries to pick up one of cards.\n\n"
|
||||
</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="activity_edit_exercise_set_name_hint">Enter a name …</string>
|
||||
<string name="exercise_section_head">Head</string>
|
||||
|
|
@ -318,6 +230,11 @@
|
|||
<string name="execution">Execution</string>
|
||||
<string name="description">Description</string>
|
||||
<string name="set_contains_no_exercises">This set contains no exercises.</string>
|
||||
<string name="take_a_break_now">Take a break now! Click here to do your chosen exercises.</string>
|
||||
|
||||
<string name="numberpicker_formatter">%02d</string>
|
||||
<string name="pref_exercise_time">Exercise time (in Seconds)</string>
|
||||
<string name="pref_keep_screen_on_during_exercise">Keep screen on during exercise</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<style name="AppTheme.NumberPicker" parent="AppTheme">
|
||||
<item name="android:textColorPrimary">@color/colorPrimary</item>
|
||||
<item name="android:textColorSecondary">@color/colorAccent</item>
|
||||
<item name="android:textSize">28sp</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,58 +1,16 @@
|
|||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
|
||||
<org.secuso.privacyfriendlybreakreminder.preferences.DynamicListPreference
|
||||
android:defaultValue="@string/pref_current_profile_value"
|
||||
android:key="current_profile"
|
||||
android:title="@string/pref_current_profile" />
|
||||
|
||||
<!-- NOTE: EditTextPreference accepts EditText attributes. -->
|
||||
<!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="pref_keep_screen_on_during_exercise"
|
||||
android:title="@string/pref_keep_screen_on_during_exercise" />
|
||||
|
||||
<EditTextPreference
|
||||
android:capitalize="words"
|
||||
android:defaultValue="@string/pref_default_display_name"
|
||||
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-"
|
||||
android:inputType="textCapWords"
|
||||
android:key="name_text"
|
||||
android:maxLength="12"
|
||||
android:maxLines="1"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:title="@string/pref_title_display_name"
|
||||
android:positiveButtonText="@string/dialog_positive"/>
|
||||
android:defaultValue="30"
|
||||
android:inputType="number"
|
||||
android:numeric="integer"
|
||||
android:maxLength="2"
|
||||
android:key="pref_exercise_time"
|
||||
android:title="@string/pref_exercise_time"/>
|
||||
|
||||
|
||||
<org.secuso.privacyfriendlybreakreminder.preferences.SeekBarPreference
|
||||
android:defaultValue="50"
|
||||
android:dialogMessage="@string/settings_dialog_message"
|
||||
android:key="work_value"
|
||||
android:max="119"
|
||||
android:summary="@string/settings_summary"
|
||||
android:text="@string/settings_unit"
|
||||
android:title="@string/settings_title" />
|
||||
|
||||
<org.secuso.privacyfriendlybreakreminder.preferences.SeekBarPreference
|
||||
android:defaultValue="10"
|
||||
android:dialogMessage="@string/settings_break_title"
|
||||
android:key="break_value"
|
||||
android:max="29"
|
||||
android:summary="@string/settings_break_summary"
|
||||
android:text="@string/settings_unit"
|
||||
android:title="@string/settings_break_title" />
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="cont_value"
|
||||
android:title="@string/new_profile_continuously" />
|
||||
|
||||
<org.secuso.privacyfriendlybreakreminder.preferences.ExerciseListPreference
|
||||
android:defaultValue="1"
|
||||
android:summary="@string/settings_exercise_summary"
|
||||
android:entries="@array/type_spinner"
|
||||
android:entryValues="@array/value_spinner"
|
||||
android:title="@string/pref_current_exercises"
|
||||
android:positiveButtonText="@string/dialog_positive"/>
|
||||
|
||||
|
||||
</PreferenceScreen><!--android:key="exercise"-->
|
||||
</PreferenceScreen>
|
||||
|
|
|
|||
|
|
@ -3,15 +3,8 @@
|
|||
<!-- These settings headers are only used on tablets. -->
|
||||
|
||||
<header
|
||||
android:fragment="org.secuso.privacyfriendlybreakreminder.activities.old.SettingsActivity$GeneralPreferenceFragment"
|
||||
android:fragment="org.secuso.privacyfriendlybreakreminder.activities.SettingsActivity$GeneralPreferenceFragment"
|
||||
android:icon="@drawable/ic_info_black"
|
||||
android:title="@string/pref_header_general" />
|
||||
|
||||
<header
|
||||
android:fragment="org.secuso.privacyfriendlybreakreminder.activities.old.SettingsActivity$NotificationPreferenceFragment"
|
||||
android:icon="@drawable/ic_notifications_black_24dp"
|
||||
android:title="@string/pref_header_notifications" />
|
||||
|
||||
|
||||
|
||||
</preference-headers>
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- Allows the user to choose a ringtone in the 'notification' category. -->
|
||||
<!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
|
||||
<!-- NOTE: RingtonePreference's summary should be set to its value by the activity code. -->
|
||||
<RingtonePreference
|
||||
android:defaultValue="content://settings/system/notification_sound"
|
||||
android:key="notifications_new_message_ringtone"
|
||||
android:ringtoneType="notification"
|
||||
android:title="@string/pref_title_ringtone" />
|
||||
|
||||
<!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="notifications_new_message_vibrate"
|
||||
android:title="@string/pref_title_vibrate" />
|
||||
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="notifications_new_message_timeLeft"
|
||||
android:title="@string/pref_title_timeLeft" />
|
||||
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="notifications_stayOn"
|
||||
android:title="@string/pref_title_stayOn" />
|
||||
|
||||
</PreferenceScreen>
|
||||