diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-04-14 14:28:02 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-04-14 14:28:02 +0300 |
commit | 01d9744bd9d80af3cc54badcb2ffc923e7324ccc (patch) | |
tree | 70756a69b13d45cd495e03e80b7c67c79f1390f0 /app/src/main/java/it/niedermann/nextcloud/deck/ui/stack | |
parent | b041efff6390dae6bf5cdda909971e417303468c (diff) |
#317 Adjust theme for each account
Tint sync icon for cards
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/stack')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java index 594c00e0e..690e8368a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java @@ -14,14 +14,16 @@ import androidx.recyclerview.widget.RecyclerView; import java.util.List; import it.niedermann.android.crosstabdnd.DragAndDropTab; +import it.niedermann.nextcloud.deck.Application; import it.niedermann.nextcloud.deck.databinding.FragmentStackBinding; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.model.full.FullCard; import it.niedermann.nextcloud.deck.persistence.sync.SyncManager; +import it.niedermann.nextcloud.deck.ui.branding.Branded; import it.niedermann.nextcloud.deck.ui.card.CardAdapter; import it.niedermann.nextcloud.deck.ui.card.SelectCardListener; -public class StackFragment extends Fragment implements DragAndDropTab<CardAdapter> { +public class StackFragment extends Fragment implements DragAndDropTab<CardAdapter>, Branded { private static final String KEY_BOARD_ID = "boardId"; private static final String KEY_STACK_ID = "stackId"; @@ -84,8 +86,7 @@ public class StackFragment extends Fragment implements DragAndDropTab<CardAdapte syncManager = new SyncManager(activity); - adapter = new CardAdapter(account, boardId, stackId, canEdit, syncManager, this, (requireActivity() instanceof SelectCardListener) ? (SelectCardListener) requireActivity() : null); - + adapter = new CardAdapter(requireContext(), account, boardId, stackId, canEdit, syncManager, this, (requireActivity() instanceof SelectCardListener) ? (SelectCardListener) requireActivity() : null); binding.recyclerView.setAdapter(adapter); if (onScrollListener != null) { @@ -118,6 +119,18 @@ public class StackFragment extends Fragment implements DragAndDropTab<CardAdapte } @Override + public void onResume() { + Application.registerBrandedComponent(requireContext(), this); + super.onResume(); + } + + @Override + public void onPause() { + Application.deregisterBrandedComponent(this); + super.onPause(); + } + + @Override public CardAdapter getAdapter() { return adapter; } @@ -126,4 +139,9 @@ public class StackFragment extends Fragment implements DragAndDropTab<CardAdapte public RecyclerView getRecyclerView() { return binding.recyclerView; } + + @Override + public void applyBrand(int mainColor, int textColor) { + this.adapter.applyBrand(mainColor, textColor); + } }
\ No newline at end of file |