Adds a visual cue to the podcast header view whenever updates are disabled (#5014)

This commit is contained in:
datavizard 2021-03-10 18:00:45 +05:30 committed by GitHub
parent 57e5784e6f
commit b276c34942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View File

@ -100,6 +100,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
private ImageView imgvCover;
private TextView txtvInformation;
private TextView txtvAuthor;
private TextView txtvUpdatesDisabled;
private ImageButton butShowInfo;
private ImageButton butShowSettings;
private View header;
@ -166,6 +167,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
butShowSettings = root.findViewById(R.id.butShowSettings);
txtvInformation = root.findViewById(R.id.txtvInformation);
txtvFailure = root.findViewById(R.id.txtvFailure);
txtvUpdatesDisabled = root.findViewById(R.id.txtvUpdatesDisabled);
header = root.findViewById(R.id.headerContainer);
AppBarLayout appBar = root.findViewById(R.id.appBar);
CollapsingToolbarLayout collapsingToolbar = root.findViewById(R.id.collapsing_toolbar);
@ -456,6 +458,13 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
} else {
txtvFailure.setVisibility(View.GONE);
}
if (!feed.getPreferences().getKeepUpdated()) {
txtvUpdatesDisabled.setText("{md-pause-circle-outline} " + this.getString(R.string.updates_disabled_label));
Iconify.addIcons(txtvUpdatesDisabled);
txtvUpdatesDisabled.setVisibility(View.VISIBLE);
} else {
txtvUpdatesDisabled.setVisibility(View.GONE);
}
txtvTitle.setText(feed.getTitle());
txtvAuthor.setText(feed.getAuthor());
if (feed.getItemFilter() != null) {

View File

@ -117,4 +117,15 @@
android:gravity="center"
tools:visibility="visible"
tools:text="(i) Information"/>
<TextView
android:id="@+id/txtvUpdatesDisabled"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2dp"
android:background="?android:attr/windowBackground"
android:visibility="gone"
android:gravity="center"
tools:visibility="visible"
tools:text="Updates disabled"/>
</LinearLayout>

View File

@ -182,6 +182,7 @@
<string name="refresh_failed_msg">{fa-exclamation-circle} Last Refresh failed. Tap to view details.</string>
<string name="open_podcast">Open Podcast</string>
<string name="please_wait_for_data">Please wait until the data is loaded</string>
<string name="updates_disabled_label">Updates disabled</string>
<!-- actions on feeditems -->
<string name="download_label">Download</string>