diff options
author | asdoi <36813904+asdoi@users.noreply.github.com> | 2020-11-04 10:18:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 10:18:44 +0100 |
commit | adcab6f9832b4a77b888e6e00c3ccf8efd60f64a (patch) | |
tree | 66b1d81e203afbf9cd64c4061b1d81b7fcf82174 | |
parent | 6ef793a9ae4aa74d2b7feb7dfa002215dbd7f0d0 (diff) | |
download | AntennaPod-adcab6f9832b4a77b888e6e00c3ccf8efd60f64a.zip |
Show "include in auto downloads" checkbox on adding podcast (#4627)
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java | 11 | ||||
-rw-r--r-- | app/src/main/res/layout/onlinefeedview_activity.xml | 72 |
2 files changed, 57 insertions, 26 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index 3f58e4a92..2fd537159 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -13,6 +13,7 @@ import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.UiThread; @@ -509,11 +510,21 @@ public class OnlineFeedViewActivity extends AppCompatActivity { viewBinding.subscribeButton.setEnabled(true); viewBinding.subscribeButton.setText(R.string.open_podcast); if (didPressSubscribe) { + didPressSubscribe = false; + if (UserPreferences.isEnableAutodownload()) { + Feed feed1 = DBReader.getFeed(getFeedId(feed)); + FeedPreferences feedPreferences = feed1.getPreferences(); + feedPreferences.setAutoDownload(viewBinding.autoDownloadCheckBox.isChecked()); + feed1.savePreferences(); + } openFeed(); } } else { viewBinding.subscribeButton.setEnabled(true); viewBinding.subscribeButton.setText(R.string.subscribe_label); + if (UserPreferences.isEnableAutodownload()) { + viewBinding.autoDownloadCheckBox.setVisibility(View.VISIBLE); + } } } } diff --git a/app/src/main/res/layout/onlinefeedview_activity.xml b/app/src/main/res/layout/onlinefeedview_activity.xml index 88ffbb8b6..909d676f0 100644 --- a/app/src/main/res/layout/onlinefeedview_activity.xml +++ b/app/src/main/res/layout/onlinefeedview_activity.xml @@ -105,35 +105,55 @@ tools:text="Podcast author"/> </RelativeLayout> - <Spinner - android:id="@+id/alternate_urls_spinner" + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginTop="8dp" - android:padding="8dp" - android:textColor="?android:attr/textColorPrimary" - android:textSize="@dimen/text_size_micro"/> - - <Button - android:id="@+id/subscribeButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="16dp" - android:focusable="false" - android:text="@string/subscribe_label"/> - - <Button - android:id="@+id/stopPreviewButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" android:layout_marginBottom="16dp" - android:focusable="false" - android:text="@string/stop_preview" - android:visibility="gone" /> + android:orientation="vertical"> + + <Spinner + android:id="@+id/alternate_urls_spinner" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:padding="8dp" + android:textColor="?android:attr/textColorPrimary" + android:textSize="@dimen/text_size_micro" /> + + <Button + android:id="@+id/subscribeButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="16dp" + android:layout_marginEnd="8dp" + android:focusable="false" + android:text="@string/subscribe_label" /> + + <CheckBox + android:id="@+id/autoDownloadCheckBox" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="left" + android:focusable="false" + android:checked="true" + android:text="@string/auto_download_label" + android:visibility="gone" + tools:visibility="visible" /> + + <Button + android:id="@+id/stopPreviewButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="8dp" + android:focusable="false" + android:text="@string/stop_preview" + android:visibility="gone" + tools:visibility="visible" /> + + </LinearLayout> <ListView android:id="@+id/listView" |