From 4e617dccc78193d55d0bb3a02c9d347e6a1b1188 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Fri, 9 Mar 2018 20:39:08 +0100 Subject: [PATCH] change the color of all SwipeRefreshLayouts to match the Tusky theme --- .../com/keylesspalace/tusky/fragment/AccountMediaFragment.kt | 2 ++ .../keylesspalace/tusky/fragment/NotificationsFragment.java | 4 +++- .../com/keylesspalace/tusky/fragment/TimelineFragment.java | 2 ++ .../com/keylesspalace/tusky/fragment/ViewThreadFragment.java | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt index 3818b0960..53f0915e0 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt @@ -155,6 +155,8 @@ class AccountMediaFragment : BaseFragment() { currentCall?.enqueue(callback) } + swipeLayout.setColorSchemeResources(R.color.primary) + swipeLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground)) recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() { diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index 019989c3b..acad55368 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -37,10 +37,10 @@ import android.view.View; import android.view.ViewGroup; import com.keylesspalace.tusky.MainActivity; +import com.keylesspalace.tusky.R; import com.keylesspalace.tusky.TuskyApplication; import com.keylesspalace.tusky.adapter.FooterViewHolder; import com.keylesspalace.tusky.adapter.NotificationsAdapter; -import com.keylesspalace.tusky.R; import com.keylesspalace.tusky.db.AccountEntity; import com.keylesspalace.tusky.db.AccountManager; import com.keylesspalace.tusky.entity.Attachment; @@ -144,6 +144,8 @@ public class NotificationsFragment extends SFragment implements // Setup the SwipeRefreshLayout. swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout.setOnRefreshListener(this); + swipeRefreshLayout.setColorSchemeResources(R.color.primary); + swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground)); // Setup the RecyclerView. recyclerView = rootView.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java index e6cebf809..450d606cc 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -169,6 +169,8 @@ public class TimelineFragment extends SFragment implements Context context = getContext(); swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout.setOnRefreshListener(this); + swipeRefreshLayout.setColorSchemeResources(R.color.primary); + swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground)); // Setup the RecyclerView. recyclerView = rootView.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java index 47b82f604..93733bc62 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java @@ -96,6 +96,8 @@ public class ViewThreadFragment extends SFragment implements Context context = getContext(); swipeRefreshLayout = rootView.findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout.setOnRefreshListener(this); + swipeRefreshLayout.setColorSchemeResources(R.color.primary); + swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground)); recyclerView = rootView.findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true);