Exercises can now be done. A Notification will be displayed when the timer is done. The Exercise Dialog is added.
|
|
@ -2,7 +2,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.secuso.privacyfriendlybreakreminder">
|
||||
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
|
@ -11,20 +11,9 @@
|
|||
android:screenOrientation="portrait"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name=".activities.old.BreakReminder"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.SettingsActivity"
|
||||
android:name=".activities.old.SettingsActivity"
|
||||
android:label="@string/title_activity_settings"
|
||||
android:parentActivityName=".activities.old.BreakReminder"
|
||||
android:screenOrientation="portrait">
|
||||
|
|
@ -32,24 +21,10 @@
|
|||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.old.BreakReminder" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activities.old.BreakDeciderActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activities.old.BreakActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activities.old.ProfileActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activities.old.ExerciseTypeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activities.AboutActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activities.HelpActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<receiver
|
||||
android:name=".widget.AppWidget"
|
||||
|
|
@ -65,8 +40,8 @@
|
|||
|
||||
<activity
|
||||
android:name=".activities.SplashActivity"
|
||||
android:icon="@mipmap/splash_icon"
|
||||
android:theme="@style/SplashTheme">
|
||||
android:theme="@style/SplashTheme"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
|
@ -75,30 +50,35 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:name=".activities.tutorial.TutorialActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<service
|
||||
android:name=".service.TimerService"
|
||||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
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.TimerActivity" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activities.TimerActivity"
|
||||
android:label="@string/activity_title_break_reminder"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.ManageExerciseSetsActivity"
|
||||
android:label="@string/activity_title_manage_exercise_sets"
|
||||
android:parentActivityName=".activities.TimerActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
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="@string/activity_title_exercise"
|
||||
android:parentActivityName=".activities.TimerActivity">
|
||||
android:label=""
|
||||
android:parentActivityName=".activities.TimerActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.TimerActivity" />
|
||||
|
|
@ -107,20 +87,49 @@
|
|||
android:name=".activities.EditExerciseSetActivity"
|
||||
android:label="@string/activity_title_edit_exercise_set"
|
||||
android:parentActivityName=".activities.ManageExerciseSetsActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.ManageExerciseSetsActivity" />
|
||||
</activity>
|
||||
|
||||
<activity android:name=".activities.ChooseExerciseActivity"
|
||||
<activity
|
||||
android:name=".activities.ChooseExerciseActivity"
|
||||
android:label="@string/activity_title_choose_exercises"
|
||||
android:parentActivityName=".activities.EditExerciseSetActivity">
|
||||
android:parentActivityName=".activities.EditExerciseSetActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.EditExerciseSetActivity" />>
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activities.AboutActivity"
|
||||
android:label="@string/activity_title_about"
|
||||
android:parentActivityName=".activities.TimerActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.TimerActivity" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activities.HelpActivity"
|
||||
android:label="@string/activity_title_help"
|
||||
android:parentActivityName=".activities.TimerActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait">
|
||||
<meta-data
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value="org.secuso.privacyfriendlybreakreminder.activities.TimerActivity" />
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".service.TimerService"
|
||||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package org.secuso.privacyfriendlybreakreminder.activities;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
|
|
@ -12,12 +13,17 @@ import org.secuso.privacyfriendlybreakreminder.R;
|
|||
|
||||
public class AboutActivity extends AppCompatActivity {
|
||||
|
||||
Handler mHandler;
|
||||
View mainContent;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.about);
|
||||
setContentView(R.layout.activity_about);
|
||||
|
||||
View mainContent = findViewById(R.id.main_content);
|
||||
mHandler = new Handler();
|
||||
|
||||
mainContent = findViewById(R.id.main_content);
|
||||
if (mainContent != null) {
|
||||
mainContent.setAlpha(0);
|
||||
mainContent.animate().alpha(1).setDuration(250);
|
||||
|
|
@ -26,11 +32,14 @@ public class AboutActivity extends AppCompatActivity {
|
|||
overridePendingTransition(0, 0);
|
||||
setupActionBar();
|
||||
|
||||
TextView t1 = (TextView) findViewById(R.id.git);
|
||||
TextView t1 = (TextView) findViewById(R.id.githubURL);
|
||||
t1.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
TextView t2 = (TextView) findViewById(R.id.url);
|
||||
TextView t2 = (TextView) findViewById(R.id.secusoWebsite);
|
||||
t2.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
TextView authors = (TextView) findViewById(R.id.textFieldAuthorNames);
|
||||
authors.setText(getString(R.string.about_author_contributors, getString(R.string.about_author_names)));
|
||||
}
|
||||
|
||||
private void setupActionBar() {
|
||||
|
|
@ -47,9 +56,29 @@ public class AboutActivity extends AppCompatActivity {
|
|||
switch (item.getItemId()) {
|
||||
// Respond to the action bar's Up/Home button
|
||||
case android.R.id.home:
|
||||
finish();
|
||||
exitActivity();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
exitActivity();
|
||||
}
|
||||
|
||||
private void exitActivity() {
|
||||
if (mainContent != null) {
|
||||
mainContent.setAlpha(1);
|
||||
mainContent.animate().alpha(0).setDuration(125);
|
||||
}
|
||||
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
finish();
|
||||
overridePendingTransition(0, 0);
|
||||
}
|
||||
}, 70);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,69 @@
|
|||
package org.secuso.privacyfriendlybreakreminder.activities;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.CountDownTimer;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.content.AsyncTaskLoader;
|
||||
import android.support.v4.content.Loader;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.secuso.privacyfriendlybreakreminder.R;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.SQLiteHelper;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.data.Exercise;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.data.ExerciseSet;
|
||||
import org.secuso.privacyfriendlybreakreminder.exercises.ExerciseLocale;
|
||||
|
||||
public class ExerciseActivity extends AppCompatActivity {
|
||||
import java.util.Locale;
|
||||
|
||||
import static android.support.design.R.id.center_horizontal;
|
||||
import static android.support.design.R.id.center_vertical;
|
||||
|
||||
public class ExerciseActivity extends AppCompatActivity implements android.support.v4.app.LoaderManager.LoaderCallbacks<ExerciseSet>{
|
||||
|
||||
private static final String TAG = ExerciseActivity.class.getSimpleName();
|
||||
|
||||
// UI
|
||||
private TextView breakTimerText;
|
||||
private ImageView playButton;
|
||||
private ProgressBar progressBar;
|
||||
private TextView timerText;
|
||||
private TextView executionText;
|
||||
private TextView descriptionText;
|
||||
private ImageView exerciseImage;
|
||||
private TextView sectionText;
|
||||
|
||||
// exerciseSet info
|
||||
private long exerciseSetId;
|
||||
private ExerciseSet set;
|
||||
private int currentExercise = 0;
|
||||
private int currentExercisePart = 0;
|
||||
|
||||
// timer
|
||||
private long exerciseTime = 20 * 1000; // TODO - get from exercise?
|
||||
private long pauseDuration = 5 * 60 * 1000; // TODO 5 minutes - get from settings
|
||||
private CountDownTimer exerciseTimer;
|
||||
private CountDownTimer breakTimer;
|
||||
private boolean isBreakTimerRunning;
|
||||
private boolean isExerciseTimerRunning;
|
||||
private long remainingBreakDuration;
|
||||
private long remainingExerciseDuration;
|
||||
|
||||
// database
|
||||
private SQLiteHelper dbHelper;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -16,12 +71,121 @@ public class ExerciseActivity extends AppCompatActivity {
|
|||
setContentView(R.layout.activity_exercise);
|
||||
|
||||
initResources();
|
||||
|
||||
ActionBar ab = getSupportActionBar();
|
||||
if(ab != null) {
|
||||
ab.setDisplayHomeAsUpEnabled(true);
|
||||
ab.setHomeAsUpIndicator(R.drawable.ic_close_white);
|
||||
}
|
||||
|
||||
exerciseSetId = PreferenceManager.getDefaultSharedPreferences(this).getLong("DEFAULT_EXERCISE_SET", 0L);
|
||||
pauseDuration = PreferenceManager.getDefaultSharedPreferences(this).getLong("DEFAULT_PAUSE_DURATION", 0L);
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
getSupportLoaderManager().initLoader(0, null, this);
|
||||
}
|
||||
|
||||
private void initResources() {
|
||||
dbHelper = new SQLiteHelper(this);
|
||||
playButton = (ImageView) findViewById(R.id.button_playPause);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressBar);
|
||||
timerText = (TextView) findViewById(R.id.timerText);
|
||||
executionText = (TextView) findViewById(R.id.execution);
|
||||
descriptionText = (TextView) findViewById(R.id.description);
|
||||
exerciseImage = (ImageView) findViewById(R.id.exercise_image);
|
||||
sectionText = (TextView) findViewById(R.id.section);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
showConfirmationDialog();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.menu_activity_exercise, menu);
|
||||
|
||||
MenuItem timerItem = menu.findItem(R.id.break_timer);
|
||||
breakTimerText = (TextView) MenuItemCompat.getActionView(timerItem);
|
||||
breakTimerText.setTextColor(Color.WHITE);
|
||||
breakTimerText.setTextSize(20);
|
||||
breakTimerText.setGravity(center_vertical);
|
||||
breakTimerText.setText("00:00");
|
||||
breakTimerText.setPadding(16, 0, 16, 0);
|
||||
//breakTimerText.set(10, 0, 10, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
showConfirmationDialog();
|
||||
}
|
||||
|
||||
private void showConfirmationDialog() {
|
||||
new AlertDialog.Builder(this)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
ExerciseActivity.this.finish();
|
||||
ExerciseActivity.this.startActivity(new Intent(ExerciseActivity.this, TimerActivity.class));
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Loader<ExerciseSet> onCreateLoader(int id, final Bundle args) {
|
||||
return new AsyncTaskLoader<ExerciseSet>(this) {
|
||||
@Override
|
||||
public ExerciseSet loadInBackground() {
|
||||
return dbHelper.getExerciseListForSet((int)exerciseSetId, ExerciseLocale.getLocale());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStartLoading() {
|
||||
forceLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onReset() {}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(Loader<ExerciseSet> loader, ExerciseSet set) {
|
||||
this.set = set;
|
||||
|
||||
if(set.size() > 0) {
|
||||
setExercise(0);
|
||||
} else {
|
||||
// TODO IF THERE ARE NO EXERCISES ONLY SHOW TIMER : showTimer();
|
||||
}
|
||||
// load data only once
|
||||
getSupportLoaderManager().destroyLoader(0);
|
||||
|
||||
pauseDuration = PreferenceManager.getDefaultSharedPreferences(ExerciseActivity.this).getLong("PAUSE TIME", 5 * 60 * 1000);
|
||||
startBreakTimer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(Loader<ExerciseSet> loader) {}
|
||||
|
||||
|
||||
private void updatePlayButton(boolean isRunning) {
|
||||
if(isRunning) {
|
||||
playButton.setImageResource(R.drawable.ic_pause_black_48dp);
|
||||
|
|
@ -29,4 +193,252 @@ public class ExerciseActivity extends AppCompatActivity {
|
|||
playButton.setImageResource(R.drawable.ic_play_arrow_black);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateProgress(long remainingDuration) {
|
||||
progressBar.setMax((int)exerciseTime);
|
||||
progressBar.setProgress(progressBar.getMax() - (int) remainingDuration);
|
||||
|
||||
int secondsUntilFinished = (int) Math.ceil(remainingDuration / 1000.0);
|
||||
int minutesUntilFinished = secondsUntilFinished / 60;
|
||||
int seconds = secondsUntilFinished % 60;
|
||||
int minutes = minutesUntilFinished % 60;
|
||||
|
||||
String time = String.format(Locale.US, "%02d:%02d", minutes, seconds);
|
||||
timerText.setText(time);
|
||||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
switch(view.getId()) {
|
||||
case R.id.progressBarLayout:
|
||||
case R.id.button_playPause:
|
||||
handlePlayPauseClicked();
|
||||
break;
|
||||
case R.id.button_next:
|
||||
handleSkipClicked();
|
||||
break;
|
||||
case R.id.button_prev:
|
||||
handlePrevClicked();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
private boolean next() {
|
||||
return nextExercisePart() || nextExercise();
|
||||
}
|
||||
|
||||
private boolean nextExercise() {
|
||||
if(set != null) {
|
||||
setExercise((currentExercise + 1));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private boolean previousExercise() {
|
||||
if(set != null) {
|
||||
setExercise(currentExercise - 1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void setExercise(int number) {
|
||||
if(set != null) {
|
||||
if(set.size() != 0) {
|
||||
|
||||
// TODO: stop if we reach the end or loop around
|
||||
boolean loopAround = true;
|
||||
|
||||
if(number < 0) {
|
||||
currentExercise = loopAround ?
|
||||
(number + set.size()) :
|
||||
0;
|
||||
|
||||
} else if(number >= set.size()) {
|
||||
currentExercise = loopAround ?
|
||||
(number % set.size()) :
|
||||
(set.size() -1);
|
||||
|
||||
} else {
|
||||
currentExercise = number;
|
||||
}
|
||||
|
||||
currentExercisePart = 0;
|
||||
showExercise(set.get(currentExercise), currentExercisePart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean nextExercisePart() {
|
||||
if(set != null) {
|
||||
if(set.size() != 0) {
|
||||
int[] images = set.get(currentExercise).getImageResIds(this);
|
||||
|
||||
currentExercisePart = (currentExercisePart + 1);
|
||||
|
||||
if(currentExercisePart >= images.length) {
|
||||
currentExercisePart = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
showExercise(set.get(currentExercise), currentExercisePart);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void showExercise(Exercise e, int image) {
|
||||
int[] images = e.getImageResIds(this);
|
||||
|
||||
if (image < 0 || image >= images.length) {
|
||||
image = 0;
|
||||
}
|
||||
|
||||
executionText.setText(e.getExecution());
|
||||
descriptionText.setText(e.getDescription());
|
||||
sectionText.setText(e.getSection());
|
||||
exerciseImage.setImageResource(e.getImageResIds(this)[image]);
|
||||
|
||||
// TODO: continuous play?
|
||||
// if()
|
||||
startExerciseTimer();
|
||||
// else
|
||||
//resetExerciseTimer();
|
||||
}
|
||||
|
||||
private void handlePrevClicked() {
|
||||
previousExercise();
|
||||
}
|
||||
|
||||
private void handleSkipClicked() {
|
||||
nextExercise();
|
||||
}
|
||||
|
||||
private void handlePlayPauseClicked() {
|
||||
if(isExercisePaused()) {
|
||||
resumeExerciseTimer();
|
||||
updatePlayButton(true);
|
||||
}
|
||||
else if(isExerciseTimerRunning){
|
||||
pauseExerciseTimer();
|
||||
updatePlayButton(false);
|
||||
} else {
|
||||
startExerciseTimer();
|
||||
updatePlayButton(true);
|
||||
}
|
||||
}
|
||||
|
||||
// timer
|
||||
public CountDownTimer createBreakTimer(long duration) {
|
||||
return new CountDownTimer(duration, 100) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
remainingBreakDuration = millisUntilFinished;
|
||||
updateBreakTimer(remainingBreakDuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
remainingBreakDuration = 0;
|
||||
isBreakTimerRunning = false;
|
||||
updateBreakTimer(remainingBreakDuration);
|
||||
// TODO: show dialog to end the exercises?
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void updateBreakTimer(long remainingBreakDuration) {
|
||||
int secondsUntilFinished = (int) Math.ceil(remainingBreakDuration / 1000.0);
|
||||
int minutesUntilFinished = secondsUntilFinished / 60;
|
||||
int seconds = secondsUntilFinished % 60;
|
||||
int minutes = minutesUntilFinished % 60;
|
||||
|
||||
String time = String.format(Locale.US, "%02d:%02d", minutes, seconds);
|
||||
time = getString(R.string.remaining_time) + " " + time;
|
||||
if(breakTimerText != null) {
|
||||
breakTimerText.setText(time);
|
||||
}
|
||||
}
|
||||
|
||||
public CountDownTimer createExerciseTimer(long duration) {
|
||||
return new CountDownTimer(duration, 25) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
remainingExerciseDuration = millisUntilFinished;
|
||||
updateProgress(millisUntilFinished);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
remainingExerciseDuration = 0;
|
||||
isExerciseTimerRunning = false;
|
||||
updatePlayButton(false);
|
||||
updateProgress(0L);
|
||||
next();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void startBreakTimer() {
|
||||
breakTimer = createBreakTimer(pauseDuration);
|
||||
breakTimer.start();
|
||||
isBreakTimerRunning = true;
|
||||
}
|
||||
|
||||
public void startExerciseTimer() {
|
||||
if(exerciseTimer != null) {
|
||||
exerciseTimer.cancel();
|
||||
}
|
||||
exerciseTimer = createExerciseTimer(exerciseTime);
|
||||
exerciseTimer.start();
|
||||
isExerciseTimerRunning = true;
|
||||
updateProgress(exerciseTime);
|
||||
updatePlayButton(true);
|
||||
}
|
||||
|
||||
private void pauseBreakTimer() {
|
||||
if(isBreakTimerRunning) {
|
||||
breakTimer.cancel();
|
||||
isBreakTimerRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void pauseExerciseTimer() {
|
||||
if(isExerciseTimerRunning) {
|
||||
exerciseTimer.cancel();
|
||||
isExerciseTimerRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void resumeBreakTimer() {
|
||||
if(!isBreakTimerRunning & remainingBreakDuration > 0) {
|
||||
breakTimer = createExerciseTimer(remainingBreakDuration);
|
||||
breakTimer.start();
|
||||
isBreakTimerRunning = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void resumeExerciseTimer() {
|
||||
if(!isExerciseTimerRunning & remainingExerciseDuration > 0) {
|
||||
exerciseTimer = createExerciseTimer(remainingExerciseDuration);
|
||||
exerciseTimer.start();
|
||||
isExerciseTimerRunning = true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isExercisePaused() {
|
||||
return !isExerciseTimerRunning && remainingExerciseDuration > 0;
|
||||
// return !isRunning && initialDuration != 0 && remainingDuration > 0 && remainingDuration != initialDuration;
|
||||
}
|
||||
|
||||
private void resetExerciseTimer() {
|
||||
exerciseTimer.cancel();
|
||||
isExerciseTimerRunning = false;
|
||||
remainingExerciseDuration = 0;
|
||||
|
||||
updatePlayButton(false);
|
||||
updateProgress(0L);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import android.os.Bundle;
|
|||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
|
@ -46,6 +47,7 @@ import static android.view.View.VISIBLE;
|
|||
|
||||
public class ManageExerciseSetsActivity extends BaseActivity implements android.support.v4.app.LoaderManager.LoaderCallbacks<List<ExerciseSet>> {
|
||||
|
||||
private static final String TAG = ManageExerciseSetsActivity.class.getSimpleName();
|
||||
private RecyclerView exerciseSetList;
|
||||
private ProgressBar loadingSpinner;
|
||||
private TextView noExerciseSetsText;
|
||||
|
|
@ -192,7 +194,7 @@ public class ManageExerciseSetsActivity extends BaseActivity implements android.
|
|||
enableDeleteMode();
|
||||
return true;
|
||||
default:
|
||||
Toast.makeText(this, "option selected", Toast.LENGTH_SHORT).show();
|
||||
Log.d(TAG, "Default option selected?");
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,6 +237,10 @@ 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()) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.secuso.privacyfriendlybreakreminder.activities.adapter;
|
|||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.constraint.ConstraintLayout;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.util.SortedList;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -18,6 +19,7 @@ import org.secuso.privacyfriendlybreakreminder.R;
|
|||
import org.secuso.privacyfriendlybreakreminder.activities.ChooseExerciseActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.data.Exercise;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.data.ExerciseSet;
|
||||
import org.secuso.privacyfriendlybreakreminder.dialog.ExerciseDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
|
|
@ -99,18 +101,10 @@ public class ExerciseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||
|
||||
final ExerciseViewHolder vh = (ExerciseViewHolder) holder;
|
||||
|
||||
String imageID = exercise.getImageID();
|
||||
String[] imageIDSplit = imageID.split(",");
|
||||
|
||||
if(imageIDSplit.length > 1) {
|
||||
imageID = imageIDSplit[0];
|
||||
}
|
||||
|
||||
final View.OnClickListener infoClick = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Toast.makeText(mContext, "Show Details Of the Exercise Now.", Toast.LENGTH_SHORT).show();
|
||||
// TODO: show Fragement ? Dialog? Something with the Information of the Exercise!
|
||||
ExerciseDialog.showExerciseDialog(mContext, exercise);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -127,11 +121,7 @@ public class ExerciseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
|||
}
|
||||
};
|
||||
|
||||
int imageResID = mContext.getResources().getIdentifier(
|
||||
"exercise_" + imageID,
|
||||
"drawable",
|
||||
mContext.getPackageName());
|
||||
vh.image.setImageResource(imageResID);
|
||||
vh.image.setImageResource(exercise.getImageResIds(mContext)[0]);
|
||||
|
||||
if(checkedIds != null)
|
||||
vh.checkbox.setChecked(checkedIds.contains(exercise.getId()));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package org.secuso.privacyfriendlybreakreminder.activities.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.RecyclerView.ViewHolder;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -32,7 +31,7 @@ public class ExerciseSetAdapter extends RecyclerView.Adapter<ViewHolder> {
|
|||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_exercise, parent, false);
|
||||
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.dialog_exercise, parent, false);
|
||||
return new ExerciseViewHolder(itemView);
|
||||
}
|
||||
|
||||
|
|
@ -44,19 +43,7 @@ public class ExerciseSetAdapter extends RecyclerView.Adapter<ViewHolder> {
|
|||
|
||||
ExerciseViewHolder vh = (ExerciseViewHolder) holder;
|
||||
|
||||
String imageID = exercise.getImageID();
|
||||
String[] imageIDSplit = imageID.split(",");
|
||||
|
||||
if(imageIDSplit.length > 1) {
|
||||
imageID = imageIDSplit[0]; // only take the first image as a display image
|
||||
}
|
||||
|
||||
int imageResID = mContext.getResources().getIdentifier(
|
||||
"exercise_" + imageID,
|
||||
"drawable",
|
||||
mContext.getPackageName());
|
||||
vh.image.setImageResource(imageResID);
|
||||
vh.name.setText(exercise.getName());
|
||||
vh.image.setImageResource(exercise.getImageResIds(mContext)[0]);
|
||||
vh.executionText.setText(exercise.getExecution());
|
||||
vh.descriptionText.setText(exercise.getDescription());
|
||||
vh.section.setText(exercise.getSection());
|
||||
|
|
@ -91,7 +78,6 @@ public class ExerciseSetAdapter extends RecyclerView.Adapter<ViewHolder> {
|
|||
public class ExerciseViewHolder extends ViewHolder {
|
||||
|
||||
ImageView image;
|
||||
TextView name;
|
||||
TextView executionText;
|
||||
TextView descriptionText;
|
||||
TextView section;
|
||||
|
|
@ -99,11 +85,10 @@ public class ExerciseSetAdapter extends RecyclerView.Adapter<ViewHolder> {
|
|||
public ExerciseViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
name = (TextView) itemView.findViewById(R.id.exercise_name);
|
||||
image = (ImageView) itemView.findViewById(R.id.exercise_image);
|
||||
executionText = (TextView) itemView.findViewById(R.id.exercise_execution);
|
||||
descriptionText = (TextView) itemView.findViewById(R.id.exercise_description);
|
||||
section = (TextView) itemView.findViewById(R.id.exercise_section);
|
||||
executionText = (TextView) itemView.findViewById(R.id.execution);
|
||||
descriptionText = (TextView) itemView.findViewById(R.id.description);
|
||||
section = (TextView) itemView.findViewById(R.id.section);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,19 +73,8 @@ public class ExerciseSetSpinnerAdapter extends ArrayAdapter<ExerciseSet> {
|
|||
View view = LayoutInflater.from(getContext()).inflate(R.layout.layout_round_exercise_image, null, false);
|
||||
ImageView image = (ImageView) view.findViewById(R.id.exercise_image);
|
||||
|
||||
String imageID = set.get(i).getImageID();
|
||||
String[] imageIDSplit = imageID.split(",");
|
||||
image.setImageResource(set.get(i).getImageResIds(getContext())[0]);
|
||||
|
||||
if(imageIDSplit.length > 1) {
|
||||
imageID = imageIDSplit[0]; // only take the first image as a display image
|
||||
}
|
||||
|
||||
int imageResID = getContext().getResources().getIdentifier(
|
||||
"exercise_" + imageID,
|
||||
"drawable",
|
||||
getContext().getPackageName());
|
||||
|
||||
image.setImageResource(imageResID);
|
||||
exerciseList.addView(view);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.SettingsActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.old.SettingsActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.TimerActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.tutorial.TutorialActivity;
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ public abstract class BaseActivity extends AppCompatActivity implements OnNaviga
|
|||
break;
|
||||
case R.id.nav_tutorial:
|
||||
intent = new Intent(this, TutorialActivity.class);
|
||||
startActivity(intent);
|
||||
createBackStack(intent);
|
||||
break;
|
||||
case R.id.nav_about:
|
||||
intent = new Intent(this, AboutActivity.class);
|
||||
|
|
@ -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 );
|
||||
createBackStack(intent);
|
||||
break;
|
||||
break;*/
|
||||
default:
|
||||
}
|
||||
overridePendingTransition(0,0);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import android.widget.TextView;
|
|||
import org.secuso.privacyfriendlybreakreminder.R;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.AboutActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.HelpActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.SettingsActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.widget.*;
|
||||
|
||||
import java.util.Locale;
|
||||
|
|
@ -304,7 +303,7 @@ public class BreakReminder extends AppCompatActivity
|
|||
// Handle navigation view item clicks here.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == R.id.nav_settings) {
|
||||
/*if (id == R.id.nav_settings) {
|
||||
// Handle the profile action
|
||||
Intent intent = new Intent(this, SettingsActivity.class);
|
||||
this.startActivity(intent);
|
||||
|
|
@ -320,7 +319,7 @@ public class BreakReminder extends AppCompatActivity
|
|||
// Show about page
|
||||
Intent intent = new Intent(this, AboutActivity.class);
|
||||
this.startActivity(intent);
|
||||
}
|
||||
}*/
|
||||
|
||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
drawer.closeDrawer(GravityCompat.START);
|
||||
|
|
@ -539,7 +538,7 @@ public class BreakReminder extends AppCompatActivity
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
|
||||
builder.setView(i.inflate(R.layout.first_dialog, null));
|
||||
builder.setIcon(R.mipmap.ic_drawer_logo);
|
||||
builder.setIcon(R.mipmap.ic_app);
|
||||
builder.setTitle(getActivity().getString(R.string.app_name_long));
|
||||
|
||||
builder.setPositiveButton(getActivity().getString(R.string.dialog_positive), null);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
package org.secuso.privacyfriendlybreakreminder.activities;
|
||||
package org.secuso.privacyfriendlybreakreminder.activities.old;
|
||||
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package org.secuso.privacyfriendlybreakreminder.database.data;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.IdRes;
|
||||
|
||||
public class Exercise {
|
||||
private int id;
|
||||
private int localId;
|
||||
|
|
@ -46,6 +50,20 @@ public class Exercise {
|
|||
public void setImageID(String imageID) {
|
||||
this.imageID = imageID;
|
||||
}
|
||||
public @DrawableRes int[] getImageResIds(Context context) {
|
||||
String[] imageIDSplit = imageID.split(",");
|
||||
|
||||
int[] result = new int[imageIDSplit.length];
|
||||
|
||||
for(int i = 0; i < result.length; ++i) {
|
||||
result[i] = context.getResources().getIdentifier(
|
||||
"exercise_" + imageIDSplit[i],
|
||||
"drawable",
|
||||
context.getPackageName());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getSection() {
|
||||
return section;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package org.secuso.privacyfriendlybreakreminder.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.secuso.privacyfriendlybreakreminder.R;
|
||||
import org.secuso.privacyfriendlybreakreminder.database.data.Exercise;
|
||||
|
||||
/**
|
||||
* Use {@link ExerciseDialog#showExerciseDialog(Context, Exercise)} to show the dialog.
|
||||
*/
|
||||
public final class ExerciseDialog {
|
||||
|
||||
/**
|
||||
* Use {@link ExerciseDialog#showExerciseDialog(Context, Exercise)} to show the dialog.
|
||||
*/
|
||||
private ExerciseDialog() {}
|
||||
|
||||
|
||||
public static void showExerciseDialog(@NonNull final Context context,@NonNull final Exercise e) {
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(FragmentActivity.LAYOUT_INFLATER_SERVICE);
|
||||
View v = inflater.inflate(R.layout.dialog_exercise, null);
|
||||
|
||||
final TextView executionText = (TextView) v.findViewById(R.id.execution);
|
||||
final TextView descriptionText = (TextView) v.findViewById(R.id.description);
|
||||
final ImageView exerciseImage = (ImageView) v.findViewById(R.id.exercise_image);
|
||||
final TextView sectionText = (TextView) v.findViewById(R.id.section);
|
||||
|
||||
if(executionText != null)
|
||||
executionText.setText(e.getExecution());
|
||||
if(descriptionText != null)
|
||||
descriptionText.setText(e.getDescription());
|
||||
if(sectionText != null)
|
||||
sectionText.setText(e.getSection());
|
||||
if(exerciseImage != null) {
|
||||
exerciseImage.setOnClickListener(new View.OnClickListener() {
|
||||
int currentlyShownExercise = 0;
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int[] resIds = e.getImageResIds(context);
|
||||
|
||||
if(resIds.length > 0) {
|
||||
currentlyShownExercise = (currentlyShownExercise + 1) % resIds.length;
|
||||
exerciseImage.setImageResource(resIds[currentlyShownExercise]);
|
||||
}
|
||||
}
|
||||
});
|
||||
exerciseImage.setImageResource(e.getImageResIds(context)[0]);
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setView(v);
|
||||
builder.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -14,11 +14,13 @@ import android.os.IBinder;
|
|||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.NotificationCompat;
|
||||
|
||||
import org.secuso.privacyfriendlybreakreminder.R;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.ExerciseActivity;
|
||||
import org.secuso.privacyfriendlybreakreminder.activities.TimerActivity;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
|
|
@ -49,6 +51,20 @@ public class TimerService extends Service {
|
|||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
if(intent.getBooleanExtra("done" ,false)) {
|
||||
lastTime = 0;
|
||||
onTimerDone();
|
||||
return;
|
||||
}
|
||||
|
||||
// reset lastTime if we are starting a new timer
|
||||
long initialMillis = intent.getLongExtra("initialMillis", 0);
|
||||
long remainingMillis = intent.getLongExtra("onTickMillis", 0);
|
||||
|
||||
if(initialMillis == remainingMillis) {
|
||||
lastTime = 0;
|
||||
}
|
||||
|
||||
// limit the notification updates
|
||||
int remainingSeconds = intent.getIntExtra("countdown_seconds", 0);
|
||||
|
||||
|
|
@ -56,13 +72,34 @@ public class TimerService extends Service {
|
|||
lastTime = remainingSeconds;
|
||||
updateNotification();
|
||||
|
||||
} else if(intent.getBooleanExtra("done" ,false)) {
|
||||
lastTime = 0;
|
||||
updateNotification();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private void onTimerDone() {
|
||||
|
||||
// send a notification with sound and vibration
|
||||
stopForeground(false);
|
||||
|
||||
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))
|
||||
.setColor(ContextCompat.getColor(this, R.color.colorAccent))
|
||||
.setPriority(NotificationCompat.PRIORITY_MAX)
|
||||
.setWhen(0)
|
||||
.setAutoCancel(true)
|
||||
.setSmallIcon(R.mipmap.ic_launcher)
|
||||
.setDefaults(Notification.DEFAULT_LIGHTS)
|
||||
.setVibrate(new long[] { 0, 1000, 1000, 1000, 1000, 1000, 1000 })
|
||||
.setSound(Settings.System.DEFAULT_NOTIFICATION_URI)
|
||||
.setOnlyAlertOnce(false);
|
||||
notificationManager.notify(NOTIFICATION_ID, builder.build());
|
||||
|
||||
// TODO: show decider activity?!
|
||||
// maybe rather show a dialog
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
|
@ -155,14 +192,12 @@ public class TimerService extends Service {
|
|||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
|
||||
mTimer.cancel();
|
||||
isRunning = false;
|
||||
remainingDuration = 0;
|
||||
|
||||
Intent broadcast = buildBroadcast();
|
||||
broadcast.putExtra("done", true);
|
||||
sendBroadcast(broadcast);
|
||||
TimerService.this.sendBroadcast(broadcast);
|
||||
|
||||
remainingDuration = initialDuration;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<item>
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@mipmap/splash_icon"
|
||||
android:src="@mipmap/ic_splash"
|
||||
android:gravity="center"/>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:weightSum="1"
|
||||
tools:context="org.secuso.privacyfriendlybreakreminder.activities.AboutActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="0.36"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/barcodeLogo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/about_privacyfriendlyappslogo" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/app_name_long" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/version_number" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldAuthor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/about_author" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldAuthorNames"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/about_author_names" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldAffiliation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="28dp"
|
||||
android:text="@string/about_affiliation"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/about_secuso_logo_blau_blau" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/privacy_friendly" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/more_info" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/url"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/url"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/git"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/github" />
|
||||
|
||||
</LinearLayout>
|
||||
145
app/src/main/res/layout/activity_about.xml
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF">
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:weightSum="1"
|
||||
tools:context=".activities.AboutActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.36">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/barcodeLogo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/about_privacyfriendlyappslogo" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/app_name_long" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/version_number" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldVersionName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_toEndOf="@+id/textFieldVersion" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldAuthor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/about_author" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldAuthorNames"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/about_author_names" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textFieldAffiliation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="@string/about_affiliation"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/about_secuso_logo_blau_blau" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/privacy_friendly" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/more_info" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/secusoWebsite"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/url"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/githubURL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/github" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
<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/main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="org.secuso.privacyfriendlybreakreminder.activities.ExerciseActivity">
|
||||
|
|
@ -25,11 +26,53 @@
|
|||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:srcCompat="@drawable/ic_play_arrow_black" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:onClick="onClick"
|
||||
android:scaleType="fitXY"
|
||||
android:tint="@color/darkblue"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:srcCompat="@drawable/ic_skip_next_black_48dp"
|
||||
app:layout_constraintHorizontal_bias="0.75" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_prev"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:onClick="onClick"
|
||||
android:scaleType="fitXY"
|
||||
android:tint="@color/darkblue"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:srcCompat="@drawable/ic_skip_previous_black_48dp"
|
||||
app:layout_constraintHorizontal_bias="0.25" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeLayout"
|
||||
android:id="@+id/progressBarLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
|
@ -68,17 +111,17 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/exercise_image"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
app:srcCompat="@drawable/exercise_0"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/relativeLayout"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="180dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp" />
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/progressBarLayout"
|
||||
app:srcCompat="@drawable/exercise_0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/execution_title"
|
||||
|
|
@ -89,7 +132,7 @@
|
|||
android:layout_marginTop="0dp"
|
||||
android:text="Execution"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/relativeLayout"
|
||||
app:layout_constraintLeft_toRightOf="@+id/progressBarLayout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/section_card" />
|
||||
|
||||
<TextView
|
||||
|
|
@ -100,7 +143,7 @@
|
|||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="sitting or standing"
|
||||
app:layout_constraintLeft_toRightOf="@+id/relativeLayout"
|
||||
app:layout_constraintLeft_toRightOf="@+id/progressBarLayout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/execution_title" />
|
||||
|
||||
<TextView
|
||||
|
|
|
|||
|
|
@ -4,27 +4,27 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:fitsSystemWindows="true"
|
||||
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"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="orgprivacy_friendly_apps.secusoprivacyfriendlybreakreminder.HelpActivity">
|
||||
tools:context=".activities.HelpActivity">
|
||||
|
||||
<include layout="@layout/app_bar_break_reminder"/>
|
||||
<include layout="@layout/layout_toolbar"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:orientation="vertical"
|
||||
tools:context="org.secuso.privacyfriendlybreakreminder.activities.HelpActivity"
|
||||
tools:context=".activities.HelpActivity"
|
||||
android:weightSum="1">
|
||||
<fragment android:name="org.secuso.privacyfriendlybreakreminder.activities.HelpActivity$HelpFragment"
|
||||
android:id="@+id/help_fragment"
|
||||
|
|
@ -37,10 +37,12 @@
|
|||
|
||||
<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>
|
||||
|
|
@ -9,9 +9,6 @@
|
|||
tools:openDrawer="start">
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
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="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
|
|
@ -19,9 +16,7 @@
|
|||
|
||||
<include layout="@layout/layout_toolbar"/>
|
||||
|
||||
<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.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:id="@+id/main_content"
|
||||
|
|
@ -67,6 +62,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@
|
|||
tools:openDrawer="start">
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
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="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
|
|
@ -19,9 +16,7 @@
|
|||
|
||||
<include layout="@layout/layout_toolbar"/>
|
||||
|
||||
<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.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="0dp"
|
||||
|
|
@ -75,7 +70,7 @@
|
|||
android:layout_marginStart="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:id="@+id/relativeLayout"
|
||||
android:id="@+id/progressBarLayout"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
android:layout_marginTop="16dp"
|
||||
|
|
@ -179,12 +174,12 @@
|
|||
android:tint="@color/darkblue"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/relativeLayout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/progressBarLayout"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintRight_toRightOf="@+id/relativeLayout"
|
||||
app:layout_constraintRight_toRightOf="@+id/progressBarLayout"
|
||||
android:layout_marginLeft="8dp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/relativeLayout"
|
||||
app:layout_constraintHorizontal_bias="0.332"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/progressBarLayout"
|
||||
app:layout_constraintHorizontal_bias="0.333"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
@ -201,12 +196,12 @@
|
|||
android:tint="@color/darkblue"
|
||||
app:srcCompat="@drawable/ic_play_arrow_black"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintRight_toRightOf="@+id/relativeLayout"
|
||||
app:layout_constraintRight_toRightOf="@+id/progressBarLayout"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/relativeLayout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/progressBarLayout"
|
||||
android:layout_marginLeft="8dp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/relativeLayout"
|
||||
app:layout_constraintHorizontal_bias="0.654"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/progressBarLayout"
|
||||
app:layout_constraintHorizontal_bias="0.666"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
|
|||
100
app/src/main/res/layout/dialog_exercise.xml
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
<?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="wrap_content"
|
||||
android:layout_margin="0dp"
|
||||
android:padding="8dp">
|
||||
|
||||
<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="7dp"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/execution"
|
||||
app:srcCompat="@drawable/exercise_0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/execution_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:text="Execution"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/section_card" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/execution"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="sitting or standing"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/execution_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/execution_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Description"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/exercise_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="- do something\n- do something else\n- then do the first something again"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/description_title"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/description_title"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/section_card"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="24dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:cardBackgroundColor="@color/middleblue"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintLeft_toRightOf="@+id/execution"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/section"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:gravity="center"
|
||||
android:text="Neck, Arms"
|
||||
android:textColor="@color/white" />
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
<?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="wrap_content"
|
||||
android:layout_margin="0dp"
|
||||
android:padding="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exercise_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:text="Name"
|
||||
android:textAlignment="viewStart"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/exercise_image_card"
|
||||
app:layout_constraintTop_toTopOf="@+id/exercise_image_card" />
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/exercise_image_card"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:innerRadius="0dp"
|
||||
android:shape="ring"
|
||||
android:thicknessRatio="1.9"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/exercise_image"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:scaleType="fitCenter"
|
||||
app:srcCompat="@drawable/exercise_0" />
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exercise_description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Description"
|
||||
android:textAlignment="textEnd"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exercise_execution"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Execution"
|
||||
android:textAlignment="viewStart"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/exercise_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/exercise_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exercise_section"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Section"
|
||||
android:textAlignment="textEnd"
|
||||
app:layout_constraintRight_toRightOf="@+id/exercise_description"
|
||||
app:layout_constraintTop_toBottomOf="@+id/exercise_description" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/ic_drawer_logo"/>
|
||||
android:src="@mipmap/ic_app"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/img_width_height"
|
||||
android:layout_height="@dimen/img_width_height"
|
||||
android:background="@mipmap/splash_icon" />
|
||||
android:background="@mipmap/ic_splash" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/img_width_height"
|
||||
android:layout_height="@dimen/img_width_height"
|
||||
android:background="@mipmap/splash_icon"
|
||||
android:background="@mipmap/ic_splash"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/img_width_height"
|
||||
android:layout_height="@dimen/img_width_height"
|
||||
android:background="@mipmap/splash_icon"
|
||||
android:background="@mipmap/ic_splash"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
|
|
|||
11
app/src/main/res/menu/menu_activity_exercise.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:compatibility="http://schemas.android.com/apk/res-auto" >
|
||||
|
||||
<item android:id="@+id/break_timer"
|
||||
android:title=""
|
||||
compatibility:showAsAction="always"
|
||||
compatibility:actionViewClass="android.widget.TextView"/>
|
||||
|
||||
</menu>
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
|
@ -102,7 +102,7 @@
|
|||
<string name="new_profile_success">Übungen wurden erfolgreich erstellt!</string>
|
||||
<string name="settings_exercise_summary">Wählen Sie die zu trainierenden Körperbereiche aus</string>
|
||||
<string name="disclaimer_title">Haftungsausschluss</string>
|
||||
<string name="about_author_contributors">und Mitwirkende</string>
|
||||
<string name="about_author_contributors">%s und Mitwirkende</string>
|
||||
<string name="help_general_breaks">Sie können in den Pausen trainieren, müssen dies aber nicht! Erstellen Sie einfach ein Profil, ohne Übungen hinzuzufügen.</string>
|
||||
<string name="help_general_information">Der \'Privacy friendly break reminder\' hilft Ihnen, regelmäßiger Pausen zu nehmen und währenddessen zu trainieren!</string>
|
||||
<string name="help_general_settings">Alternativ können die Profile und die dazugehörigen Übungen in den Profil-Einstellungen bearbeitet werden</string>
|
||||
|
|
@ -119,5 +119,4 @@
|
|||
<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="about_author_names">Sergej Alexeev, Jannik Schildknecht und Mitwirkende</string>
|
||||
</resources>
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
<string name="new_profile_success">Exercices créé avec succès!</string>
|
||||
<string name="disclaimer_title">Désistement</string>
|
||||
<string name="settings_exercise_summary">Sélectionnez les parties du corps pour l\'entrainement</string>
|
||||
<string name="about_author_contributors">et contributeurs</string>
|
||||
<string name="about_author_contributors">%s et contributeurs</string>
|
||||
<string name="help_general_breaks">Vous pouvez faire de l\'entrainement dans les pauses, mais vous n\'etes pas forcé! Il suffit de créer un nouveau profil et de ne pas sélectionnez d\'exercices pour faire une pause simple sans exercise.</string>
|
||||
<string name="help_general_information">Le \'privacy friendly break reminder\' vous aide à faire des pauses plus régulièrement et se mettre en forme avec des exercise pour toute le corps!</string>
|
||||
<string name="help_general_settings">Alternative, les profils et ces exercices peuvent être modifiés dans le paramètres du profils</string>
|
||||
|
|
@ -119,6 +119,5 @@
|
|||
<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="about_author_names">Sergej Alexeev, Jannik Schildknecht et contributeurs</string>
|
||||
|
||||
</resources>
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
</string-array>
|
||||
<string name="disclaimer_title">Дисклеймер </string>
|
||||
<string name="settings_exercise_summary">Выберите части тела, которые вы хотите тренировать</string>
|
||||
<string name="about_author_contributors">и соучастники</string>
|
||||
<string name="about_author_contributors">%s и соучастники</string>
|
||||
<string name="help_tepps_brac_title">Basic Rest Activity Circle</string>
|
||||
<string name="help_tipps_title">Рекомендация</string>
|
||||
<string name="help_tipps_pomodoro_title">Помодоро</string>
|
||||
|
|
@ -118,5 +118,4 @@
|
|||
<string name="help_support_next">При нажатии на кнопку \'Next\', приложение будет выбрать новое упражнение в текущей области тела. В то же время часы будут сброшены на следующую полную минуту, чтобы провестить время полностью на упражнениях.</string>
|
||||
<string name="help_support_clock_title">Интерактивные часы</string>
|
||||
<string name="help_support_clock_descr">При нажатии на часы возможно их запустить или остановить.</string>
|
||||
<string name="about_author_names">Sergej Alexeev, Jannik Schildknecht и соучастники</string>
|
||||
</resources>
|
||||
|
|
@ -73,10 +73,10 @@
|
|||
<!-- settings for AboutActivity -->
|
||||
<string name="about">About</string>
|
||||
<string name="app_name_long" translatable="false">Privacy Friendly Break Reminder</string>
|
||||
<string name="version_number" translatable="false">Version 1.0</string>
|
||||
<string name="about_author">Authors:</string>
|
||||
<string name="about_author_names">Sergej Alexeev, Jannik Schildknecht and contributors.</string>
|
||||
<string name="about_author_contributors">and contributors.</string>
|
||||
<string name="version_number" translatable="false">Version</string>
|
||||
<string name="about_author">Authors: </string>
|
||||
<string name="about_author_names" translatable="false">Christopher Beckmann, Sergej Alexeev, Jannik Schildknecht</string>
|
||||
<string name="about_author_contributors">%s and contributors.</string>
|
||||
<string name="about_affiliation">In affiliation with</string>
|
||||
<string name="more_info">More Information can be found on:</string>
|
||||
<string name="github" translatable="false"><a href="https://github.com/SecUSo/privacy-friendly-break-reminder">Github-Repo</a></string>
|
||||
|
|
@ -302,6 +302,13 @@
|
|||
<string name="exercise_section_legs">Legs</string>
|
||||
<string name="activity_title_choose_exercises">Choose Exercises</string>
|
||||
<string name="activity_edit_no_empty_name">Please specify a name.</string>
|
||||
<string name="activity_title_help">Help</string>
|
||||
<string name="activity_title_about">About</string>
|
||||
<string name="dialog_leave_break_confirmation">Do you really want to cancel your break?</string>
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string name="exercise">Exercise</string>
|
||||
<string name="remaining_time">Time remaining:</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
<!-- These settings headers are only used on tablets. -->
|
||||
|
||||
<header
|
||||
android:fragment="org.secuso.privacyfriendlybreakreminder.activities.SettingsActivity$GeneralPreferenceFragment"
|
||||
android:fragment="org.secuso.privacyfriendlybreakreminder.activities.old.SettingsActivity$GeneralPreferenceFragment"
|
||||
android:icon="@drawable/ic_info_black"
|
||||
android:title="@string/pref_header_general" />
|
||||
|
||||
<header
|
||||
android:fragment="org.secuso.privacyfriendlybreakreminder.activities.SettingsActivity$NotificationPreferenceFragment"
|
||||
android:fragment="org.secuso.privacyfriendlybreakreminder.activities.old.SettingsActivity$NotificationPreferenceFragment"
|
||||
android:icon="@drawable/ic_notifications_black_24dp"
|
||||
android:title="@string/pref_header_notifications" />
|
||||
|
||||
|
|
|
|||