Compare commits
3 commits
master
...
feature/da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c52be73a80 | ||
|
|
925da5c87a | ||
|
|
be0400c3ac |
19 changed files with 199 additions and 373 deletions
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
|
|
@ -1,4 +1,7 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="corretto-11" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="corretto-11" project-jdk-type="JavaSDK" />
|
||||||
|
<component name="SuppressKotlinCodeStyleNotification">
|
||||||
|
<option name="disableForAll" value="true" />
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Binary file not shown.
|
|
@ -1,232 +0,0 @@
|
||||||
|
|
||||||
package org.secuso.aktivpause.activities;
|
|
||||||
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.preference.MultiSelectListPreference;
|
|
||||||
import android.preference.Preference;
|
|
||||||
import android.preference.PreferenceFragment;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
import org.secuso.aktivpause.R;
|
|
||||||
import org.secuso.aktivpause.activities.helper.AppCompatPreferenceActivity;
|
|
||||||
import org.secuso.aktivpause.receivers.TimerSchedulerReceiver;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Christopher Beckmann
|
|
||||||
* @version 2.0
|
|
||||||
*/
|
|
||||||
public class SettingsActivity extends AppCompatPreferenceActivity {
|
|
||||||
|
|
||||||
protected SharedPreferences mSharedPreferences;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
|
|
||||||
overridePendingTransition(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean onIsMultiPane() {
|
|
||||||
return isXLargeTablet(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper method to determine if the device has an extra-large screen. For
|
|
||||||
* example, 10" tablets are extra-large.
|
|
||||||
*/
|
|
||||||
private static boolean isXLargeTablet(Context context) {
|
|
||||||
return (context.getResources().getConfiguration().screenLayout
|
|
||||||
& Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public void onBuildHeaders(List<Header> target) {
|
|
||||||
loadHeadersFromResource(R.xml.pref_headers, target);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case android.R.id.home:
|
|
||||||
onBackPressed();
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean isValidFragment(String fragmentName) {
|
|
||||||
return ExercisePreferenceFragment.class.getName().equals(fragmentName)
|
|
||||||
|| TimerSchedulePreferenceFragment.class.getName().equals(fragmentName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A preference value change listener that updates the preference's summary
|
|
||||||
* to reflect its new value.
|
|
||||||
*/
|
|
||||||
private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object value) {
|
|
||||||
String stringValue = value.toString();
|
|
||||||
|
|
||||||
if (preference instanceof ListPreference) {
|
|
||||||
|
|
||||||
// For list preferences, look up the correct display value in
|
|
||||||
// the preference's 'entries' list.
|
|
||||||
ListPreference listPreference = (ListPreference) preference;
|
|
||||||
int index = listPreference.findIndexOfValue(stringValue);
|
|
||||||
|
|
||||||
// Set the summary to reflect the new value.
|
|
||||||
preference.setSummary(
|
|
||||||
index >= 0
|
|
||||||
? listPreference.getEntries()[index]
|
|
||||||
: null);
|
|
||||||
} if(preference instanceof MultiSelectListPreference) {
|
|
||||||
MultiSelectListPreference mslPreference = (MultiSelectListPreference) preference;
|
|
||||||
|
|
||||||
if(stringValue.length() >= 2) {
|
|
||||||
stringValue = stringValue.substring(1, stringValue.length() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] setValues = stringValue.split(",");
|
|
||||||
|
|
||||||
if(setValues.length == 7) {
|
|
||||||
mslPreference.setSummary(preference.getContext().getString(R.string.pref_schedule_exercise_days_allselectedsummary));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
for(int i = 0; i < mslPreference.getEntries().length; i++) {
|
|
||||||
String preferenceEntryString = mslPreference.getEntryValues()[i].toString();
|
|
||||||
|
|
||||||
for(String chosenValue : setValues) {
|
|
||||||
if (chosenValue.trim().equals(preferenceEntryString)) {
|
|
||||||
sb.append(mslPreference.getEntries()[i]);
|
|
||||||
sb.append(", ");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sb.length() > 0) {
|
|
||||||
sb.setLength(sb.length() - 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sb.length() == 0) {
|
|
||||||
sb.append(preference.getContext().getString(R.string.pref_schedule_exercise_days_defaultsummary));
|
|
||||||
}
|
|
||||||
|
|
||||||
mslPreference.setSummary(sb.toString());
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// For all other preferences, set the summary to the value's
|
|
||||||
// simple string representation.
|
|
||||||
preference.setSummary(stringValue);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Binds a preference's summary to its value. More specifically, when the
|
|
||||||
* preference's value is changed, its summary (line of text below the
|
|
||||||
* preference title) is updated to reflect the value. The summary is also
|
|
||||||
* immediately updated upon calling this method. The exact display format is
|
|
||||||
* dependent on the type of preference.
|
|
||||||
*
|
|
||||||
* @see #sBindPreferenceSummaryToValueListener
|
|
||||||
*/
|
|
||||||
private static void bindPreferenceSummaryToValue(Preference preference) {
|
|
||||||
// Set the listener to watch for value changes.
|
|
||||||
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
|
|
||||||
|
|
||||||
// Trigger the listener immediately with the preference's
|
|
||||||
// current value.
|
|
||||||
if(preference instanceof MultiSelectListPreference) {
|
|
||||||
sBindPreferenceSummaryToValueListener.onPreferenceChange(preference, PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(preference.getContext())
|
|
||||||
.getStringSet(preference.getKey(), new HashSet<String>()));
|
|
||||||
} else {
|
|
||||||
sBindPreferenceSummaryToValueListener.onPreferenceChange(preference, PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(preference.getContext())
|
|
||||||
.getString(preference.getKey(), ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected int getNavigationDrawerID() {
|
|
||||||
return R.id.nav_settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ExercisePreferenceFragment extends PreferenceFragment {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.pref_exercise);
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
|
||||||
// to their values. When their values change, their summaries are
|
|
||||||
// updated to reflect the new value, per the Android Design
|
|
||||||
// guidelines.
|
|
||||||
bindPreferenceSummaryToValue(findPreference("pref_exercise_time"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TimerSchedulePreferenceFragment extends PreferenceFragment {
|
|
||||||
|
|
||||||
private OnSharedPreferenceChangeListener listener = new OnSharedPreferenceChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
|
||||||
// if anything changed with this settings .. reset the alarm
|
|
||||||
TimerSchedulerReceiver.scheduleNextAlarm(getActivity().getApplicationContext());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.pref_scheduler);
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
bindPreferenceSummaryToValue(findPreference("pref_schedule_exercise_days"));
|
|
||||||
|
|
||||||
PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext())
|
|
||||||
.registerOnSharedPreferenceChangeListener(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDetach() {
|
|
||||||
PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext())
|
|
||||||
.unregisterOnSharedPreferenceChangeListener(listener);
|
|
||||||
|
|
||||||
super.onDetach();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
This file is part of the application Privacy Friendly Notes.
|
||||||
|
Privacy Friendly Notes is free software:
|
||||||
|
you can redistribute it and/or modify it under the terms of the
|
||||||
|
GNU General Public License as published by the Free Software Foundation,
|
||||||
|
either version 3 of the License, or any later version.
|
||||||
|
Privacy Friendly Notes is distributed in the hope
|
||||||
|
that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the GNU General Public License for more details.
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Privacy Friendly Notes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.secuso.aktivpause.activities
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import org.secuso.aktivpause.R
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Activity that allows to register some settings like a custom font size.
|
||||||
|
*/
|
||||||
|
class SettingsActivity : AppCompatActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_settings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
This file is part of the application Privacy Friendly Notes.
|
||||||
|
Privacy Friendly Notes is free software:
|
||||||
|
you can redistribute it and/or modify it under the terms of the
|
||||||
|
GNU General Public License as published by the Free Software Foundation,
|
||||||
|
either version 3 of the License, or any later version.
|
||||||
|
Privacy Friendly Notes is distributed in the hope
|
||||||
|
that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||||
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the GNU General Public License for more details.
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Privacy Friendly Notes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.secuso.aktivpause.activities.fragments;
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.preference.PreferenceFragment
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
import org.secuso.aktivpause.R
|
||||||
|
|
||||||
|
class SettingsFragment : PreferenceFragment() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
addPreferencesFromResource(R.xml.preferences)
|
||||||
|
findPreference("settings_day_night_theme")?.setOnPreferenceChangeListener { _, newValue ->
|
||||||
|
AppCompatDelegate.setDefaultNightMode(newValue.toString().toInt())
|
||||||
|
true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -46,6 +46,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
|
android:background="?attr/colorBackground"
|
||||||
app:headerLayout="@layout/nav_header"
|
app:headerLayout="@layout/nav_header"
|
||||||
app:menu="@menu/nav_drawer" />
|
app:menu="@menu/nav_drawer" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
|
android:background="?attr/colorBackground"
|
||||||
app:headerLayout="@layout/nav_header"
|
app:headerLayout="@layout/nav_header"
|
||||||
app:menu="@menu/nav_drawer" />
|
app:menu="@menu/nav_drawer" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,81 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout 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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/drawer_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fitsSystemWindows="true"
|
tools:context="org.secuso.aktivpause.activities.SettingsActivity">
|
||||||
tools:openDrawer="start">
|
<fragment
|
||||||
|
android:id="@+id/fragment_settings"
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
android:name="org.secuso.aktivpause.activities.fragments.SettingsFragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent" />
|
||||||
tools:context="org.secuso.aktivpause.activities.EditExerciseSetActivity">
|
|
||||||
|
|
||||||
<include layout="@layout/layout_toolbar"/>
|
</RelativeLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
|
||||||
android:id="@+id/main_content"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0px"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/headers"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<ListView android:id="@android:id/list"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:drawSelectorOnTop="false"
|
|
||||||
android:cacheColorHint="@android:color/transparent"
|
|
||||||
android:listPreferredItemHeight="48dp"
|
|
||||||
android:scrollbarAlwaysDrawVerticalTrack="true" />
|
|
||||||
|
|
||||||
<FrameLayout android:id="@+id/list_footer"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/prefs_frame"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:visibility="visible" >
|
|
||||||
|
|
||||||
<android.preference.PreferenceFrameLayout android:id="@+id/prefs"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dip"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.navigation.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" />
|
|
||||||
|
|
||||||
</androidx.drawerlayout.widget.DrawerLayout>
|
|
||||||
|
|
|
||||||
|
|
@ -323,6 +323,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
|
android:background="?attr/colorBackground"
|
||||||
app:headerLayout="@layout/nav_header"
|
app:headerLayout="@layout/nav_header"
|
||||||
app:menu="@menu/nav_drawer" />
|
app:menu="@menu/nav_drawer" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,38 +2,41 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/nav_header_height"
|
android:layout_height="@dimen/nav_header_height"
|
||||||
android:background="@color/colorAccent"
|
android:background="?attr/colorNavbarHeaderBackground"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingRight="@dimen/activity_vertical_margin"
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="#ffffff"
|
android:orientation="horizontal"
|
||||||
|
android:background="?attr/colorNavbarHeaderSurface"
|
||||||
android:paddingTop="7dp"
|
android:paddingTop="7dp"
|
||||||
android:paddingBottom="7dp"
|
android:paddingBottom="7dp">
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@mipmap/ic_app"/>
|
android:paddingStart="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_horizontal_margin"
|
||||||
|
android:src="@mipmap/ic_drawer"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:text="@string/app_name_short"
|
android:text="@string/app_name"
|
||||||
android:textColor="@color/colorPrimary"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_toEndOf="@+id/imageView" />
|
android:layout_toEndOf="@id/imageView"
|
||||||
|
android:layout_toRightOf="@id/imageView"
|
||||||
|
android:textColor="?attr/colorNavbarHeaderText"
|
||||||
|
android:textSize="18sp"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,4 +177,12 @@
|
||||||
<string name="dialog_evaluation_yes">Ja</string>
|
<string name="dialog_evaluation_yes">Ja</string>
|
||||||
<string name="menu_display_evaluation_dialog">Online-Befragung</string>
|
<string name="menu_display_evaluation_dialog">Online-Befragung</string>
|
||||||
|
|
||||||
|
<string name="settings_appearance_heading">Darstellung</string>
|
||||||
|
<string-array name="array_day_night_theme">
|
||||||
|
<item>System</item>
|
||||||
|
<item>Hell</item>
|
||||||
|
<item>Dunkel</item>
|
||||||
|
</string-array>
|
||||||
|
<string name="select_day_night_theme">Aussehen</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
32
app/src/main/res/values-night/styles.xml
Normal file
32
app/src/main/res/values-night/styles.xml
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||||
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
<item name="colorSurface">@color/colorSurfaceDark</item>
|
||||||
|
<item name="colorOnSurface">@color/white</item>
|
||||||
|
<item name="colorSurfaceSecondary">@color/colorSurfaceSecondaryDark</item>
|
||||||
|
<item name="colorBackground">@color/colorBackgroundDark</item>
|
||||||
|
<item name="colorOnBackground">@color/white</item>
|
||||||
|
<item name="android:windowBackground">@color/colorBackgroundDark</item>
|
||||||
|
|
||||||
|
<item name="colorNavbarHeaderBackground">@color/colorPrimaryDark</item>
|
||||||
|
<item name="colorNavbarHeaderSurface">#476885</item>
|
||||||
|
<item name="colorNavbarHeaderText">@color/white</item>
|
||||||
|
|
||||||
|
<item name="colorIconFill">@color/white</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppTheme.PopupOverlay.DialogAlert" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
|
||||||
|
<item name="colorPrimary">?attr/colorOnSurface</item>
|
||||||
|
</style>
|
||||||
|
<style name="AppTheme.PopupOverlay.Calendar" parent="ThemeOverlay.MaterialComponents.MaterialCalendar">
|
||||||
|
<item name="buttonBarButtonStyle">@style/AppTheme.PopupOverlay.Button</item>
|
||||||
|
</style>
|
||||||
|
<style name="AppTheme.PopupOverlay.Button" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
|
||||||
|
<item name="android:textColor">?attr/colorOnSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
||||||
|
|
@ -18,4 +18,9 @@
|
||||||
<item>Sa</item>
|
<item>Sa</item>
|
||||||
<item>So</item>
|
<item>So</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
<string-array name="array_day_night_theme_values">
|
||||||
|
<item>-1</item>
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
</string-array>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -8,4 +8,12 @@
|
||||||
<attr name="layout_breakLine" format="boolean" />
|
<attr name="layout_breakLine" format="boolean" />
|
||||||
<attr name="layout_horizontalSpacing" format="dimension" />
|
<attr name="layout_horizontalSpacing" format="dimension" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
<declare-styleable name="AppTheme">
|
||||||
|
<attr name="colorSurfaceSecondary" format="color" />
|
||||||
|
<attr name="colorBackground" format="color" />
|
||||||
|
<attr name="colorNavbarHeaderBackground" format="color" />
|
||||||
|
<attr name="colorNavbarHeaderSurface" format="color" />
|
||||||
|
<attr name="colorNavbarHeaderText" format="color"/>
|
||||||
|
<attr name="colorIconFill" format="color" />
|
||||||
|
</declare-styleable>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,25 @@
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#024265</color>
|
<color name="colorPrimary">#024265</color>
|
||||||
<color name="colorPrimaryDark">#024265</color>
|
<color name="colorPrimaryDark">#024265</color>
|
||||||
<color name="colorAccent">#0274B2</color>
|
<color name="colorSurface">#FFFFFF</color>
|
||||||
|
<color name="colorSurfaceDark">#373a3d</color>
|
||||||
|
<color name="colorBackground">#FFFFFF</color>
|
||||||
|
<color name="colorBackgroundDark">#050a0f</color>
|
||||||
|
<color name="colorSurfaceSecondary">#FFFFFF</color>
|
||||||
|
<color name="colorSurfaceSecondaryDark">#222222</color>
|
||||||
<color name="colorLightAccent">#8aa5ce</color>
|
<color name="colorLightAccent">#8aa5ce</color>
|
||||||
|
<color name="colorAccent">#0274B2</color>
|
||||||
<color name="transparent">#00000000</color>
|
<color name="transparent">#00000000</color>
|
||||||
<color name="white">#ffffff</color>
|
|
||||||
<color name="black">#000000</color>
|
|
||||||
<color name="lightblue">#0274B2</color>
|
|
||||||
<color name="middleblue">#8aa5ce</color>
|
|
||||||
<color name="darkblue">#024265</color>
|
|
||||||
<color name="middlegrey">#A8A8A8</color>
|
<color name="middlegrey">#A8A8A8</color>
|
||||||
|
<color name="white">#ffffff</color>
|
||||||
<color name="yellow">#f6d126</color>
|
<color name="yellow">#f6d126</color>
|
||||||
|
<color name="black">#000000</color>
|
||||||
|
<color name="middleblue">#8aa5ce</color>
|
||||||
|
<color name="lightblue">#0274B2</color>
|
||||||
|
<color name="darkblue">#024265</color>
|
||||||
<color name="red">#B71C1C</color>
|
<color name="red">#B71C1C</color>
|
||||||
<color name="green">#388E3C</color>
|
<color name="green">#388E3C</color>
|
||||||
|
|
||||||
<color name="KITgreen">#008C84</color>
|
<color name="KITgreen">#008C84</color>
|
||||||
<color name="aktivpauseGreen">#00d67d</color>
|
<color name="aktivpauseGreen">#00d67d</color>
|
||||||
<color name="KITlightgreen">#3BAAA2</color>
|
<color name="KITlightgreen">#3BAAA2</color>
|
||||||
|
|
|
||||||
|
|
@ -169,5 +169,12 @@
|
||||||
<string name="dialog_evaluation_yes">Yes</string>
|
<string name="dialog_evaluation_yes">Yes</string>
|
||||||
<string name="menu_display_evaluation_dialog">Online Evaluation</string>
|
<string name="menu_display_evaluation_dialog">Online Evaluation</string>
|
||||||
|
|
||||||
|
<string name="settings_appearance_heading">Appearance</string>
|
||||||
|
<string-array name="array_day_night_theme">
|
||||||
|
<item>System</item>
|
||||||
|
<item>Light</item>
|
||||||
|
<item>Dark</item>
|
||||||
|
</string-array>
|
||||||
|
<string name="select_day_night_theme">Design</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/pref_category_exercise">
|
|
||||||
|
|
||||||
<SwitchPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_keep_screen_on_during_exercise"
|
|
||||||
android:title="@string/pref_keep_screen_on_during_exercise" />
|
|
||||||
|
|
||||||
<EditTextPreference
|
|
||||||
android:defaultValue="30"
|
|
||||||
android:inputType="number"
|
|
||||||
android:numeric="integer"
|
|
||||||
android:maxLength="2"
|
|
||||||
android:key="pref_exercise_time"
|
|
||||||
android:title="@string/pref_exercise_time"/>
|
|
||||||
|
|
||||||
<SwitchPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_exercise_continuous"
|
|
||||||
android:title="@string/pref_exercise_continuous"
|
|
||||||
android:summary="@string/pref_exercise_continuous_summary"/>
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/pref_category_default_exercise_sets">
|
|
||||||
|
|
||||||
<SwitchPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_hide_default_exercise_sets"
|
|
||||||
android:title="@string/pref_hide_default_exercise_sets" />
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<!-- These settings headers are only used on tablets. -->
|
|
||||||
|
|
||||||
<header
|
|
||||||
android:fragment="org.secuso.aktivpause.activities.SettingsActivity$ExercisePreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_info_black"
|
|
||||||
android:title="@string/pref_header_exercises" />
|
|
||||||
|
|
||||||
<header
|
|
||||||
android:fragment="org.secuso.aktivpause.activities.SettingsActivity$TimerSchedulePreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_alarm_black"
|
|
||||||
android:title="@string/pref_header_schedule" />
|
|
||||||
|
|
||||||
</preference-headers>
|
|
||||||
|
|
@ -1,5 +1,46 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<PreferenceCategory android:title="@string/settings_appearance_heading">
|
||||||
|
<ListPreference
|
||||||
|
android:key="settings_day_night_theme"
|
||||||
|
android:title="@string/select_day_night_theme"
|
||||||
|
android:summary="%s"
|
||||||
|
android:defaultValue="-1"
|
||||||
|
android:entries="@array/array_day_night_theme"
|
||||||
|
android:entryValues="@array/array_day_night_theme_values"
|
||||||
|
/>
|
||||||
|
</PreferenceCategory>
|
||||||
|
<PreferenceCategory android:title="@string/pref_category_exercise">
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="pref_keep_screen_on_during_exercise"
|
||||||
|
android:title="@string/pref_keep_screen_on_during_exercise" />
|
||||||
|
|
||||||
|
<EditTextPreference
|
||||||
|
android:defaultValue="30"
|
||||||
|
android:inputType="number"
|
||||||
|
android:numeric="integer"
|
||||||
|
android:maxLength="2"
|
||||||
|
android:key="pref_exercise_time"
|
||||||
|
android:title="@string/pref_exercise_time"/>
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_exercise_continuous"
|
||||||
|
android:title="@string/pref_exercise_continuous"
|
||||||
|
android:summary="@string/pref_exercise_continuous_summary"/>
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory android:title="@string/pref_category_default_exercise_sets">
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_hide_default_exercise_sets"
|
||||||
|
android:title="@string/pref_hide_default_exercise_sets" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/pref_category_schedule">
|
<PreferenceCategory android:title="@string/pref_category_schedule">
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
Loading…
Add table
Add a link
Reference in a new issue