From 467c33aacb8081eb45ece9d3079fd96f140dd0ef Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Tue, 28 Jul 2020 10:38:28 +0200 Subject: [PATCH] upgrade SwipeRefreshLayout to 1.1.0 (#1866) --- app/build.gradle | 2 +- app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt | 2 -- .../tusky/components/conversation/ConversationsFragment.kt | 1 - .../components/report/fragments/ReportStatusesFragment.kt | 1 - .../tusky/components/scheduled/ScheduledTootActivity.kt | 2 -- .../tusky/components/search/fragments/SearchFragment.kt | 3 --- .../com/keylesspalace/tusky/fragment/AccountMediaFragment.kt | 1 - .../keylesspalace/tusky/fragment/NotificationsFragment.java | 1 - .../com/keylesspalace/tusky/fragment/TimelineFragment.java | 3 --- .../com/keylesspalace/tusky/fragment/ViewThreadFragment.java | 2 -- app/src/main/res/values/styles.xml | 2 ++ 11 files changed, 3 insertions(+), 17 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6f8f08a9..240b758c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -111,7 +111,7 @@ dependencies { implementation "androidx.appcompat:appcompat:1.2.0-rc01" implementation "androidx.fragment:fragment-ktx:1.2.5" implementation "androidx.browser:browser:1.2.0" - implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" + implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" implementation "androidx.recyclerview:recyclerview:1.1.0" implementation "androidx.exifinterface:exifinterface:1.2.0" implementation "androidx.cardview:cardview:1.0.0" diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt index 292fe241..09781875 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt @@ -353,8 +353,6 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI swipeToRefreshLayout.isRefreshing = isRefreshing == true }) swipeToRefreshLayout.setColorSchemeResources(R.color.tusky_blue) - swipeToRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(this, - android.R.attr.colorBackground)) } private fun onAccountChanged(account: Account?) { diff --git a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsFragment.kt index 995022e2..dc2d60c8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsFragment.kt @@ -102,7 +102,6 @@ class ConversationsFragment : SFragment(), StatusActionListener, Injectable, Res viewModel.refresh() } swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue) - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(swipeRefreshLayout.context, android.R.attr.colorBackground)) } private fun onTopLoaded() { diff --git a/app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt index dad6fe1f..e5308efc 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt @@ -101,7 +101,6 @@ class ReportStatusesFragment : Fragment(), Injectable, AdapterHandler { private fun setupSwipeRefreshLayout() { swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue) - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(swipeRefreshLayout.context, android.R.attr.colorBackground)) swipeRefreshLayout.setOnRefreshListener { snackbarErrorRetry?.dismiss() diff --git a/app/src/main/java/com/keylesspalace/tusky/components/scheduled/ScheduledTootActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/scheduled/ScheduledTootActivity.kt index 17682ad3..2ade20b8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/scheduled/ScheduledTootActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/scheduled/ScheduledTootActivity.kt @@ -59,8 +59,6 @@ class ScheduledTootActivity : BaseActivity(), ScheduledTootActionListener, Injec swipeRefreshLayout.setOnRefreshListener(this::refreshStatuses) swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue) - swipeRefreshLayout.setProgressBackgroundColorSchemeColor( - ThemeUtils.getColor(this, android.R.attr.colorBackground)) scheduledTootList.setHasFixedSize(true) scheduledTootList.layoutManager = LinearLayoutManager(this) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchFragment.kt index 45fa4d6e..c185bcc3 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchFragment.kt @@ -58,9 +58,6 @@ abstract class SearchFragment : Fragment(), private fun setupSwipeRefreshLayout() { swipeRefreshLayout.setOnRefreshListener(this) swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue) - swipeRefreshLayout.setProgressBackgroundColorSchemeColor( - ThemeUtils.getColor(swipeRefreshLayout.context, android.R.attr.colorBackground) - ) } private fun subscribeObservables() { 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 74c97b6c..ed1fbad8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt @@ -188,7 +188,6 @@ class AccountMediaFragment : BaseFragment(), RefreshableFragment, Injectable { refresh() } swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue) - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(view.context, android.R.attr.colorBackground)) } statusView.visibility = View.GONE 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 5e87c427..9a5cbbb6 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -223,7 +223,6 @@ public class NotificationsFragment extends SFragment implements swipeRefreshLayout.setOnRefreshListener(this); swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue); - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, android.R.attr.colorBackground)); loadNotificationsFilter(); 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 ef1f5ee1..0a6162c1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -421,11 +421,8 @@ public class TimelineFragment extends SFragment implements private void setupSwipeRefreshLayout() { swipeRefreshLayout.setEnabled(isSwipeToRefreshEnabled); if (isSwipeToRefreshEnabled) { - Context context = swipeRefreshLayout.getContext(); swipeRefreshLayout.setOnRefreshListener(this); swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue); - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.getColor(context, - android.R.attr.colorBackground)); } } 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 73011ca8..77fb3283 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java @@ -150,8 +150,6 @@ public final class ViewThreadFragment extends SFragment implements swipeRefreshLayout = rootView.findViewById(R.id.swipeRefreshLayout); swipeRefreshLayout.setOnRefreshListener(this); swipeRefreshLayout.setColorSchemeResources(R.color.tusky_blue); - swipeRefreshLayout.setProgressBackgroundColorSchemeColor( - ThemeUtils.getColor(context, android.R.attr.colorBackground)); recyclerView = rootView.findViewById(R.id.recyclerView); recyclerView.setHasFixedSize(true); diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 24a4352f..0c9c66f4 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -77,6 +77,8 @@ 32dp false + ?attr/colorSurface +