Some minor fixes

No empty or double profile name allowed
This commit is contained in:
Sergej A 2016-08-12 15:36:12 +02:00
commit 7b731beb7f
22 changed files with 452 additions and 134 deletions

View file

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder">
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
@ -30,6 +31,9 @@
<activity android:name=".BreakActivity"></activity>
<activity android:name=".ProfileActivity"></activity>
<activity android:name=".ExerciseTypeActivity"></activity>
<activity android:name=".AboutActivity"></activity>
<activity android:name=".StatisticsActivity"></activity>
<activity android:name=".HelpActivity"></activity>
</application>
</manifest>

View file

@ -0,0 +1,36 @@
package orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
public class AboutActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
setupActionBar();
}
private void setupActionBar() {
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(R.string.about);
if (actionBar != null) {
// Show the Up button in the action bar.
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

View file

@ -20,7 +20,6 @@ import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.WindowManager;
import android.widget.AdapterView;
@ -38,6 +37,7 @@ public class BreakReminder extends AppCompatActivity
private TextView ct_text;
private CountDownTimer ct;
private String stopTime = "";
private int oldTime = 0;
private Spinner profileSpinner;
@ -135,7 +135,6 @@ public class BreakReminder extends AppCompatActivity
String currentProfile = sharedPrefs.getString("name_text", "") + "," + sharedPrefs.getInt("work_value", -1) + "," + sharedPrefs.getInt("break_value", -1);
System.out.println("Current PROFILE: " + currentProfile + " , PROFILE SELECTED: " + profileSelected);
if (allProfiles.contains(currentProfile) && profileSelected.equals(sharedPrefs.getString("name_text", ""))) {
System.out.println("Profile didn´t change");
} else {
@ -230,28 +229,6 @@ public class BreakReminder extends AppCompatActivity
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.break_reminder, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
@ -263,11 +240,17 @@ public class BreakReminder extends AppCompatActivity
Intent intent = new Intent(this, SettingsActivity.class);
this.startActivity(intent);
} else if (id == R.id.nav_statistics) {
// Show statistics
Intent intent = new Intent(this, StatisticsActivity.class);
this.startActivity(intent);
} else if (id == R.id.nav_help) {
// Show help
Intent intent = new Intent(this, HelpActivity.class);
this.startActivity(intent);
} else if (id == R.id.nav_about) {
// Show about page
Intent intent = new Intent(this, AboutActivity.class);
this.startActivity(intent);
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
@ -281,8 +264,13 @@ public class BreakReminder extends AppCompatActivity
String bufferZeroMinute = "";
String bufferZeroSecond = "";
int time = mins * 60 * 1000;
time = 5000;
int oldTime = time;
//FIXME Hardcoded for testing
//time = 5000;
stopTime = (String) ct_text.getText();
oldTime = time;
if (stopTime == "" && !isRunning) {
if (time / 1000 / 60 < 10)
@ -398,6 +386,7 @@ public class BreakReminder extends AppCompatActivity
case R.id.button_reset:
if (ct != null) {
//Reset clock
ct.cancel();
int interval = sharedPrefs.getInt("work_value", 1);
bufferZeroMinute = "";
@ -406,8 +395,9 @@ public class BreakReminder extends AppCompatActivity
bufferZeroMinute = "0";
ct_text.setText(bufferZeroMinute + time / 1000 / 60 + ":00");
stopTime = (String) ct_text.getText();
isRunning = false;
break;
}

View file

@ -0,0 +1,36 @@
package orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
public class HelpActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.help);
setupActionBar();
}
private void setupActionBar() {
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(R.string.help);
if (actionBar != null) {
// Show the Up button in the action bar.
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

View file

@ -11,6 +11,7 @@ import android.widget.Button;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
public class ProfileActivity extends AppCompatActivity implements View.OnClickListener {
@ -77,22 +78,30 @@ public class ProfileActivity extends AppCompatActivity implements View.OnClickLi
public void onClick(View v) {
switch (v.getId()) {
case R.id.button_profile_save:
//Fixme Check names for doubles
System.out.println("Save new profile!");
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = sharedPrefs.edit();
EditText profileName =
(EditText) findViewById(R.id.editProfileName);
String name = profileName.getText().toString();
editor.putString("name_text", name);
editor.putInt("work_value",interval_seekbar.getProgress());
editor.putInt("break_value",break_seekbar.getProgress());
editor.putString("profiles", sharedPrefs.getString("profiles", "") + name + "," + interval_seekbar.getProgress() + "," + break_seekbar.getProgress() + ";");
editor.apply();
finish();
break;
if (name.equals("")) {
Toast.makeText(this, R.string.new_profile_emptyName, Toast.LENGTH_SHORT).show();
return;
} else if (prefContainsName(name)) {
Toast.makeText(this, R.string.new_profile_doubleName, Toast.LENGTH_SHORT).show();
return;
} else {
// Add to preferences
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putString("name_text", name);
editor.putInt("work_value", interval_seekbar.getProgress());
editor.putInt("break_value", break_seekbar.getProgress());
editor.putString("profiles", sharedPrefs.getString("profiles", "") + name + "," + interval_seekbar.getProgress() + "," + break_seekbar.getProgress() + ";");
editor.apply();
finish();
break;
}
case R.id.button_profile_cancel:
System.out.println("New profile canceled!");
finish();
@ -106,6 +115,19 @@ public class ProfileActivity extends AppCompatActivity implements View.OnClickLi
}
private boolean prefContainsName(String profileName) {
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
String allProfiles = sharedPrefs.getString("profiles", "");
String[] profiles = allProfiles.split(";");
for (String profile : profiles) {
if (profile.split(",")[0].equalsIgnoreCase(profileName)) {
return true;
}
}
return false;
}
private void createExerciseType() {
Intent intent = new Intent(this, ExerciseTypeActivity.class);
this.startActivity(intent);

View file

@ -21,9 +21,8 @@ import android.preference.RingtonePreference;
import android.text.TextUtils;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
import android.widget.TextView;
import android.widget.Toast;
import orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder.SeekBarPreference;
import java.util.List;
@ -254,31 +253,62 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
String newProfileName = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getString("name_text", "");
String allProfiles = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).getString("profiles", "");
if (allProfiles.contains(newProfileName + "," + work_radius + "," + break_radius)) {
System.out.println("SETTINGS ACTIVITY0: " + newProfileName + "," + work_radius + "," + break_radius);
if (allProfiles.contains(newProfileName + "," + work_radius + "," + break_radius) && newProfileName.equals(currentProfile)) {
//Nothing changes
System.out.println("No changes for a profile in general settings");
} else {
//FIXME Check for doubles
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this.getActivity()).edit();
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;
break;
System.out.println("SETTINGS ACTIVITY: " + newProfileName);
if (newProfileName.equals("")) {
// Profile name empty
System.out.println("EMPTY NAME IN SETTINGS ACTIVITY");
Toast.makeText(this.getActivity(), R.string.settings_emptyName, Toast.LENGTH_SHORT).show();
editor.putString("name_text", currentProfile);
editor.apply();
} else if (currentProfile != newProfileName && prefContainsName(newProfileName)) {
// Profile name exists already
Toast.makeText(this.getActivity(), R.string.settings_doubleName, Toast.LENGTH_SHORT).show();
editor.putString("name_text", currentProfile);
editor.apply();
} 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;
break;
}
}
StringBuilder builder = new StringBuilder();
for (String s : profiles) {
builder.append(s + ";");
}
editor.putString("profiles", builder.toString());
editor.apply();
}
StringBuilder builder = new StringBuilder();
for (String s : profiles) {
builder.append(s + ";");
}
editor.putString("profiles", builder.toString());
editor.apply();
}
super.onPause();
}
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);

View file

@ -0,0 +1,37 @@
package orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
public class StatisticsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.statistics);
setupActionBar();
}
private void setupActionBar() {
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(R.string.statistics);
if (actionBar != null) {
// Show the Up button in the action bar.
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View file

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="#FFFFFF">
<LinearLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="vertical"
android:isScrollContainer="true"
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:gravity="center"
tools:context=".AboutActivity">
<ImageView
android:id="@+id/barcodeLogo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/privacyfriendlyappslogo" />
<TextView
android:id="@+id/appName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="20dp"
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="10dp"
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="10dp"
android:text="@string/about_author" />
<TextView
android:id="@+id/textFieldAuthorNames"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_marginTop="0dp"
android:text="@string/about_author_names" />
<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="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/secuso_logo_blau_blau" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:text="@string/privacy_friendly"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="@string/more_info"/>
<TextView
android:id="@+id/linkID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/url"
android:textStyle="bold"
android:layout_gravity="center_horizontal"
android:autoLink="web"/>
</LinearLayout>
</ScrollView>

View file

@ -13,12 +13,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="10:00"
android:text="@string/_10_00"
android:id="@+id/textViewBreak"
android:clickable="true"
android:enabled="true"
android:textStyle="bold"
android:textSize="60dp"
android:textSize="60sp"
android:textIsSelectable="false"
android:layout_centerHorizontal="true" />
@ -26,7 +26,7 @@
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Play/Stop"
android:text="@string/break_play_stop"
android:id="@+id/button_playStopBreak"
android:layout_below="@+id/textViewBreak"
android:layout_centerHorizontal="true" />
@ -35,7 +35,7 @@
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:text="@string/break_cancel"
android:id="@+id/button_cancel"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
@ -61,7 +61,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="name of the Exercise"
android:text="@string/name_of_the_exercise"
android:id="@+id/textViewExercise"
android:layout_above="@+id/horizontalScrollView2"
android:layout_centerHorizontal="true" />
@ -70,9 +70,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="You have to train hard, you little bitch"
android:text="@string/break_explanation"
android:id="@+id/textViewDescription"
android:layout_below="@+id/horizontalScrollView2"
android:layout_centerHorizontal="true" />
android:layout_centerHorizontal="true"
android:gravity="center" />
</RelativeLayout>

View file

@ -13,7 +13,7 @@
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Take the Break"
android:text="@string/take_the_break"
android:id="@+id/button_break"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
@ -24,7 +24,7 @@
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Skip the Break"
android:text="@string/skip_the_break"
android:id="@+id/button_skip"
android:layout_alignTop="@+id/button_break"
android:layout_alignParentRight="true"
@ -34,9 +34,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Do you want to take the break?"
android:text="@string/do_you_want_to_take_the_break"
android:id="@+id/textView2"
android:textSize="24dp"
android:textSize="24sp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="97dp" />

View file

@ -34,7 +34,7 @@
android:layout_alignTop="@+id/button_reset"
android:layout_toLeftOf="@+id/button_reset"
android:layout_toStartOf="@+id/button_reset"
android:text="Play/Stop" />
android:text="@string/play_stop" />
<Button
android:id="@+id/button_reset"
@ -45,7 +45,7 @@
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/textView"
android:layout_marginBottom="182dp"
android:text="Reset" />
android:text="@string/reset" />
<TextView
android:id="@+id/textView"
@ -55,10 +55,10 @@
android:layout_centerHorizontal="true"
android:clickable="true"
android:enabled="true"
android:text="30:00"
android:text="@string/_30_00"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textIsSelectable="false"
android:textSize="60dp"
android:textSize="60sp"
android:textStyle="bold" />

View file

@ -14,7 +14,7 @@
android:layout_width="100dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Exercise-name"
android:text="@string/exercise_name"
android:id="@+id/textView8"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
@ -37,7 +37,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Exercise time"
android:text="@string/exercise_time"
android:id="@+id/textView9"
android:layout_marginTop="42dp"
android:layout_below="@+id/textView8"
@ -58,7 +58,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Repetitions"
android:text="@string/repetitions"
android:id="@+id/textView10"
android:layout_below="@+id/seekBar3"
android:layout_alignLeft="@+id/textView9"
@ -76,7 +76,7 @@
android:layout_width="100dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Type"
android:text="@string/type"
android:id="@+id/textView11"
android:textSize="24sp"
android:layout_centerVertical="true"
@ -87,7 +87,7 @@
android:layout_width="120dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Sequential"
android:text="@string/sequential"
android:id="@+id/textView12"
android:textSize="24sp"
android:layout_below="@+id/textView11"
@ -107,7 +107,7 @@
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add"
android:text="@string/add"
android:id="@+id/button_et_add"
android:layout_marginTop="23dp"
android:layout_below="@+id/textView12"
@ -117,7 +117,7 @@
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Edit"
android:text="@string/edit"
android:id="@+id/button_et_edit"
android:layout_alignBottom="@+id/button_et_add"
android:layout_toRightOf="@+id/textView9"
@ -126,7 +126,7 @@
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save"
android:text="@string/save"
android:id="@+id/button_et_save"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/button_et_add"
@ -136,7 +136,7 @@
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:text="@string/cancel"
android:id="@+id/button_et_cancel"
android:layout_alignBottom="@+id/button_et_save"
android:layout_alignLeft="@+id/button_et_edit"

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Will be completed once the exercise activity is done"
android:id="@+id/textView14"
android:layout_gravity="center_horizontal"
android:gravity="center" />
</LinearLayout>

View file

@ -11,12 +11,5 @@
android:paddingTop="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="Break Reminder"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
</LinearLayout>

View file

@ -17,9 +17,9 @@
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="53dp"
android:text="Profile Name"
android:text="@string/profile_name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="24dp" />
android:textSize="24sp" />
<EditText
android:id="@+id/editProfileName"
@ -31,7 +31,7 @@
android:layout_marginEnd="42dp"
android:layout_marginRight="42dp"
android:inputType="text"
android:textSize="25dp" />
android:textSize="25sp" />
<SeekBar
android:id="@+id/new_profile_interval"
@ -48,7 +48,7 @@
android:layout_below="@+id/editProfileName"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:text="interval"
android:text="@string/interval"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
@ -59,15 +59,15 @@
android:layout_alignParentStart="true"
android:layout_below="@+id/new_profile_break"
android:layout_marginTop="48dp"
android:text="Exercise Type"
android:text="@string/exercise_type"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="24dp" />
android:textSize="24sp" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Break"
android:text="@string/new_profile_break"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_above="@+id/new_profile_break"
android:layout_centerHorizontal="true" />
@ -100,7 +100,7 @@
android:layout_alignBottom="@+id/checkBox"
android:layout_toEndOf="@+id/checkBox"
android:layout_toRightOf="@+id/checkBox"
android:text="Select" />
android:text="@string/new_profile_select" />
<TextView
android:id="@+id/textView7"
@ -110,7 +110,7 @@
android:layout_alignParentStart="true"
android:layout_below="@+id/textView6"
android:layout_marginTop="40dp"
android:text="Continuosly"
android:text="@string/new_profile_continuously"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="24sp" />
@ -130,7 +130,7 @@
android:layout_below="@+id/checkBox2"
android:layout_toLeftOf="@+id/checkBox2"
android:layout_toStartOf="@+id/checkBox2"
android:text="Save" />
android:text="@string/new_profile_save" />
<Button
android:id="@+id/button_profile_cancel"
@ -139,13 +139,13 @@
android:layout_below="@+id/checkBox2"
android:layout_toEndOf="@+id/textView4"
android:layout_toRightOf="@+id/textView4"
android:text="Cancel" />
android:text="@string/new_profile_cancel" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="0"
android:text="@string/_0"
android:id="@+id/interval_text"
android:layout_alignTop="@+id/textView4"
android:layout_toRightOf="@+id/new_profile_interval"

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<TextView
android:layout_width="292dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="To be done...."
android:id="@+id/textView13"
android:layout_weight="0.36"
android:gravity="center" />
</LinearLayout>

View file

@ -8,22 +8,23 @@
<item
android:id="@+id/nav_settings"
android:icon="@drawable/ic_menu_manage"
android:title="Settings" />
android:title="@string/title_activity_settings" />
<item
android:id="@+id/nav_statistics"
android:icon="@drawable/statistic_logo"
android:title="Statistics" />
android:title="@string/statistics" />
</group>
<item android:title="Informations">
<menu>
<item
android:id="@+id/nav_help"
android:title="Help" />
<item
android:id="@+id/nav_about"
android:title="About" />
</menu>
</item>
<group android:checkableBehavior="single">
<item android:title="@string/information">
<menu>
<item
android:id="@+id/nav_help"
android:title="@string/help" />
<item
android:id="@+id/nav_about"
android:title="@string/about" />
</menu>
</item>
</group>
</menu>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
</menu>

View file

@ -1,10 +0,0 @@
<menu 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"
tools:context="orgprivacy_friendly_apps.secuso.privacyfriendlybreakreminder.BreakActivity">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
</menu>

View file

@ -4,7 +4,6 @@
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="action_settings">Settings</string>
<string name="title_activity_settings">Settings</string>
<!-- Strings related to Settings -->
@ -37,6 +36,60 @@
<string name="pref_title_stayOn">Screen stays on</string>
<string name="pref_title_timeLeft">Time left</string>
<string name="pref_title_vibrate">Vibrate</string>
<string name="play_stop">Play/Stop</string>
<string name="reset">Reset</string>
<string name="_30_00" translatable="false">30:00</string>
<string name="exercise_name">Exercise-name</string>
<string name="exercise_time">Exercise time</string>
<string name="repetitions">Repetitions</string>
<string name="type">Type</string>
<string name="sequential">Sequential</string>
<string name="add">Add</string>
<string name="edit">Edit</string>
<string name="save">Save</string>
<string name="cancel">Cancel</string>
<string name="profile_name">Profile Name</string>
<string name="interval">interval</string>
<string name="exercise_type">Exercise Type</string>
<string name="_0" translatable="false">0</string>
<string name="take_the_break">Take the Break</string>
<string name="skip_the_break">Skip the Break</string>
<string name="do_you_want_to_take_the_break">Do you want to take the break?</string>
<string name="_10_00" translatable="false">10:00</string>
<string name="name_of_the_exercise">name of the Exercise</string>
<string name="break_cancel">Cancel</string>
<string name="break_play_stop">Play/Stop</string>
<string name="break_reminder">Break Reminder</string>
<string name="statistics">Statistics</string>
<string name="information">Information</string>
<string name="help">Help</string>
<!--settings for SettingsActivity -->
<string name="settings_emptyName">The changes could not be applied because the name for the profile was empty!</string>
<string name="settings_doubleName">The changes could not be applied because there is already a profile with the same name!</string>
<!--settings for ProfileActivity -->
<string name="new_profile_save">Save</string>
<string name="new_profile_cancel">Cancel</string>
<string name="new_profile_break">Break</string>
<string name="new_profile_select">Select</string>
<string name="new_profile_continuously">Continuously</string>
<string name="new_profile_emptyName">Please enter a name for the profile</string>
<string name="new_profile_doubleName">Enter another name, there is already a profile with the same name!</string>
<!-- settings for AboutActivity -->
<string name="about">About</string>
<string name="app_name_long">Privacy Friendly Break Reminder</string>
<string name="version_number">1.0</string>
<string name="about_author">Authors of the App:</string>
<string name="about_author_names" translatable="false">Sergej Alexeev, \n Jannik Schildknecht</string>
<string name="about_affiliation">In Affiliation with</string>
<string name="privacy_friendly">This application belongs to the Privacy Friendly Apps.</string>
<string name="more_info">More Information can be found here:</string>
<string name="url" translatable="false"><a href="https://www.secuso.informatik.tu-darmstadt.de/en/research/results/">https://www.secuso.org</a></string>
<string name="break_explanation">You have to train your chest hard! Eat healthy</string>
<!-- settings for BreakActivity -->