From 17a85e517a9b402c0db85df546b3d06c600061fa Mon Sep 17 00:00:00 2001 From: olegivo Date: Thu, 13 Aug 2020 07:53:37 -0500 Subject: [PATCH 01/49] Konvert BaseRootView Co-authored-by: Alinson S. Xavier --- .../androidbase/activities/BaseRootView.java | 110 ------------------ .../androidbase/activities/BaseRootView.kt | 63 ++++++++++ .../common/views/TaskProgressBar.kt | 4 +- .../habits/list/views/EmptyListView.kt | 5 +- 4 files changed, 67 insertions(+), 115 deletions(-) delete mode 100644 android/android-base/src/main/java/org/isoron/androidbase/activities/BaseRootView.java create mode 100644 android/android-base/src/main/java/org/isoron/androidbase/activities/BaseRootView.kt diff --git a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseRootView.java b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseRootView.java deleted file mode 100644 index 3ff339387..000000000 --- a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseRootView.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2016 Álinson Santos Xavier - * - * 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 . - */ - -package org.isoron.androidbase.activities; - -import android.content.*; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.widget.Toolbar; -import android.view.*; -import android.widget.*; - -import org.isoron.androidbase.*; -import org.isoron.androidbase.utils.*; - -import static android.os.Build.VERSION.SDK_INT; -import static android.os.Build.VERSION_CODES.LOLLIPOP; - -/** - * Base class for all root views in the application. - *

- * A root view is an Android view that is directly attached to an activity. This - * view usually includes a toolbar and a progress bar. This abstract class hides - * some of the complexity of setting these things up, for every version of - * Android. - */ -public abstract class BaseRootView extends FrameLayout -{ - @NonNull - private final Context context; - - protected boolean shouldDisplayHomeAsUp = false; - - @Nullable - private BaseScreen screen; - - public BaseRootView(@NonNull Context context) - { - super(context); - this.context = context; - } - - public boolean getDisplayHomeAsUp() - { - return shouldDisplayHomeAsUp; - } - - public void setDisplayHomeAsUp(boolean b) - { - shouldDisplayHomeAsUp = b; - } - - @NonNull - public Toolbar getToolbar() - { - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - if (toolbar == null) throw new RuntimeException( - "Your BaseRootView should have a " + - "toolbar with id R.id.toolbar"); - return toolbar; - } - - public int getToolbarColor() - { - StyledResources res = new StyledResources(context); - return res.getColor(R.attr.colorPrimary); - } - - protected void initToolbar() - { - if (SDK_INT >= LOLLIPOP) - { - getToolbar().setElevation(InterfaceUtils.dpToPixels(context, 2)); - - View view = findViewById(R.id.toolbarShadow); - if (view != null) view.setVisibility(GONE); - - view = findViewById(R.id.headerShadow); - if (view != null) view.setVisibility(GONE); - } - } - - public void onAttachedToScreen(BaseScreen screen) - { - this.screen = screen; - } - - @Nullable - public BaseScreen getScreen() - { - return screen; - } -} diff --git a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseRootView.kt b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseRootView.kt new file mode 100644 index 000000000..cc8fb3c7e --- /dev/null +++ b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseRootView.kt @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2016 Álinson Santos Xavier + * + * 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 . + */ +package org.isoron.androidbase.activities + +import android.content.Context +import android.os.Build.VERSION +import android.os.Build.VERSION_CODES +import android.view.View +import android.widget.FrameLayout +import androidx.appcompat.widget.Toolbar +import org.isoron.androidbase.R +import org.isoron.androidbase.utils.InterfaceUtils.dpToPixels +import org.isoron.androidbase.utils.StyledResources + +/** + * Base class for all root views in the application. + * + * + * A root view is an Android view that is directly attached to an activity. This + * view usually includes a toolbar and a progress bar. This abstract class hides + * some of the complexity of setting these things up, for every version of + * Android. + */ +abstract class BaseRootView(context: Context) : FrameLayout(context) { + var displayHomeAsUp = false + var screen: BaseScreen? = null + private set + + open fun getToolbar(): Toolbar { + return findViewById(R.id.toolbar) + ?: throw RuntimeException("Your BaseRootView should have a toolbar with id R.id.toolbar") + } + + open fun getToolbarColor(): Int = StyledResources(context).getColor(R.attr.colorPrimary) + + protected open fun initToolbar() { + if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { + getToolbar().elevation = dpToPixels(context, 2f) + findViewById(R.id.toolbarShadow)?.visibility = View.GONE + findViewById(R.id.headerShadow)?.visibility = View.GONE + } + } + + fun onAttachedToScreen(screen: BaseScreen?) { + this.screen = screen + } +} \ No newline at end of file diff --git a/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/common/views/TaskProgressBar.kt b/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/common/views/TaskProgressBar.kt index 13a23fc07..452c60369 100644 --- a/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/common/views/TaskProgressBar.kt +++ b/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/common/views/TaskProgressBar.kt @@ -20,8 +20,8 @@ package org.isoron.uhabits.activities.common.views import android.content.* +import android.view.* import android.widget.* -import org.isoron.androidbase.activities.* import org.isoron.uhabits.core.tasks.* class TaskProgressBar( @@ -34,7 +34,7 @@ class TaskProgressBar( ), TaskRunner.Listener { init { - visibility = BaseRootView.GONE + visibility = View.GONE isIndeterminate = true } diff --git a/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/views/EmptyListView.kt b/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/views/EmptyListView.kt index 3d4ddafb1..c92eb341f 100644 --- a/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/views/EmptyListView.kt +++ b/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/views/EmptyListView.kt @@ -24,15 +24,14 @@ import android.view.* import android.view.Gravity.* import android.view.ViewGroup.LayoutParams.* import android.widget.* -import org.isoron.androidbase.activities.* import org.isoron.uhabits.* import org.isoron.uhabits.utils.* class EmptyListView(context: Context) : LinearLayout(context) { init { orientation = VERTICAL - gravity = Gravity.CENTER - visibility = BaseRootView.GONE + gravity = CENTER + visibility = View.GONE addView(TextView(context).apply { text = str(R.string.fa_star_half_o) From d202f14c14772637d51e7c42940f96fcefb1b499 Mon Sep 17 00:00:00 2001 From: olegivo Date: Sat, 15 Aug 2020 11:36:03 -0500 Subject: [PATCH 02/49] Konvert BaseScreen Co-authored-by: Alinson S. Xavier --- .../androidbase/activities/BaseScreen.java | 318 ------------------ .../androidbase/activities/BaseScreen.kt | 234 +++++++++++++ 2 files changed, 234 insertions(+), 318 deletions(-) delete mode 100644 android/android-base/src/main/java/org/isoron/androidbase/activities/BaseScreen.java create mode 100644 android/android-base/src/main/java/org/isoron/androidbase/activities/BaseScreen.kt diff --git a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseScreen.java b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseScreen.java deleted file mode 100644 index 331d91742..000000000 --- a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseScreen.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright (C) 2016 Álinson Santos Xavier - * - * 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 . - */ - -package org.isoron.androidbase.activities; - -import android.content.*; -import android.graphics.*; -import android.graphics.drawable.*; -import android.net.*; -import android.os.*; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.StringRes; -import androidx.core.content.res.*; -import androidx.appcompat.app.*; -import androidx.appcompat.view.ActionMode; -import androidx.appcompat.widget.Toolbar; -import android.view.*; -import android.widget.*; - -import com.google.android.material.snackbar.Snackbar; - -import org.isoron.androidbase.*; -import org.isoron.androidbase.utils.*; - -import java.io.*; - -import static android.os.Build.VERSION.SDK_INT; -import static android.os.Build.VERSION_CODES.LOLLIPOP; -import static androidx.core.content.FileProvider.getUriForFile; - -/** - * Base class for all screens in the application. - *

- * Screens are responsible for deciding what root views and what menus should be - * attached to the main window. They are also responsible for showing other - * screens and for receiving their results. - */ -public class BaseScreen -{ - protected BaseActivity activity; - - @Nullable - private BaseRootView rootView; - - @Nullable - private BaseSelectionMenu selectionMenu; - - protected Snackbar snackbar; - - public BaseScreen(@NonNull BaseActivity activity) - { - this.activity = activity; - } - - @Deprecated - public static int getDefaultActionBarColor(Context context) - { - if (SDK_INT < LOLLIPOP) - { - return ResourcesCompat.getColor(context.getResources(), - R.color.grey_900, context.getTheme()); - } - else - { - StyledResources res = new StyledResources(context); - return res.getColor(R.attr.colorPrimary); - } - } - - @Deprecated - public static void setupActionBarColor(@NonNull AppCompatActivity activity, - int color) - { - - Toolbar toolbar = (Toolbar) activity.findViewById(R.id.toolbar); - if (toolbar == null) return; - - activity.setSupportActionBar(toolbar); - - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar == null) return; - - actionBar.setDisplayHomeAsUpEnabled(true); - - ColorDrawable drawable = new ColorDrawable(color); - actionBar.setBackgroundDrawable(drawable); - - if (SDK_INT >= LOLLIPOP) - { - int darkerColor = ColorUtils.mixColors(color, Color.BLACK, 0.75f); - activity.getWindow().setStatusBarColor(darkerColor); - - toolbar.setElevation(InterfaceUtils.dpToPixels(activity, 2)); - - View view = activity.findViewById(R.id.toolbarShadow); - if (view != null) view.setVisibility(View.GONE); - - view = activity.findViewById(R.id.headerShadow); - if (view != null) view.setVisibility(View.GONE); - } - } - - /** - * Notifies the screen that its contents should be updated. - */ - public void invalidate() - { - if (rootView == null) return; - rootView.invalidate(); - } - - public void invalidateToolbar() - { - if (rootView == null) return; - - activity.runOnUiThread(() -> - { - Toolbar toolbar = rootView.getToolbar(); - activity.setSupportActionBar(toolbar); - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar == null) return; - - actionBar.setDisplayHomeAsUpEnabled(rootView.getDisplayHomeAsUp()); - - int color = rootView.getToolbarColor(); - setActionBarColor(actionBar, color); - setStatusBarColor(color); - }); - } - - /** - * Called when another Activity has finished, and has returned some result. - * - * @param requestCode the request code originally supplied to {@link - * android.app.Activity#startActivityForResult(Intent, - * int, Bundle)}. - * @param resultCode the result code sent by the other activity. - * @param data an Intent containing extra data sent by the other - * activity. - * @see {@link android.app.Activity#onActivityResult(int, int, Intent)} - */ - public void onResult(int requestCode, int resultCode, Intent data) - { - } - - - /** - * Called after activity has been recreated, and the dialogs should be - * reattached to their controllers. - */ - public void reattachDialogs() - { - } - - /** - * Sets the menu to be shown by this screen. - *

- * This menu will be visible if when there is no active selection operation. - * If the provided menu is null, then no menu will be shown. - * - * @param menu the menu to be shown. - */ - public void setMenu(@Nullable BaseMenu menu) - { - activity.setBaseMenu(menu); - } - - /** - * Sets the root view for this screen. - * - * @param rootView the root view for this screen. - */ - public void setRootView(@Nullable BaseRootView rootView) - { - this.rootView = rootView; - activity.setContentView(rootView); - if (rootView == null) return; - rootView.onAttachedToScreen(this); - invalidateToolbar(); - } - - /** - * Sets the menu to be shown when a selection is active on the screen. - * - * @param menu the menu to be shown during a selection - */ - public void setSelectionMenu(@Nullable BaseSelectionMenu menu) - { - this.selectionMenu = menu; - } - - /** - * Shows a message on the screen. - * - * @param stringId the string resource id for this message. - */ - public void showMessage(@StringRes Integer stringId) - { - if (stringId == null || rootView == null) return; - if (snackbar == null) - { - snackbar = Snackbar.make(rootView, stringId, Snackbar.LENGTH_SHORT); - int tvId = R.id.snackbar_text; - TextView tv = (TextView) snackbar.getView().findViewById(tvId); - tv.setTextColor(Color.WHITE); - } - else snackbar.setText(stringId); - snackbar.show(); - } - - public void showSendEmailScreen(@StringRes int toId, - @StringRes int subjectId, - String content) - { - String to = activity.getString(toId); - String subject = activity.getString(subjectId); - - Intent intent = new Intent(); - intent.setAction(Intent.ACTION_SEND); - intent.setType("message/rfc822"); - intent.putExtra(Intent.EXTRA_EMAIL, new String[]{ to }); - intent.putExtra(Intent.EXTRA_SUBJECT, subject); - intent.putExtra(Intent.EXTRA_TEXT, content); - activity.startActivity(intent); - } - - public void showSendFileScreen(@NonNull String archiveFilename) - { - File file = new File(archiveFilename); - Uri fileUri = getUriForFile(activity, "org.isoron.uhabits", file); - - Intent intent = new Intent(); - intent.setAction(Intent.ACTION_SEND); - intent.setType("application/zip"); - intent.putExtra(Intent.EXTRA_STREAM, fileUri); - intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - activity.startActivity(intent); - } - - /** - * Instructs the screen to start a selection. - *

- * If a selection menu was provided, this menu will be shown instead of the - * regular one. - */ - public void startSelection() - { - activity.startSupportActionMode(new ActionModeWrapper()); - } - - private void setActionBarColor(@NonNull ActionBar actionBar, int color) - { - ColorDrawable drawable = new ColorDrawable(color); - actionBar.setBackgroundDrawable(drawable); - } - - private void setStatusBarColor(int baseColor) - { - if (SDK_INT < LOLLIPOP) return; - - int darkerColor = ColorUtils.mixColors(baseColor, Color.BLACK, 0.75f); - activity.getWindow().setStatusBarColor(darkerColor); - } - - private class ActionModeWrapper implements ActionMode.Callback - { - @Override - public boolean onActionItemClicked(@Nullable ActionMode mode, - @Nullable MenuItem item) - { - if (item == null || selectionMenu == null) return false; - return selectionMenu.onItemClicked(item); - } - - @Override - public boolean onCreateActionMode(@Nullable ActionMode mode, - @Nullable Menu menu) - { - if (selectionMenu == null) return false; - if (mode == null || menu == null) return false; - selectionMenu.onCreate(activity.getMenuInflater(), mode, menu); - return true; - } - - @Override - public void onDestroyActionMode(@Nullable ActionMode mode) - { - if (selectionMenu == null) return; - selectionMenu.onFinish(); - } - - @Override - public boolean onPrepareActionMode(@Nullable ActionMode mode, - @Nullable Menu menu) - { - if (selectionMenu == null || menu == null) return false; - return selectionMenu.onPrepare(menu); - } - } -} diff --git a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseScreen.kt b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseScreen.kt new file mode 100644 index 000000000..443344e87 --- /dev/null +++ b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseScreen.kt @@ -0,0 +1,234 @@ +/* + * Copyright (C) 2016 Álinson Santos Xavier + * + * 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 . + */ +package org.isoron.androidbase.activities + +import android.content.* +import android.graphics.* +import android.graphics.drawable.* +import android.view.* +import android.widget.* +import androidx.annotation.* +import androidx.appcompat.app.* +import androidx.appcompat.view.ActionMode +import androidx.appcompat.widget.Toolbar +import androidx.core.content.* +import com.google.android.material.snackbar.* +import org.isoron.androidbase.* +import org.isoron.androidbase.utils.* +import org.isoron.androidbase.utils.ColorUtils.mixColors +import org.isoron.androidbase.utils.InterfaceUtils.dpToPixels +import java.io.* + +/** + * Base class for all screens in the application. + * + * Screens are responsible for deciding what root views and what menus should be attached to the + * main window. They are also responsible for showing other screens and for receiving their results. + */ +open class BaseScreen(@JvmField protected var activity: BaseActivity) { + + private var rootView: BaseRootView? = null + private var selectionMenu: BaseSelectionMenu? = null + private var snackbar: Snackbar? = null + + /** + * Notifies the screen that its contents should be updated. + */ + fun invalidate() { + rootView?.invalidate() + } + + fun invalidateToolbar() { + rootView?.let { root -> + activity.runOnUiThread { + val toolbar = root.getToolbar() + activity.setSupportActionBar(toolbar) + activity.supportActionBar?.let { actionBar -> + actionBar.setDisplayHomeAsUpEnabled(root.displayHomeAsUp) + val color = root.getToolbarColor() + setActionBarColor(actionBar, color) + setStatusBarColor(color) + } + } + } + } + + /** + * Called when another Activity has finished, and has returned some result. + * + * @param requestCode the request code originally supplied to startActivityForResult. + * @param resultCode the result code sent by the other activity. + * @param data an Intent containing extra data sent by the other + * activity. + * @see {@link android.app.Activity.onActivityResult + */ + open fun onResult(requestCode: Int, resultCode: Int, data: Intent?) {} + + /** + * Called after activity has been recreated, and the dialogs should be + * reattached to their controllers. + */ + open fun reattachDialogs() {} + + /** + * Sets the menu to be shown by this screen. + * + * + * This menu will be visible if when there is no active selection operation. + * If the provided menu is null, then no menu will be shown. + * + * @param menu the menu to be shown. + */ + fun setMenu(menu: BaseMenu?) { + activity.setBaseMenu(menu) + } + + /** + * Sets the root view for this screen. + * + * @param rootView the root view for this screen. + */ + fun setRootView(rootView: BaseRootView?) { + this.rootView = rootView + activity.setContentView(rootView) + rootView?.let { + it.onAttachedToScreen(this) + invalidateToolbar() + } + } + + /** + * Sets the menu to be shown when a selection is active on the screen. + * + * @param menu the menu to be shown during a selection + */ + fun setSelectionMenu(menu: BaseSelectionMenu?) { + selectionMenu = menu + } + + /** + * Shows a message on the screen. + * + * @param stringId the string resource id for this message. + */ + fun showMessage(@StringRes stringId: Int?) { + val rootView = this.rootView + var snackbar = this.snackbar + if (stringId == null || rootView == null) return + if (snackbar == null) { + snackbar = Snackbar.make(rootView, stringId, Snackbar.LENGTH_SHORT) + val tvId = R.id.snackbar_text + val tv = snackbar.view.findViewById(tvId) + tv.setTextColor(Color.WHITE) + this.snackbar = snackbar + } + snackbar.setText(stringId) + snackbar.show() + } + + fun showSendEmailScreen(@StringRes toId: Int, @StringRes subjectId: Int, content: String?) { + val to = activity.getString(toId) + val subject = activity.getString(subjectId) + activity.startActivity(Intent().apply { + action = Intent.ACTION_SEND + type = "message/rfc822" + putExtra(Intent.EXTRA_EMAIL, arrayOf(to)) + putExtra(Intent.EXTRA_SUBJECT, subject) + putExtra(Intent.EXTRA_TEXT, content) + }) + } + + fun showSendFileScreen(archiveFilename: String) { + val file = File(archiveFilename) + val fileUri = FileProvider.getUriForFile(activity, "org.isoron.uhabits", file) + activity.startActivity(Intent().apply { + action = Intent.ACTION_SEND + type = "application/zip" + putExtra(Intent.EXTRA_STREAM, fileUri) + flags = Intent.FLAG_GRANT_READ_URI_PERMISSION + }) + } + + /** + * Instructs the screen to start a selection. + * + * If a selection menu was provided, this menu will be shown instead of the regular one. + */ + fun startSelection() { + activity.startSupportActionMode(ActionModeWrapper()) + } + + private fun setActionBarColor(actionBar: ActionBar, color: Int) { + val drawable = ColorDrawable(color) + actionBar.setBackgroundDrawable(drawable) + } + + private fun setStatusBarColor(baseColor: Int) { + val darkerColor = mixColors(baseColor, Color.BLACK, 0.75f) + activity.window.statusBarColor = darkerColor + } + + private inner class ActionModeWrapper : ActionMode.Callback { + override fun onActionItemClicked(mode: ActionMode?, item: MenuItem?): Boolean { + val selectionMenu = selectionMenu + if (item == null || selectionMenu == null) return false + return selectionMenu.onItemClicked(item) + } + + override fun onCreateActionMode(mode: ActionMode?, menu: Menu?): Boolean { + if (mode == null || menu == null) return false + val selectionMenu = selectionMenu ?: return false + selectionMenu.onCreate(activity.menuInflater, mode, menu) + return true + } + + override fun onDestroyActionMode(mode: ActionMode?) { + selectionMenu?.onFinish() + } + + override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?): Boolean { + val selectionMenu = selectionMenu + if (selectionMenu == null || menu == null) return false + return selectionMenu.onPrepare(menu) + } + } + + companion object { + @JvmStatic + @Deprecated("") + fun getDefaultActionBarColor(context: Context) = + StyledResources(context).getColor(R.attr.colorPrimary) + + @JvmStatic + @Deprecated("") + fun setupActionBarColor(activity: AppCompatActivity, color: Int) { + val toolbar = activity.findViewById(R.id.toolbar) ?: return + activity.setSupportActionBar(toolbar) + val supportActionBar = activity.supportActionBar ?: return + supportActionBar.setDisplayHomeAsUpEnabled(true) + val drawable = ColorDrawable(color) + supportActionBar.setBackgroundDrawable(drawable) + val darkerColor = mixColors(color, Color.BLACK, 0.75f) + activity.window.statusBarColor = darkerColor + toolbar.elevation = dpToPixels(activity, 2f) + activity.findViewById(R.id.toolbarShadow)?.visibility = View.GONE + activity.findViewById(R.id.headerShadow)?.visibility = View.GONE + } + } +} \ No newline at end of file From 978946baabacc6b88ab7469d01802e365947feea Mon Sep 17 00:00:00 2001 From: olegivo Date: Sat, 15 Aug 2020 11:38:41 -0500 Subject: [PATCH 03/49] Konvert BaseSelectionMenu Co-authored-by: Alinson S. Xavier --- ...electionMenu.java => BaseSelectionMenu.kt} | 75 +++++++------------ 1 file changed, 26 insertions(+), 49 deletions(-) rename android/android-base/src/main/java/org/isoron/androidbase/activities/{BaseSelectionMenu.java => BaseSelectionMenu.kt} (65%) diff --git a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseSelectionMenu.java b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseSelectionMenu.kt similarity index 65% rename from android/android-base/src/main/java/org/isoron/androidbase/activities/BaseSelectionMenu.java rename to android/android-base/src/main/java/org/isoron/androidbase/activities/BaseSelectionMenu.kt index a1b486555..5d4b9af11 100644 --- a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseSelectionMenu.java +++ b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseSelectionMenu.kt @@ -16,50 +16,43 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ +package org.isoron.androidbase.activities -package org.isoron.androidbase.activities; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.view.ActionMode; -import android.view.*; +import android.view.* +import androidx.appcompat.view.ActionMode /** * Base class for all the selection menus in the application. - *

+ * * A selection menu is a menu that appears when the screen starts a selection * operation. It contains actions that modify the selected items, such as delete * or archive. Since it replaces the toolbar, it also has a title. - *

+ * * This class hides many implementation details of creating such menus in - * Android. The interface is supposed to look very similar to {@link BaseMenu}, + * Android. The interface is supposed to look very similar to [BaseMenu], * with a few additional methods, such as finishing the selection operation. - * Internally, it uses an {@link ActionMode}. + * Internally, it uses an [ActionMode]. */ -public abstract class BaseSelectionMenu -{ - @Nullable - private ActionMode actionMode; +abstract class BaseSelectionMenu { + private var actionMode: ActionMode? = null /** * Finishes the selection operation. */ - public void finish() - { - if (actionMode != null) actionMode.finish(); + fun finish() { + actionMode?.finish() } /** * Declare that the menu has changed, and should be recreated. */ - public void invalidate() - { - if (actionMode != null) actionMode.invalidate(); + fun invalidate() { + actionMode?.invalidate() } /** * Called when the menu is first displayed. - *

+ * * This method should not be overridden. The application should override * the methods onCreate(Menu) and getMenuResourceId instead. * @@ -67,22 +60,16 @@ public abstract class BaseSelectionMenu * @param mode the action mode associated with this menu. * @param menu the menu that is being created. */ - public void onCreate(@NonNull MenuInflater inflater, - @NonNull ActionMode mode, - @NonNull Menu menu) - { - this.actionMode = mode; - inflater.inflate(getResourceId(), menu); - onCreate(menu); + fun onCreate(inflater: MenuInflater, mode: ActionMode, menu: Menu) { + actionMode = mode + inflater.inflate(getResourceId(), menu) + onCreate(menu) } /** * Called when the selection operation is about to finish. */ - public void onFinish() - { - - } + open fun onFinish() {} /** * Called whenever an item on the menu is selected. @@ -90,11 +77,7 @@ public abstract class BaseSelectionMenu * @param item the item that was selected. * @return true if the event was consumed, or false otherwise */ - public boolean onItemClicked(@NonNull MenuItem item) - { - return false; - } - + open fun onItemClicked(item: MenuItem): Boolean = false /** * Called whenever the menu is invalidated. @@ -102,29 +85,23 @@ public abstract class BaseSelectionMenu * @param menu the menu to be refreshed * @return true if the menu has changes, false otherwise */ - public boolean onPrepare(@NonNull Menu menu) - { - return false; - } + open fun onPrepare(menu: Menu): Boolean = false /** * Sets the title of the selection menu. * * @param title the new title. */ - public void setTitle(String title) - { - if (actionMode != null) actionMode.setTitle(title); + fun setTitle(title: String?) { + actionMode?.title = title } - protected abstract int getResourceId(); + protected abstract fun getResourceId(): Int /** * Called when the menu is first created. * * @param menu the menu being created */ - protected void onCreate(@NonNull Menu menu) - { - } -} + protected fun onCreate(menu: Menu) {} +} \ No newline at end of file From b76882dd1de05b11b654ab018fdc25ed16868cb3 Mon Sep 17 00:00:00 2001 From: olegivo Date: Sat, 15 Aug 2020 11:41:19 -0500 Subject: [PATCH 04/49] Konvert BaseMenu Co-authored-by: Alinson S. Xavier --- .../activities/{BaseMenu.java => BaseMenu.kt} | 59 ++++++------------- 1 file changed, 18 insertions(+), 41 deletions(-) rename android/android-base/src/main/java/org/isoron/androidbase/activities/{BaseMenu.java => BaseMenu.kt} (70%) diff --git a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseMenu.java b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseMenu.kt similarity index 70% rename from android/android-base/src/main/java/org/isoron/androidbase/activities/BaseMenu.java rename to android/android-base/src/main/java/org/isoron/androidbase/activities/BaseMenu.kt index c5113a3fa..337b906dc 100644 --- a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseMenu.java +++ b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseMenu.kt @@ -16,71 +16,50 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ +package org.isoron.androidbase.activities -package org.isoron.androidbase.activities; - -import android.view.*; - -import androidx.annotation.MenuRes; -import androidx.annotation.NonNull; +import android.view.* +import androidx.annotation.* /** * Base class for all the menus in the application. - *

+ * * This class receives from BaseActivity all callbacks related to menus, such as * menu creation and click events. It also handles some implementation details * of creating menus in Android, such as inflating the resources. */ -public abstract class BaseMenu -{ - @NonNull - private final BaseActivity activity; - - public BaseMenu(@NonNull BaseActivity activity) - { - this.activity = activity; - } - - @NonNull - public BaseActivity getActivity() - { - return activity; - } +abstract class BaseMenu(private val activity: BaseActivity) { /** * Declare that the menu has changed, and should be recreated. */ - public void invalidate() - { - activity.invalidateOptionsMenu(); + fun invalidate() { + activity.invalidateOptionsMenu() } /** * Called when the menu is first displayed. - *

+ * * The given menu is already inflated and ready to receive items. The * application should override this method and add items to the menu here. * * @param menu the menu that is being created. */ - public void onCreate(@NonNull Menu menu) - { - } + open fun onCreate(menu: Menu) {} /** * Called when the menu is first displayed. - *

+ * * This method should not be overridden. The application should override * the methods onCreate(Menu) and getMenuResourceId instead. * * @param inflater a menu inflater, for creating the menu * @param menu the menu that is being created. */ - public void onCreate(@NonNull MenuInflater inflater, @NonNull Menu menu) - { - menu.clear(); - inflater.inflate(getMenuResourceId(), menu); - onCreate(menu); + fun onCreate(inflater: MenuInflater, menu: Menu) { + menu.clear() + inflater.inflate(getMenuResourceId(), menu) + onCreate(menu) } /** @@ -89,10 +68,7 @@ public abstract class BaseMenu * @param item the item that was selected. * @return true if the event was consumed, or false otherwise */ - public boolean onItemSelected(@NonNull MenuItem item) - { - return false; - } + open fun onItemSelected(item: MenuItem): Boolean = false /** * Returns the id of the resource that should be used to inflate this menu. @@ -100,5 +76,6 @@ public abstract class BaseMenu * @return id of the menu resource. */ @MenuRes - protected abstract int getMenuResourceId(); -} + protected abstract fun getMenuResourceId(): Int + +} \ No newline at end of file From acb5051eecaaa1646191f7236a22527937628f67 Mon Sep 17 00:00:00 2001 From: olegivo Date: Sat, 15 Aug 2020 11:46:13 -0500 Subject: [PATCH 05/49] Konvert BaseActivity Co-authored-by: Alinson S. Xavier --- .../androidbase/activities/BaseActivity.java | 129 ------------------ .../androidbase/activities/BaseActivity.kt | 96 +++++++++++++ 2 files changed, 96 insertions(+), 129 deletions(-) delete mode 100644 android/android-base/src/main/java/org/isoron/androidbase/activities/BaseActivity.java create mode 100644 android/android-base/src/main/java/org/isoron/androidbase/activities/BaseActivity.kt diff --git a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseActivity.java b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseActivity.java deleted file mode 100644 index 2dea22e50..000000000 --- a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseActivity.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2016 Álinson Santos Xavier - * - * 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 . - */ - -package org.isoron.androidbase.activities; - -import android.content.*; -import android.os.*; - -import androidx.annotation.Nullable; -import androidx.appcompat.app.*; -import android.view.*; - -import org.isoron.androidbase.*; - -import static android.R.anim.fade_in; -import static android.R.anim.fade_out; - -/** - * Base class for all activities in the application. - *

- * This class delegates the responsibilities of an Android activity to other - * classes. For example, callbacks related to menus are forwarded to a {@link - * BaseMenu}, while callbacks related to activity results are forwarded to a - * {@link BaseScreen}. - *

- * A BaseActivity also installs an {@link java.lang.Thread.UncaughtExceptionHandler} - * to the main thread. By default, this handler is an instance of - * BaseExceptionHandler, which logs the exception to the disk before the application - * crashes. To the default handler, you should override the method - * getExceptionHandler. - */ -abstract public class BaseActivity extends AppCompatActivity -{ - @Nullable - private BaseMenu baseMenu; - - @Nullable - private BaseScreen screen; - - @Override - public boolean onCreateOptionsMenu(@Nullable Menu menu) - { - if (menu == null) return true; - if (baseMenu == null) return true; - baseMenu.onCreate(getMenuInflater(), menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(@Nullable MenuItem item) - { - if (item == null) return false; - if (baseMenu == null) return false; - return baseMenu.onItemSelected(item); - } - - public void restartWithFade(Class cls) - { - new Handler().postDelayed(() -> - { - finish(); - overridePendingTransition(fade_in, fade_out); - startActivity(new Intent(this, cls)); - - }, 500); // HACK: Let the menu disappear first - } - - public void setBaseMenu(@Nullable BaseMenu baseMenu) - { - this.baseMenu = baseMenu; - } - - public void setScreen(@Nullable BaseScreen screen) - { - this.screen = screen; - } - - public void showDialog(AppCompatDialogFragment dialog, String tag) - { - dialog.show(getSupportFragmentManager(), tag); - } - - public void showDialog(AppCompatDialog dialog) - { - dialog.show(); - } - - @Override - protected void onActivityResult(int request, int result, Intent data) - { - if (screen == null) super.onActivityResult(request, result, data); - else screen.onResult(request, result, data); - } - - @Override - protected void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - Thread.setDefaultUncaughtExceptionHandler(getExceptionHandler()); - } - - protected Thread.UncaughtExceptionHandler getExceptionHandler() - { - return new BaseExceptionHandler(this); - } - - @Override - protected void onResume() - { - super.onResume(); - if(screen != null) screen.reattachDialogs(); - } -} diff --git a/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseActivity.kt b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseActivity.kt new file mode 100644 index 000000000..efb68c278 --- /dev/null +++ b/android/android-base/src/main/java/org/isoron/androidbase/activities/BaseActivity.kt @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2016 Álinson Santos Xavier + * + * 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 . + */ +package org.isoron.androidbase.activities + +import android.R.anim +import android.content.* +import android.os.* +import android.view.* +import androidx.appcompat.app.* +import org.isoron.androidbase.* + +/** + * Base class for all activities in the application. + * + * This class delegates the responsibilities of an Android activity to other classes. For example, + * callbacks related to menus are forwarded to a []BaseMenu], while callbacks related to activity + * results are forwarded to a [BaseScreen]. + * + * + * A BaseActivity also installs an [java.lang.Thread.UncaughtExceptionHandler] to the main thread. + * By default, this handler is an instance of BaseExceptionHandler, which logs the exception to the + * disk before the application crashes. To the default handler, you should override the method + * getExceptionHandler. + */ +abstract class BaseActivity : AppCompatActivity() { + private var baseMenu: BaseMenu? = null + private var screen: BaseScreen? = null + + override fun onCreateOptionsMenu(menu: Menu?): Boolean { + if (menu != null) baseMenu?.onCreate(menuInflater, menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem?): Boolean { + if (item == null) return false + return baseMenu?.onItemSelected(item) ?: false + } + + fun restartWithFade(cls: Class<*>?) { + Handler().postDelayed({ + finish() + overridePendingTransition(anim.fade_in, anim.fade_out) + startActivity(Intent(this, cls)) + }, 500) // HACK: Let the menu disappear first + } + + fun setBaseMenu(baseMenu: BaseMenu?) { + this.baseMenu = baseMenu + } + + fun setScreen(screen: BaseScreen?) { + this.screen = screen + } + + fun showDialog(dialog: AppCompatDialogFragment, tag: String?) { + dialog.show(supportFragmentManager, tag) + } + + fun showDialog(dialog: AppCompatDialog) { + dialog.show() + } + + override fun onActivityResult(request: Int, result: Int, data: Intent?) { + val screen = screen + if(screen == null) super.onActivityResult(request, result, data) + else screen.onResult(request, result, data) + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + Thread.setDefaultUncaughtExceptionHandler(getExceptionHandler()) + } + + private fun getExceptionHandler() = BaseExceptionHandler(this) + + override fun onResume() { + super.onResume() + screen?.reattachDialogs() + } +} \ No newline at end of file From 3e99d821a5bef90f3ce4c71303f61fc16df51b33 Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Sat, 15 Aug 2020 12:29:49 -0500 Subject: [PATCH 06/49] Allow user to sort habits in reverse order Closes #556, closes #497 --- .../list/views/HabitCardListAdapter.java | 6 ++++ .../isoron/uhabits/core/models/HabitList.java | 9 ++++-- .../core/models/memory/MemoryHabitList.java | 32 +++++++++++++------ .../habits/list/ListHabitsMenuBehavior.java | 20 ++++++++++-- .../uhabits/core/models/HabitListTest.java | 18 +++++++++-- .../core/preferences/PreferencesTest.java | 4 +-- .../list/ListHabitsMenuBehaviorTest.java | 6 ++-- 7 files changed, 71 insertions(+), 24 deletions(-) diff --git a/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/views/HabitCardListAdapter.java b/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/views/HabitCardListAdapter.java index ad4f8013e..62394690e 100644 --- a/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/views/HabitCardListAdapter.java +++ b/android/uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/views/HabitCardListAdapter.java @@ -319,6 +319,12 @@ public class HabitCardListAdapter preferences.setDefaultOrder(order); } + @Override + public HabitList.Order getOrder() + { + return cache.getOrder(); + } + /** * Selects or deselects the item at a given position. * diff --git a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/models/HabitList.java b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/models/HabitList.java index 84916f322..436016664 100644 --- a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/models/HabitList.java +++ b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/models/HabitList.java @@ -244,9 +244,12 @@ public abstract class HabitList implements Iterable public enum Order { - BY_NAME, - BY_COLOR, - BY_SCORE, + BY_NAME_ASC, + BY_NAME_DESC, + BY_COLOR_ASC, + BY_COLOR_DESC, + BY_SCORE_ASC, + BY_SCORE_DESC, BY_POSITION } } diff --git a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/models/memory/MemoryHabitList.java b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/models/memory/MemoryHabitList.java index 80a6d514a..7dd31a65f 100644 --- a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/models/memory/MemoryHabitList.java +++ b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/models/memory/MemoryHabitList.java @@ -120,37 +120,49 @@ public class MemoryHabitList extends HabitList private Comparator getComparatorByOrder(Order order) { - Comparator nameComparator = - (h1, h2) -> h1.getName().compareTo(h2.getName()); + Comparator nameComparatorAsc = + (h1, h2) -> h1.getName().compareTo(h2.getName()); - Comparator colorComparator = (h1, h2) -> + Comparator nameComparatorDesc = + (h1, h2) -> nameComparatorAsc.compare(h2, h1); + + Comparator colorComparatorAsc = (h1, h2) -> { Integer c1 = h1.getColor(); Integer c2 = h2.getColor(); - if (c1.equals(c2)) return nameComparator.compare(h1, h2); + if (c1.equals(c2)) return nameComparatorAsc.compare(h1, h2); else return c1.compareTo(c2); }; - Comparator scoreComparator = (h1, h2) -> + Comparator colorComparatorDesc = + (h1, h2) -> colorComparatorAsc.compare(h2, h1); + + Comparator scoreComparatorDesc = (h1, h2) -> { Double s1 = h1.getScores().getTodayValue(); Double s2 = h2.getScores().getTodayValue(); - if (s1.equals(s2)) return nameComparator.compare(h1, h2); + if (s1.equals(s2)) return nameComparatorAsc.compare(h1, h2); else return s2.compareTo(s1); }; + Comparator scoreComparatorAsc = + (h1, h2) -> scoreComparatorDesc.compare(h2, h1); + Comparator positionComparator = (h1, h2) -> { Integer p1 = h1.getPosition(); Integer p2 = h2.getPosition(); - if (p1.equals(p2)) return nameComparator.compare(h1, h2); + if (p1.equals(p2)) return nameComparatorAsc.compare(h1, h2); else return p1.compareTo(p2); }; if (order == BY_POSITION) return positionComparator; - if (order == BY_NAME) return nameComparator; - if (order == BY_COLOR) return colorComparator; - if (order == BY_SCORE) return scoreComparator; + if (order == BY_NAME_ASC) return nameComparatorAsc; + if (order == BY_NAME_DESC) return nameComparatorDesc; + if (order == BY_COLOR_ASC) return colorComparatorAsc; + if (order == BY_COLOR_DESC) return colorComparatorDesc; + if (order == BY_SCORE_DESC) return scoreComparatorDesc; + if (order == BY_SCORE_ASC) return scoreComparatorAsc; throw new IllegalStateException(); } diff --git a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehavior.java b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehavior.java index 9714a7522..ad0607a4c 100644 --- a/android/uhabits-core/src/main/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehavior.java +++ b/android/uhabits-core/src/main/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehavior.java @@ -97,7 +97,11 @@ public class ListHabitsMenuBehavior public void onSortByColor() { - adapter.setOrder(HabitList.Order.BY_COLOR); + if (adapter.getOrder() != HabitList.Order.BY_COLOR_ASC) { + adapter.setOrder(HabitList.Order.BY_COLOR_ASC); + } else { + adapter.setOrder(HabitList.Order.BY_COLOR_DESC); + } } public void onSortByManually() @@ -107,12 +111,20 @@ public class ListHabitsMenuBehavior public void onSortByScore() { - adapter.setOrder(HabitList.Order.BY_SCORE); + if (adapter.getOrder() != HabitList.Order.BY_SCORE_DESC) { + adapter.setOrder(HabitList.Order.BY_SCORE_DESC); + } else { + adapter.setOrder(HabitList.Order.BY_SCORE_ASC); + } } public void onSortByName() { - adapter.setOrder(HabitList.Order.BY_NAME); + if (adapter.getOrder() != HabitList.Order.BY_NAME_ASC) { + adapter.setOrder(HabitList.Order.BY_NAME_ASC); + } else { + adapter.setOrder(HabitList.Order.BY_NAME_DESC); + } } public void onToggleNightMode() @@ -137,6 +149,8 @@ public class ListHabitsMenuBehavior void setFilter(HabitMatcher build); void setOrder(HabitList.Order order); + + HabitList.Order getOrder(); } public interface Screen diff --git a/android/uhabits-core/src/test/java/org/isoron/uhabits/core/models/HabitListTest.java b/android/uhabits-core/src/test/java/org/isoron/uhabits/core/models/HabitListTest.java index a7b490b24..da482150a 100644 --- a/android/uhabits-core/src/test/java/org/isoron/uhabits/core/models/HabitListTest.java +++ b/android/uhabits-core/src/test/java/org/isoron/uhabits/core/models/HabitListTest.java @@ -144,7 +144,13 @@ public class HabitListTest extends BaseUnitTest assertThat(list.getByPosition(2), equalTo(h4)); assertThat(list.getByPosition(3), equalTo(h2)); - list.setOrder(BY_NAME); + list.setOrder(BY_NAME_DESC); + assertThat(list.getByPosition(0), equalTo(h4)); + assertThat(list.getByPosition(1), equalTo(h3)); + assertThat(list.getByPosition(2), equalTo(h2)); + assertThat(list.getByPosition(3), equalTo(h1)); + + list.setOrder(BY_NAME_ASC); assertThat(list.getByPosition(0), equalTo(h1)); assertThat(list.getByPosition(1), equalTo(h2)); assertThat(list.getByPosition(2), equalTo(h3)); @@ -154,12 +160,18 @@ public class HabitListTest extends BaseUnitTest list.add(h1); assertThat(list.getByPosition(0), equalTo(h1)); - list.setOrder(BY_COLOR); + list.setOrder(BY_COLOR_ASC); assertThat(list.getByPosition(0), equalTo(h3)); assertThat(list.getByPosition(1), equalTo(h4)); assertThat(list.getByPosition(2), equalTo(h1)); assertThat(list.getByPosition(3), equalTo(h2)); + list.setOrder(BY_COLOR_DESC); + assertThat(list.getByPosition(0), equalTo(h2)); + assertThat(list.getByPosition(1), equalTo(h1)); + assertThat(list.getByPosition(2), equalTo(h4)); + assertThat(list.getByPosition(3), equalTo(h3)); + list.setOrder(BY_POSITION); assertThat(list.getByPosition(0), equalTo(h3)); assertThat(list.getByPosition(1), equalTo(h1)); @@ -284,7 +296,7 @@ public class HabitListTest extends BaseUnitTest @Test public void testReorder_onSortedList() throws Exception { - habitList.setOrder(BY_SCORE); + habitList.setOrder(BY_SCORE_DESC); Habit h1 = habitsArray.get(1); Habit h2 = habitsArray.get(2); thrown.expect(IllegalStateException.class); diff --git a/android/uhabits-core/src/test/java/org/isoron/uhabits/core/preferences/PreferencesTest.java b/android/uhabits-core/src/test/java/org/isoron/uhabits/core/preferences/PreferencesTest.java index b2f036cbc..f1011f583 100644 --- a/android/uhabits-core/src/test/java/org/isoron/uhabits/core/preferences/PreferencesTest.java +++ b/android/uhabits-core/src/test/java/org/isoron/uhabits/core/preferences/PreferencesTest.java @@ -77,8 +77,8 @@ public class PreferencesTest extends BaseUnitTest { assertThat(prefs.getDefaultOrder(), equalTo(HabitList.Order.BY_POSITION)); - prefs.setDefaultOrder(HabitList.Order.BY_SCORE); - assertThat(prefs.getDefaultOrder(), equalTo(HabitList.Order.BY_SCORE)); + prefs.setDefaultOrder(HabitList.Order.BY_SCORE_DESC); + assertThat(prefs.getDefaultOrder(), equalTo(HabitList.Order.BY_SCORE_DESC)); storage.putString("pref_default_order", "BOGUS"); assertThat(prefs.getDefaultOrder(), equalTo(HabitList.Order.BY_POSITION)); diff --git a/android/uhabits-core/src/test/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehaviorTest.java b/android/uhabits-core/src/test/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehaviorTest.java index 429878df5..a6191933d 100644 --- a/android/uhabits-core/src/test/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehaviorTest.java +++ b/android/uhabits-core/src/test/java/org/isoron/uhabits/core/ui/screens/habits/list/ListHabitsMenuBehaviorTest.java @@ -104,7 +104,7 @@ public class ListHabitsMenuBehaviorTest extends BaseUnitTest { behavior.onSortByColor(); verify(adapter).setOrder(orderCaptor.capture()); - assertThat(orderCaptor.getValue(), equalTo(BY_COLOR)); + assertThat(orderCaptor.getValue(), equalTo(BY_COLOR_ASC)); } @Test @@ -120,7 +120,7 @@ public class ListHabitsMenuBehaviorTest extends BaseUnitTest { behavior.onSortByScore(); verify(adapter).setOrder(orderCaptor.capture()); - assertThat(orderCaptor.getValue(), equalTo(BY_SCORE)); + assertThat(orderCaptor.getValue(), equalTo(BY_SCORE_DESC)); } @Test @@ -128,7 +128,7 @@ public class ListHabitsMenuBehaviorTest extends BaseUnitTest { behavior.onSortByName(); verify(adapter).setOrder(orderCaptor.capture()); - assertThat(orderCaptor.getValue(), equalTo(BY_NAME)); + assertThat(orderCaptor.getValue(), equalTo(BY_NAME_ASC)); } @Test From bae0e3bcc1da1a8cba2e7abb17e98fc8916766b0 Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Sat, 15 Aug 2020 12:45:34 -0500 Subject: [PATCH 07/49] Remove unused resources --- .../res/drawable/done_background_color.xml | 25 -------- .../drawable/done_background_color_dark.xml | 25 -------- .../res/layout/date_picker_header_view.xml | 26 -------- .../res/drawable-hdpi/ic_action_add_light.png | Bin 170 -> 0 bytes .../drawable-hdpi/ic_action_archive_light.png | Bin 393 -> 0 bytes .../ic_action_download_light.png | Bin 280 -> 0 bytes .../drawable-hdpi/ic_action_filter_light.png | Bin 107 -> 0 bytes .../ic_action_unarchive_light.png | Bin 410 -> 0 bytes .../res/drawable-mdpi/ic_action_add_light.png | Bin 111 -> 0 bytes .../drawable-mdpi/ic_action_archive_light.png | Bin 244 -> 0 bytes .../ic_action_download_light.png | Bin 236 -> 0 bytes .../drawable-mdpi/ic_action_filter_light.png | Bin 89 -> 0 bytes .../ic_action_unarchive_light.png | Bin 243 -> 0 bytes .../drawable-xhdpi/ic_action_add_light.png | Bin 140 -> 0 bytes .../ic_action_archive_light.png | Bin 390 -> 0 bytes .../ic_action_download_light.png | Bin 319 -> 0 bytes .../drawable-xhdpi/ic_action_filter_light.png | Bin 103 -> 0 bytes .../ic_action_unarchive_light.png | Bin 381 -> 0 bytes .../drawable-xxhdpi/ic_action_add_light.png | Bin 181 -> 0 bytes .../ic_action_archive_light.png | Bin 674 -> 0 bytes .../ic_action_download_light.png | Bin 397 -> 0 bytes .../ic_action_filter_light.png | Bin 112 -> 0 bytes .../ic_action_unarchive_light.png | Bin 683 -> 0 bytes .../drawable-xxxhdpi/ic_action_add_light.png | Bin 119 -> 0 bytes .../ic_action_filter_light.png | Bin 123 -> 0 bytes .../res/drawable/done_background_color.xml | 25 -------- .../drawable/done_background_color_dark.xml | 25 -------- .../src/main/res/layout/filter.xml | 31 ---------- .../res/layout/habit_checkbox_list_item.xml | 22 ------- .../src/main/res/layout/list_habits_hint.xml | 46 -------------- .../main/res/layout/show_habit_preview.xml | 30 ---------- .../stack_widget_configure_activity.xml | 40 ------------- .../src/main/res/layout/widget_empty.xml | 50 ---------------- .../src/main/res/values-af-rZA/strings.xml | 4 -- .../src/main/res/values-ar-rSA/strings.xml | 29 --------- .../src/main/res/values-bg-rBG/strings.xml | 29 --------- .../src/main/res/values-ca-rES/strings.xml | 29 --------- .../src/main/res/values-cs-rCZ/strings.xml | 29 --------- .../src/main/res/values-da-rDK/strings.xml | 29 --------- .../src/main/res/values-de-rDE/strings.xml | 29 --------- .../src/main/res/values-el-rGR/strings.xml | 29 --------- .../src/main/res/values-eo-rUY/strings.xml | 12 ---- .../src/main/res/values-es-rES/strings.xml | 35 ----------- .../src/main/res/values-eu-rES/strings.xml | 29 --------- .../src/main/res/values-fa-rIR/strings.xml | 29 --------- .../src/main/res/values-fi-rFI/strings.xml | 15 ----- .../src/main/res/values-fr-rFR/strings.xml | 31 ---------- .../src/main/res/values-hi-rIN/strings.xml | 40 ------------- .../src/main/res/values-hr-rHR/strings.xml | 29 --------- .../src/main/res/values-hu-rHU/strings.xml | 36 ----------- .../src/main/res/values-in-rID/strings.xml | 29 --------- .../src/main/res/values-it-rIT/strings.xml | 32 ---------- .../src/main/res/values-iw-rIL/strings.xml | 29 --------- .../src/main/res/values-ja-rJP/strings.xml | 35 ----------- .../src/main/res/values-ko-rKR/strings.xml | 29 --------- .../src/main/res/values-nl-rNL/strings.xml | 29 --------- .../src/main/res/values-no-rNO/strings.xml | 29 --------- .../src/main/res/values-pl-rPL/strings.xml | 29 --------- .../src/main/res/values-pt-rBR/strings.xml | 35 ----------- .../src/main/res/values-pt-rPT/strings.xml | 35 ----------- .../src/main/res/values-ro-rRO/strings.xml | 29 --------- .../src/main/res/values-ru-rRU/strings.xml | 35 ----------- .../src/main/res/values-sl-rSI/strings.xml | 29 --------- .../src/main/res/values-sr-rSP/strings.xml | 28 --------- .../src/main/res/values-sv-rSE/strings.xml | 29 --------- .../src/main/res/values-ta-rIN/strings.xml | 29 --------- .../src/main/res/values-tr-rTR/strings.xml | 29 --------- .../src/main/res/values-ug-rCN/strings.xml | 1 - .../src/main/res/values-uk-rUA/strings.xml | 35 ----------- .../res/values-v21/styles_list_habits.xml | 6 -- .../src/main/res/values-vi-rVN/strings.xml | 29 --------- .../src/main/res/values-zh-rCN/strings.xml | 29 --------- .../src/main/res/values-zh-rTW/strings.xml | 29 --------- .../src/main/res/values/constants.xml | 34 ----------- .../src/main/res/values/dimens.xml | 2 - .../src/main/res/values/fontawesome.xml | 12 +--- .../src/main/res/values/keys.xml | 3 - .../src/main/res/values/strings.xml | 41 ------------- .../src/main/res/values/styles.xml | 22 ------- .../src/main/res/values/styles_dialog.xml | 56 ------------------ .../main/res/values/styles_list_habits.xml | 12 ---- 81 files changed, 3 insertions(+), 1635 deletions(-) delete mode 100644 android/android-pickers/src/main/res/drawable/done_background_color.xml delete mode 100644 android/android-pickers/src/main/res/drawable/done_background_color_dark.xml delete mode 100644 android/android-pickers/src/main/res/layout/date_picker_header_view.xml delete mode 100644 android/uhabits-android/src/main/res/drawable-hdpi/ic_action_add_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-hdpi/ic_action_archive_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-hdpi/ic_action_download_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-hdpi/ic_action_filter_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-hdpi/ic_action_unarchive_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-mdpi/ic_action_add_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-mdpi/ic_action_archive_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-mdpi/ic_action_download_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-mdpi/ic_action_filter_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-mdpi/ic_action_unarchive_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_add_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_archive_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_download_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_filter_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_unarchive_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_add_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_archive_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_download_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_filter_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_unarchive_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xxxhdpi/ic_action_add_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable-xxxhdpi/ic_action_filter_light.png delete mode 100644 android/uhabits-android/src/main/res/drawable/done_background_color.xml delete mode 100644 android/uhabits-android/src/main/res/drawable/done_background_color_dark.xml delete mode 100644 android/uhabits-android/src/main/res/layout/filter.xml delete mode 100644 android/uhabits-android/src/main/res/layout/habit_checkbox_list_item.xml delete mode 100644 android/uhabits-android/src/main/res/layout/list_habits_hint.xml delete mode 100644 android/uhabits-android/src/main/res/layout/show_habit_preview.xml delete mode 100644 android/uhabits-android/src/main/res/layout/stack_widget_configure_activity.xml delete mode 100644 android/uhabits-android/src/main/res/layout/widget_empty.xml diff --git a/android/android-pickers/src/main/res/drawable/done_background_color.xml b/android/android-pickers/src/main/res/drawable/done_background_color.xml deleted file mode 100644 index 19a386134..000000000 --- a/android/android-pickers/src/main/res/drawable/done_background_color.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/android/android-pickers/src/main/res/drawable/done_background_color_dark.xml b/android/android-pickers/src/main/res/drawable/done_background_color_dark.xml deleted file mode 100644 index 1665eee3f..000000000 --- a/android/android-pickers/src/main/res/drawable/done_background_color_dark.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/android/android-pickers/src/main/res/layout/date_picker_header_view.xml b/android/android-pickers/src/main/res/layout/date_picker_header_view.xml deleted file mode 100644 index 5fd73ccc0..000000000 --- a/android/android-pickers/src/main/res/layout/date_picker_header_view.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - diff --git a/android/uhabits-android/src/main/res/drawable-hdpi/ic_action_add_light.png b/android/uhabits-android/src/main/res/drawable-hdpi/ic_action_add_light.png deleted file mode 100644 index 641e149895075c7ede8a0fbd475ad0da7186e42a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUtLQfaRkcwMxub<{@Fc5HXT)nZe zX4eL()f=O4HVd$PT-4Yi8FAuZ^ZAa0sf-K_yQ5x5dEHD(vW;=LQ*rKRN9R@sMkW@H z8R`pcm&{XJx+R`*W8Ln3uM@A^-Ce)zwH~j$!5{4>+A0nWKxNDRuViO4qH5Y=i=#Xr#=awz0GIp-=`u!USb=(T^KxBLQyf}sD_c_o6V(X^f2tnePpB_wa= z&AefiuZm0DM^wqNxIVvaDv-t@nu;KB-v*i z$6JZ15^Y~N=imf4au_MTs;UR+(hS{_WGjhxEei?Phw!fJNz9N-U4Rh3NNlvNbHPd* z5%sJtAc~@~>Ee%KtS+ElEvyJYE()Lk3g}Qk69)xQ!1-76Tds%y;0(dh^#s;`5rJn8 z`=8D&gf0d_@YpJ2lzHm6!Ocovzu&nN_ICPPc61)G~T%r#7~6aVzm- zr?$3naxa9g|EBZY%-#4Wp4bwATqY(E+7giGd0=7!k3zn*AYf4x#n8yv5Jc2V;za9A n=n&vU=ZzIl5ClOGgaPaU^vnc0GT^Z@00000NkvXXu0mjf|3InR_XO}LlV+LwIFn__;Z&T8h z=B;fAdX>>r`PXX?8ha^p{j;@?pgzi0igf49_cQS;naY>hE30@9jGH6>?F%hvG& cI*%db8Smcvg&cp^T1$htp00i_>zopr0HXDGX8-^I diff --git a/android/uhabits-android/src/main/res/drawable-hdpi/ic_action_filter_light.png b/android/uhabits-android/src/main/res/drawable-hdpi/ic_action_filter_light.png deleted file mode 100644 index a966cb9bd03131170190bceb9057938491e08f7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;k*AAeNCo5DGm3l+3L=Lu)PK2K z6(dWz6@&-RC`6Y)gifU*)TCiW4)t2FXm;2ua);ke1YA>Asd=;ph!PC{xWt~$( F69B-SBB1~P diff --git a/android/uhabits-android/src/main/res/drawable-hdpi/ic_action_unarchive_light.png b/android/uhabits-android/src/main/res/drawable-hdpi/ic_action_unarchive_light.png deleted file mode 100644 index 2cc3aa8fc6ba72d149861ff8207688acb34b3195..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 410 zcmV;L0cHM)P)+4|*z;+`Z)!C=?3y+xi})P=ZNRX17_L2LmCH zH}l&WHk*t_DwRs5QmGu1@B5cYlH_Tc-b)0%=xL?+APA;$9KRyzhh)%`-bRZrieijp z>nMtLh&v(M6L>z+liti>r1+|;PO(Z0t`?HLAs(bg2wsoyeXl#QU@mb07+)i{(xdam zC~X0CB@PgV;oNlb2Qe21sCNr10L-NT3h);Iu%na=Cjn6S%JaMn2Ctn0V8MvV!8>H~ z6NsY%aAdgZ&FAY*l!FG?k4>A$cgN`{0L`)KIFj^^lXZZ$vFYhVIS7EhvH8t7Spz@; z8{A(ukH=jejabrSaNB5`hcoX1=K(rC-t{o|e*v&t+}Z+QE)yNNu?3K2*~~--&SCyy z0pK~$^D`s=h6uqgDck}>yxGXJVXzipR~r9k?9%x9q0A4g&(l9a4@{s!YJ)vca*Djj~CDc22WQ% Jmvv4FO#nmHAj$v$ diff --git a/android/uhabits-android/src/main/res/drawable-mdpi/ic_action_archive_light.png b/android/uhabits-android/src/main/res/drawable-mdpi/ic_action_archive_light.png deleted file mode 100644 index 7e43bedd5f7a070be43cb9c5e2adf028f5dcf02c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ-JULvAr-fh6C_v{Cy4NrC1hl1 zq~_$@$xBKynk>R|Br>Du|$|;U3!n~Kbjhb`V8F)`9UVZ*T z;>CoVO|lGEY?_1E85Sp5sVW*wma4eIXi~_an$^CH*@3lt=FFJ}ina=-3R_J$8J+qL zq*-2F%rITKAkuHLNy9sinrWAH1P{qLo+z3%jai|aGtzDgx6*?5RVxA{ODDf&2o4Tr rp1?RIg3m|!*W$Cg0u8v>Oc@w%hIy{-i|E}3^ag{ctDnm{r-UW|?NC+U diff --git a/android/uhabits-android/src/main/res/drawable-mdpi/ic_action_download_light.png b/android/uhabits-android/src/main/res/drawable-mdpi/ic_action_download_light.png deleted file mode 100644 index 6f5078ee897c6d269a69c597d7c138125266e50f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ&7LlfAr-fh6C_v{Cx}eoaB_B@ z>FeWjWn46o@EAkSZotcGCBuJQa?;C0OFj1s zSBpg4FKFK=v`SLYUCz(Iwpqkr#_N*@7fhNc#Wz8Hu?S0YaBy&Bm+XQ?iw^O9=`^yG kSW>=)*OJTa-~x6Ag-dI8U+U|206L$+)78&qol`;+03)(gfdBvi diff --git a/android/uhabits-android/src/main/res/drawable-mdpi/ic_action_filter_light.png b/android/uhabits-android/src/main/res/drawable-mdpi/ic_action_filter_light.png deleted file mode 100644 index d86492b42df06096c171dc7b2cb2a893de183fb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*11y2{pkP60R1;(DH|1F9qrP{V# m*Sun|#l~NmcSeE;1A|e9^WOQ_&q)E*GI+ZBxvXR|Br>Du|$|;U3!n~Kbjhb`V8F)`9UVZ*T z;>CoVO|lGEY?_1E85Sp5sVW*wma6z+#W3ZPV}*kZ!=@W&&iF{Qa9TFK;%kWH3wA#t z7*fix>**1TrYyb#sg{cF0Y@2IbdEpgn5E+6b%l?gy{BiAz>FDHD*_}-C%?~LfL#b-2|K!#sAf>dF)T9XpMfOrDrh`L+h=)H5b0+y6;E4+6h9jfa4yU8QKdy5B!rcqu^rmB k_(?51000000021V7hypTWWL=dfB*mh07*qoM6N<$f-QNdga7~l diff --git a/android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_download_light.png b/android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_download_light.png deleted file mode 100644 index 67109515418d44b5082eef4b388801967e5d9e90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 319 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7T#lEU}W=jaSW-r^>)Tyz9s_^w@4Gc zeGSKEO0>0o+B`!-&0PMl>!SCMZ{Olm(UIU@xHIOQ=evj<_c`~f`U(Nf0D>9qCcfXV z-KzHZX`03Iq_R%q^e5qh-M_t`FIDwwLz@ z_cZ97-nMRKc*Y6Nt75Jj1;2_One?E^{%C8zs$hS%>;(aQ-^P?r}l-U;o<$_J1a@gfi=g9MU@c{l9RSw48(B zwOgB4yPqjq?ymLn(r2lUR%=#s1D(>cYL(wRoBc<1lFv+h$qn&?L6`o^C-qCXjSTZZ N0-mmZF6*2Ung9&NgmM4? diff --git a/android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_filter_light.png b/android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_filter_light.png deleted file mode 100644 index b64df3612a16d378c6cea2299ab28c16c39252b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 103 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tJx>?MkP61Pmkk9O9C(-xe$W4< z+^EJn^QP;8P@4v;`gEqsfM2hC7=F!@<&mdKI;Vst0N}G6 AdH?_b diff --git a/android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_unarchive_light.png b/android/uhabits-android/src/main/res/drawable-xhdpi/ic_action_unarchive_light.png deleted file mode 100644 index a258a9ff0c44481036dfac1141af6591d13aea2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 381 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7T#lEV07_xaSW-r^>*g@ye0>McGIor zFZ>ewq#t9ss?&Yaw>9Fg4@D~I0a@kafw(+&0g`)Yem>#4P=MT}>IHv}j>aCbhi zUXgL?vE%O(R|+&RuqZGvF65jLeCOa*9o8KW{M}z2Uc+M3{#{j3f-(1Dtp|tGf%=E- zUIzLPrhaf%nIU#TwI-f3jr9xXefK6$M(0E2Qxp6e`ai^~%n*8D{AaaLlO=n`U2#SZ z2ZsO5Amc0M@`i1m$Fs9?jv`}v@5LX>P4-I(6rBD1$2ryIoyrb#$7Jg($sadIRY1JY ZF~dG1k1xegR4@}H;OXk;vd$@?2>_)4o!I~Y diff --git a/android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_add_light.png b/android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_add_light.png deleted file mode 100644 index 96c3ec67bd503fc5b831f363d1340ed0d9931055..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoHJ&bxAr-gYUNhunaNuBZbeS7@ zr|zpPlgA9ta}2iwSb<6)pdfnEyk|yC91RRi3JnY#3Jl21H#T>+aRP;zI6y>&v!DY5 qivR;7ivt6r01&ev5is)@7#>vL{$a|joS*#yBV9NA#aSW-r^>)r_Z>B(z_N`3{ z8G_p~JTk5~-%I_U`@Dg9^NXeDUd*w+&n|wu z^4!mNe`9rxr!xbMMFzJ`W}jV|we?k~)>P$4|4*OOXHC1dWGkyP)ghnYLB&6+E*@6EENHLE>}`#;_A3GS7$ z40^op$~UoVD^0WCE^Ck15ldGM_E+BhI&{{pX>RG4!d71~(cdb2;&FA#<~bSsYVGkF zBFk*g-=4T^*Tl9ysorBTUf$=fzy8X)@}or&*REU5-;(lvTskrBU4{0}|EH^Tr=Om^ zOy!H--DvhU`E}BkoZ8d$?%B4t$sc>ZPLeU`&E96FcRF($)@3toQ8#9ak*?bz(7?c= zz`)4iz`z7!O3Y>GHboNq^CNuO>8Q2aY}Q$Q-MO{RXFh|hg8)nS;&p-ZH_v})E$jG; zaYdll3*P@N)(Jd?SMuMayb|)W>SODiduA_}msTHJ?_8gKJiXR^Z9tKI{2khTZ9tLz zg3@Mvk2>a_*)J?-()XxKwocU0LFTBWHOC9%zDIqsEMElOJ&*7){gZU}JPM?MykkJB zWATz?cE)-SiK`z34?J%IyZHdizW4hre&nw@pT^>`QJjyU<~neaSW-r_4d|YzrzM1Y!}{j zFd7=CJ5G$cKC|n{ffLLI8#jMGKl#J99YK;4qcopbowK|Yd;3}4zKy!2TbY2y06|0N z(>d#dyv`?I`M0^`i_7h|+qA#h29;WAF)%7%LniqWZKs`s`&Z5Rd^dto#_sit_xIkG ziJxV?Pt*th(7*ayZ|21P+Gn3##Pv;aO8cKRJASS|YgW%T`9j@iZN5ayv+LiM zZt1x0w|4S{FKyLc97_c!`#W*|%l&w^e-?}O|M#{Jvzw;=U-#2-a>7$~zozoK2PzRi z8^5=>&i|}EgXJtgkK<=%=L>%h2$>umF8#ve@QEuGh;`oWtH}TW diff --git a/android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_filter_light.png b/android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_filter_light.png deleted file mode 100644 index 2314642f936d4617377df066a4837b44b18a53ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 112 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhaw%spKkLo)8Yy|R&!fq{j^@VEY1 zE)kPS@efw@GcYu)w3(yeXy43W@jK74iG^{)mj_KOoJzG^v6L%NQOF98Gg2B_( K&t;ucLK6U<10nJN diff --git a/android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_unarchive_light.png b/android/uhabits-android/src/main/res/drawable-xxhdpi/ic_action_unarchive_light.png deleted file mode 100644 index b02809e8b4991be4df06fe0fdc424180428ed202..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 683 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>U@G!-aSW-r^>)tLY~e(K_Q_!a zT(%-C{zttH0{BnnZR%{7DY}$g-C41DIhSZvfFm~}^WK|Ye?4-4-7jO?wPDJ#th?pA zjo*JhFkyms+Ox{<+n2~^ngC5l1_#U@fBfON|Gt0K-g}K#_$%uImtUHeWz<5SX-Ri4VGgMAyOJ)U1yht#S%DuAX>9Ych8Xenx`Z28Ba~;zSx7SFfxcl#! zdT0OAXLs|;Z%=7iJ^S6p=BLlUhOTST^)|m3>wfzDW{GnJ?r zGwso}*Jn{+VB~OMU=nCx05QMoJJ`+j+bU4N&s6fU`QU?cF8+IS_dtuS#bm0FnzY`Wk`U}?F;1qRV$2vvUTJh0|wG9Cq zgUe)giU?Sho$668XIj-Yche({SMymT-!LK^+OVJ73GQY?4v))UrXQ{k{+sF6U{d`e z;DEY!_yO;Brnnh`3+{I)`R<>*?7XbbznHB3$L@bBQa-EVId26EJJYvPvAHV~dzQ_U z>Q$C}wE5lfGFfh2BS5;_BGhfpb^c5uG>FVdQ&MBb@0Bb@b A)Bpeg diff --git a/android/uhabits-android/src/main/res/drawable-xxxhdpi/ic_action_add_light.png b/android/uhabits-android/src/main/res/drawable-xxxhdpi/ic_action_add_light.png deleted file mode 100644 index 3cb10924a0912d9f64d338b9769da053bc051da6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeK3?y%aJ*@^(YymzYu0R?HmZtAK52P4Ng8YIR z9G=}s19Id&T^vIy7?T^C0uTIeOgX2~{@-4rW`SaRO?zLF8zVzTLHf)E76O$Z{hqFV JF6*2UngE2qAnO1C diff --git a/android/uhabits-android/src/main/res/drawable-xxxhdpi/ic_action_filter_light.png b/android/uhabits-android/src/main/res/drawable-xxxhdpi/ic_action_filter_light.png deleted file mode 100644 index 9319c4bb41a21feaae9739dc5ffa5ad3eb1fe5e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeK3?y%aJ*@^(YymzYu0R?HmZtAK52P4Ng8YIR z9G=}s19Fr-T^vIy7?Tx*dzk+H5BShHZO%bHg?CE~(>Yq0bS - - - - - - - - \ No newline at end of file diff --git a/android/uhabits-android/src/main/res/drawable/done_background_color_dark.xml b/android/uhabits-android/src/main/res/drawable/done_background_color_dark.xml deleted file mode 100644 index 1665eee3f..000000000 --- a/android/uhabits-android/src/main/res/drawable/done_background_color_dark.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/android/uhabits-android/src/main/res/layout/filter.xml b/android/uhabits-android/src/main/res/layout/filter.xml deleted file mode 100644 index 4f53105a2..000000000 --- a/android/uhabits-android/src/main/res/layout/filter.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/android/uhabits-android/src/main/res/layout/habit_checkbox_list_item.xml b/android/uhabits-android/src/main/res/layout/habit_checkbox_list_item.xml deleted file mode 100644 index e2c574ca8..000000000 --- a/android/uhabits-android/src/main/res/layout/habit_checkbox_list_item.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/android/uhabits-android/src/main/res/layout/list_habits_hint.xml b/android/uhabits-android/src/main/res/layout/list_habits_hint.xml deleted file mode 100644 index 11d86bd72..000000000 --- a/android/uhabits-android/src/main/res/layout/list_habits_hint.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/android/uhabits-android/src/main/res/layout/show_habit_preview.xml b/android/uhabits-android/src/main/res/layout/show_habit_preview.xml deleted file mode 100644 index a6c9317ed..000000000 --- a/android/uhabits-android/src/main/res/layout/show_habit_preview.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/android/uhabits-android/src/main/res/layout/stack_widget_configure_activity.xml b/android/uhabits-android/src/main/res/layout/stack_widget_configure_activity.xml deleted file mode 100644 index d5eb1a561..000000000 --- a/android/uhabits-android/src/main/res/layout/stack_widget_configure_activity.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - -