diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..1dc527e72a6822d9171abc9fb761699f89bf9192 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,30 @@ +image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:latest" + +stages: +- build + +before_script: +- if [ -d "/srv/userscripts" ]; then cp -R userscripts/* /srv/userscripts ; fi +- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' +- eval $(ssh-agent -s) +- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null +- mkdir -p ~/.ssh +- chmod 700 ~/.ssh +- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts +- chmod 644 ~/.ssh/known_hosts +- export GRADLE_USER_HOME=$(pwd)/.gradle +- chmod +x ./gradlew + +cache: + key: ${CI_PROJECT_ID} + paths: + - .gradle/ + +build: + stage: build + script: + - git submodule update --recursive --init + - ./gradlew build -x test + artifacts: + paths: + - app/build/outputs/apk/ diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..bcbdbb13f37884ca0e79c84f131d02e0303e6219 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +© e Foundation 2018-2019 - Author: Nihar Thakkar +© ECORP SAS 2018-2019 - Author: Romain Hunault \ No newline at end of file diff --git a/README.md b/README.md index c9bcdbd2bc7ef955afea47cb0626c35e3721d4a9..db30ed4891aa97faeabd1228799a8ae0d580b220 100644 --- a/README.md +++ b/README.md @@ -1,67 +1,21 @@ -# Nextcloud Notes for Android -An android client for [Nextcloud Notes App](https://github.com/nextcloud/notes/). +# Notes +An android client for [Nextcloud Notes App](https://github.com/nextcloud/notes/) +Notes is forked from [Nextcloud Notes](https://github.com/stefan-niedermann/nextcloud-notes) -[![Android CI](https://github.com/stefan-niedermann/nextcloud-notes/workflows/Android%20CI/badge.svg)](https://github.com/stefan-niedermann/nextcloud-notes/actions) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9f784826834042e8b512d531cab84711)](https://www.codacy.com/manual/info_147/nextcloud-notes?utm_source=github.com&utm_medium=referral&utm_content=stefan-niedermann/nextcloud-notes&utm_campaign=Badge_Grade) -[![GitHub issues](https://img.shields.io/github/issues/stefan-niedermann/nextcloud-notes.svg)](https://github.com/stefan-niedermann/nextcloud-notes/issues) -[![GitHub stars](https://img.shields.io/github/stars/stefan-niedermann/nextcloud-notes.svg)](https://github.com/stefan-niedermann/nextcloud-notes/stargazers) -[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) +## Authors -## :arrow_forward: Access +[Authors](https://gitlab.e.foundation/e/apps/Notes/-/blob/master/AUTHORS) -[![Latest Release](https://img.shields.io/github/v/tag/stefan-niedermann/nextcloud-notes?label=latest+release&sort=semver)](https://github.com/stefan-niedermann/nextcloud-notes/tags) -[![F-Droid Release](https://img.shields.io/f-droid/v/it.niedermann.owncloud.notes)](https://f-droid.org/de/packages/it.niedermann.owncloud.notes/) +## Release Notes -[Get it on Play Store](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes) -[Get it on F-Droid](https://f-droid.org/repository/browse/?fdid=it.niedermann.owncloud.notes) -[Donate with PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K7HVLE6J7SXXA) -[Donate using Liberapay](https://liberapay.com/stefan-niedermann/donate) +Check out the [Release Notes](https://gitlab.e.foundation/e/apps/Notes/-/releases) to find out what changed +in each version of Notes. -## :eyes: Screenshots +## Privacy Policy -| _ | _ | _ | -| :--: | :--: | :--: | -| ![Screenshot of list view](/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png) | ![Screenshot of edit mode](/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png) | ![Screenshot of preview](/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png) | +[Privacy Policy](https://e.foundation/legal-notice-privacy) +[Terms of service](https://e.foundation/legal-notice-privacy) -## :rocket: Features - * Multiple accounts - * List, create, edit, share, search and delete notes - * Share text and links as new note into the app - * Toggling checkboxes in view mode - * Mark notes as favorite - * Bulk delete - * In-note search - * Single note widget and note list widget - * Render Markdown (using [Markwon](https://noties.io/Markwon)) - * Translated in many languages on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/) - * Context based formatting ([#363](https://github.com/stefan-niedermann/nextcloud-notes/issues/363)) - * Password protection ([#354](https://github.com/stefan-niedermann/nextcloud-notes/issues/354)) +## License -## :checkered_flag: Roadmap - * We usually focus on [pinned issues](https://github.com/stefan-niedermann/nextcloud-notes/issues) in our issue tracker - * Since this is an Open Source freetime project, there is no guarantee when and if and how we implement new features - -## :family: Join the team - * Test the app with different devices - * Report issues in the [issue tracker](https://github.com/stefan-niedermann/nextcloud-notes/issues) - * [Pick a good first issue](https://github.com/stefan-niedermann/nextcloud-notes/labels/Good%20first%20issue) :notebook: - * Create a [Pull Request](https://opensource.guide/how-to-contribute/#opening-a-pull-request) - * Help translating this app on [Transifex](https://www.transifex.com/nextcloud/nextcloud/android-notes/) 🌎 - * Buy this app on [Google Play Store](https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes) - * Send me a bottle of your favorite beer :beers: :wink: - -## :link: Requirements - * [Nextcloud](https://nextcloud.com/) instance running - * [Nextcloud Android](https://github.com/nextcloud/android) app installed (≥ 3.9.0) - * [Nextcloud Notes](https://github.com/nextcloud/notes) app enabled - -## :notebook: License -This project is licensed under the [GNU GENERAL PUBLIC LICENSE](/LICENSE). +Notes is licensed under the [GNU General Public License v3.0](https://gitlab.e.foundation/e/apps/Notes/-/blob/master/LICENSE) \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 27ceced8b93c8a6eb7af207694804c92422b8fbb..615e4a095823fe760660d3052810953874e86566 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { } defaultConfig { - applicationId "it.niedermann.owncloud.notes" - minSdkVersion 23 + applicationId "foundation.e.notes" + minSdkVersion 24 targetSdkVersion 33 versionCode 3007001 versionName "3.7.1" @@ -39,30 +39,6 @@ android { } } - - flavorDimensions "version" - - productFlavors { - fdroid { - dimension "version" - } - dev { - dimension "version" - applicationIdSuffix ".dev" - } - play { - dimension "version" - } - pfungstadt { - dimension "version" - applicationIdSuffix ".pfungstadt" - } - mdm { - dimension "version" - applicationIdSuffix ".mdm" - } - } - testOptions { unitTests { includeAndroidResources true @@ -73,6 +49,7 @@ android { disable 'MissingTranslation' } namespace 'it.niedermann.owncloud.notes' + } dependencies { @@ -124,4 +101,5 @@ dependencies { testImplementation 'org.robolectric:robolectric:4.9' implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'foundation.e:elib:0.0.1-alpha11' } diff --git a/app/src/dev/res/drawable/ic_launcher_foreground.xml b/app/src/dev/res/drawable/ic_launcher_foreground.xml deleted file mode 100644 index 9cb8dccf26611d40250a33b9b508b8a75b5c3f95..0000000000000000000000000000000000000000 --- a/app/src/dev/res/drawable/ic_launcher_foreground.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/dev/res/xml/shortcuts.xml b/app/src/dev/res/xml/shortcuts.xml deleted file mode 100644 index 086d61f8c69b694d991670b89de18ccb25309ec1..0000000000000000000000000000000000000000 --- a/app/src/dev/res/xml/shortcuts.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5b23bd71524a16e246156886e77b97416b34081b..490b5b2f040bf0a58be3395ffacbf0c1efa0809f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -4,6 +4,8 @@ + + @@ -15,7 +17,7 @@ android:allowBackup="true" android:fullBackupContent="true" android:icon="@mipmap/ic_launcher" - android:label="@string/app_name_long" + android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true" android:theme="@style/AppTheme" @@ -173,5 +175,11 @@ + + diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png index c1e67d8b80be48e46b8a786bd79bc1f4245cdb57..7acab5295324858eba9533e4342049b7c84c34a1 100644 Binary files a/app/src/main/ic_launcher-web.png and b/app/src/main/ic_launcher-web.png differ diff --git a/app/src/main/java/it/niedermann/owncloud/notes/NotesApplication.java b/app/src/main/java/it/niedermann/owncloud/notes/NotesApplication.java index e177f7c7c9ecada189cce84e6aa2f4498fe69d6d..0ef67609122a803c7f6a3b7139f5646aa0c7dc84 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/NotesApplication.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/NotesApplication.java @@ -20,12 +20,10 @@ public class NotesApplication extends Application { private static boolean lockedPreference = false; private static boolean isLocked = true; private static long lastInteraction = 0; - private static String PREF_KEY_THEME; private static boolean isGridViewEnabled = false; @Override public void onCreate() { - PREF_KEY_THEME = getString(R.string.pref_key_theme); setAppTheme(getAppTheme(getApplicationContext())); final var prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); lockedPreference = prefs.getBoolean(getString(R.string.pref_key_lock), false); @@ -46,14 +44,7 @@ public class NotesApplication extends Application { } public static DarkModeSetting getAppTheme(Context context) { - final var prefs = PreferenceManager.getDefaultSharedPreferences(context); - String mode; - try { - mode = prefs.getString(PREF_KEY_THEME, DarkModeSetting.SYSTEM_DEFAULT.name()); - } catch (ClassCastException e) { - final boolean darkModeEnabled = prefs.getBoolean(PREF_KEY_THEME, false); - mode = darkModeEnabled ? DarkModeSetting.DARK.name() : DarkModeSetting.LIGHT.name(); - } + String mode = DarkModeSetting.SYSTEM_DEFAULT.name(); return DarkModeSetting.valueOf(mode); } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java index 5c5bf519f4baeada3e4285487fce1cebb9af3ca3..ed21d14e3f0a2eb03da9112451cb102a577ace2b 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutActivity.java @@ -2,27 +2,13 @@ package it.niedermann.owncloud.notes.about; import android.os.Bundle; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentActivity; -import androidx.viewpager2.adapter.FragmentStateAdapter; - -import com.google.android.material.tabs.TabLayoutMediator; - -import it.niedermann.owncloud.notes.LockedActivity; import it.niedermann.owncloud.notes.R; -import it.niedermann.owncloud.notes.branding.BrandingUtil; +import it.niedermann.owncloud.notes.branding.BrandedActivity; import it.niedermann.owncloud.notes.databinding.ActivityAboutBinding; -public class AboutActivity extends LockedActivity { +public class AboutActivity extends BrandedActivity { private ActivityAboutBinding binding; - private final static int POS_CREDITS = 0; - private final static int POS_CONTRIB = 1; - private final static int POS_LICENSE = 2; - private final static int TOTAL_COUNT = 3; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -31,65 +17,12 @@ public class AboutActivity extends LockedActivity { setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); - binding.pager.setAdapter(new TabsStateAdapter(this)); - // generate title based on given position - new TabLayoutMediator(binding.tabs, binding.pager, (tab, position) -> { - switch (position) { - default: // Fall-through to credits tab - case POS_CREDITS: - tab.setText(R.string.about_credits_tab_title); - break; - case POS_CONTRIB: - tab.setText(R.string.about_contribution_tab_title); - break; - case POS_LICENSE: - tab.setText(R.string.about_license_tab_title); - break; - } - }).attach(); + + getFragmentManager().beginTransaction().replace(binding.container.getId(), new AboutFragment()).commit(); } @Override public void applyBrand(int mainColor, int textColor) { applyBrandToPrimaryToolbar(binding.appBar, binding.toolbar); - @ColorInt int finalMainColor = BrandingUtil.getSecondaryForegroundColorDependingOnTheme(this, mainColor); - binding.tabs.setSelectedTabIndicatorColor(finalMainColor); - } - - private static class TabsStateAdapter extends FragmentStateAdapter { - - TabsStateAdapter(FragmentActivity fa) { - super(fa); - } - - @Override - public int getItemCount() { - return TOTAL_COUNT; - } - - /** - * return the right fragment for the given position - */ - @NonNull - @Override - public Fragment createFragment(int position) { - switch (position) { - default: // Fall-through to credits tab - case POS_CREDITS: - return new AboutFragmentCreditsTab(); - - case POS_CONTRIB: - return new AboutFragmentContributingTab(); - - case POS_LICENSE: - return new AboutFragmentLicenseTab(); - } - } - } - - @Override - public boolean onSupportNavigateUp() { - finish(); // close this activity as oppose to navigating up - return true; } } \ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragment.java new file mode 100644 index 0000000000000000000000000000000000000000..14ddf19c30f2c395b582b93b0a8b7a89bcf7fd49 --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragment.java @@ -0,0 +1,24 @@ +package it.niedermann.owncloud.notes.about; + +import android.os.Bundle; +import android.preference.PreferenceFragment; + +import androidx.annotation.Nullable; + +import it.niedermann.owncloud.notes.BuildConfig; +import it.niedermann.owncloud.notes.R; + +public class AboutFragment extends PreferenceFragment { + + private static final String BUILD_VERSION = "build_version"; + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + addPreferencesFromResource(R.xml.about_preferences); + + findPreference(BUILD_VERSION).setSummary(BuildConfig.VERSION_NAME); + + } +} diff --git a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentContributingTab.java b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentContributingTab.java deleted file mode 100644 index 90a9a3bce964ec120d941bb54c176f4965ee421e..0000000000000000000000000000000000000000 --- a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentContributingTab.java +++ /dev/null @@ -1,28 +0,0 @@ -package it.niedermann.owncloud.notes.about; - -import static it.niedermann.owncloud.notes.shared.util.SupportUtil.setTextWithURL; - -import android.os.Bundle; -import android.text.method.LinkMovementMethod; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; - -import it.niedermann.owncloud.notes.R; -import it.niedermann.owncloud.notes.databinding.FragmentAboutContributionTabBinding; -import it.niedermann.owncloud.notes.shared.util.SupportUtil; - -public class AboutFragmentContributingTab extends Fragment { - - @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - final var binding = FragmentAboutContributionTabBinding.inflate(inflater, container, false); - setTextWithURL(binding.aboutSource, getResources(), R.string.about_source, R.string.url_source, R.string.url_source); - setTextWithURL(binding.aboutIssues, getResources(), R.string.about_issues, R.string.url_issues, R.string.url_issues); - setTextWithURL(binding.aboutTranslate, getResources(), R.string.about_translate, R.string.url_translations, R.string.url_translations); - return binding.getRoot(); - } -} \ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentCreditsTab.java b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentCreditsTab.java deleted file mode 100644 index 028bfa4e0a95e6e9534a725163a2f30fdcc18dea..0000000000000000000000000000000000000000 --- a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentCreditsTab.java +++ /dev/null @@ -1,31 +0,0 @@ -package it.niedermann.owncloud.notes.about; - -import static it.niedermann.owncloud.notes.shared.util.SupportUtil.setTextWithURL; -import static it.niedermann.owncloud.notes.shared.util.SupportUtil.strong; -import static it.niedermann.owncloud.notes.shared.util.SupportUtil.url; - -import android.os.Bundle; -import android.text.method.LinkMovementMethod; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; - -import it.niedermann.owncloud.notes.BuildConfig; -import it.niedermann.owncloud.notes.R; -import it.niedermann.owncloud.notes.databinding.FragmentAboutCreditsTabBinding; - -public class AboutFragmentCreditsTab extends Fragment { - - @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - final var binding = FragmentAboutCreditsTabBinding.inflate(inflater, container, false); - binding.aboutVersion.setText(getString(R.string.about_version, strong(BuildConfig.VERSION_NAME))); - binding.aboutMaintainer.setText(url(getString(R.string.about_maintainer), getString(R.string.url_maintainer))); - binding.aboutMaintainer.setMovementMethod(new LinkMovementMethod()); - setTextWithURL(binding.aboutTranslators, getResources(), R.string.about_translators_transifex, R.string.about_translators_transifex_label, R.string.url_translations); - return binding.getRoot(); - } -} \ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentLicenseTab.java b/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentLicenseTab.java deleted file mode 100644 index 10cc02c74afe814326a97375c3cfa94b731a5deb..0000000000000000000000000000000000000000 --- a/app/src/main/java/it/niedermann/owncloud/notes/about/AboutFragmentLicenseTab.java +++ /dev/null @@ -1,42 +0,0 @@ -package it.niedermann.owncloud.notes.about; - -import static it.niedermann.owncloud.notes.shared.util.SupportUtil.setTextWithURL; - -import android.content.Intent; -import android.content.res.ColorStateList; -import android.net.Uri; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; -import androidx.core.graphics.drawable.DrawableCompat; - -import it.niedermann.android.util.ColorUtil; -import it.niedermann.owncloud.notes.R; -import it.niedermann.owncloud.notes.branding.BrandedFragment; -import it.niedermann.owncloud.notes.branding.BrandingUtil; -import it.niedermann.owncloud.notes.databinding.FragmentAboutLicenseTabBinding; - -public class AboutFragmentLicenseTab extends BrandedFragment { - - private FragmentAboutLicenseTabBinding binding; - - @Override - public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - binding = FragmentAboutLicenseTabBinding.inflate(inflater, container, false); - setTextWithURL(binding.aboutIconsDisclaimerAppIcon, getResources(), R.string.about_icons_disclaimer_app_icon, R.string.about_app_icon_author_link_label, R.string.url_about_icon_author); - setTextWithURL(binding.aboutIconsDisclaimerMdiIcons, getResources(), R.string.about_icons_disclaimer_mdi_icons, R.string.about_icons_disclaimer_mdi, R.string.url_about_icons_disclaimer_mdi); - binding.aboutAppLicenseButton.setOnClickListener((v) -> startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.url_license))))); - return binding.getRoot(); - } - - @Override - public void applyBrand(int mainColor, int textColor) { - @ColorInt final int finalMainColor = BrandingUtil.getSecondaryForegroundColorDependingOnTheme(requireContext(), mainColor); - DrawableCompat.setTintList(binding.aboutAppLicenseButton.getBackground(), ColorStateList.valueOf(finalMainColor)); - binding.aboutAppLicenseButton.setTextColor(ColorUtil.INSTANCE.getForegroundColorForBackgroundColor(finalMainColor)); - } -} \ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java index e7cc6dfd8cf71cfe52a8d13407b0f51f53aec4c6..92d0d8972112e35a8661de0d66a074c36fd23ffd 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java @@ -50,19 +50,5 @@ public abstract class BrandedActivity extends AppCompatActivity implements Brand } public void applyBrandToPrimaryToolbar(@NonNull AppBarLayout appBarLayout, @NonNull Toolbar toolbar) { - // FIXME Workaround for https://github.com/stefan-niedermann/nextcloud-notes/issues/889 - appBarLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.primary)); - - final var overflowDrawable = toolbar.getOverflowIcon(); - if (overflowDrawable != null) { - overflowDrawable.setColorFilter(colorAccent, PorterDuff.Mode.SRC_ATOP); - toolbar.setOverflowIcon(overflowDrawable); - } - - final var navigationDrawable = toolbar.getNavigationIcon(); - if (navigationDrawable != null) { - navigationDrawable.setColorFilter(colorAccent, PorterDuff.Mode.SRC_ATOP); - toolbar.setNavigationIcon(navigationDrawable); - } } } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedSwitchPreference.java b/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedSwitchPreference.java index 07eb0c63c632e1988ddf8894eb0ccab30a90a4d5..c31ad1eeb8cbbf20d0f87f5522165b3e62b09e50 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedSwitchPreference.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedSwitchPreference.java @@ -2,8 +2,6 @@ package it.niedermann.owncloud.notes.branding; import android.annotation.SuppressLint; import android.content.Context; -import android.content.res.ColorStateList; -import android.graphics.Color; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; @@ -11,14 +9,9 @@ import android.widget.Switch; import androidx.annotation.ColorInt; import androidx.annotation.Nullable; -import androidx.core.graphics.drawable.DrawableCompat; import androidx.preference.PreferenceViewHolder; import androidx.preference.SwitchPreference; -import it.niedermann.owncloud.notes.R; - -import static it.niedermann.owncloud.notes.branding.BrandingUtil.getSecondaryForegroundColorDependingOnTheme; - public class BrandedSwitchPreference extends SwitchPreference implements Branded { @ColorInt @@ -53,9 +46,6 @@ public class BrandedSwitchPreference extends SwitchPreference implements Branded if (holder.itemView instanceof ViewGroup) { switchView = findSwitchWidget(holder.itemView); - if (mainColor != null && textColor != null) { - applyBrand(); - } } } @@ -64,22 +54,6 @@ public class BrandedSwitchPreference extends SwitchPreference implements Branded this.mainColor = mainColor; this.textColor = textColor; // onBindViewHolder is called after applyBrand, therefore we have to store the given values and apply them later. - applyBrand(); - } - - private void applyBrand() { - if (switchView != null) { - final int finalMainColor = getSecondaryForegroundColorDependingOnTheme(getContext(), mainColor); - // int trackColor = Color.argb(77, Color.red(finalMainColor), Color.green(finalMainColor), Color.blue(finalMainColor)); - DrawableCompat.setTintList(switchView.getThumbDrawable(), new ColorStateList( - new int[][]{new int[]{android.R.attr.state_checked}, new int[]{}}, - new int[]{finalMainColor, getContext().getResources().getColor(R.color.fg_default_low)} - )); - DrawableCompat.setTintList(switchView.getTrackDrawable(), new ColorStateList( - new int[][]{new int[]{android.R.attr.state_checked}, new int[]{}}, - new int[]{finalMainColor, getContext().getResources().getColor(R.color.fg_default_low)} - )); - } } /** diff --git a/app/src/main/java/it/niedermann/owncloud/notes/edit/BaseNoteFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/edit/BaseNoteFragment.java index b524e2fb2fe4a65d185bfc5442e2399f1c70c1ef..e7284a80ed11834c5a50297170fd020cbcef49a6 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/edit/BaseNoteFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/edit/BaseNoteFragment.java @@ -201,7 +201,7 @@ public abstract class BaseNoteFragment extends BrandedFragment implements Catego } private void prepareFavoriteOption(MenuItem item) { - item.setIcon(note.getFavorite() ? R.drawable.ic_star_white_24dp : R.drawable.ic_star_border_white_24dp); + item.setIcon(note.getFavorite() ? R.drawable.ic_star_accent_24dp : R.drawable.ic_star_border_accent_24dp); item.setChecked(note.getFavorite()); tintMenuIcon(item, colorAccent); } @@ -252,7 +252,7 @@ public abstract class BaseNoteFragment extends BrandedFragment implements Catego if (ShortcutManagerCompat.isRequestPinShortcutSupported(context)) { final var pinShortcutInfo = new ShortcutInfoCompat.Builder(context, String.valueOf(note.getId())) .setShortLabel(note.getTitle()) - .setIcon(IconCompat.createWithResource(context.getApplicationContext(), TRUE.equals(note.getFavorite()) ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_grey_ccc_24dp)) + .setIcon(IconCompat.createWithResource(context.getApplicationContext(), TRUE.equals(note.getFavorite()) ? R.drawable.ic_star_accent_24dp : R.drawable.ic_star_border_accent_24dp)) .setIntent(new Intent(getActivity(), EditNoteActivity.class).putExtra(EditNoteActivity.PARAM_NOTE_ID, note.getId()).setAction(ACTION_SHORTCUT)) .build(); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionActivity.java index 0761b603647ec3d237c200200486aa4075782422..cb51d736bdef3ff12f91ea06d8a618b9a562f481 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionActivity.java @@ -38,7 +38,7 @@ public class ExceptionActivity extends AppCompatActivity { } final var adapter = new TipsAdapter(this::startActivity); - final String debugInfos = ExceptionUtil.INSTANCE.getDebugInfos(this, throwable, BuildConfig.FLAVOR); + final String debugInfos = ExceptionUtil.INSTANCE.getDebugInfos(this, throwable, "PROD"); binding.tips.setAdapter(adapter); binding.tips.setNestedScrollingEnabled(false); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java index ca242a7fd1129ef5f6eb4d6e40d666f13b9d95e5..33a65173b2074d163c102f2668ef048f1daa5c2a 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java @@ -57,7 +57,7 @@ public class ExceptionDialogFragment extends AppCompatDialogFragment { final var adapter = new TipsAdapter((actionIntent) -> requireActivity().startActivity(actionIntent)); - final String debugInfos = ExceptionUtil.INSTANCE.getDebugInfos(requireContext(), throwables, BuildConfig.FLAVOR); + final String debugInfos = ExceptionUtil.INSTANCE.getDebugInfos(requireContext(), throwables, "PROD"); binding.tips.setAdapter(adapter); binding.stacktrace.setText(debugInfos); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java index 046f0e7d5ec12aa857161cd4d5998656743657dc..a42c836af4082199a729fc298866abc540e0ef68 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java @@ -34,7 +34,6 @@ import androidx.appcompat.widget.SearchView; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; -import androidx.core.graphics.drawable.DrawableCompat; import androidx.core.splashscreen.SplashScreen; import androidx.core.view.GravityCompat; import androidx.lifecycle.Observer; @@ -157,10 +156,6 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A gridView = isGridViewEnabled(); - if (!gridView || isDarkThemeActive(this)) { - activityBinding.activityNotesListView.setBackgroundColor(ContextCompat.getColor(this, R.color.primary)); - } - setupToolbars(); setupNavigationList(); setupNotesList(); @@ -404,8 +399,15 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A final var toggle = new ActionBarDrawerToggle(this, binding.drawerLayout, activityBinding.homeToolbar, 0, 0); binding.drawerLayout.addDrawerListener(toggle); + toggle.setHomeAsUpIndicator(R.drawable.ic_hamberger_24dp); toggle.syncState(); + if (binding.activityNotesListView.searchToolbar.getNavigationIcon() != null) { + binding.activityNotesListView.searchToolbar.getNavigationIcon().setTint(ContextCompat.getColor(this, R.color.e_primary_text_color)); + } + + toggle.setToolbarNavigationClickListener(view -> binding.drawerLayout.openDrawer(GravityCompat.START)); + activityBinding.searchView.setOnCloseListener(() -> { if (activityBinding.searchToolbar.getVisibility() == VISIBLE && TextUtils.isEmpty(activityBinding.searchView.getQuery())) { updateToolbars(false); @@ -602,7 +604,6 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A // TODO We assume, that the background of the spinner is always white activityBinding.swiperefreshlayout.setColorSchemeColors(contrastRatioIsSufficient(Color.WHITE, mainColor) ? mainColor : Color.BLACK); binding.appName.setTextColor(textColor); - DrawableCompat.setTint(binding.logo.getDrawable(), textColor); adapter.applyBrand(mainColor, textColor); adapterCategories.applyBrand(mainColor, textColor); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java b/app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java index 4de6ebeced78dbff5d1edcefcf1f82f45fc69d10..15e3cb54d2dce734cdbf87bc6b34b2c1fe5ba49e 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java @@ -319,7 +319,7 @@ public class MainViewModel extends AndroidViewModel { private static List fromCategoriesWithNotesCount(@NonNull Context context, @Nullable String expandedCategory, @NonNull List fromDatabase, int count, int favoritesCount) { final var categories = convertToCategoryNavigationItem(context, fromDatabase); final var itemRecent = new NavigationItem(ADAPTER_KEY_RECENT, context.getString(R.string.label_all_notes), count, R.drawable.ic_access_time_grey600_24dp, RECENT); - final var itemFavorites = new NavigationItem(ADAPTER_KEY_STARRED, context.getString(R.string.label_favorites), favoritesCount, R.drawable.ic_star_yellow_24dp, FAVORITES); + final var itemFavorites = new NavigationItem(ADAPTER_KEY_STARRED, context.getString(R.string.label_favorites), favoritesCount, R.drawable.ic_star_grey_24dp, FAVORITES); final var items = new ArrayList(fromDatabase.size() + 3); items.add(itemRecent); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java index 609d1aeff4a9191cf3c64018c1bdb41d224ee413..499957069baaf8b0d54764cd3f69d66ccb43b5a8 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java @@ -104,7 +104,7 @@ public abstract class NoteViewHolder extends RecyclerView.ViewHolder { } protected void bindFavorite(@NonNull ImageView noteFavorite, boolean isFavorite) { - noteFavorite.setImageResource(isFavorite ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_grey_ccc_24dp); + noteFavorite.setImageResource(isFavorite ? R.drawable.ic_star_accent_24dp : R.drawable.ic_star_border_accent_24dp); noteFavorite.setOnClickListener(view -> noteClickListener.onNoteFavoriteClick(getLayoutPosition(), view)); } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/menu/MenuViewHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/main/menu/MenuViewHolder.java index d5a2f60887ff54b5cdbeedc8bb7ecd00e7ffc9d1..dd05e971254c5119cca79c77b513429f6a8ff56a 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/menu/MenuViewHolder.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/menu/MenuViewHolder.java @@ -24,7 +24,7 @@ public class MenuViewHolder extends RecyclerView.ViewHolder { public void bind(@NonNull MenuItem menuItem, @NonNull Consumer onClick) { @NonNull Context context = itemView.getContext(); binding.navigationItemLabel.setText(context.getString(menuItem.getLabelResource())); - binding.navigationItemLabel.setTextColor(binding.getRoot().getResources().getColor(R.color.fg_default)); + binding.navigationItemLabel.setTextColor(binding.getRoot().getResources().getColor(R.color.color_default_primary_text)); binding.navigationItemIcon.setImageDrawable(ContextCompat.getDrawable(context, menuItem.getDrawableResource())); binding.navigationItemCount.setVisibility(GONE); binding.getRoot().setOnClickListener((v) -> onClick.accept(menuItem)); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/navigation/NavigationViewHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/main/navigation/NavigationViewHolder.java index 8fb03dfa4399492aa17109763c880211f85efbc8..81bab0faf68a4982322a68c6ec1304be7d3a7260 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/navigation/NavigationViewHolder.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/navigation/NavigationViewHolder.java @@ -53,11 +53,12 @@ class NavigationViewHolder extends RecyclerView.ViewHolder { } else { icon.setVisibility(View.GONE); } - final int textColor = isSelected ? mainColor : view.getResources().getColor(R.color.fg_default); + final int textColor = isSelected ? mainColor : ContextCompat.getColor(view.getContext(), R.color.color_default_primary_text); + int unSelectedIconColor = ContextCompat.getColor(view.getContext(), isSelected ? R.color.accent_color : R.color.icon_color_default); name.setTextColor(textColor); count.setTextColor(textColor); - icon.setColorFilter(isSelected ? textColor : 0); + icon.setColorFilter(isSelected ? textColor : unSelectedIconColor); view.setSelected(isSelected); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java index 27865a3ba39cc3bbc52ae5aababbd08c0b6f05d2..fa3e2575b88c44e69682881aca91dbd8c1d668e4 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java @@ -70,6 +70,7 @@ import it.niedermann.owncloud.notes.shared.model.ImportStatus; import it.niedermann.owncloud.notes.shared.model.NavigationCategory; import it.niedermann.owncloud.notes.shared.model.NotesSettings; import it.niedermann.owncloud.notes.shared.model.SyncResultStatus; +import it.niedermann.owncloud.notes.shared.util.AccountSyncUtil; import it.niedermann.owncloud.notes.shared.util.ApiVersionUtil; import it.niedermann.owncloud.notes.shared.util.NoteUtil; import it.niedermann.owncloud.notes.shared.util.SSOUtil; @@ -594,7 +595,7 @@ public class NotesRepository { newShortcuts.add(new ShortcutInfo.Builder(this.context, note.getId() + "") .setShortLabel(note.getTitle() + "") - .setIcon(Icon.createWithResource(this.context, note.getFavorite() ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_grey_ccc_24dp)) + .setIcon(Icon.createWithResource(this.context, note.getFavorite() ? R.drawable.ic_star_accent_24dp : R.drawable.ic_star_border_accent_24dp)) .setIntent(intent) .build()); } else { @@ -815,80 +816,82 @@ public class NotesRepository { syncActive.put(account.getId(), false); } Log.d(TAG, "Sync requested (" + (onlyLocalChanges ? "onlyLocalChanges" : "full") + "; " + (Boolean.TRUE.equals(syncActive.get(account.getId())) ? "sync active" : "sync NOT active") + ") ..."); - if (isSyncPossible() && (!Boolean.TRUE.equals(syncActive.get(account.getId())) || onlyLocalChanges)) { - syncActive.put(account.getId(), true); - try { - Log.d(TAG, "... starting now"); - final NotesServerSyncTask syncTask = new NotesServerSyncTask(context, this, account, onlyLocalChanges, apiProvider) { - @Override - void onPreExecute() { - syncStatus.postValue(true); - if (!syncScheduled.containsKey(localAccount.getId()) || syncScheduled.get(localAccount.getId()) == null) { - syncScheduled.put(localAccount.getId(), false); - } - if (!onlyLocalChanges && Boolean.TRUE.equals(syncScheduled.get(localAccount.getId()))) { - syncScheduled.put(localAccount.getId(), false); + if (AccountSyncUtil.isSyncEnable(context, account)) { + if (isSyncPossible() && (!Boolean.TRUE.equals(syncActive.get(account.getId())) || onlyLocalChanges)) { + syncActive.put(account.getId(), true); + try { + Log.d(TAG, "... starting now"); + final NotesServerSyncTask syncTask = new NotesServerSyncTask(context, this, account, onlyLocalChanges, apiProvider) { + @Override + void onPreExecute() { + syncStatus.postValue(true); + if (!syncScheduled.containsKey(localAccount.getId()) || syncScheduled.get(localAccount.getId()) == null) { + syncScheduled.put(localAccount.getId(), false); + } + if (!onlyLocalChanges && Boolean.TRUE.equals(syncScheduled.get(localAccount.getId()))) { + syncScheduled.put(localAccount.getId(), false); + } } - } - @Override - void onPostExecute(SyncResultStatus status) { - for (Throwable e : exceptions) { - Log.e(TAG, e.getMessage(), e); - } - if (!status.pullSuccessful || !status.pushSuccessful) { - syncErrors.postValue(exceptions); - } - syncActive.put(localAccount.getId(), false); - // notify callbacks - if (callbacks.containsKey(localAccount.getId()) && callbacks.get(localAccount.getId()) != null) { - for (ISyncCallback callback : Objects.requireNonNull(callbacks.get(localAccount.getId()))) { - callback.onFinish(); + @Override + void onPostExecute(SyncResultStatus status) { + for (Throwable e : exceptions) { + Log.e(TAG, e.getMessage(), e); } + if (!status.pullSuccessful || !status.pushSuccessful) { + syncErrors.postValue(exceptions); + } + syncActive.put(localAccount.getId(), false); + // notify callbacks + if (callbacks.containsKey(localAccount.getId()) && callbacks.get(localAccount.getId()) != null) { + for (ISyncCallback callback : Objects.requireNonNull(callbacks.get(localAccount.getId()))) { + callback.onFinish(); + } + } + notifyWidgets(); + updateDynamicShortcuts(localAccount.getId()); + // start next sync if scheduled meanwhile + if (syncScheduled.containsKey(localAccount.getId()) && syncScheduled.get(localAccount.getId()) != null && Boolean.TRUE.equals(syncScheduled.get(localAccount.getId()))) { + scheduleSync(localAccount, false); + } + syncStatus.postValue(false); } - notifyWidgets(); - updateDynamicShortcuts(localAccount.getId()); - // start next sync if scheduled meanwhile - if (syncScheduled.containsKey(localAccount.getId()) && syncScheduled.get(localAccount.getId()) != null && Boolean.TRUE.equals(syncScheduled.get(localAccount.getId()))) { - scheduleSync(localAccount, false); - } - syncStatus.postValue(false); + }; + syncTask.addCallbacks(account, callbacksPush.get(account.getId())); + callbacksPush.put(account.getId(), new ArrayList<>()); + if (!onlyLocalChanges) { + syncTask.addCallbacks(account, callbacksPull.get(account.getId())); + callbacksPull.put(account.getId(), new ArrayList<>()); } - }; - syncTask.addCallbacks(account, callbacksPush.get(account.getId())); - callbacksPush.put(account.getId(), new ArrayList<>()); - if (!onlyLocalChanges) { - syncTask.addCallbacks(account, callbacksPull.get(account.getId())); - callbacksPull.put(account.getId(), new ArrayList<>()); + syncExecutor.submit(syncTask); + } catch (NextcloudFilesAppAccountNotFoundException e) { + Log.e(TAG, "... Could not find " + SingleSignOnAccount.class.getSimpleName() + " for account name " + account.getAccountName()); + e.printStackTrace(); } - syncExecutor.submit(syncTask); - } catch (NextcloudFilesAppAccountNotFoundException e) { - Log.e(TAG, "... Could not find " + SingleSignOnAccount.class.getSimpleName() + " for account name " + account.getAccountName()); - e.printStackTrace(); - } - } else if (!onlyLocalChanges) { - Log.d(TAG, "... scheduled"); - syncScheduled.put(account.getId(), true); - if (callbacksPush.containsKey(account.getId()) && callbacksPush.get(account.getId()) != null) { - final var callbacks = callbacksPush.get(account.getId()); - if (callbacks != null) { - for (final var callback : callbacks) { - callback.onScheduled(); + } else if (!onlyLocalChanges) { + Log.d(TAG, "... scheduled"); + syncScheduled.put(account.getId(), true); + if (callbacksPush.containsKey(account.getId()) && callbacksPush.get(account.getId()) != null) { + final var callbacks = callbacksPush.get(account.getId()); + if (callbacks != null) { + for (final var callback : callbacks) { + callback.onScheduled(); + } + } else { + Log.w(TAG, "List of push-callbacks was set for account \"" + account.getAccountName() + "\" but it was null"); } - } else { - Log.w(TAG, "List of push-callbacks was set for account \"" + account.getAccountName() + "\" but it was null"); } - } - } else { - Log.d(TAG, "... do nothing"); - if (callbacksPush.containsKey(account.getId()) && callbacksPush.get(account.getId()) != null) { - final var callbacks = callbacksPush.get(account.getId()); - if (callbacks != null) { - for (final var callback : callbacks) { - callback.onScheduled(); + } else { + Log.d(TAG, "... do nothing"); + if (callbacksPush.containsKey(account.getId()) && callbacksPush.get(account.getId()) != null) { + final var callbacks = callbacksPush.get(account.getId()); + if (callbacks != null) { + for (final var callback : callbacks) { + callback.onScheduled(); + } + } else { + Log.w(TAG, "List of push-callbacks was set for account \"" + account.getAccountName() + "\" but it was null"); } - } else { - Log.w(TAG, "List of push-callbacks was set for account \"" + account.getAccountName() + "\" but it was null"); } } } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java index f2a252598041aa909db30a3a54177018c8b9a0e5..462d5884a4b92119ced2dd1eb75cf7997c30e318 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/preferences/PreferencesFragment.java @@ -1,15 +1,11 @@ package it.niedermann.owncloud.notes.preferences; import android.app.Activity; -import android.content.Context; import android.os.Bundle; import android.util.Log; import androidx.annotation.ColorInt; -import androidx.annotation.Nullable; -import androidx.core.app.ActivityCompat; import androidx.lifecycle.ViewModelProvider; -import androidx.preference.ListPreference; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; @@ -85,15 +81,6 @@ public class PreferencesFragment extends PreferenceFragmentCompat implements Bra Log.e(TAG, "Could not find \"" + getString(R.string.pref_key_lock) + "\"-preference."); } - final var themePref = findPreference(getString(R.string.pref_key_theme)); - assert themePref != null; - themePref.setOnPreferenceChangeListener((preference, newValue) -> { - NotesApplication.setAppTheme(DarkModeSetting.valueOf((String) newValue)); - viewModel.resultCode$.setValue(Activity.RESULT_OK); - ActivityCompat.recreate(requireActivity()); - return true; - }); - wifiOnlyPref = findPreference(getString(R.string.pref_key_wifi_only)); assert wifiOnlyPref != null; wifiOnlyPref.setOnPreferenceChangeListener((preference, newValue) -> { diff --git a/app/src/main/java/it/niedermann/owncloud/notes/providers/AppContentProvider.java b/app/src/main/java/it/niedermann/owncloud/notes/providers/AppContentProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..347554b1521a96bc1ccc050193a609c748d10fec --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/providers/AppContentProvider.java @@ -0,0 +1,45 @@ +package it.niedermann.owncloud.notes.providers; + +import android.content.ContentProvider; +import android.content.ContentValues; +import android.database.Cursor; +import android.net.Uri; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +public class AppContentProvider extends ContentProvider { + + @Override + public boolean onCreate() { + return false; + } + + @Nullable + @Override + public Cursor query(@NonNull Uri uri, @Nullable String[] strings, @Nullable String s, @Nullable String[] strings1, @Nullable String s1) { + return null; + } + + @Nullable + @Override + public String getType(@NonNull Uri uri) { + return null; + } + + @Nullable + @Override + public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) { + return null; + } + + @Override + public int delete(@NonNull Uri uri, @Nullable String s, @Nullable String[] strings) { + return 0; + } + + @Override + public int update(@NonNull Uri uri, @Nullable ContentValues contentValues, @Nullable String s, @Nullable String[] strings) { + return 0; + } +} diff --git a/app/src/main/java/it/niedermann/owncloud/notes/shared/util/AccountSyncUtil.java b/app/src/main/java/it/niedermann/owncloud/notes/shared/util/AccountSyncUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..27c379e87c56b879c844a3119719f0a68c28f309 --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/shared/util/AccountSyncUtil.java @@ -0,0 +1,62 @@ +/* + * Copyright MURENA SAS 2023 + * This program 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. + * + * This program 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 it.niedermann.owncloud.notes.shared.util; + +import android.accounts.AccountManager; +import android.content.ContentResolver; +import android.content.Context; +import android.util.Log; + +import it.niedermann.owncloud.notes.persistence.entity.Account; + +public class AccountSyncUtil { + + private static final String TAG = AccountSyncUtil.class.getSimpleName(); + private static final String murena_account_type = "e.foundation.webdav.eelo"; + private static final String notes_content_authority = "foundation.e.notes.android.providers.AppContentProvider"; + + private AccountSyncUtil() { + throw new UnsupportedOperationException("Do not instantiate this util class."); + } + + private static android.accounts.Account[] getMurenaAccountsOnDevice(AccountManager accountManager) { + return accountManager.getAccountsByType(murena_account_type); + } + + private static boolean isSyncEnable(android.accounts.Account account) { + return ContentResolver.getMasterSyncAutomatically() && ContentResolver.getSyncAutomatically(account, notes_content_authority); + } + + public static boolean isSyncEnable(Context context, Account account) { + AccountManager accountManager = AccountManager.get(context); + + try { + android.accounts.Account[] murenaAccounts = getMurenaAccountsOnDevice(accountManager); + + for (android.accounts.Account murenaAccount : murenaAccounts) { + if (account.getAccountName().equals(murenaAccount.name)) { + return isSyncEnable(murenaAccount); + } + } + } catch (SecurityException e) { + Log.e(TAG, "Failed to load murena accounts", e); + } + + return true; + } + +} diff --git a/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListViewModel.java b/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListViewModel.java index 61d6869d61bb0e1b194bd9aa7ca99c05de09ef9f..cd43ee8a0f93f7808c826c867b55a02dcd07f13a 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListViewModel.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListViewModel.java @@ -46,7 +46,7 @@ public class NoteListViewModel extends AndroidViewModel { final var items = new ArrayList(fromDatabase.size() + 3); items.add(new NavigationItem(MainActivity.ADAPTER_KEY_RECENT, getApplication().getString(R.string.label_all_notes), count, R.drawable.ic_access_time_grey600_24dp, RECENT)); - items.add(new NavigationItem(MainActivity.ADAPTER_KEY_STARRED, getApplication().getString(R.string.label_favorites), favoritesCount, R.drawable.ic_star_yellow_24dp, FAVORITES)); + items.add(new NavigationItem(MainActivity.ADAPTER_KEY_STARRED, getApplication().getString(R.string.label_favorites), favoritesCount, R.drawable.ic_star_grey_24dp, FAVORITES)); if (categories.size() > 2 && categories.get(2).label.isEmpty()) { items.add(new NavigationItem(MainActivity.ADAPTER_KEY_UNCATEGORIZED, "", null, NavigationAdapter.ICON_NOFOLDER)); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetConfigurationActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetConfigurationActivity.java index fb94f7d8675f31772982f0020bf30696fcac82de..a488288dc54477133a8710798bfeb01b406c297e 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetConfigurationActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetConfigurationActivity.java @@ -1,5 +1,10 @@ package it.niedermann.owncloud.notes.widget.notelist; +import static it.niedermann.owncloud.notes.persistence.entity.NotesListWidgetData.MODE_DISPLAY_ALL; +import static it.niedermann.owncloud.notes.persistence.entity.NotesListWidgetData.MODE_DISPLAY_CATEGORY; +import static it.niedermann.owncloud.notes.persistence.entity.NotesListWidgetData.MODE_DISPLAY_STARRED; +import static it.niedermann.owncloud.notes.shared.model.ENavigationCategoryType.RECENT; + import android.app.Activity; import android.appwidget.AppWidgetManager; import android.content.Intent; @@ -28,11 +33,6 @@ import it.niedermann.owncloud.notes.persistence.NotesRepository; import it.niedermann.owncloud.notes.persistence.entity.Account; import it.niedermann.owncloud.notes.persistence.entity.NotesListWidgetData; -import static it.niedermann.owncloud.notes.persistence.entity.NotesListWidgetData.MODE_DISPLAY_ALL; -import static it.niedermann.owncloud.notes.persistence.entity.NotesListWidgetData.MODE_DISPLAY_CATEGORY; -import static it.niedermann.owncloud.notes.persistence.entity.NotesListWidgetData.MODE_DISPLAY_STARRED; -import static it.niedermann.owncloud.notes.shared.model.ENavigationCategoryType.RECENT; - public class NoteListWidgetConfigurationActivity extends LockedActivity { private static final String TAG = Activity.class.getSimpleName(); @@ -130,7 +130,8 @@ public class NoteListWidgetConfigurationActivity extends LockedActivity { executor.submit(() -> { try { this.localAccount = repo.getAccountByName(SingleAccountHelper.getCurrentSingleSignOnAccount(this).name); - } catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) { + } catch (NextcloudFilesAppAccountNotFoundException | + NoCurrentAccountSelectedException e) { e.printStackTrace(); Toast.makeText(this, R.string.widget_not_logged_in, Toast.LENGTH_LONG).show(); // TODO Present user with app login screen diff --git a/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.java b/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.java index 94548e982b13a406673bff33cf093b73d5c70b26..1a701ef16039dfdc1ff3ffda705b37b97978c6e9 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/widget/notelist/NoteListWidgetFactory.java @@ -134,8 +134,8 @@ public class NoteListWidgetFactory implements RemoteViewsService.RemoteViewsFact note_content.setOnClickFillInIntent(R.id.widget_note_list_entry, fillInIntent); note_content.setTextViewText(R.id.widget_entry_content_tv, note.getTitle()); note_content.setImageViewResource(R.id.widget_entry_fav_icon, note.getFavorite() - ? R.drawable.ic_star_yellow_24dp - : R.drawable.ic_star_grey_ccc_24dp); + ? R.drawable.ic_star_accent_24dp + : R.drawable.ic_star_border_accent_24dp); } return note_content; diff --git a/app/src/main/res/drawable/ic_access_time_grey600_24dp.xml b/app/src/main/res/drawable/ic_access_time_grey600_24dp.xml index a5b3c814afd111259005585bf48cd9d482eb33b3..f2590665b82b0f4668e83292220c5bd84020a63d 100644 --- a/app/src/main/res/drawable/ic_access_time_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_access_time_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_account_circle_grey_24dp.xml b/app/src/main/res/drawable/ic_account_circle_grey_24dp.xml index fb1be50b1fdab8eba70feb347c917a0247e85f92..968c9764cacedeff32b57b9b263874953c28be15 100644 --- a/app/src/main/res/drawable/ic_account_circle_grey_24dp.xml +++ b/app/src/main/res/drawable/ic_account_circle_grey_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_add_blue_24dp.xml b/app/src/main/res/drawable/ic_add_blue_24dp.xml index 669331520e63b5ec09d59eb6feefe9c1b02f6c3c..033d5505bea3d5b6594920b39f2797e165c28e38 100644 --- a/app/src/main/res/drawable/ic_add_blue_24dp.xml +++ b/app/src/main/res/drawable/ic_add_blue_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_add_white_24dp.xml b/app/src/main/res/drawable/ic_add_white_24dp.xml index 43bfcda20e5fe770ea676a00b53b9cdd0cbf0c11..d07c66c0017d9b4764f766e10ad435b42fbfc325 100644 --- a/app/src/main/res/drawable/ic_add_white_24dp.xml +++ b/app/src/main/res/drawable/ic_add_white_24dp.xml @@ -1,6 +1,5 @@ diff --git a/app/src/main/res/drawable/ic_baseline_card_giftcard_24.xml b/app/src/main/res/drawable/ic_baseline_card_giftcard_24.xml index c1c10515be23514965e0041de880808687201d53..553145e55576dd392212a2f50dab8350f4102275 100644 --- a/app/src/main/res/drawable/ic_baseline_card_giftcard_24.xml +++ b/app/src/main/res/drawable/ic_baseline_card_giftcard_24.xml @@ -1,5 +1,10 @@ - - + + diff --git a/app/src/main/res/drawable/ic_baseline_checklist_24.xml b/app/src/main/res/drawable/ic_baseline_checklist_24.xml index 4e310e8dcd5a465411e3e51744e4f5e949996516..799ea36d465fcf804e6cf9e8b1254d5fce191d11 100644 --- a/app/src/main/res/drawable/ic_baseline_checklist_24.xml +++ b/app/src/main/res/drawable/ic_baseline_checklist_24.xml @@ -2,10 +2,9 @@ android:width="24dp" android:height="24dp" android:autoMirrored="true" - android:tint="#757575" android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_baseline_dashboard_24.xml b/app/src/main/res/drawable/ic_baseline_dashboard_24.xml index 229f678c76f9a5737993243827d102a7a5e35c4d..bd2226b5fc01779c74bd951c9016822a8b7280e5 100644 --- a/app/src/main/res/drawable/ic_baseline_dashboard_24.xml +++ b/app/src/main/res/drawable/ic_baseline_dashboard_24.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_baseline_fastfood_24.xml b/app/src/main/res/drawable/ic_baseline_fastfood_24.xml index 6a2c6e1e80fcceea928642fccf33f8ba7a9a8744..c94c3d6cc419618dda2bfcc24f45e05ac3ef5c91 100644 --- a/app/src/main/res/drawable/ic_baseline_fastfood_24.xml +++ b/app/src/main/res/drawable/ic_baseline_fastfood_24.xml @@ -1,5 +1,10 @@ - - + + diff --git a/app/src/main/res/drawable/ic_baseline_games_24.xml b/app/src/main/res/drawable/ic_baseline_games_24.xml index 502d83f25f1a83e0ada6acaf09ae4a3402f35fdc..b13b11a51dd3bd48db6a4f2e51c6d45b070d9935 100644 --- a/app/src/main/res/drawable/ic_baseline_games_24.xml +++ b/app/src/main/res/drawable/ic_baseline_games_24.xml @@ -1,5 +1,10 @@ - - + + diff --git a/app/src/main/res/drawable/ic_baseline_help_outline_24.xml b/app/src/main/res/drawable/ic_baseline_help_outline_24.xml index 19d5949a2809608b3a290900ddb193d6b2e1632c..7e595771ed583e68786a6d1a90de8a7040ae658c 100644 --- a/app/src/main/res/drawable/ic_baseline_help_outline_24.xml +++ b/app/src/main/res/drawable/ic_baseline_help_outline_24.xml @@ -1,10 +1,9 @@ diff --git a/app/src/main/res/drawable/ic_baseline_menu_24.xml b/app/src/main/res/drawable/ic_baseline_menu_24.xml index b2ceb45b5b7f3bc8769f8c5c67dc842162f31c2a..aa8d3312298b51f5277d1c88828043ca10196a4d 100644 --- a/app/src/main/res/drawable/ic_baseline_menu_24.xml +++ b/app/src/main/res/drawable/ic_baseline_menu_24.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_baseline_screen_lock_portrait_24.xml b/app/src/main/res/drawable/ic_baseline_screen_lock_portrait_24.xml index 8ec144f5697f337357a8c40fc5c5a0861dbfad68..81fdcd3ca81ecd4da494e5ee43c848d0684ff077 100644 --- a/app/src/main/res/drawable/ic_baseline_screen_lock_portrait_24.xml +++ b/app/src/main/res/drawable/ic_baseline_screen_lock_portrait_24.xml @@ -1,5 +1,9 @@ - - + + diff --git a/app/src/main/res/drawable/ic_baseline_smartphone_24.xml b/app/src/main/res/drawable/ic_baseline_smartphone_24.xml index fc886c921e89c43e3e5ea846b11ae46e449458e8..8cddd008c7f089fd97da1c163198075b4bb8d625 100644 --- a/app/src/main/res/drawable/ic_baseline_smartphone_24.xml +++ b/app/src/main/res/drawable/ic_baseline_smartphone_24.xml @@ -2,10 +2,9 @@ android:width="24dp" android:height="24dp" android:autoMirrored="true" - android:tint="#757575" android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_baseline_vpn_key_24.xml b/app/src/main/res/drawable/ic_baseline_vpn_key_24.xml index 194d81a94196963eb02adf7e8adccba94fa78fc8..656296345fbdbaf5ba72a96faf189a725b1b44b9 100644 --- a/app/src/main/res/drawable/ic_baseline_vpn_key_24.xml +++ b/app/src/main/res/drawable/ic_baseline_vpn_key_24.xml @@ -1,5 +1,10 @@ - - + + diff --git a/app/src/main/res/drawable/ic_brightness_2_grey_24dp.xml b/app/src/main/res/drawable/ic_brightness_2_grey_24dp.xml index 7e5b2fc590db5bf44c669943c2e4603dd1c784f5..e8ba2d980f7bd6d8b483c95a2b6077af06ff2a58 100644 --- a/app/src/main/res/drawable/ic_brightness_2_grey_24dp.xml +++ b/app/src/main/res/drawable/ic_brightness_2_grey_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_clear_grey_24dp.xml b/app/src/main/res/drawable/ic_clear_grey_24dp.xml index c99d8c4227f9cd04c6bd5dfa452650628ccb0ad9..eece1f1611577819419caaada6e7605c339b5226 100644 --- a/app/src/main/res/drawable/ic_clear_grey_24dp.xml +++ b/app/src/main/res/drawable/ic_clear_grey_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_create_new_folder_grey600_18dp.xml b/app/src/main/res/drawable/ic_create_new_folder_grey600_18dp.xml index da7b8b09b00163b301da4d1a7a09e72e82b5eda2..5e4bf47cb591eea8d404dd1f223e7d584e63956a 100644 --- a/app/src/main/res/drawable/ic_create_new_folder_grey600_18dp.xml +++ b/app/src/main/res/drawable/ic_create_new_folder_grey600_18dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_create_new_folder_grey600_24dp.xml b/app/src/main/res/drawable/ic_create_new_folder_grey600_24dp.xml index b6f2118f149002110f6f459dfe1b2efa080f2481..8eea615f875a9168adee0016578953638af4a6b2 100644 --- a/app/src/main/res/drawable/ic_create_new_folder_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_create_new_folder_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_delete_grey600_24dp.xml b/app/src/main/res/drawable/ic_delete_grey600_24dp.xml index ae12fa2c5be3e5e1bd4cb28a746d934a85c45eab..aa38b8f85ddd5d82c683db52ea807032805b10b9 100644 --- a/app/src/main/res/drawable/ic_delete_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_delete_grey600_24dp.xml @@ -1,10 +1,9 @@ diff --git a/app/src/main/res/drawable/ic_edit_grey600_24dp.xml b/app/src/main/res/drawable/ic_edit_grey600_24dp.xml index 53bd7d023d36bd8dcf5322b08bf25a28c9b54e59..194156310a45c078fbe743847dc0f5af7f3ce826 100644 --- a/app/src/main/res/drawable/ic_edit_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_edit_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_eye_grey600_24dp.xml b/app/src/main/res/drawable/ic_eye_grey600_24dp.xml index dab8e80bade2ddd2d7f9cc22763ccaaeedbb5db1..3683675a820688f698f1585bf444dd22e3574ce9 100644 --- a/app/src/main/res/drawable/ic_eye_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_eye_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_folder_grey600_18dp.xml b/app/src/main/res/drawable/ic_folder_grey600_18dp.xml index dc540b580b137698d8bb00b15fafda3f7ec6d982..f1415d9f0fb92e1508d2a9e799c468bf8301401e 100644 --- a/app/src/main/res/drawable/ic_folder_grey600_18dp.xml +++ b/app/src/main/res/drawable/ic_folder_grey600_18dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_folder_grey600_24dp.xml b/app/src/main/res/drawable/ic_folder_grey600_24dp.xml index dc78257239fb2bf56a59637b7323f3c07dfea762..dd6da9003145f7827b2bb9324c68d0f60d27f17d 100644 --- a/app/src/main/res/drawable/ic_folder_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_folder_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_folder_white_24dp.xml b/app/src/main/res/drawable/ic_folder_grey_24dp.xml similarity index 85% rename from app/src/main/res/drawable/ic_folder_white_24dp.xml rename to app/src/main/res/drawable/ic_folder_grey_24dp.xml index 89dd53d0528fa26abbd56fe2f1d430eef48aa111..dd6da9003145f7827b2bb9324c68d0f60d27f17d 100644 --- a/app/src/main/res/drawable/ic_folder_white_24dp.xml +++ b/app/src/main/res/drawable/ic_folder_grey_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_folder_open_grey600_24dp.xml b/app/src/main/res/drawable/ic_folder_open_grey600_24dp.xml index 633b832ab346e7099a741c81c7c56b6e6a4ec851..e4d82802aa74594bbc55ab841cc31e4ffadc3726 100644 --- a/app/src/main/res/drawable/ic_folder_open_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_folder_open_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_format_size_black_24dp.xml b/app/src/main/res/drawable/ic_format_size_black_24dp.xml index d903d80493b6d2501debdad977a23c50810be4a2..ab1a4cd05546f6f2cf4411886aacece5f6e18e2d 100644 --- a/app/src/main/res/drawable/ic_format_size_black_24dp.xml +++ b/app/src/main/res/drawable/ic_format_size_black_24dp.xml @@ -1,10 +1,9 @@ diff --git a/app/src/main/res/drawable/ic_hamberger_24dp.xml b/app/src/main/res/drawable/ic_hamberger_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..cdc451e7d178b9bdad22b50bf8e6ce13986e3dbe --- /dev/null +++ b/app/src/main/res/drawable/ic_hamberger_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/app/src/main/res/drawable/ic_info_outline_grey600_24dp.xml b/app/src/main/res/drawable/ic_info_outline_grey600_24dp.xml index 4909d815881a2fa7d4da2de54772beea7883d3f8..e06059dc59b13d5c08d3cd8d35ee46f11c882edd 100644 --- a/app/src/main/res/drawable/ic_info_outline_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_info_outline_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml index 9127e535acc52f109e185c26177b6a291b7c3349..788ff6a73c31563b079445826a0921596fa1c5a2 100644 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -2,26 +2,40 @@ xmlns:aapt="http://schemas.android.com/aapt" android:width="108dp" android:height="108dp" - android:viewportWidth="1344" - android:viewportHeight="1344"> - - - - - - - - + android:viewportWidth="108" + android:viewportHeight="108"> + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index b3eb55f92783bb98a65c1a3c894112ee9c24a885..96540cd3c15d3d49214c6f3505b9ba1628e21be7 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -2,13 +2,22 @@ - - - - \ No newline at end of file + android:viewportWidth="108" + android:viewportHeight="108"> + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground_full.xml b/app/src/main/res/drawable/ic_launcher_foreground_full.xml index cf08e71a5b61cec5268bd0ab494d78019da2f642..c9b6b0d7744593ee2aacc4447649a3e6e6e30790 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground_full.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground_full.xml @@ -1,14 +1,59 @@ - - + android:viewportWidth="108" + android:viewportHeight="108"> + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/app/src/main/res/drawable/ic_library_music_grey600_24dp.xml b/app/src/main/res/drawable/ic_library_music_grey600_24dp.xml index ae1f73a35c1c2c8404cf618c2c664d6b49254fd3..82f4e7cbb8bd64767fb325eec0114722f6e85a32 100644 --- a/app/src/main/res/drawable/ic_library_music_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_library_music_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_lightbulb_outline_grey600_24dp.xml b/app/src/main/res/drawable/ic_lightbulb_outline_grey600_24dp.xml index 695de0a58a88425bbbf13b8763f21a7f509e0a98..9355f14d53d8413d69087620f0960c15ab1ffcb3 100644 --- a/app/src/main/res/drawable/ic_lightbulb_outline_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_lightbulb_outline_grey600_24dp.xml @@ -1,10 +1,9 @@ diff --git a/app/src/main/res/drawable/ic_local_movies_grey600_24dp.xml b/app/src/main/res/drawable/ic_local_movies_grey600_24dp.xml index 04d79cd4c7bf8fbfb5dfbbb775df58e5f0ec4823..d15e86f45a6746b9edf2515c776e9d16a5ee4fc9 100644 --- a/app/src/main/res/drawable/ic_local_movies_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_local_movies_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_lock_grey600_24dp.xml b/app/src/main/res/drawable/ic_lock_grey600_24dp.xml index 9c6d7f761a1e89591a5e958fef5d308d308d0bb8..c288c1c275f4e1118a2f403d1a31f673c87b3833 100644 --- a/app/src/main/res/drawable/ic_lock_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_lock_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_more_24.xml b/app/src/main/res/drawable/ic_more_24.xml new file mode 100644 index 0000000000000000000000000000000000000000..cff9d837182b7cee3275478f2d8794ab2d2fc0db --- /dev/null +++ b/app/src/main/res/drawable/ic_more_24.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_network_wifi_grey600_24dp.xml b/app/src/main/res/drawable/ic_network_wifi_grey600_24dp.xml index 5180396cfe0ad5676bfd1bbe83e85207c958492d..ea568f77607444d20c6115f83521f44e488dd44c 100644 --- a/app/src/main/res/drawable/ic_network_wifi_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_network_wifi_grey600_24dp.xml @@ -1,15 +1,14 @@ diff --git a/app/src/main/res/drawable/ic_person_add_grey600_24dp.xml b/app/src/main/res/drawable/ic_person_add_grey600_24dp.xml index 1ff8efa27bc5b3c085a88efa6fe3420da59e220f..cb10b9bfa212a21d8df9ac88c569dca2da93f09d 100644 --- a/app/src/main/res/drawable/ic_person_add_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_person_add_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_remove_red_eye_grey_24dp.xml b/app/src/main/res/drawable/ic_remove_red_eye_grey_24dp.xml index d9b1702df6eecc05d8d33b498c0a1edddb1f873b..42a4a7dbae9b356d7a01fbb500efa6d40332d0af 100644 --- a/app/src/main/res/drawable/ic_remove_red_eye_grey_24dp.xml +++ b/app/src/main/res/drawable/ic_remove_red_eye_grey_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_search_grey600_24dp.xml b/app/src/main/res/drawable/ic_search_grey600_24dp.xml index d46f2cb3509901b1ebd1f3c02adffb849a1f9c41..a125282fee572aa54184f53b3f6efaedc52f64b4 100644 --- a/app/src/main/res/drawable/ic_search_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_search_grey600_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/app/src/main/res/drawable/ic_send_grey600_24dp.xml b/app/src/main/res/drawable/ic_send_grey600_24dp.xml index 0579570bb7429884fa8a2b4866fa209972e778b7..e25830978814b5965bf0364aeb3b7b5def0e22a7 100644 --- a/app/src/main/res/drawable/ic_send_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_send_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_settings_grey600_24dp.xml b/app/src/main/res/drawable/ic_settings_grey600_24dp.xml index eca3850c96f1eff984c91fbe49ac342b2445da7a..6343f45056ce57a50d366118442f402db167f192 100644 --- a/app/src/main/res/drawable/ic_settings_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_settings_grey600_24dp.xml @@ -3,11 +3,10 @@ android:width="24dp" android:height="24dp" android:autoMirrored="true" - android:tint="#757575" android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_share_white_24dp.xml b/app/src/main/res/drawable/ic_share_grey_24dp.xml similarity index 91% rename from app/src/main/res/drawable/ic_share_white_24dp.xml rename to app/src/main/res/drawable/ic_share_grey_24dp.xml index 9ad3ec3409311000a111cd3f9f24ef1678547762..46a50753838f565444399ed9dd0af18511d520df 100644 --- a/app/src/main/res/drawable/ic_share_white_24dp.xml +++ b/app/src/main/res/drawable/ic_share_grey_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_star_accent_24dp.xml b/app/src/main/res/drawable/ic_star_accent_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..67343f62156561850197fdeadc1a7326577db84e --- /dev/null +++ b/app/src/main/res/drawable/ic_star_accent_24dp.xml @@ -0,0 +1,25 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_star_border_accent_24dp.xml b/app/src/main/res/drawable/ic_star_border_accent_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..a90ab8f4b81186588468e3f543b431100356913d --- /dev/null +++ b/app/src/main/res/drawable/ic_star_border_accent_24dp.xml @@ -0,0 +1,26 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_star_border_white_24dp.xml b/app/src/main/res/drawable/ic_star_border_white_24dp.xml index 66887c8deff0970277f47948cc1ed04407173017..8ea199df75942af389cb354946b32d55157523af 100644 --- a/app/src/main/res/drawable/ic_star_border_white_24dp.xml +++ b/app/src/main/res/drawable/ic_star_border_white_24dp.xml @@ -1,10 +1,9 @@ - + android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_star_grey_24dp.xml b/app/src/main/res/drawable/ic_star_grey_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce8dbc9ea83e5cf8c8d147cb9aec61c52ab38d23 --- /dev/null +++ b/app/src/main/res/drawable/ic_star_grey_24dp.xml @@ -0,0 +1,25 @@ + + + + diff --git a/app/src/main/res/drawable/ic_star_grey_ccc_24dp.xml b/app/src/main/res/drawable/ic_star_grey_ccc_24dp.xml deleted file mode 100644 index cc1d9fb8d07ff14506a797f4ce543a7943be339a..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_star_grey_ccc_24dp.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_star_white_24dp.xml b/app/src/main/res/drawable/ic_star_white_24dp.xml index b7fb611c0bbdf41b18a8cab751800e32367a3966..3c9606b5c96400fafc78bb9fd56e8d5acdaaeed6 100644 --- a/app/src/main/res/drawable/ic_star_white_24dp.xml +++ b/app/src/main/res/drawable/ic_star_white_24dp.xml @@ -1,6 +1,5 @@ diff --git a/app/src/main/res/drawable/ic_sync_blue_18dp.xml b/app/src/main/res/drawable/ic_sync_blue_18dp.xml index 8432cfc615f2bebb3dad12d8b2caf493881c680c..55ffa35deebb53a5cb4f16bb5e38140a1908850f 100644 --- a/app/src/main/res/drawable/ic_sync_blue_18dp.xml +++ b/app/src/main/res/drawable/ic_sync_blue_18dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_text_format_grey600_24dp.xml b/app/src/main/res/drawable/ic_text_format_grey600_24dp.xml index f6a970aef8ab85d396cd0b273071e3630d50c92f..1f8844b38c4dc8e16f6c09bbc180c8f440520b52 100644 --- a/app/src/main/res/drawable/ic_text_format_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_text_format_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_title_grey600_24dp.xml b/app/src/main/res/drawable/ic_title_grey600_24dp.xml index 38f2bf625721a1b4a84a3e373ed31ef4f6c274e9..9b993fcd913585ee70c7819b912418cc7d09f355 100644 --- a/app/src/main/res/drawable/ic_title_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_title_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/ic_work_grey600_24dp.xml b/app/src/main/res/drawable/ic_work_grey600_24dp.xml index 030d0889edb96622a7fa08fb97118129bedf846c..c660430d998884b94c34de1752611b86817ecc41 100644 --- a/app/src/main/res/drawable/ic_work_grey600_24dp.xml +++ b/app/src/main/res/drawable/ic_work_grey600_24dp.xml @@ -1,11 +1,10 @@ diff --git a/app/src/main/res/drawable/list_item_background_selector.xml b/app/src/main/res/drawable/list_item_background_selector.xml index 573bd924b6c0dbd700c254b5e5c88dde6277db20..4025de9d9f881f084e675311ad4311866f55ef44 100644 --- a/app/src/main/res/drawable/list_item_background_selector.xml +++ b/app/src/main/res/drawable/list_item_background_selector.xml @@ -5,11 +5,11 @@ - + - + diff --git a/app/src/main/res/drawable/modification_desc.xml b/app/src/main/res/drawable/modification_desc.xml index acd49abad56f102650787326e6305568fb0cb1a8..edd8f2584f7cded6c7233de08a48704b2a04ede0 100644 --- a/app/src/main/res/drawable/modification_desc.xml +++ b/app/src/main/res/drawable/modification_desc.xml @@ -6,6 +6,6 @@ android:viewportHeight="26"> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 89c2aaa66ff54b6e3f8427baaf8dc12cbddbb0a2..1c686f5d7491d426bd4fc19faf1d32a81d31d993 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -1,14 +1,30 @@ + @@ -19,22 +35,13 @@ android:layout_marginHorizontal="@dimen/spacer_activity_sides" app:contentInsetStartWithNavigation="0dp" app:navigationIcon="@drawable/ic_arrow_back_grey600_24dp" - app:titleMarginStart="0dp" - tools:title="@string/simple_about" /> - - + app:title="@string/simple_about" + app:titleMarginStart="0dp" /> - - + android:layout_height="match_parent" + android:orientation="vertical" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml index 8948c07689f42a6f8e2a66642b8c792c9b01bd50..f7796f63839e1bab40f55b073137cc20a0d1cd8c 100644 --- a/app/src/main/res/layout/activity_edit.xml +++ b/app/src/main/res/layout/activity_edit.xml @@ -8,6 +8,7 @@ @@ -26,6 +27,6 @@ android:id="@+id/fragment_container_view" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/colorPrimary" /> + android:background="@color/e_background" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_exception.xml b/app/src/main/res/layout/activity_exception.xml index ce352cc6b0c415e9630531024da426ba21189cb9..fb3554a5965cff388ae2de7a8d6f04f4aab3d84a 100644 --- a/app/src/main/res/layout/activity_exception.xml +++ b/app/src/main/res/layout/activity_exception.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/colorPrimary" + android:background="@color/e_background" android:orientation="vertical"> @@ -49,6 +50,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="@dimen/spacer_2x" + android:textColor="@color/color_default_primary_text" android:text="@string/error_dialog_we_need_info" android:textAppearance="?attr/textAppearanceBody2" /> @@ -63,6 +65,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/bg_highlighted" + android:textColor="@color/color_default_primary_text" android:padding="@dimen/spacer_1x" android:textIsSelectable="true" android:typeface="monospace" @@ -88,6 +91,10 @@ android:text="@string/simple_close" android:textColor="@color/defaultBrand" /> + +