mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Merge branch 'feature/material-compat' into dev
This commit is contained in:
@@ -32,14 +32,17 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'com.android.support:support-v4:23.1.1'
|
||||
compile 'com.android.support:support-v4:23.2.1'
|
||||
compile 'com.android.support:appcompat-v7:23.2.1'
|
||||
compile 'com.android.support:design:23.2.1'
|
||||
compile 'com.android.support:preference-v14:23.2.1'
|
||||
compile 'com.github.paolorotolo:appintro:3.4.0'
|
||||
compile 'org.apmem.tools:layouts:1.10@aar'
|
||||
compile 'com.opencsv:opencsv:3.7'
|
||||
compile project(':libs:drag-sort-listview:library')
|
||||
compile files('libs/ActiveAndroid.jar')
|
||||
|
||||
androidTestCompile 'com.android.support:support-annotations:23.1.1'
|
||||
androidTestCompile 'com.android.support:support-annotations:23.2.1'
|
||||
androidTestCompile 'com.android.support.test:runner:0.4.1'
|
||||
androidTestCompile 'com.android.support.test:rules:0.4.1'
|
||||
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
|
||||
|
||||
@@ -16,24 +16,24 @@
|
||||
|
||||
package com.android.colorpicker;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.app.AppCompatDialogFragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.android.colorpicker.ColorPickerSwatch.OnColorSelectedListener;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
|
||||
/**
|
||||
* A dialog which takes in as input an array of palette and creates a palette allowing the user to
|
||||
* select a specific color swatch, which invokes a listener.
|
||||
*/
|
||||
public class ColorPickerDialog extends DialogFragment implements OnColorSelectedListener {
|
||||
public class ColorPickerDialog extends AppCompatDialogFragment implements OnColorSelectedListener {
|
||||
|
||||
public static final int SIZE_LARGE = 1;
|
||||
public static final int SIZE_SMALL = 2;
|
||||
|
||||
@@ -30,6 +30,7 @@ import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatDialogFragment;
|
||||
import android.util.Log;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
@@ -49,7 +50,7 @@ import com.android.datetimepicker.time.RadialPickerLayout.OnValueSelectedListene
|
||||
/**
|
||||
* Dialog to set a time.
|
||||
*/
|
||||
public class TimePickerDialog extends DialogFragment implements OnValueSelectedListener{
|
||||
public class TimePickerDialog extends AppCompatDialogFragment implements OnValueSelectedListener{
|
||||
private static final String TAG = "TimePickerDialog";
|
||||
|
||||
private static final String KEY_HOUR_OF_DAY = "hour_of_day";
|
||||
|
||||
@@ -19,38 +19,27 @@
|
||||
|
||||
package org.isoron.uhabits;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.isoron.uhabits.helpers.ColorHelper;
|
||||
import org.isoron.uhabits.helpers.UIHelper;
|
||||
|
||||
public class AboutActivity extends Activity implements View.OnClickListener
|
||||
public class AboutActivity extends BaseActivity implements View.OnClickListener
|
||||
{
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
UIHelper.applyCurrentTheme(this);
|
||||
|
||||
setContentView(R.layout.about);
|
||||
setupSupportActionBar(true);
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= 21 && !UIHelper.isNightMode())
|
||||
{
|
||||
int color = UIHelper.getStyledColor(this, R.attr.aboutScreenColor);
|
||||
int darkerColor = ColorHelper.mixColors(color, Color.BLACK, 0.75f);
|
||||
ActionBar actionBar = getActionBar();
|
||||
if(actionBar != null) actionBar.setBackgroundDrawable(new ColorDrawable(color));
|
||||
getWindow().setStatusBarColor(darkerColor);
|
||||
}
|
||||
setupActionBarColor(color);
|
||||
|
||||
TextView tvVersion = (TextView) findViewById(R.id.tvVersion);
|
||||
TextView tvRate = (TextView) findViewById(R.id.tvRate);
|
||||
|
||||
@@ -19,18 +19,25 @@
|
||||
|
||||
package org.isoron.uhabits;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.backup.BackupManager;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.isoron.uhabits.commands.Command;
|
||||
import org.isoron.uhabits.helpers.ColorHelper;
|
||||
import org.isoron.uhabits.helpers.UIHelper;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
abstract public class BaseActivity extends Activity implements Thread.UncaughtExceptionHandler
|
||||
abstract public class BaseActivity extends AppCompatActivity implements Thread.UncaughtExceptionHandler
|
||||
{
|
||||
private static int MAX_UNDO_LEVEL = 15;
|
||||
|
||||
@@ -120,6 +127,23 @@ abstract public class BaseActivity extends Activity implements Thread.UncaughtEx
|
||||
showToast(command.getExecuteStringId());
|
||||
}
|
||||
|
||||
protected void setupSupportActionBar(boolean homeButtonEnabled)
|
||||
{
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
if(toolbar == null) return;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
toolbar.setElevation(UIHelper.dpToPixels(this, 3));
|
||||
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if(actionBar == null) return;
|
||||
|
||||
if(homeButtonEnabled)
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
public void onPostExecuteCommand(Long refreshKey)
|
||||
{
|
||||
}
|
||||
@@ -142,4 +166,36 @@ abstract public class BaseActivity extends Activity implements Thread.UncaughtEx
|
||||
else
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
protected void setupActionBarColor(int color)
|
||||
{
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if(actionBar == null) return;
|
||||
|
||||
if (!UIHelper.getStyledBoolean(this, R.attr.useHabitColorAsPrimary)) return;
|
||||
|
||||
ColorDrawable drawable = new ColorDrawable(color);
|
||||
actionBar.setBackgroundDrawable(drawable);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
{
|
||||
int darkerColor = ColorHelper.mixColors(color, Color.BLACK, 0.75f);
|
||||
getWindow().setStatusBarColor(darkerColor);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostResume()
|
||||
{
|
||||
super.onPostResume();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
hideFakeToolbarShadow();
|
||||
}
|
||||
|
||||
protected void hideFakeToolbarShadow()
|
||||
{
|
||||
View view = findViewById(R.id.toolbarShadow);
|
||||
if(view != null) view.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,16 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
@@ -74,17 +77,32 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
setContentView(R.layout.list_habits_activity);
|
||||
|
||||
setupSupportActionBar(false);
|
||||
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
listHabitsFragment =
|
||||
(ListHabitsFragment) getFragmentManager().findFragmentById(R.id.fragment1);
|
||||
(ListHabitsFragment) getSupportFragmentManager().findFragmentById(R.id.fragment1);
|
||||
|
||||
receiver = new Receiver();
|
||||
localBroadcastManager = LocalBroadcastManager.getInstance(this);
|
||||
localBroadcastManager.registerReceiver(receiver, new IntentFilter(ACTION_REFRESH));
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
|
||||
onPreLollipopStartup();
|
||||
|
||||
onStartup();
|
||||
}
|
||||
|
||||
private void onPreLollipopStartup()
|
||||
{
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if(actionBar == null) return;
|
||||
if(UIHelper.isNightMode()) return;
|
||||
|
||||
int color = getResources().getColor(R.color.grey_900);
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(color));
|
||||
}
|
||||
|
||||
private void onStartup()
|
||||
{
|
||||
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
|
||||
@@ -123,6 +141,7 @@ public class MainActivity extends BaseActivity
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu)
|
||||
{
|
||||
menu.clear();
|
||||
getMenuInflater().inflate(R.menu.list_habits_menu, menu);
|
||||
|
||||
MenuItem nightModeItem = menu.findItem(R.id.action_night_mode);
|
||||
|
||||
@@ -19,23 +19,20 @@
|
||||
|
||||
package org.isoron.uhabits;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import org.isoron.uhabits.fragments.SettingsFragment;
|
||||
import org.isoron.uhabits.helpers.UIHelper;
|
||||
|
||||
public class SettingsActivity extends Activity
|
||||
public class SettingsActivity extends BaseActivity
|
||||
{
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.settings_activity);
|
||||
setupSupportActionBar(true);
|
||||
|
||||
UIHelper.applyCurrentTheme(this);
|
||||
|
||||
getFragmentManager().beginTransaction()
|
||||
.replace(android.R.id.content, new SettingsFragment())
|
||||
.commit();
|
||||
int color = UIHelper.getStyledColor(this, R.attr.aboutScreenColor);
|
||||
setupActionBarColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,15 +19,12 @@
|
||||
|
||||
package org.isoron.uhabits;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.content.ContentUris;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
|
||||
import org.isoron.uhabits.helpers.ColorHelper;
|
||||
import org.isoron.uhabits.helpers.UIHelper;
|
||||
import org.isoron.uhabits.models.Habit;
|
||||
|
||||
public class ShowHabitActivity extends BaseActivity
|
||||
@@ -41,26 +38,23 @@ public class ShowHabitActivity extends BaseActivity
|
||||
|
||||
Uri data = getIntent().getData();
|
||||
habit = Habit.get(ContentUris.parseId(data));
|
||||
ActionBar actionBar = getActionBar();
|
||||
|
||||
if(actionBar != null && getHabit() != null)
|
||||
{
|
||||
actionBar.setTitle(getHabit().name);
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= 21 &&
|
||||
UIHelper.getStyledBoolean(this, R.attr.useHabitColorAsPrimary))
|
||||
{
|
||||
int androidColor = ColorHelper.getColor(this, getHabit().color);
|
||||
ColorDrawable drawable = new ColorDrawable(androidColor);
|
||||
actionBar.setBackgroundDrawable(drawable);
|
||||
|
||||
int color = ColorHelper.getColor(this, habit.color);
|
||||
int darkerHabitColor = ColorHelper.mixColors(color, Color.BLACK, 0.75f);
|
||||
getWindow().setStatusBarColor(darkerHabitColor);
|
||||
}
|
||||
}
|
||||
|
||||
setContentView(R.layout.show_habit_activity);
|
||||
|
||||
setupSupportActionBar(true);
|
||||
setupHabitActionBar();
|
||||
}
|
||||
|
||||
private void setupHabitActionBar()
|
||||
{
|
||||
if(habit == null) return;
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if(actionBar == null) return;
|
||||
|
||||
actionBar.setTitle(habit.name);
|
||||
|
||||
setupActionBarColor(ColorHelper.getColor(this, habit.color));
|
||||
}
|
||||
|
||||
public Habit getHabit()
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.isoron.uhabits.fragments;
|
||||
package org.isoron.uhabits.dialogs;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v7.app.AppCompatDialogFragment;
|
||||
import android.text.format.DateFormat;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -44,7 +44,6 @@ import org.isoron.uhabits.R;
|
||||
import org.isoron.uhabits.commands.Command;
|
||||
import org.isoron.uhabits.commands.CreateHabitCommand;
|
||||
import org.isoron.uhabits.commands.EditHabitCommand;
|
||||
import org.isoron.uhabits.dialogs.WeekdayPickerDialog;
|
||||
import org.isoron.uhabits.helpers.ColorHelper;
|
||||
import org.isoron.uhabits.helpers.DateHelper;
|
||||
import org.isoron.uhabits.helpers.UIHelper.OnSavedListener;
|
||||
@@ -52,7 +51,7 @@ import org.isoron.uhabits.models.Habit;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class EditHabitFragment extends DialogFragment
|
||||
public class EditHabitDialogFragment extends AppCompatDialogFragment
|
||||
implements OnClickListener, WeekdayPickerDialog.OnWeekdaysPickedListener,
|
||||
TimePickerDialog.OnTimeSetListener, Spinner.OnItemSelectedListener
|
||||
{
|
||||
@@ -79,9 +78,9 @@ public class EditHabitFragment extends DialogFragment
|
||||
private SharedPreferences prefs;
|
||||
private boolean is24HourMode;
|
||||
|
||||
public static EditHabitFragment editSingleHabitFragment(long id)
|
||||
public static EditHabitDialogFragment editSingleHabitFragment(long id)
|
||||
{
|
||||
EditHabitFragment frag = new EditHabitFragment();
|
||||
EditHabitDialogFragment frag = new EditHabitDialogFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("habitId", id);
|
||||
args.putInt("editMode", EDIT_MODE);
|
||||
@@ -89,9 +88,9 @@ public class EditHabitFragment extends DialogFragment
|
||||
return frag;
|
||||
}
|
||||
|
||||
public static EditHabitFragment createHabitFragment()
|
||||
public static EditHabitDialogFragment createHabitFragment()
|
||||
{
|
||||
EditHabitFragment frag = new EditHabitFragment();
|
||||
EditHabitDialogFragment frag = new EditHabitDialogFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("editMode", CREATE_MODE);
|
||||
frag.setArguments(args);
|
||||
@@ -19,12 +19,12 @@
|
||||
|
||||
package org.isoron.uhabits.dialogs;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.app.AppCompatDialogFragment;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
@@ -32,7 +32,7 @@ import org.isoron.uhabits.models.Habit;
|
||||
import org.isoron.uhabits.tasks.BaseTask;
|
||||
import org.isoron.uhabits.views.HabitHistoryView;
|
||||
|
||||
public class HistoryEditorDialog extends DialogFragment
|
||||
public class HistoryEditorDialog extends AppCompatDialogFragment
|
||||
implements DialogInterface.OnClickListener
|
||||
{
|
||||
private Habit habit;
|
||||
|
||||
@@ -19,16 +19,16 @@
|
||||
|
||||
package org.isoron.uhabits.dialogs;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.app.AppCompatDialogFragment;
|
||||
|
||||
import org.isoron.uhabits.helpers.DateHelper;
|
||||
import org.isoron.uhabits.R;
|
||||
import org.isoron.uhabits.helpers.DateHelper;
|
||||
|
||||
public class WeekdayPickerDialog extends DialogFragment
|
||||
public class WeekdayPickerDialog extends AppCompatDialogFragment
|
||||
implements DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnClickListener
|
||||
{
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.isoron.uhabits.commands.ArchiveHabitsCommand;
|
||||
import org.isoron.uhabits.commands.ChangeHabitColorCommand;
|
||||
import org.isoron.uhabits.commands.DeleteHabitsCommand;
|
||||
import org.isoron.uhabits.commands.UnarchiveHabitsCommand;
|
||||
import org.isoron.uhabits.dialogs.EditHabitDialogFragment;
|
||||
import org.isoron.uhabits.helpers.ColorHelper;
|
||||
import org.isoron.uhabits.helpers.UIHelper;
|
||||
import org.isoron.uhabits.loaders.HabitListLoader;
|
||||
@@ -155,9 +156,10 @@ public class HabitSelectionCallback implements ActionMode.Callback
|
||||
|
||||
case R.id.action_edit_habit:
|
||||
{
|
||||
EditHabitFragment frag = EditHabitFragment.editSingleHabitFragment(firstHabit.getId());
|
||||
EditHabitDialogFragment
|
||||
frag = EditHabitDialogFragment.editSingleHabitFragment(firstHabit.getId());
|
||||
frag.setOnSavedListener(onSavedListener);
|
||||
frag.show(activity.getFragmentManager(), "editHabit");
|
||||
frag.show(activity.getSupportFragmentManager(), "editHabit");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -180,7 +182,7 @@ public class HabitSelectionCallback implements ActionMode.Callback
|
||||
mode.finish();
|
||||
}
|
||||
});
|
||||
picker.show(activity.getFragmentManager(), "picker");
|
||||
picker.show(activity.getSupportFragmentManager(), "picker");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
package org.isoron.uhabits.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.ActionMode;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.ContextMenu.ContextMenuInfo;
|
||||
@@ -50,17 +50,18 @@ import com.mobeta.android.dslv.DragSortController;
|
||||
import com.mobeta.android.dslv.DragSortListView;
|
||||
import com.mobeta.android.dslv.DragSortListView.DropListener;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
import org.isoron.uhabits.BaseActivity;
|
||||
import org.isoron.uhabits.R;
|
||||
import org.isoron.uhabits.commands.Command;
|
||||
import org.isoron.uhabits.commands.ToggleRepetitionCommand;
|
||||
import org.isoron.uhabits.dialogs.EditHabitDialogFragment;
|
||||
import org.isoron.uhabits.dialogs.FilePickerDialog;
|
||||
import org.isoron.uhabits.helpers.DatabaseHelper;
|
||||
import org.isoron.uhabits.helpers.DateHelper;
|
||||
import org.isoron.uhabits.helpers.UIHelper.OnSavedListener;
|
||||
import org.isoron.uhabits.helpers.HintManager;
|
||||
import org.isoron.uhabits.helpers.ListHabitsHelper;
|
||||
import org.isoron.uhabits.helpers.ReminderHelper;
|
||||
import org.isoron.uhabits.helpers.UIHelper.OnSavedListener;
|
||||
import org.isoron.uhabits.loaders.HabitListLoader;
|
||||
import org.isoron.uhabits.models.Habit;
|
||||
import org.isoron.uhabits.tasks.ExportCSVTask;
|
||||
@@ -141,7 +142,7 @@ public class ListHabitsFragment extends Fragment
|
||||
|
||||
if(savedInstanceState != null)
|
||||
{
|
||||
EditHabitFragment frag = (EditHabitFragment) getFragmentManager()
|
||||
EditHabitDialogFragment frag = (EditHabitDialogFragment) getFragmentManager()
|
||||
.findFragmentByTag("editHabit");
|
||||
if(frag != null) frag.setOnSavedListener(this);
|
||||
}
|
||||
@@ -217,7 +218,7 @@ public class ListHabitsFragment extends Fragment
|
||||
{
|
||||
case R.id.action_add:
|
||||
{
|
||||
EditHabitFragment frag = EditHabitFragment.createHabitFragment();
|
||||
EditHabitDialogFragment frag = EditHabitDialogFragment.createHabitFragment();
|
||||
frag.setOnSavedListener(this);
|
||||
frag.show(getFragmentManager(), "editHabit");
|
||||
return true;
|
||||
|
||||
@@ -22,15 +22,15 @@ package org.isoron.uhabits.fragments;
|
||||
import android.app.backup.BackupManager;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceCategory;
|
||||
import android.preference.PreferenceFragment;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceCategory;
|
||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
||||
|
||||
import org.isoron.uhabits.MainActivity;
|
||||
import org.isoron.uhabits.R;
|
||||
import org.isoron.uhabits.helpers.UIHelper;
|
||||
|
||||
public class SettingsFragment extends PreferenceFragment
|
||||
public class SettingsFragment extends PreferenceFragmentCompat
|
||||
implements SharedPreferences.OnSharedPreferenceChangeListener
|
||||
{
|
||||
@Override
|
||||
@@ -48,6 +48,12 @@ public class SettingsFragment extends PreferenceFragment
|
||||
removePreference("translate", "linksCategory");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle bundle, String s)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void removePreference(String preferenceKey, String categoryKey)
|
||||
{
|
||||
PreferenceCategory cat = (PreferenceCategory) findPreference(categoryKey);
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
|
||||
package org.isoron.uhabits.fragments;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
@@ -39,6 +39,7 @@ import org.isoron.uhabits.HabitBroadcastReceiver;
|
||||
import org.isoron.uhabits.R;
|
||||
import org.isoron.uhabits.ShowHabitActivity;
|
||||
import org.isoron.uhabits.commands.Command;
|
||||
import org.isoron.uhabits.dialogs.EditHabitDialogFragment;
|
||||
import org.isoron.uhabits.dialogs.HistoryEditorDialog;
|
||||
import org.isoron.uhabits.helpers.ColorHelper;
|
||||
import org.isoron.uhabits.helpers.ReminderHelper;
|
||||
@@ -132,7 +133,7 @@ public class ShowHabitFragment extends Fragment
|
||||
|
||||
if(savedInstanceState != null)
|
||||
{
|
||||
EditHabitFragment fragEdit = (EditHabitFragment) getFragmentManager()
|
||||
EditHabitDialogFragment fragEdit = (EditHabitDialogFragment) getFragmentManager()
|
||||
.findFragmentByTag("editHabit");
|
||||
HistoryEditorDialog fragEditor = (HistoryEditorDialog) getFragmentManager()
|
||||
.findFragmentByTag("historyEditor");
|
||||
@@ -200,7 +201,8 @@ public class ShowHabitFragment extends Fragment
|
||||
{
|
||||
case R.id.action_edit_habit:
|
||||
{
|
||||
EditHabitFragment frag = EditHabitFragment.editSingleHabitFragment(habit.getId());
|
||||
EditHabitDialogFragment
|
||||
frag = EditHabitDialogFragment.editSingleHabitFragment(habit.getId());
|
||||
frag.setOnSavedListener(this);
|
||||
frag.show(getFragmentManager(), "editHabit");
|
||||
return true;
|
||||
|
||||
@@ -21,6 +21,7 @@ package org.isoron.uhabits.helpers;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
|
||||
@@ -67,7 +68,10 @@ public class ColorHelper
|
||||
|
||||
int palette[] = getPalette(context);
|
||||
if(paletteColor < 0 || paletteColor >= palette.length)
|
||||
throw new IllegalArgumentException(String.format("Invalid color: %d", paletteColor));
|
||||
{
|
||||
Log.w("ColorHelper", String.format("Invalid color: %d. Returning default.", paletteColor));
|
||||
paletteColor = 0;
|
||||
}
|
||||
|
||||
return palette[paletteColor];
|
||||
}
|
||||
|
||||
@@ -28,17 +28,9 @@
|
||||
android:angle="270"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:top="21dp" android:bottom="2dp">
|
||||
<shape android:shape="rectangle" >
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#ccffffff"
|
||||
android:startColor="#ffffff" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:bottom="21dp">
|
||||
<shape android:shape="rectangle" >
|
||||
<solid android:color="#ffffff" />
|
||||
<solid android:color="@color/grey_200" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
||||
28
app/src/main/res/drawable/toolbar_shadow.xml
Normal file
28
app/src/main/res/drawable/toolbar_shadow.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
|
||||
~
|
||||
~ This file is part of Loop Habit Tracker.
|
||||
~
|
||||
~ Loop Habit Tracker 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 (at your
|
||||
~ option) any later version.
|
||||
~
|
||||
~ Loop Habit Tracker 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient android:startColor="@android:color/transparent"
|
||||
android:endColor="@color/black"
|
||||
android:angle="90"/>
|
||||
|
||||
</shape>
|
||||
@@ -18,12 +18,23 @@
|
||||
~ with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?windowBackgroundColor"
|
||||
android:fillViewport="true">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
app:popupTheme="?toolbarPopupTheme"
|
||||
style="@style/Toolbar"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/CardList">
|
||||
|
||||
@@ -179,3 +190,9 @@
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<View
|
||||
android:id="@+id/toolbarShadow"
|
||||
style="@style/ToolbarShadow"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
style="@style/dialogForm"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="org.isoron.uhabits.fragments.EditHabitFragment"
|
||||
tools:context=".dialogs.EditHabitDialogFragment"
|
||||
tools:ignore="MergeRootFrame">
|
||||
|
||||
<LinearLayout
|
||||
@@ -61,11 +61,12 @@
|
||||
style="@style/dialogFormLabel"
|
||||
android:text="@string/repeat"/>
|
||||
|
||||
<Spinner
|
||||
<android.support.v7.widget.AppCompatSpinner
|
||||
android:id="@+id/sFrequency"
|
||||
style="?dialogFormSpinnerTheme"
|
||||
android:theme="@style/dialogFormText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="25dp"
|
||||
android:minWidth="400dp"
|
||||
android:entries="@array/frequencyQuickSelect"
|
||||
android:visibility="gone"/>
|
||||
|
||||
@@ -111,7 +112,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/inputReminderTime"
|
||||
style="?dialogFormSpinnerTheme"/>
|
||||
style="@style/dialogFormSpinner"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -125,7 +126,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/inputReminderDays"
|
||||
style="?dialogFormSpinnerTheme"/>
|
||||
style="@style/dialogFormSpinner"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -17,19 +17,30 @@
|
||||
~ with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout android:id="@+id/container"
|
||||
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/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="org.isoron.uhabits.MainActivity"
|
||||
tools:ignore="MergeRootFrame">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
app:popupTheme="?toolbarPopupTheme"/>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/fragment1"
|
||||
android:name="org.isoron.uhabits.fragments.ListHabitsFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
tools:layout="@layout/list_habits_fragment"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/toolbarShadow"
|
||||
style="@style/ToolbarShadow"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -80,7 +80,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_below="@id/header"
|
||||
android:layout_below="@+id/header"
|
||||
android:layout_marginTop="@dimen/progressbarOffset"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
26
app/src/main/res/layout/preference_category_custom.xml
Normal file
26
app/src/main/res/layout/preference_category_custom.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2015 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License
|
||||
-->
|
||||
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="0dip"
|
||||
android:textColor="?aboutScreenColor"
|
||||
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingLeft"
|
||||
android:paddingTop="8dip" />
|
||||
46
app/src/main/res/layout/settings_activity.xml
Normal file
46
app/src/main/res/layout/settings_activity.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<!--
|
||||
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
|
||||
~
|
||||
~ This file is part of Loop Habit Tracker.
|
||||
~
|
||||
~ Loop Habit Tracker 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 (at your
|
||||
~ option) any later version.
|
||||
~
|
||||
~ Loop Habit Tracker 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="org.isoron.uhabits.SettingsActivity"
|
||||
tools:ignore="MergeRootFrame">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
app:popupTheme="?toolbarPopupTheme"
|
||||
style="@style/Toolbar"/>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/fragment"
|
||||
android:name="org.isoron.uhabits.fragments.SettingsFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_below="@id/toolbar"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/toolbarShadow"
|
||||
style="@style/ToolbarShadow"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -61,15 +61,15 @@
|
||||
style="@style/Card"
|
||||
android:gravity="center">
|
||||
|
||||
<Spinner
|
||||
<android.support.v7.widget.AppCompatSpinner
|
||||
android:id="@+id/sStrengthInterval"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="22dp"
|
||||
android:entries="@array/strengthIntervalNames"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:minWidth="100dp"
|
||||
android:theme="@style/SmallSpinner"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
~ with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -26,12 +27,23 @@
|
||||
tools:ignore="MergeRootFrame"
|
||||
tools:menu="show_habit_activity_menu,show_habit_fragment_menu">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
app:popupTheme="?toolbarPopupTheme"
|
||||
|
||||
style="@style/Toolbar"/>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/fragment2"
|
||||
android:name="org.isoron.uhabits.fragments.ShowHabitFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:layout="@layout/show_habit"
|
||||
android:layout_gravity="center"/>
|
||||
android:layout_gravity="center"
|
||||
android:layout_below="@id/toolbar"/>
|
||||
|
||||
</FrameLayout>
|
||||
<View
|
||||
android:id="@+id/toolbarShadow"
|
||||
style="@style/ToolbarShadow"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -22,17 +22,25 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="org.isoron.uhabits.MainActivity">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_add"
|
||||
android:icon="?iconAdd"
|
||||
android:title="@string/add_habit"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_show_archived"
|
||||
android:checkable="true"
|
||||
android:enabled="true"
|
||||
android:title="@string/show_archived"/>
|
||||
android:title="@string/show_archived"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_night_mode"
|
||||
android:checkable="true"
|
||||
android:enabled="true"
|
||||
android:title="@string/night_mode"/>
|
||||
android:title="@string/night_mode"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
|
||||
@@ -19,12 +19,7 @@
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:context="org.isoron.uhabits.MainActivity">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_add"
|
||||
android:icon="?iconAdd"
|
||||
android:title="@string/add_habit"
|
||||
android:showAsAction="always"/>
|
||||
|
||||
</menu>
|
||||
|
||||
@@ -18,12 +18,13 @@
|
||||
~ with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_edit_habit"
|
||||
android:icon="?iconEdit"
|
||||
android:title="@string/edit"
|
||||
android:showAsAction="ifRoom"/>
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
</menu>
|
||||
23
app/src/main/res/values-v21/dimens.xml
Normal file
23
app/src/main/res/values-v21/dimens.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
|
||||
~
|
||||
~ This file is part of Loop Habit Tracker.
|
||||
~
|
||||
~ Loop Habit Tracker 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 (at your
|
||||
~ option) any later version.
|
||||
~
|
||||
~ Loop Habit Tracker 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<dimen name="progressbarOffset">-6dp</dimen>
|
||||
</resources>
|
||||
@@ -18,105 +18,6 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="AppBaseTheme" parent="android:Theme.Material.Light.DarkActionBar">
|
||||
<item name="android:dialogTheme">@style/MyDialogStyle</item>
|
||||
<item name="android:alertDialogTheme">@style/MyDialogStyle</item>
|
||||
<item name="android:windowContentTransitions">true</item>
|
||||
<item name="android:windowAllowEnterTransitionOverlap">true</item>
|
||||
<item name="android:windowAllowReturnTransitionOverlap">true</item>
|
||||
<item name="android:spinnerItemStyle">@style/dialogFormSmallText</item>
|
||||
|
||||
<item name="android:colorPrimary">@color/blue_grey_800</item>
|
||||
<item name="android:colorPrimaryDark">@color/blue_grey_900</item>
|
||||
<item name="cardBackgroundColor">@color/grey_50</item>
|
||||
<item name="windowBackgroundColor">@color/grey_200</item>
|
||||
<item name="headerBackgroundColor">@color/grey_200</item>
|
||||
<item name="highlightedBackgroundColor">@color/grey_100</item>
|
||||
|
||||
<item name="android:textColor">@color/grey_800</item>
|
||||
<item name="useHabitColorAsPrimary">true</item>
|
||||
<item name="palette">@array/lightPalette</item>
|
||||
|
||||
<item name="highContrastReverseTextColor">@color/white</item>
|
||||
<item name="mediumContrastReverseTextColor">@color/grey_500</item>
|
||||
<item name="lowContrastReverseTextColor">@color/grey_700</item>
|
||||
|
||||
<item name="highContrastTextColor">@color/grey_800</item>
|
||||
<item name="mediumContrastTextColor">@color/grey_500</item>
|
||||
<item name="lowContrastTextColor">@color/grey_300</item>
|
||||
|
||||
<item name="iconAdd">@drawable/ic_action_add_dark</item>
|
||||
<item name="iconArchive">@drawable/ic_action_archive_dark</item>
|
||||
<item name="iconEdit">@drawable/ic_action_edit_dark</item>
|
||||
<item name="iconUnarchive">@drawable/ic_action_unarchive_dark</item>
|
||||
<item name="iconChangeColor">@drawable/ic_action_color_dark</item>
|
||||
<item name="dialogIconChangeColor">@drawable/ic_action_color_light</item>
|
||||
<item name="dialogFormSpinnerTheme">@style/dialogFormSpinnerLight</item>
|
||||
|
||||
<item name="aboutScreenColor">@color/blue_700</item>
|
||||
</style>
|
||||
|
||||
<style name="AppBaseThemeDark" parent="android:Theme.Material">
|
||||
<item name="android:dialogTheme">@style/MyDialogStyleDark</item>
|
||||
<item name="android:alertDialogTheme">@style/MyDialogStyleDark</item>
|
||||
<item name="android:windowContentTransitions">true</item>
|
||||
<item name="android:windowAllowEnterTransitionOverlap">true</item>
|
||||
<item name="android:windowAllowReturnTransitionOverlap">true</item>
|
||||
|
||||
<item name="android:colorPrimary">@color/grey_950</item>
|
||||
<item name="android:colorPrimaryDark">@color/black</item>
|
||||
<item name="cardBackgroundColor">@color/grey_850</item>
|
||||
<item name="windowBackgroundColor">@color/grey_900</item>
|
||||
<item name="headerBackgroundColor">@color/grey_900</item>
|
||||
<item name="highlightedBackgroundColor">@color/grey_800</item>
|
||||
|
||||
<item name="android:textColor">@color/grey_100</item>
|
||||
<item name="useHabitColorAsPrimary">false</item>
|
||||
|
||||
<item name="highContrastTextColor">@color/grey_100</item>
|
||||
<item name="mediumContrastTextColor">@color/grey_500</item>
|
||||
<item name="lowContrastTextColor">@color/grey_800</item>
|
||||
|
||||
<item name="highContrastReverseTextColor">@color/grey_900</item>
|
||||
<item name="mediumContrastReverseTextColor">@color/grey_700</item>
|
||||
<item name="lowContrastReverseTextColor">@color/grey_300</item>
|
||||
|
||||
<item name="iconAdd">@drawable/ic_action_add_dark</item>
|
||||
<item name="iconArchive">@drawable/ic_action_archive_dark</item>
|
||||
<item name="iconEdit">@drawable/ic_action_edit_dark</item>
|
||||
<item name="iconUnarchive">@drawable/ic_action_unarchive_dark</item>
|
||||
<item name="iconChangeColor">@drawable/ic_action_color_dark</item>
|
||||
<item name="dialogIconChangeColor">@drawable/ic_action_color_dark</item>
|
||||
<item name="dialogFormSpinnerTheme">@style/dialogFormSpinnerDark</item>
|
||||
|
||||
<item name="palette">@array/darkPalette</item>
|
||||
|
||||
<item name="aboutScreenColor">@color/blue_300</item>
|
||||
</style>
|
||||
|
||||
<style name="AppBaseThemeDark.PureBlack">
|
||||
<item name="android:colorPrimary">@color/black</item>
|
||||
<item name="android:colorPrimaryDark">@color/black</item>
|
||||
<item name="cardBackgroundColor">@color/black</item>
|
||||
<item name="windowBackgroundColor">@color/black</item>
|
||||
<item name="headerBackgroundColor">@color/black</item>
|
||||
<item name="highlightedBackgroundColor">@color/black</item>
|
||||
|
||||
<item name="lowContrastTextColor">@color/grey_900</item>
|
||||
<item name="highContrastReverseTextColor">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="MyDialogStyle" parent="android:Theme.Material.Light.Dialog">
|
||||
<item name="android:spinnerItemStyle">@style/dialogFormText</item>
|
||||
<item name="android:spinnerDropDownItemStyle">@style/dialogFormSpinnerDropDown</item>
|
||||
</style>
|
||||
|
||||
<style name="MyDialogStyleDark" parent="android:Theme.Material.Dialog">
|
||||
<item name="android:spinnerItemStyle">@style/dialogFormText</item>
|
||||
<item name="android:spinnerDropDownItemStyle">@style/dialogFormSpinnerDropDown</item>
|
||||
</style>
|
||||
|
||||
<style name="Card" parent="CardCommon">
|
||||
<item name="android:elevation">1dp</item>
|
||||
<item name="android:background">?attr/cardBackgroundColor</item>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<attr name="iconUnarchive" format="reference"/>
|
||||
<attr name="dialogIconChangeColor" format="reference"/>
|
||||
|
||||
<attr name="dialogFormSpinnerTheme" format="reference"/>
|
||||
<attr name="toolbarPopupTheme" format="reference"/>
|
||||
|
||||
<!-- Pre-Lollipop -->
|
||||
<attr name="cardBackground" format="reference"/>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<dimen name="smallTextSize">14sp</dimen>
|
||||
<dimen name="tinyTextSize">10sp</dimen>
|
||||
<dimen name="habitNameWidth">160dp</dimen>
|
||||
<dimen name="progressbarOffset">-10dp</dimen>
|
||||
|
||||
<string-array name="snooze_interval_names">
|
||||
<item>@string/interval_15_minutes</item>
|
||||
|
||||
@@ -18,14 +18,26 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
<item name="android:dialogTheme">@style/Theme.AppCompat.Light.Dialog</item>
|
||||
<item name="android:alertDialogTheme">@style/Theme.AppCompat.Light.Dialog</item>
|
||||
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="actionModeBackground">@color/blue_grey_700</item>
|
||||
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
|
||||
|
||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
|
||||
<item name="selectedBackground">@drawable/selected_box_light</item>
|
||||
<item name="headerBackground">@drawable/habits_list_header_light_background</item>
|
||||
<item name="cardBackground">@drawable/card_light_background</item>
|
||||
<item name="cardBackgroundColor">@color/white</item>
|
||||
|
||||
<item name="colorPrimary">@color/blue_grey_800</item>
|
||||
<item name="colorPrimaryDark">@color/blue_grey_900</item>
|
||||
<item name="colorAccent">?aboutScreenColor</item>
|
||||
<item name="cardBackgroundColor">@color/grey_50</item>
|
||||
<item name="windowBackgroundColor">@color/grey_200</item>
|
||||
<item name="headerBackgroundColor">@color/grey_200</item>
|
||||
<item name="highlightedBackgroundColor">@color/grey_100</item>
|
||||
|
||||
<item name="android:textColor">@color/grey_800</item>
|
||||
<item name="useHabitColorAsPrimary">true</item>
|
||||
@@ -39,24 +51,41 @@
|
||||
<item name="mediumContrastTextColor">@color/grey_500</item>
|
||||
<item name="lowContrastTextColor">@color/grey_300</item>
|
||||
|
||||
<item name="iconAdd">@drawable/ic_action_add_light</item>
|
||||
<item name="iconArchive">@drawable/ic_action_archive_light</item>
|
||||
<item name="iconEdit">@drawable/ic_action_edit_light</item>
|
||||
<item name="iconUnarchive">@drawable/ic_action_unarchive_light</item>
|
||||
<item name="iconChangeColor">@drawable/ic_action_color_light</item>
|
||||
<item name="iconAdd">@drawable/ic_action_add_dark</item>
|
||||
<item name="iconArchive">@drawable/ic_action_archive_dark</item>
|
||||
<item name="iconEdit">@drawable/ic_action_edit_dark</item>
|
||||
<item name="iconUnarchive">@drawable/ic_action_unarchive_dark</item>
|
||||
<item name="iconChangeColor">@drawable/ic_action_color_dark</item>
|
||||
<item name="dialogIconChangeColor">@drawable/ic_action_color_light</item>
|
||||
<item name="dialogFormSpinnerTheme">@style/dialogFormSpinnerLight</item>
|
||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
|
||||
|
||||
<item name="aboutScreenColor">@color/blue_700</item>
|
||||
<item name="aboutScreenColor">@color/blue_800</item>
|
||||
</style>
|
||||
|
||||
<style name="AppBaseThemeDark" parent="android:Theme.Holo">
|
||||
<style name="SmallSpinner">
|
||||
<item name="android:textColor">?mediumContrastTextColor</item>
|
||||
<item name="android:textSize">@dimen/smallTextSize</item>
|
||||
</style>
|
||||
|
||||
<style name="AppBaseThemeDark" parent="@style/Theme.AppCompat.NoActionBar">
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
<item name="android:dialogTheme">@style/Theme.AppCompat.Dialog</item>
|
||||
<item name="android:alertDialogTheme">@style/Theme.AppCompat.Dialog</item>
|
||||
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="actionModeBackground">@color/grey_800</item>
|
||||
|
||||
<item name="selectedBackground">@drawable/selected_box_dark</item>
|
||||
<item name="headerBackground">@drawable/habits_list_header_dark_background</item>
|
||||
<item name="cardBackground">@drawable/card_dark_background</item>
|
||||
|
||||
<item name="colorPrimary">@color/grey_950</item>
|
||||
<item name="colorPrimaryDark">@color/black</item>
|
||||
<item name="colorAccent">?aboutScreenColor</item>
|
||||
<item name="cardBackgroundColor">@color/grey_850</item>
|
||||
<item name="windowBackgroundColor">@color/grey_900</item>
|
||||
<item name="headerBackgroundColor">@color/grey_900</item>
|
||||
<item name="highlightedBackgroundColor">@color/grey_800</item>
|
||||
|
||||
<item name="android:textColor">@color/grey_100</item>
|
||||
<item name="useHabitColorAsPrimary">false</item>
|
||||
@@ -75,7 +104,7 @@
|
||||
<item name="iconUnarchive">@drawable/ic_action_unarchive_dark</item>
|
||||
<item name="iconChangeColor">@drawable/ic_action_color_dark</item>
|
||||
<item name="dialogIconChangeColor">@drawable/ic_action_color_dark</item>
|
||||
<item name="dialogFormSpinnerTheme">@style/dialogFormSpinnerDark</item>
|
||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat</item>
|
||||
|
||||
<item name="palette">@array/darkPalette</item>
|
||||
|
||||
@@ -86,9 +115,14 @@
|
||||
<item name="selectedBackground">@drawable/selected_box_amoled</item>
|
||||
<item name="headerBackground">@drawable/habits_list_header_amoled_background</item>
|
||||
<item name="cardBackground">@drawable/card_amoled_background</item>
|
||||
|
||||
<item name="colorPrimary">@color/black</item>
|
||||
<item name="colorPrimaryDark">@color/black</item>
|
||||
<item name="cardBackgroundColor">@color/black</item>
|
||||
<item name="windowBackgroundColor">@color/black</item>
|
||||
<item name="headerBackgroundColor">@color/black</item>
|
||||
<item name="highlightedBackgroundColor">@color/black</item>
|
||||
|
||||
<item name="lowContrastTextColor">@color/grey_900</item>
|
||||
<item name="highContrastReverseTextColor">@color/black</item>
|
||||
</style>
|
||||
@@ -174,4 +208,23 @@
|
||||
<item name="android:textColor">?mediumContrastTextColor</item>
|
||||
</style>
|
||||
|
||||
<style name="Toolbar">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">?actionBarSize</item>
|
||||
<item name="android:background">?colorPrimary</item>
|
||||
<item name="android:theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
|
||||
<item name="android:layout_alignParentTop">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Preference.Category.Material">
|
||||
<item name="android:layout">@layout/preference_category_custom</item>
|
||||
</style>
|
||||
|
||||
<style name="ToolbarShadow">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">3dp</item>
|
||||
<item name="android:background">@drawable/toolbar_shadow</item>
|
||||
<item name="android:alpha">0.25</item>
|
||||
<item name="android:layout_below">@id/toolbar</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -71,28 +71,19 @@
|
||||
<style name="dialogFormLabel" parent="dialogFormText">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:minWidth">100dp</item>
|
||||
<item name="android:minWidth">90dp</item>
|
||||
<item name="android:gravity">left</item>
|
||||
<item name="android:paddingLeft">6dp</item>
|
||||
<item name="android:textColor">?mediumContrastTextColor</item>
|
||||
</style>
|
||||
|
||||
<style name="dialogFormSpinnerDark" parent="android:Widget.DeviceDefault.Spinner">
|
||||
<style name="dialogFormSpinner" parent="@style/Widget.AppCompat.Spinner">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:paddingLeft">12dp</item>
|
||||
<item name="android:textSize">@dimen/regularTextSize</item>
|
||||
<item name="android:minWidth">400dp</item>
|
||||
<item name="android:textColor">?highContrastTextColor</item>
|
||||
</style>
|
||||
|
||||
<style name="dialogFormSpinnerLight" parent="android:Widget.DeviceDefault.Light.Spinner">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:paddingLeft">12dp</item>
|
||||
<item name="android:textSize">@dimen/regularTextSize</item>
|
||||
<item name="android:minWidth">400dp</item>
|
||||
<item name="android:textColor">?highContrastTextColor</item>
|
||||
<item name="android:paddingLeft">8dp</item>
|
||||
</style>
|
||||
|
||||
<style name="dialogFormRow">
|
||||
|
||||
Reference in New Issue
Block a user