Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Niedermann <info@niedermann.it>2020-06-30 13:23:25 +0300
committerNiedermann IT-Dienstleistungen <stefan-niedermann@users.noreply.github.com>2020-06-30 13:58:19 +0300
commit15f3fdb2ae5eaf77300a98417f6e828ce213cc68 (patch)
treea3b8ea069e93b7fa93ccdcf854e7fca706258562 /app/src/main
parent9b8e069debfe290aaa873eb9c4823f75e1a55ef9 (diff)
#525 Adjust design to new style of Nextcloud app
Swipe 2 Refresh progress spinner
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java10
-rw-r--r--app/src/main/res/layout/activity_import_account.xml4
2 files changed, 8 insertions, 6 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java
index a9ddf2efb..27d02ce79 100644
--- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java
+++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java
@@ -95,7 +95,6 @@ import it.niedermann.nextcloud.deck.ui.stack.EditStackListener;
import it.niedermann.nextcloud.deck.ui.stack.OnScrollListener;
import it.niedermann.nextcloud.deck.ui.stack.StackAdapter;
import it.niedermann.nextcloud.deck.ui.stack.StackFragment;
-import it.niedermann.nextcloud.deck.util.ColorUtil;
import it.niedermann.nextcloud.deck.util.DrawerMenuUtil;
import static android.graphics.Color.parseColor;
@@ -106,6 +105,7 @@ import static it.niedermann.nextcloud.deck.Application.NO_STACK_ID;
import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.util.LiveDataHelper.observeOnce;
import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.applyBrandToFAB;
import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.applyBrandToPrimaryTabLayout;
+import static it.niedermann.nextcloud.deck.util.ColorUtil.contrastRatioIsSufficient;
import static it.niedermann.nextcloud.deck.util.DrawerMenuUtil.MENU_ID_ABOUT;
import static it.niedermann.nextcloud.deck.util.DrawerMenuUtil.MENU_ID_ADD_BOARD;
import static it.niedermann.nextcloud.deck.util.DrawerMenuUtil.MENU_ID_ARCHIVED_BOARDS;
@@ -419,10 +419,12 @@ public class MainActivity extends BrandedActivity implements DeleteStackListener
public void applyBrand(@ColorInt int mainColor) {
applyBrandToPrimaryTabLayout(mainColor, binding.stackTitles);
applyBrandToFAB(mainColor, binding.fab);
+ // TODO We assume, that the background of the spinner is always white
+ binding.swipeRefreshLayout.setColorSchemeColors(contrastRatioIsSufficient(Color.WHITE, mainColor) ? mainColor : colorAccent);
headerBinding.headerView.setBackgroundColor(mainColor);
- @ColorInt final int finalTextColor = ColorUtil.contrastRatioIsSufficient(mainColor, Color.WHITE) ? Color.WHITE : Color.BLACK;
- DrawableCompat.setTint(headerBinding.logo.getDrawable(), finalTextColor);
- headerBinding.appName.setTextColor(finalTextColor);
+ @ColorInt final int headerTextColor = contrastRatioIsSufficient(mainColor, Color.WHITE) ? Color.WHITE : Color.BLACK;
+ DrawableCompat.setTint(headerBinding.logo.getDrawable(), headerTextColor);
+ headerBinding.appName.setTextColor(headerTextColor);
}
@Override
diff --git a/app/src/main/res/layout/activity_import_account.xml b/app/src/main/res/layout/activity_import_account.xml
index ad7d31d46..e5ee4290a 100644
--- a/app/src/main/res/layout/activity_import_account.xml
+++ b/app/src/main/res/layout/activity_import_account.xml
@@ -44,12 +44,12 @@
android:layout_height="wrap_content"
android:layout_below="@id/welcome_text"
android:layout_centerHorizontal="true"
- android:backgroundTint="@color/defaultBrand"
android:paddingStart="32dp"
android:paddingTop="24dp"
android:paddingEnd="32dp"
android:paddingBottom="24dp"
- android:text="@string/choose_account" />
+ android:text="@string/choose_account"
+ app:backgroundTint="@color/defaultBrand" />
<TextView
android:id="@+id/status"