From 6fa23d1bc388da4c73255c3b399a8f02d27e7840 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 8 Dec 2022 10:20:03 +0100 Subject: [PATCH] Allow to enable or disable the cardview presentation in settings --- .../android/ui/drawer/AccountAdapter.java | 7 ++++++ .../drawer/AccountFollowRequestAdapter.java | 10 +++++++++ .../android/ui/drawer/AccountListAdapter.java | 10 +++++++++ .../ui/drawer/AnnouncementAdapter.java | 10 +++++++++ .../ui/drawer/ConversationAdapter.java | 5 ++++- .../android/ui/drawer/DomainBlockAdapter.java | 10 +++++++++ .../android/ui/drawer/InstanceRegAdapter.java | 7 ++++++ .../ui/drawer/NotificationAdapter.java | 16 +++++++++++++- .../android/ui/drawer/StatusAdapter.java | 22 +++++++++++++++++-- .../android/ui/drawer/StatusDraftAdapter.java | 11 +++++++++- .../ui/drawer/StatusScheduledAdapter.java | 2 +- .../android/ui/drawer/SuggestionAdapter.java | 8 ++++++- .../fedilab/android/ui/drawer/TagAdapter.java | 10 +++++++++ .../ui/drawer/admin/AdminAccountAdapter.java | 13 ++++++++++- app/src/main/res/layout/drawer_account.xml | 13 +++++++---- .../main/res/layout/drawer_account_list.xml | 22 ++++++++++++------- .../main/res/layout/drawer_admin_account.xml | 15 +++++++++---- .../main/res/layout/drawer_announcement.xml | 12 +++++----- .../main/res/layout/drawer_conversation.xml | 14 +++++++----- .../main/res/layout/drawer_domain_block.xml | 13 ++++++++--- app/src/main/res/layout/drawer_follow.xml | 12 +++++++--- .../main/res/layout/drawer_instance_reg.xml | 15 +++++++++---- app/src/main/res/layout/drawer_status.xml | 10 +++++---- .../main/res/layout/drawer_status_draft.xml | 14 ++++++++---- .../res/layout/drawer_status_filtered.xml | 9 +++++--- .../layout/drawer_status_filtered_hide.xml | 9 +++++--- .../main/res/layout/drawer_status_history.xml | 14 +++++++----- .../res/layout/drawer_status_scheduled.xml | 14 ++++++++---- .../main/res/layout/drawer_status_simple.xml | 14 +++++++----- app/src/main/res/layout/drawer_suggestion.xml | 14 ++++++++---- app/src/main/res/layout/drawer_tag.xml | 14 +++++++++--- app/src/main/res/values/strings.xml | 3 +++ app/src/main/res/xml/pref_theming.xml | 9 ++++++++ 33 files changed, 302 insertions(+), 79 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java index 7fdfb581c..2b0448de3 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java @@ -68,6 +68,11 @@ public class AccountAdapter extends RecyclerView.Adapter { Intent intent = new Intent(context, ProfileActivity.class); Bundle b = new Bundle(); @@ -78,6 +83,8 @@ public class AccountAdapter extends RecyclerView.Adapter 0) { ReactionAdapter reactionAdapter = new ReactionAdapter(announcement.id, announcement.reactions); holder.binding.layoutReactions.reactionsView.setAdapter(reactionAdapter); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ConversationAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ConversationAdapter.java index f163d4b9f..fbc59b82b 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ConversationAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ConversationAdapter.java @@ -90,7 +90,10 @@ public class ConversationAdapter extends RecyclerView.Adapter. */ import android.content.Context; +import android.content.SharedPreferences; import android.view.LayoutInflater; +import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; import java.util.List; @@ -61,6 +64,13 @@ public class DomainBlockAdapter extends RecyclerView.Adapter { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/InstanceRegAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/InstanceRegAdapter.java index a88c24ad5..82a5703d8 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/InstanceRegAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/InstanceRegAdapter.java @@ -16,11 +16,13 @@ package app.fedilab.android.ui.drawer; import android.content.Context; +import android.content.SharedPreferences; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.Glide; @@ -46,6 +48,11 @@ public class InstanceRegAdapter extends RecyclerView.Adapter { notification.filteredByApp = null; @@ -234,6 +244,11 @@ public class NotificationAdapter extends RecyclerView.Adapter 0) { holderStatus.bindingNotification.status.mediaContainer.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 3b1de7cc1..228dc4277 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -2164,12 +2164,21 @@ public class StatusAdapter extends RecyclerView.Adapter Status status = statusList.get(position); if (viewHolder.getItemViewType() == STATUS_VISIBLE) { StatusViewHolder holder = (StatusViewHolder) viewHolder; + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); + if (sharedpreferences.getBoolean(context.getString(R.string.SET_CARDVIEW), false)) { + holder.binding.cardviewContainer.setCardElevation(Helper.convertDpToPixel(5, context)); + holder.binding.dividerCard.setVisibility(View.GONE); + } StatusesVM statusesVM = new ViewModelProvider((ViewModelStoreOwner) context).get(StatusesVM.class); SearchVM searchVM = new ViewModelProvider((ViewModelStoreOwner) context).get(SearchVM.class); statusManagement(context, statusesVM, searchVM, holder, mRecyclerView, this, statusList, status, timelineType, minified, canBeFederated, checkRemotely, fetchMoreCallBack); } else if (viewHolder.getItemViewType() == STATUS_FILTERED_HIDE) { StatusViewHolder holder = (StatusViewHolder) viewHolder; - + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); + if (sharedpreferences.getBoolean(context.getString(R.string.SET_CARDVIEW), false)) { + holder.binding.cardviewContainer.setCardElevation(Helper.convertDpToPixel(5, context)); + holder.binding.dividerCard.setVisibility(View.GONE); + } if (status.isFetchMore && fetchMoreCallBack != null) { holder.bindingFilteredHide.layoutFetchMore.fetchMoreContainer.setVisibility(View.VISIBLE); holder.bindingFilteredHide.layoutFetchMore.fetchMoreMin.setOnClickListener(v -> { @@ -2203,7 +2212,11 @@ public class StatusAdapter extends RecyclerView.Adapter } else if (viewHolder.getItemViewType() == STATUS_FILTERED) { StatusViewHolder holder = (StatusViewHolder) viewHolder; - + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); + if (sharedpreferences.getBoolean(context.getString(R.string.SET_CARDVIEW), false)) { + holder.binding.cardviewContainer.setCardElevation(Helper.convertDpToPixel(5, context)); + holder.binding.dividerCard.setVisibility(View.GONE); + } holder.bindingFiltered.filteredText.setText(context.getString(R.string.filtered_by, status.filteredByApp.title)); holder.bindingFiltered.displayButton.setOnClickListener(v -> { status.filteredByApp = null; @@ -2243,6 +2256,11 @@ public class StatusAdapter extends RecyclerView.Adapter } else if (viewHolder.getItemViewType() == STATUS_ART) { StatusViewHolder holder = (StatusViewHolder) viewHolder; + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); + if (sharedpreferences.getBoolean(context.getString(R.string.SET_CARDVIEW), false)) { + holder.binding.cardviewContainer.setCardElevation(Helper.convertDpToPixel(5, context)); + holder.binding.dividerCard.setVisibility(View.GONE); + } MastodonHelper.loadPPMastodon(holder.bindingArt.artPp, status.account); if (status.art_attachment != null) { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java index 134030160..a9b849905 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java @@ -17,12 +17,15 @@ package app.fedilab.android.ui.drawer; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.view.LayoutInflater; +import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; import java.io.File; @@ -68,6 +71,12 @@ public class StatusDraftAdapter extends RecyclerView.Adapter 0) { holder.binding.statusContent.setText(statusDraft.statusDraftList.get(0).text, TextView.BufferType.SPANNABLE); @@ -87,7 +96,7 @@ public class StatusDraftAdapter extends RecyclerView.Adapter { + holder.binding.cardviewContainer.setOnClickListener(v -> { Intent intent = new Intent(context, ComposeActivity.class); intent.putExtra(Helper.ARG_STATUS_DRAFT, statusDraft); context.startActivity(intent); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusScheduledAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusScheduledAdapter.java index 011fadbe0..5e1e458d2 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusScheduledAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusScheduledAdapter.java @@ -121,7 +121,7 @@ public class StatusScheduledAdapter extends RecyclerView.Adapter { + holder.binding.cardviewContainer.setOnClickListener(v -> { if (statusDraft != null) { Intent intent = new Intent(context, ComposeActivity.class); intent.putExtra(Helper.ARG_STATUS_DRAFT, statusDraft); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/SuggestionAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/SuggestionAdapter.java index c1a817a4b..1637004cb 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/SuggestionAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/SuggestionAdapter.java @@ -18,6 +18,7 @@ package app.fedilab.android.ui.drawer; import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -28,6 +29,7 @@ import androidx.annotation.NonNull; import androidx.core.app.ActivityOptionsCompat; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; import java.lang.ref.WeakReference; @@ -76,7 +78,11 @@ public class SuggestionAdapter extends RecyclerView.Adapter { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/TagAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/TagAdapter.java index 7f7a8a77c..58c9969fc 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/TagAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/TagAdapter.java @@ -16,11 +16,14 @@ package app.fedilab.android.ui.drawer; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Bundle; import android.view.LayoutInflater; +import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; import com.github.mikephil.charting.components.Description; @@ -52,6 +55,13 @@ public class TagAdapter extends RecyclerView.Adapter { public static void tagManagement(Context context, TagViewHolder tagViewHolder, Tag tag) { tagViewHolder.binding.tagName.setText(String.format("#%s", tag.name)); + + SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); + if (sharedpreferences.getBoolean(context.getString(R.string.SET_CARDVIEW), false)) { + tagViewHolder.binding.cardviewContainer.setCardElevation(Helper.convertDpToPixel(5, context)); + tagViewHolder.binding.dividerCard.setVisibility(View.GONE); + } + List trendsEntry = new ArrayList<>(); List historyList = tag.history; diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/admin/AdminAccountAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/admin/AdminAccountAdapter.java index 16968e410..772c55850 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/admin/AdminAccountAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/admin/AdminAccountAdapter.java @@ -17,16 +17,20 @@ package app.fedilab.android.ui.drawer.admin; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Bundle; import android.view.LayoutInflater; +import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; import java.util.List; import java.util.Locale; +import app.fedilab.android.R; import app.fedilab.android.activities.admin.AdminAccountActivity; import app.fedilab.android.client.entities.api.admin.AdminAccount; import app.fedilab.android.databinding.DrawerAdminAccountBinding; @@ -63,8 +67,15 @@ public class AdminAccountAdapter extends RecyclerView.Adapter { + holder.binding.cardviewContainer.setOnClickListener(v -> { Intent intent = new Intent(context, AdminAccountActivity.class); Bundle b = new Bundle(); b.putSerializable(Helper.ARG_ACCOUNT, adminAccount); diff --git a/app/src/main/res/layout/drawer_account.xml b/app/src/main/res/layout/drawer_account.xml index 75a4731a8..449c8befc 100644 --- a/app/src/main/res/layout/drawer_account.xml +++ b/app/src/main/res/layout/drawer_account.xml @@ -14,16 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:layout_marginTop="6dp" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -154,4 +159,4 @@ - + diff --git a/app/src/main/res/layout/drawer_account_list.xml b/app/src/main/res/layout/drawer_account_list.xml index 06c946949..78b1b0af8 100644 --- a/app/src/main/res/layout/drawer_account_list.xml +++ b/app/src/main/res/layout/drawer_account_list.xml @@ -14,15 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:layout_marginHorizontal="6dp" + android:layout_marginTop="6dp" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -71,14 +77,14 @@ - + diff --git a/app/src/main/res/layout/drawer_admin_account.xml b/app/src/main/res/layout/drawer_admin_account.xml index 11be13127..2b5152947 100644 --- a/app/src/main/res/layout/drawer_admin_account.xml +++ b/app/src/main/res/layout/drawer_admin_account.xml @@ -1,16 +1,23 @@ - + android:layout_marginTop="6dp" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> + - + diff --git a/app/src/main/res/layout/drawer_announcement.xml b/app/src/main/res/layout/drawer_announcement.xml index b7fe36219..4825a7be3 100644 --- a/app/src/main/res/layout/drawer_announcement.xml +++ b/app/src/main/res/layout/drawer_announcement.xml @@ -14,19 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -96,4 +98,4 @@ - + diff --git a/app/src/main/res/layout/drawer_conversation.xml b/app/src/main/res/layout/drawer_conversation.xml index 3fa599d23..8da244c4b 100644 --- a/app/src/main/res/layout/drawer_conversation.xml +++ b/app/src/main/res/layout/drawer_conversation.xml @@ -14,17 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:layout_marginTop="6dp" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -115,4 +119,4 @@ tools:visibility="visible" /> - + diff --git a/app/src/main/res/layout/drawer_domain_block.xml b/app/src/main/res/layout/drawer_domain_block.xml index 81edbc780..653b54c49 100644 --- a/app/src/main/res/layout/drawer_domain_block.xml +++ b/app/src/main/res/layout/drawer_domain_block.xml @@ -14,13 +14,20 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see . --> - + android:layout_marginHorizontal="6dp" + android:layout_marginTop="6dp" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -51,4 +58,4 @@ android:padding="6dp" app:icon="@drawable/ic_baseline_delete_24" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_follow.xml b/app/src/main/res/layout/drawer_follow.xml index 0fcc8e74a..7a6973df1 100644 --- a/app/src/main/res/layout/drawer_follow.xml +++ b/app/src/main/res/layout/drawer_follow.xml @@ -14,15 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -128,4 +134,4 @@ - + diff --git a/app/src/main/res/layout/drawer_instance_reg.xml b/app/src/main/res/layout/drawer_instance_reg.xml index 0f97003ab..7eea23d17 100644 --- a/app/src/main/res/layout/drawer_instance_reg.xml +++ b/app/src/main/res/layout/drawer_instance_reg.xml @@ -14,14 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see . --> - + android:id="@+id/cardview_container" + android:layout_marginHorizontal="@dimen/card_margin" + android:layout_marginTop="@dimen/card_margin" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -49,7 +56,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="6dp" - android:textAppearance="@style/TextAppearance.Material3.HeadlineMedium" + android:textAppearance="@style/TextAppearance.Material3.TitleMedium" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/instance_pp" app:layout_constraintTop_toTopOf="parent" @@ -99,4 +106,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_status.xml b/app/src/main/res/layout/drawer_status.xml index aa6609ab7..7402e0da1 100644 --- a/app/src/main/res/layout/drawer_status.xml +++ b/app/src/main/res/layout/drawer_status.xml @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - - + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -738,4 +740,4 @@ - + diff --git a/app/src/main/res/layout/drawer_status_draft.xml b/app/src/main/res/layout/drawer_status_draft.xml index 1eb24ce4b..20d4c9efa 100644 --- a/app/src/main/res/layout/drawer_status_draft.xml +++ b/app/src/main/res/layout/drawer_status_draft.xml @@ -14,15 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:layout_marginHorizontal="@dimen/card_margin" + android:layout_marginTop="@dimen/card_margin" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -106,4 +112,4 @@ - + diff --git a/app/src/main/res/layout/drawer_status_filtered.xml b/app/src/main/res/layout/drawer_status_filtered.xml index 69154e28a..ad55cf66c 100644 --- a/app/src/main/res/layout/drawer_status_filtered.xml +++ b/app/src/main/res/layout/drawer_status_filtered.xml @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -78,4 +81,4 @@ tools:visibility="visible" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_status_filtered_hide.xml b/app/src/main/res/layout/drawer_status_filtered_hide.xml index 4b7b32232..a4b85bdf4 100644 --- a/app/src/main/res/layout/drawer_status_filtered_hide.xml +++ b/app/src/main/res/layout/drawer_status_filtered_hide.xml @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -47,4 +50,4 @@ app:layout_constraintTop_toTopOf="parent" tools:visibility="visible" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_status_history.xml b/app/src/main/res/layout/drawer_status_history.xml index 0522d2c66..9bdee310b 100644 --- a/app/src/main/res/layout/drawer_status_history.xml +++ b/app/src/main/res/layout/drawer_status_history.xml @@ -14,17 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -100,4 +104,4 @@ tools:text="@tools:sample/lorem/random" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_status_scheduled.xml b/app/src/main/res/layout/drawer_status_scheduled.xml index b22296a2c..d2c36eb97 100644 --- a/app/src/main/res/layout/drawer_status_scheduled.xml +++ b/app/src/main/res/layout/drawer_status_scheduled.xml @@ -14,15 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:layout_marginHorizontal="@dimen/card_margin" + android:layout_marginTop="@dimen/card_margin" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -96,4 +102,4 @@ - + diff --git a/app/src/main/res/layout/drawer_status_simple.xml b/app/src/main/res/layout/drawer_status_simple.xml index f74127091..baa53c424 100644 --- a/app/src/main/res/layout/drawer_status_simple.xml +++ b/app/src/main/res/layout/drawer_status_simple.xml @@ -14,17 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -98,4 +102,4 @@ tools:text="@tools:sample/lorem/random" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/drawer_suggestion.xml b/app/src/main/res/layout/drawer_suggestion.xml index 8ed647a55..a8eba685e 100644 --- a/app/src/main/res/layout/drawer_suggestion.xml +++ b/app/src/main/res/layout/drawer_suggestion.xml @@ -14,15 +14,21 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see --> - + android:layout_marginHorizontal="@dimen/card_margin" + android:layout_marginTop="@dimen/card_margin" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -107,4 +113,4 @@ - + diff --git a/app/src/main/res/layout/drawer_tag.xml b/app/src/main/res/layout/drawer_tag.xml index 966671041..1819db94f 100644 --- a/app/src/main/res/layout/drawer_tag.xml +++ b/app/src/main/res/layout/drawer_tag.xml @@ -14,12 +14,20 @@ You should have received a copy of the GNU General Public License along with Fedilab; if not, see . --> - + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/cardview_container" + android:layout_marginHorizontal="@dimen/card_margin" + android:layout_marginTop="@dimen/card_margin" + android:clipChildren="false" + android:clipToPadding="false" + app:cardElevation="0dp" + app:strokeWidth="0dp"> @@ -64,4 +72,4 @@ android:layout_width="100dp" android:layout_height="50dp" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index aa1a76088..f0d5cd641 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1297,6 +1297,7 @@ SET_CAPITALIZE SET_THEME_BASE SET_DYNAMICCOLOR + SET_CARDVIEW SET_THEME_DEFAULT_LIGHT SET_THEME_DEFAULT_DARK @@ -2015,4 +2016,6 @@ Align tonally with the color scheme of your personal wallpaper. Default light theme Default dark theme + Use card view presentation + When enabled, items in timelines will have a shadow and an elevation. \ No newline at end of file diff --git a/app/src/main/res/xml/pref_theming.xml b/app/src/main/res/xml/pref_theming.xml index 742c4202f..7c8b1cc7f 100644 --- a/app/src/main/res/xml/pref_theming.xml +++ b/app/src/main/res/xml/pref_theming.xml @@ -44,4 +44,13 @@ app:title="@string/type_default_theme_dark" app:useSimpleSummaryProvider="true" /> + + +