Merge branch 'develop' into glide-48
This commit is contained in:
commit
94a4b78449
@ -1,10 +1,10 @@
|
||||
Change Log
|
||||
==========
|
||||
|
||||
Version 1.6.6
|
||||
Version 1.7.0
|
||||
-------------
|
||||
|
||||
* Experimental new media player (ExoPlayer)
|
||||
* NEW ExoPlayer (experimental)
|
||||
* Fix for Bluetooth Forward (Oreo)
|
||||
* Preference redesign + search
|
||||
* Notification improvements
|
||||
|
@ -150,7 +150,7 @@ dependencies {
|
||||
implementation "com.android.support:gridlayout-v7:$supportVersion"
|
||||
implementation "com.android.support:percent:$supportVersion"
|
||||
implementation "com.android.support:recyclerview-v7:$supportVersion"
|
||||
provided 'com.google.android.wearable:wearable:2.2.0'
|
||||
compileOnly 'com.google.android.wearable:wearable:2.2.0'
|
||||
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
|
||||
implementation("org.shredzone.flattr4j:flattr4j-core:$flattr4jVersion") {
|
||||
exclude group: "org.json", module: "json"
|
||||
|
@ -1,6 +1,7 @@
|
||||
package de.test.antennapod.feed;
|
||||
|
||||
import android.test.AndroidTestCase;
|
||||
|
||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||
|
||||
public class FeedItemTest extends AndroidTestCase {
|
||||
|
@ -5,7 +5,6 @@ import android.test.FlakyTest;
|
||||
import android.test.InstrumentationTestCase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -21,6 +21,7 @@ import de.danoeh.antennapod.core.util.flattr.FlattrStatus;
|
||||
*/
|
||||
class DBTestUtils {
|
||||
|
||||
private DBTestUtils(){}
|
||||
/**
|
||||
* Use this method when tests don't involve chapters.
|
||||
*/
|
||||
|
@ -18,7 +18,6 @@ import java.util.concurrent.TimeoutException;
|
||||
import de.danoeh.antennapod.core.feed.Feed;
|
||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||
import de.danoeh.antennapod.core.feed.FeedMedia;
|
||||
import de.danoeh.antennapod.core.feed.SimpleChapter;
|
||||
import de.danoeh.antennapod.core.storage.DBReader;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
||||
|
@ -8,6 +8,7 @@ import java.io.IOException;
|
||||
* Utility methods for FeedGenerator
|
||||
*/
|
||||
class GeneratorUtil {
|
||||
private GeneratorUtil(){}
|
||||
|
||||
public static void addPaymentLink(XmlSerializer xml, String paymentLink, boolean withNamespace) throws IOException {
|
||||
String ns = (withNamespace) ? "http://www.w3.org/2005/Atom" : null;
|
||||
|
@ -2,8 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="de.danoeh.antennapod"
|
||||
android:installLocation="auto"
|
||||
android:versionCode="1060691"
|
||||
android:versionName="1.6.6-RC2">
|
||||
android:versionCode="1070000"
|
||||
android:versionName="1.7.0">
|
||||
<!--
|
||||
Version code schema:
|
||||
"1.2.3-SNAPSHOT" -> 1020300
|
||||
|
@ -20,7 +20,7 @@ public class PodcastApp extends Application {
|
||||
try {
|
||||
Class.forName("de.danoeh.antennapod.config.ClientConfigurator");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("ClientConfigurator not found");
|
||||
throw new RuntimeException("ClientConfigurator not found", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,8 @@ public class AboutActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||
setContentView(R.layout.about);
|
||||
webViewContainer = (LinearLayout) findViewById(R.id.webViewContainer);
|
||||
webView = (WebView) findViewById(R.id.webViewAbout);
|
||||
webViewContainer = findViewById(R.id.webViewContainer);
|
||||
webView = findViewById(R.id.webViewAbout);
|
||||
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||
if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) {
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
|
||||
|
@ -64,11 +64,11 @@ public class DirectoryChooserActivity extends AppCompatActivity {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
setContentView(R.layout.directory_chooser);
|
||||
butConfirm = (Button) findViewById(R.id.butConfirm);
|
||||
butCancel = (Button) findViewById(R.id.butCancel);
|
||||
butNavUp = (ImageButton) findViewById(R.id.butNavUp);
|
||||
txtvSelectedFolder = (TextView) findViewById(R.id.txtvSelectedFolder);
|
||||
listDirectories = (ListView) findViewById(R.id.directory_list);
|
||||
butConfirm = findViewById(R.id.butConfirm);
|
||||
butCancel = findViewById(R.id.butCancel);
|
||||
butNavUp = findViewById(R.id.butNavUp);
|
||||
txtvSelectedFolder = findViewById(R.id.txtvSelectedFolder);
|
||||
listDirectories = findViewById(R.id.directory_list);
|
||||
|
||||
butConfirm.setOnClickListener(new OnClickListener() {
|
||||
|
||||
|
@ -49,11 +49,11 @@ public class DownloadAuthenticationActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
setContentView(R.layout.download_authentication_activity);
|
||||
TextView txtvDescription = (TextView) findViewById(R.id.txtvDescription);
|
||||
etxtUsername = (EditText) findViewById(R.id.etxtUsername);
|
||||
etxtPassword = (EditText) findViewById(R.id.etxtPassword);
|
||||
Button butConfirm = (Button) findViewById(R.id.butConfirm);
|
||||
Button butCancel = (Button) findViewById(R.id.butCancel);
|
||||
TextView txtvDescription = findViewById(R.id.txtvDescription);
|
||||
etxtUsername = findViewById(R.id.etxtUsername);
|
||||
etxtPassword = findViewById(R.id.etxtPassword);
|
||||
Button butConfirm = findViewById(R.id.butConfirm);
|
||||
Button butCancel = findViewById(R.id.butCancel);
|
||||
|
||||
Validate.isTrue(getIntent().hasExtra(ARG_DOWNLOAD_REQUEST), "Download request missing");
|
||||
DownloadRequest request = getIntent().getParcelableExtra(ARG_DOWNLOAD_REQUEST);
|
||||
|
@ -16,9 +16,15 @@ import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.joanzapata.iconify.Iconify;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
|
||||
import de.danoeh.antennapod.core.feed.Feed;
|
||||
@ -31,9 +37,6 @@ import de.danoeh.antennapod.core.util.IntentUtils;
|
||||
import de.danoeh.antennapod.core.util.LangUtils;
|
||||
import de.danoeh.antennapod.core.util.syndication.HtmlToPlainText;
|
||||
import de.danoeh.antennapod.menuhandler.FeedMenuHandler;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import rx.Observable;
|
||||
import rx.Subscription;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
@ -83,22 +86,22 @@ public class FeedInfoActivity extends AppCompatActivity {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
long feedId = getIntent().getLongExtra(EXTRA_FEED_ID, -1);
|
||||
|
||||
imgvCover = (ImageView) findViewById(R.id.imgvCover);
|
||||
txtvTitle = (TextView) findViewById(R.id.txtvTitle);
|
||||
TextView txtvAuthorHeader = (TextView) findViewById(R.id.txtvAuthor);
|
||||
ImageView imgvBackground = (ImageView) findViewById(R.id.imgvBackground);
|
||||
imgvCover = findViewById(R.id.imgvCover);
|
||||
txtvTitle = findViewById(R.id.txtvTitle);
|
||||
TextView txtvAuthorHeader = findViewById(R.id.txtvAuthor);
|
||||
ImageView imgvBackground = findViewById(R.id.imgvBackground);
|
||||
findViewById(R.id.butShowInfo).setVisibility(View.INVISIBLE);
|
||||
findViewById(R.id.butShowSettings).setVisibility(View.INVISIBLE);
|
||||
// https://github.com/bumptech/glide/issues/529
|
||||
imgvBackground.setColorFilter(new LightingColorFilter(0xff828282, 0x000000));
|
||||
|
||||
|
||||
txtvDescription = (TextView) findViewById(R.id.txtvDescription);
|
||||
lblLanguage = (TextView) findViewById(R.id.lblLanguage);
|
||||
txtvLanguage = (TextView) findViewById(R.id.txtvLanguage);
|
||||
lblAuthor = (TextView) findViewById(R.id.lblAuthor);
|
||||
txtvAuthor = (TextView) findViewById(R.id.txtvDetailsAuthor);
|
||||
txtvUrl = (TextView) findViewById(R.id.txtvUrl);
|
||||
txtvDescription = findViewById(R.id.txtvDescription);
|
||||
lblLanguage = findViewById(R.id.lblLanguage);
|
||||
txtvLanguage = findViewById(R.id.txtvLanguage);
|
||||
lblAuthor = findViewById(R.id.lblAuthor);
|
||||
txtvAuthor = findViewById(R.id.txtvDetailsAuthor);
|
||||
txtvUrl = findViewById(R.id.txtvUrl);
|
||||
|
||||
txtvUrl.setOnClickListener(copyUrlToClipboard);
|
||||
|
||||
|
@ -25,8 +25,10 @@ import android.widget.RadioButton;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
|
||||
import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
|
||||
@ -70,22 +72,6 @@ public class FeedSettingsActivity extends AppCompatActivity {
|
||||
|
||||
private Subscription subscription;
|
||||
|
||||
|
||||
private final View.OnClickListener copyUrlToClipboard = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(feed != null && feed.getDownload_url() != null) {
|
||||
String url = feed.getDownload_url();
|
||||
ClipData clipData = ClipData.newPlainText(url, url);
|
||||
android.content.ClipboardManager cm = (android.content.ClipboardManager) FeedSettingsActivity.this
|
||||
.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
cm.setPrimaryClip(clipData);
|
||||
Toast t = Toast.makeText(FeedSettingsActivity.this, R.string.copied_url_msg, Toast.LENGTH_SHORT);
|
||||
t.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private boolean authInfoChanged = false;
|
||||
|
||||
private final TextWatcher authTextWatcher = new TextWatcher() {
|
||||
@ -128,27 +114,27 @@ public class FeedSettingsActivity extends AppCompatActivity {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
long feedId = getIntent().getLongExtra(EXTRA_FEED_ID, -1);
|
||||
|
||||
imgvCover = (ImageView) findViewById(R.id.imgvCover);
|
||||
txtvTitle = (TextView) findViewById(R.id.txtvTitle);
|
||||
TextView txtvAuthorHeader = (TextView) findViewById(R.id.txtvAuthor);
|
||||
ImageView imgvBackground = (ImageView) findViewById(R.id.imgvBackground);
|
||||
imgvCover = findViewById(R.id.imgvCover);
|
||||
txtvTitle = findViewById(R.id.txtvTitle);
|
||||
TextView txtvAuthorHeader = findViewById(R.id.txtvAuthor);
|
||||
ImageView imgvBackground = findViewById(R.id.imgvBackground);
|
||||
findViewById(R.id.butShowInfo).setVisibility(View.INVISIBLE);
|
||||
findViewById(R.id.butShowSettings).setVisibility(View.INVISIBLE);
|
||||
// https://github.com/bumptech/glide/issues/529
|
||||
imgvBackground.setColorFilter(new LightingColorFilter(0xff828282, 0x000000));
|
||||
|
||||
cbxAutoDownload = (CheckBox) findViewById(R.id.cbxAutoDownload);
|
||||
cbxKeepUpdated = (CheckBox) findViewById(R.id.cbxKeepUpdated);
|
||||
spnAutoDelete = (Spinner) findViewById(R.id.spnAutoDelete);
|
||||
etxtUsername = (EditText) findViewById(R.id.etxtUsername);
|
||||
etxtPassword = (EditText) findViewById(R.id.etxtPassword);
|
||||
etxtFilterText = (EditText) findViewById(R.id.etxtEpisodeFilterText);
|
||||
rdoFilterInclude = (RadioButton) findViewById(R.id.radio_filter_include);
|
||||
cbxAutoDownload = findViewById(R.id.cbxAutoDownload);
|
||||
cbxKeepUpdated = findViewById(R.id.cbxKeepUpdated);
|
||||
spnAutoDelete = findViewById(R.id.spnAutoDelete);
|
||||
etxtUsername = findViewById(R.id.etxtUsername);
|
||||
etxtPassword = findViewById(R.id.etxtPassword);
|
||||
etxtFilterText = findViewById(R.id.etxtEpisodeFilterText);
|
||||
rdoFilterInclude = findViewById(R.id.radio_filter_include);
|
||||
rdoFilterInclude.setOnClickListener(v -> {
|
||||
filterInclude = true;
|
||||
filterTextChanged = true;
|
||||
});
|
||||
rdoFilterExclude = (RadioButton) findViewById(R.id.radio_filter_exclude);
|
||||
rdoFilterExclude = findViewById(R.id.radio_filter_exclude);
|
||||
rdoFilterExclude.setOnClickListener(v -> {
|
||||
filterInclude = false;
|
||||
filterTextChanged = true;
|
||||
|
@ -41,9 +41,9 @@ public class FlattrAuthActivity extends AppCompatActivity {
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, "Activity created");
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setContentView(R.layout.flattr_auth);
|
||||
txtvExplanation = (TextView) findViewById(R.id.txtvExplanation);
|
||||
butAuthenticate = (Button) findViewById(R.id.but_authenticate);
|
||||
butReturn = (Button) findViewById(R.id.but_return_home);
|
||||
txtvExplanation = findViewById(R.id.txtvExplanation);
|
||||
butAuthenticate = findViewById(R.id.but_authenticate);
|
||||
butReturn = findViewById(R.id.but_return_home);
|
||||
|
||||
butReturn.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(FlattrAuthActivity.this, MainActivity.class);
|
||||
|
@ -13,9 +13,7 @@ import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
@ -26,6 +24,10 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.channels.FileChannel;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
||||
|
||||
/**
|
||||
* Displays the 'import/export' screen
|
||||
*/
|
||||
|
@ -30,9 +30,6 @@ import android.widget.ListView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import de.danoeh.antennapod.core.event.ServiceEvent;
|
||||
import de.danoeh.antennapod.core.util.IntentUtils;
|
||||
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
@ -45,6 +42,7 @@ import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
|
||||
import de.danoeh.antennapod.core.event.MessageEvent;
|
||||
import de.danoeh.antennapod.core.event.ProgressEvent;
|
||||
import de.danoeh.antennapod.core.event.QueueEvent;
|
||||
import de.danoeh.antennapod.core.event.ServiceEvent;
|
||||
import de.danoeh.antennapod.core.feed.EventDistributor;
|
||||
import de.danoeh.antennapod.core.feed.Feed;
|
||||
import de.danoeh.antennapod.core.preferences.PlaybackPreferences;
|
||||
@ -55,7 +53,9 @@ import de.danoeh.antennapod.core.storage.DBTasks;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.util.FeedItemUtil;
|
||||
import de.danoeh.antennapod.core.util.Flavors;
|
||||
import de.danoeh.antennapod.core.util.IntentUtils;
|
||||
import de.danoeh.antennapod.core.util.StorageUtils;
|
||||
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
|
||||
import de.danoeh.antennapod.dialog.RatingDialog;
|
||||
import de.danoeh.antennapod.dialog.RenameFeedDialog;
|
||||
import de.danoeh.antennapod.fragment.AddFeedFragment;
|
||||
@ -130,7 +130,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||
StorageUtils.checkStorageAvailability(this);
|
||||
setContentView(R.layout.main);
|
||||
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
@ -142,8 +142,8 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||
|
||||
currentTitle = getTitle();
|
||||
|
||||
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
navList = (ListView) findViewById(R.id.nav_list);
|
||||
drawerLayout = findViewById(R.id.drawer_layout);
|
||||
navList = findViewById(R.id.nav_list);
|
||||
navDrawer = findViewById(R.id.nav_layout);
|
||||
|
||||
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close);
|
||||
|
@ -231,7 +231,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
|
||||
Log.d(TAG, "onCreate()");
|
||||
StorageUtils.checkStorageAvailability(this);
|
||||
|
||||
orientation = getResources().getConfiguration().orientation;
|
||||
getWindow().setFormat(PixelFormat.TRANSPARENT);
|
||||
}
|
||||
|
||||
@ -265,15 +264,10 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
|
||||
|
||||
private void onBufferUpdate(float progress) {
|
||||
if (sbPosition != null) {
|
||||
sbPosition.setSecondaryProgress((int) progress * sbPosition.getMax());
|
||||
sbPosition.setSecondaryProgress((int) (progress * sbPosition.getMax()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Current screen orientation.
|
||||
*/
|
||||
private int orientation;
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
@ -803,13 +797,13 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
|
||||
|
||||
void setupGUI() {
|
||||
setContentView(getContentViewResourceId());
|
||||
sbPosition = (SeekBar) findViewById(R.id.sbPosition);
|
||||
txtvPosition = (TextView) findViewById(R.id.txtvPosition);
|
||||
sbPosition = findViewById(R.id.sbPosition);
|
||||
txtvPosition = findViewById(R.id.txtvPosition);
|
||||
|
||||
SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE);
|
||||
showTimeLeft = prefs.getBoolean(PREF_SHOW_TIME_LEFT, false);
|
||||
Log.d("timeleft", showTimeLeft ? "true" : "false");
|
||||
txtvLength = (TextView) findViewById(R.id.txtvLength);
|
||||
txtvLength = findViewById(R.id.txtvLength);
|
||||
if (txtvLength != null) {
|
||||
txtvLength.setOnClickListener(v -> {
|
||||
showTimeLeft = !showTimeLeft;
|
||||
@ -833,18 +827,18 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
|
||||
});
|
||||
}
|
||||
|
||||
butRev = (ImageButton) findViewById(R.id.butRev);
|
||||
txtvRev = (TextView) findViewById(R.id.txtvRev);
|
||||
butRev = findViewById(R.id.butRev);
|
||||
txtvRev = findViewById(R.id.txtvRev);
|
||||
if (txtvRev != null) {
|
||||
txtvRev.setText(String.valueOf(UserPreferences.getRewindSecs()));
|
||||
}
|
||||
butPlay = (ImageButton) findViewById(R.id.butPlay);
|
||||
butFF = (ImageButton) findViewById(R.id.butFF);
|
||||
txtvFF = (TextView) findViewById(R.id.txtvFF);
|
||||
butPlay = findViewById(R.id.butPlay);
|
||||
butFF = findViewById(R.id.butFF);
|
||||
txtvFF = findViewById(R.id.txtvFF);
|
||||
if (txtvFF != null) {
|
||||
txtvFF.setText(String.valueOf(UserPreferences.getFastForwardSecs()));
|
||||
}
|
||||
butSkip = (ImageButton) findViewById(R.id.butSkip);
|
||||
butSkip = findViewById(R.id.butSkip);
|
||||
|
||||
// SEEKBAR SETUP
|
||||
|
||||
@ -992,7 +986,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
if (requestCode == REQUEST_CODE_STORAGE) {
|
||||
if (grantResults.length <= 0 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
|
||||
Toast.makeText(this, R.string.needs_storage_permission, Toast.LENGTH_LONG).show();
|
||||
|
@ -227,18 +227,18 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
|
||||
@Override
|
||||
protected void setupGUI() {
|
||||
super.setupGUI();
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setTitle("");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
findViewById(R.id.shadow).setVisibility(View.GONE);
|
||||
AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appBar);
|
||||
AppBarLayout appBarLayout = findViewById(R.id.appBar);
|
||||
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources().getDisplayMetrics());
|
||||
appBarLayout.setElevation(px);
|
||||
}
|
||||
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
navList = (ListView) findViewById(R.id.nav_list);
|
||||
drawerLayout = findViewById(R.id.drawer_layout);
|
||||
navList = findViewById(R.id.nav_list);
|
||||
navDrawer = findViewById(R.id.nav_layout);
|
||||
|
||||
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close);
|
||||
@ -274,14 +274,14 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
|
||||
startActivity(new Intent(MediaplayerInfoActivity.this, PreferenceActivity.class));
|
||||
});
|
||||
|
||||
butPlaybackSpeed = (Button) findViewById(R.id.butPlaybackSpeed);
|
||||
butCastDisconnect = (ImageButton) findViewById(R.id.butCastDisconnect);
|
||||
butPlaybackSpeed = findViewById(R.id.butPlaybackSpeed);
|
||||
butCastDisconnect = findViewById(R.id.butCastDisconnect);
|
||||
|
||||
pager = (ViewPager) findViewById(R.id.pager);
|
||||
pager = findViewById(R.id.pager);
|
||||
pagerAdapter = new MediaplayerInfoPagerAdapter(getSupportFragmentManager(), media);
|
||||
pagerAdapter.setController(controller);
|
||||
pager.setAdapter(pagerAdapter);
|
||||
CirclePageIndicator pageIndicator = (CirclePageIndicator) findViewById(R.id.page_indicator);
|
||||
CirclePageIndicator pageIndicator = findViewById(R.id.page_indicator);
|
||||
pageIndicator.setViewPager(pager);
|
||||
loadLastFragment();
|
||||
pager.onSaveInstanceState();
|
||||
@ -357,7 +357,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
return drawerToggle != null && drawerToggle.onOptionsItemSelected(item) || super.onOptionsItemSelected(item);
|
||||
return (drawerToggle != null && drawerToggle.onOptionsItemSelected(item)) || super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -145,7 +145,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
|
||||
feedUrl = getIntent().getStringExtra(ARG_FEEDURL);
|
||||
} else if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND)
|
||||
|| TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) {
|
||||
feedUrl = (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND))
|
||||
feedUrl = TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND)
|
||||
? getIntent().getStringExtra(Intent.EXTRA_TEXT) : getIntent().getDataString();
|
||||
if (actionBar != null) {
|
||||
actionBar.setTitle(R.string.add_feed_label);
|
||||
@ -307,7 +307,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void parseFeed() {
|
||||
if (feed == null || feed.getFile_url() == null && feed.isDownloaded()) {
|
||||
if (feed == null || (feed.getFile_url() == null && feed.isDownloaded())) {
|
||||
throw new IllegalStateException("feed must be non-null and downloaded when parseFeed is called");
|
||||
}
|
||||
Log.d(TAG, "Parsing feed");
|
||||
@ -380,20 +380,20 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
|
||||
this.feed = feed;
|
||||
this.selectedDownloadUrl = feed.getDownload_url();
|
||||
EventDistributor.getInstance().register(listener);
|
||||
ListView listView = (ListView) findViewById(R.id.listview);
|
||||
ListView listView = findViewById(R.id.listview);
|
||||
LayoutInflater inflater = LayoutInflater.from(this);
|
||||
View header = inflater.inflate(R.layout.onlinefeedview_header, listView, false);
|
||||
listView.addHeaderView(header);
|
||||
|
||||
listView.setAdapter(new FeedItemlistDescriptionAdapter(this, 0, feed.getItems()));
|
||||
|
||||
ImageView cover = (ImageView) header.findViewById(R.id.imgvCover);
|
||||
TextView title = (TextView) header.findViewById(R.id.txtvTitle);
|
||||
TextView author = (TextView) header.findViewById(R.id.txtvAuthor);
|
||||
TextView description = (TextView) header.findViewById(R.id.txtvDescription);
|
||||
Spinner spAlternateUrls = (Spinner) header.findViewById(R.id.spinnerAlternateUrls);
|
||||
ImageView cover = header.findViewById(R.id.imgvCover);
|
||||
TextView title = header.findViewById(R.id.txtvTitle);
|
||||
TextView author = header.findViewById(R.id.txtvAuthor);
|
||||
TextView description = header.findViewById(R.id.txtvDescription);
|
||||
Spinner spAlternateUrls = header.findViewById(R.id.spinnerAlternateUrls);
|
||||
|
||||
subscribeButton = (Button) header.findViewById(R.id.butSubscribe);
|
||||
subscribeButton = header.findViewById(R.id.butSubscribe);
|
||||
|
||||
if (StringUtils.isNotBlank(feed.getImageUrl())) {
|
||||
Glide.with(this)
|
||||
|
@ -39,9 +39,9 @@ public class OpmlFeedChooserActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.opml_selection);
|
||||
butConfirm = (Button) findViewById(R.id.butConfirm);
|
||||
butCancel = (Button) findViewById(R.id.butCancel);
|
||||
feedlist = (ListView) findViewById(R.id.feedlist);
|
||||
butConfirm = findViewById(R.id.butConfirm);
|
||||
butCancel = findViewById(R.id.butCancel);
|
||||
feedlist = findViewById(R.id.feedlist);
|
||||
|
||||
feedlist.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
|
||||
listAdapter = new ArrayAdapter<>(this,
|
||||
|
@ -36,16 +36,16 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setContentView(R.layout.opml_import);
|
||||
|
||||
final TextView txtvHeaderExplanation1 = (TextView) findViewById(R.id.txtvHeadingExplanation1);
|
||||
final TextView txtvExplanation1 = (TextView) findViewById(R.id.txtvExplanation1);
|
||||
final TextView txtvHeaderExplanation2 = (TextView) findViewById(R.id.txtvHeadingExplanation2);
|
||||
final TextView txtvExplanation2 = (TextView) findViewById(R.id.txtvExplanation2);
|
||||
final TextView txtvHeaderExplanation3 = (TextView) findViewById(R.id.txtvHeadingExplanation3);
|
||||
final TextView txtvHeaderExplanation1 = findViewById(R.id.txtvHeadingExplanation1);
|
||||
final TextView txtvExplanation1 = findViewById(R.id.txtvExplanation1);
|
||||
final TextView txtvHeaderExplanation2 = findViewById(R.id.txtvHeadingExplanation2);
|
||||
final TextView txtvExplanation2 = findViewById(R.id.txtvExplanation2);
|
||||
final TextView txtvHeaderExplanation3 = findViewById(R.id.txtvHeadingExplanation3);
|
||||
|
||||
Button butChooseFilesystem = (Button) findViewById(R.id.butChooseFileFromFilesystem);
|
||||
Button butChooseFilesystem = findViewById(R.id.butChooseFileFromFilesystem);
|
||||
butChooseFilesystem.setOnClickListener(v -> chooseFileFromFilesystem());
|
||||
|
||||
Button butChooseExternal = (Button) findViewById(R.id.butChooseFileFromExternal);
|
||||
Button butChooseExternal = findViewById(R.id.butChooseFileFromExternal);
|
||||
butChooseExternal.setOnClickListener(v -> chooseFileFromExternal());
|
||||
|
||||
int nextOption = 1;
|
||||
|
@ -14,6 +14,8 @@ import de.danoeh.antennapod.core.export.opml.OpmlElement;
|
||||
*/
|
||||
public class OpmlImportHolder {
|
||||
|
||||
private OpmlImportHolder(){}
|
||||
|
||||
private static ArrayList<OpmlElement> readElements;
|
||||
|
||||
public static ArrayList<OpmlElement> getReadElements() {
|
||||
|
@ -12,11 +12,11 @@ import android.view.MenuItem;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import com.bytehamster.lib.preferencesearch.SearchPreference;
|
||||
import com.bytehamster.lib.preferencesearch.SearchPreferenceResult;
|
||||
import com.bytehamster.lib.preferencesearch.SearchPreferenceResultListener;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.preferences.PreferenceController;
|
||||
|
@ -9,6 +9,7 @@ import android.support.annotation.Nullable;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
||||
import rx.Completable;
|
||||
|
@ -53,9 +53,9 @@ public class StatisticsActivity extends AppCompatActivity
|
||||
prefs = getSharedPreferences(PREF_NAME, MODE_PRIVATE);
|
||||
countAll = prefs.getBoolean(PREF_COUNT_ALL, false);
|
||||
|
||||
totalTimeTextView = (TextView) findViewById(R.id.total_time);
|
||||
feedStatisticsList = (ListView) findViewById(R.id.statistics_list);
|
||||
progressBar = (ProgressBar) findViewById(R.id.progressBar);
|
||||
totalTimeTextView = findViewById(R.id.total_time);
|
||||
feedStatisticsList = findViewById(R.id.statistics_list);
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
listAdapter = new StatisticsListAdapter(this);
|
||||
listAdapter.setCountAll(countAll);
|
||||
feedStatisticsList.setAdapter(listAdapter);
|
||||
|
@ -42,7 +42,7 @@ public class StorageErrorActivity extends AppCompatActivity {
|
||||
|
||||
setContentView(R.layout.storage_error);
|
||||
|
||||
Button btnChooseDataFolder = (Button) findViewById(R.id.btnChooseDataFolder);
|
||||
Button btnChooseDataFolder = findViewById(R.id.btnChooseDataFolder);
|
||||
btnChooseDataFolder.setOnClickListener(v -> {
|
||||
if (Build.VERSION_CODES.KITKAT <= Build.VERSION.SDK_INT &&
|
||||
Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
|
@ -23,6 +23,10 @@ import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.SeekBar;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.feed.MediaType;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
@ -32,9 +36,6 @@ import de.danoeh.antennapod.core.util.gui.PictureInPictureUtil;
|
||||
import de.danoeh.antennapod.core.util.playback.Playable;
|
||||
import de.danoeh.antennapod.view.AspectRatioVideoView;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* Activity for playing video files.
|
||||
*/
|
||||
@ -142,11 +143,11 @@ public class VideoplayerActivity extends MediaplayerActivity {
|
||||
}
|
||||
super.setupGUI();
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
controls = (LinearLayout) findViewById(R.id.controls);
|
||||
videoOverlay = (LinearLayout) findViewById(R.id.overlay);
|
||||
videoview = (AspectRatioVideoView) findViewById(R.id.videoview);
|
||||
videoframe = (FrameLayout) findViewById(R.id.videoframe);
|
||||
progressIndicator = (ProgressBar) findViewById(R.id.progressIndicator);
|
||||
controls = findViewById(R.id.controls);
|
||||
videoOverlay = findViewById(R.id.overlay);
|
||||
videoview = findViewById(R.id.videoview);
|
||||
videoframe = findViewById(R.id.videoframe);
|
||||
progressIndicator = findViewById(R.id.progressIndicator);
|
||||
videoview.getHolder().addCallback(surfaceHolderCallback);
|
||||
videoframe.setOnTouchListener(onVideoviewTouched);
|
||||
videoOverlay.setOnTouchListener((view, motionEvent) -> true); // To suppress touches directly below the slider
|
||||
|
@ -45,8 +45,6 @@ import de.danoeh.antennapod.core.service.GpodnetSyncService;
|
||||
public class GpodnetAuthenticationActivity extends AppCompatActivity {
|
||||
private static final String TAG = "GpodnetAuthActivity";
|
||||
|
||||
private static final String CURRENT_STEP = "current_step";
|
||||
|
||||
private ViewFlipper viewFlipper;
|
||||
|
||||
private static final int STEP_DEFAULT = -1;
|
||||
@ -72,7 +70,7 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.gpodnetauth_activity);
|
||||
service = new GpodnetService();
|
||||
|
||||
viewFlipper = (ViewFlipper) findViewById(R.id.viewflipper);
|
||||
viewFlipper = findViewById(R.id.viewflipper);
|
||||
LayoutInflater inflater = (LayoutInflater)
|
||||
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
views = new View[]{
|
||||
@ -109,11 +107,11 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void setupLoginView(View view) {
|
||||
final EditText username = (EditText) view.findViewById(R.id.etxtUsername);
|
||||
final EditText password = (EditText) view.findViewById(R.id.etxtPassword);
|
||||
final Button login = (Button) view.findViewById(R.id.butLogin);
|
||||
final TextView txtvError = (TextView) view.findViewById(R.id.txtvError);
|
||||
final ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progBarLogin);
|
||||
final EditText username = view.findViewById(R.id.etxtUsername);
|
||||
final EditText password = view.findViewById(R.id.etxtPassword);
|
||||
final Button login = view.findViewById(R.id.butLogin);
|
||||
final TextView txtvError = view.findViewById(R.id.txtvError);
|
||||
final ProgressBar progressBar = view.findViewById(R.id.progBarLogin);
|
||||
|
||||
password.setOnEditorActionListener((v, actionID, event) ->
|
||||
actionID == EditorInfo.IME_ACTION_GO && login.performClick());
|
||||
@ -177,13 +175,13 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void setupDeviceView(View view) {
|
||||
final EditText deviceID = (EditText) view.findViewById(R.id.etxtDeviceID);
|
||||
final EditText caption = (EditText) view.findViewById(R.id.etxtCaption);
|
||||
final Button createNewDevice = (Button) view.findViewById(R.id.butCreateNewDevice);
|
||||
final Button chooseDevice = (Button) view.findViewById(R.id.butChooseExistingDevice);
|
||||
final TextView txtvError = (TextView) view.findViewById(R.id.txtvError);
|
||||
final ProgressBar progBarCreateDevice = (ProgressBar) view.findViewById(R.id.progbarCreateDevice);
|
||||
final Spinner spinnerDevices = (Spinner) view.findViewById(R.id.spinnerChooseDevice);
|
||||
final EditText deviceID = view.findViewById(R.id.etxtDeviceID);
|
||||
final EditText caption = view.findViewById(R.id.etxtCaption);
|
||||
final Button createNewDevice = view.findViewById(R.id.butCreateNewDevice);
|
||||
final Button chooseDevice = view.findViewById(R.id.butChooseExistingDevice);
|
||||
final TextView txtvError = view.findViewById(R.id.txtvError);
|
||||
final ProgressBar progBarCreateDevice = view.findViewById(R.id.progbarCreateDevice);
|
||||
final Spinner spinnerDevices = view.findViewById(R.id.spinnerChooseDevice);
|
||||
|
||||
|
||||
// load device list
|
||||
@ -348,8 +346,8 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void setupFinishView(View view) {
|
||||
final Button sync = (Button) view.findViewById(R.id.butSyncNow);
|
||||
final Button back = (Button) view.findViewById(R.id.butGoMainscreen);
|
||||
final Button sync = view.findViewById(R.id.butSyncNow);
|
||||
final Button back = view.findViewById(R.id.butGoMainscreen);
|
||||
|
||||
sync.setOnClickListener(v -> {
|
||||
GpodnetSyncService.sendSyncIntent(GpodnetAuthenticationActivity.this);
|
||||
|
@ -77,24 +77,24 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.new_episodes_listitem, parent, false);
|
||||
Holder holder = new Holder(view);
|
||||
holder.container = (FrameLayout) view.findViewById(R.id.container);
|
||||
holder.content = (LinearLayout) view.findViewById(R.id.content);
|
||||
holder.placeholder = (TextView) view.findViewById(R.id.txtvPlaceholder);
|
||||
holder.title = (TextView) view.findViewById(R.id.txtvTitle);
|
||||
holder.container = view.findViewById(R.id.container);
|
||||
holder.content = view.findViewById(R.id.content);
|
||||
holder.placeholder = view.findViewById(R.id.txtvPlaceholder);
|
||||
holder.title = view.findViewById(R.id.txtvTitle);
|
||||
if(Build.VERSION.SDK_INT >= 23) {
|
||||
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
|
||||
}
|
||||
holder.pubDate = (TextView) view
|
||||
holder.pubDate = view
|
||||
.findViewById(R.id.txtvPublished);
|
||||
holder.statusUnread = view.findViewById(R.id.statusUnread);
|
||||
holder.butSecondary = (ImageButton) view
|
||||
holder.butSecondary = view
|
||||
.findViewById(R.id.butSecondaryAction);
|
||||
holder.queueStatus = (ImageView) view
|
||||
holder.queueStatus = view
|
||||
.findViewById(R.id.imgvInPlaylist);
|
||||
holder.progress = (ProgressBar) view
|
||||
holder.progress = view
|
||||
.findViewById(R.id.pbar_progress);
|
||||
holder.cover = (ImageView) view.findViewById(R.id.imgvCover);
|
||||
holder.txtvDuration = (TextView) view.findViewById(R.id.txtvDuration);
|
||||
holder.cover = view.findViewById(R.id.imgvCover);
|
||||
holder.txtvDuration = view.findViewById(R.id.txtvDuration);
|
||||
holder.item = null;
|
||||
holder.mainActivityRef = mainActivityRef;
|
||||
// so we can grab this later
|
||||
|
@ -57,12 +57,12 @@ public class ChaptersListAdapter extends ArrayAdapter<Chapter> {
|
||||
|
||||
convertView = inflater.inflate(R.layout.simplechapter_item, parent, false);
|
||||
holder.view = convertView;
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
defaultTextColor = holder.title.getTextColors().getDefaultColor();
|
||||
holder.start = (TextView) convertView.findViewById(R.id.txtvStart);
|
||||
holder.link = (TextView) convertView.findViewById(R.id.txtvLink);
|
||||
holder.duration = (TextView) convertView.findViewById(R.id.txtvDuration);
|
||||
holder.butPlayChapter = (ImageButton) convertView.findViewById(R.id.butPlayChapter);
|
||||
holder.start = convertView.findViewById(R.id.txtvStart);
|
||||
holder.link = convertView.findViewById(R.id.txtvLink);
|
||||
holder.duration = convertView.findViewById(R.id.txtvDuration);
|
||||
holder.butPlayChapter = convertView.findViewById(R.id.butPlayChapter);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (Holder) convertView.getTag();
|
||||
|
@ -1,13 +1,12 @@
|
||||
package de.danoeh.antennapod.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.content.Intent;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
|
||||
import de.danoeh.antennapod.core.util.IntentUtils;
|
||||
import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
@ -21,8 +20,10 @@ import de.danoeh.antennapod.core.storage.DBTasks;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.storage.DownloadRequestException;
|
||||
import de.danoeh.antennapod.core.storage.DownloadRequester;
|
||||
import de.danoeh.antennapod.core.util.IntentUtils;
|
||||
import de.danoeh.antennapod.core.util.LongList;
|
||||
import de.danoeh.antennapod.core.util.NetworkUtils;
|
||||
import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;
|
||||
|
||||
/**
|
||||
* Default implementation of an ActionButtonCallback
|
||||
|
@ -49,15 +49,15 @@ public class DownloadLogAdapter extends BaseAdapter {
|
||||
LayoutInflater inflater = (LayoutInflater) context
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = inflater.inflate(R.layout.downloadlog_item, parent, false);
|
||||
holder.icon = (IconTextView) convertView.findViewById(R.id.txtvIcon);
|
||||
holder.retry = (IconButton) convertView.findViewById(R.id.btnRetry);
|
||||
holder.date = (TextView) convertView.findViewById(R.id.txtvDate);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.icon = convertView.findViewById(R.id.txtvIcon);
|
||||
holder.retry = convertView.findViewById(R.id.btnRetry);
|
||||
holder.date = convertView.findViewById(R.id.txtvDate);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
if(Build.VERSION.SDK_INT >= 23) {
|
||||
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
|
||||
}
|
||||
holder.type = (TextView) convertView.findViewById(R.id.txtvType);
|
||||
holder.reason = (TextView) convertView.findViewById(R.id.txtvReason);
|
||||
holder.type = convertView.findViewById(R.id.txtvType);
|
||||
holder.reason = convertView.findViewById(R.id.txtvReason);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (Holder) convertView.getTag();
|
||||
|
@ -62,16 +62,16 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = inflater.inflate(R.layout.downloaded_episodeslist_item,
|
||||
parent, false);
|
||||
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.imageView = convertView.findViewById(R.id.imgvImage);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
if(Build.VERSION.SDK_INT >= 23) {
|
||||
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
|
||||
}
|
||||
holder.txtvSize = (TextView) convertView.findViewById(R.id.txtvSize);
|
||||
holder.queueStatus = (ImageView) convertView.findViewById(R.id.imgvInPlaylist);
|
||||
holder.pubDate = (TextView) convertView
|
||||
holder.txtvSize = convertView.findViewById(R.id.txtvSize);
|
||||
holder.queueStatus = convertView.findViewById(R.id.imgvInPlaylist);
|
||||
holder.pubDate = convertView
|
||||
.findViewById(R.id.txtvPublished);
|
||||
holder.butSecondary = (ImageButton) convertView
|
||||
holder.butSecondary = convertView
|
||||
.findViewById(R.id.butSecondaryAction);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
|
@ -59,14 +59,14 @@ public class DownloadlistAdapter extends BaseAdapter {
|
||||
LayoutInflater inflater = (LayoutInflater) context
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = inflater.inflate(R.layout.downloadlist_item, parent, false);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.downloaded = (TextView) convertView
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
holder.downloaded = convertView
|
||||
.findViewById(R.id.txtvDownloaded);
|
||||
holder.percent = (TextView) convertView
|
||||
holder.percent = convertView
|
||||
.findViewById(R.id.txtvPercent);
|
||||
holder.progbar = (ProgressBar) convertView
|
||||
holder.progbar = convertView
|
||||
.findViewById(R.id.progProgress);
|
||||
holder.butSecondary = (ImageButton) convertView
|
||||
holder.butSecondary = convertView
|
||||
.findViewById(R.id.butSecondaryAction);
|
||||
|
||||
convertView.setTag(holder);
|
||||
|
@ -90,24 +90,24 @@ public class FeedItemlistAdapter extends BaseAdapter {
|
||||
LayoutInflater inflater = (LayoutInflater) context
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = inflater.inflate(R.layout.feeditemlist_item, parent, false);
|
||||
holder.container = (LinearLayout) convertView
|
||||
holder.container = convertView
|
||||
.findViewById(R.id.container);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvItemname);
|
||||
holder.title = convertView.findViewById(R.id.txtvItemname);
|
||||
if(Build.VERSION.SDK_INT >= 23) {
|
||||
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
|
||||
}
|
||||
holder.lenSize = (TextView) convertView
|
||||
holder.lenSize = convertView
|
||||
.findViewById(R.id.txtvLenSize);
|
||||
holder.butAction = (ImageButton) convertView
|
||||
holder.butAction = convertView
|
||||
.findViewById(R.id.butSecondaryAction);
|
||||
holder.published = (TextView) convertView
|
||||
holder.published = convertView
|
||||
.findViewById(R.id.txtvPublished);
|
||||
holder.inPlaylist = (ImageView) convertView
|
||||
holder.inPlaylist = convertView
|
||||
.findViewById(R.id.imgvInPlaylist);
|
||||
holder.type = (ImageView) convertView.findViewById(R.id.imgvType);
|
||||
holder.type = convertView.findViewById(R.id.imgvType);
|
||||
holder.statusUnread = convertView
|
||||
.findViewById(R.id.statusUnread);
|
||||
holder.episodeProgress = (ProgressBar) convertView
|
||||
holder.episodeProgress = convertView
|
||||
.findViewById(R.id.pbar_episode_progress);
|
||||
|
||||
convertView.setTag(holder);
|
||||
|
@ -34,9 +34,9 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> {
|
||||
LayoutInflater inflater = (LayoutInflater) getContext()
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = inflater.inflate(R.layout.itemdescription_listitem, parent, false);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.pubDate = (TextView) convertView.findViewById(R.id.txtvPubDate);
|
||||
holder.description = (TextView) convertView.findViewById(R.id.txtvDescription);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
holder.pubDate = convertView.findViewById(R.id.txtvPubDate);
|
||||
holder.description = convertView.findViewById(R.id.txtvDescription);
|
||||
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
|
@ -213,7 +213,7 @@ public class NavListAdapter extends BaseAdapter
|
||||
v = getFeedView(position, convertView, parent);
|
||||
}
|
||||
if (v != null && viewType != VIEW_TYPE_SECTION_DIVIDER) {
|
||||
TextView txtvTitle = (TextView) v.findViewById(R.id.txtvTitle);
|
||||
TextView txtvTitle = v.findViewById(R.id.txtvTitle);
|
||||
if (position == itemAccess.getSelectedItemIndex()) {
|
||||
txtvTitle.setTypeface(null, Typeface.BOLD);
|
||||
} else {
|
||||
@ -236,9 +236,9 @@ public class NavListAdapter extends BaseAdapter
|
||||
|
||||
convertView = inflater.inflate(R.layout.nav_listitem, parent, false);
|
||||
|
||||
holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.count = (TextView) convertView.findViewById(R.id.txtvCount);
|
||||
holder.image = convertView.findViewById(R.id.imgvCover);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
holder.count = convertView.findViewById(R.id.txtvCount);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (NavHolder) convertView.getTag();
|
||||
@ -326,10 +326,10 @@ public class NavListAdapter extends BaseAdapter
|
||||
|
||||
convertView = inflater.inflate(R.layout.nav_feedlistitem, parent, false);
|
||||
|
||||
holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.failure = (IconTextView) convertView.findViewById(R.id.itxtvFailure);
|
||||
holder.count = (TextView) convertView.findViewById(R.id.txtvCount);
|
||||
holder.image = convertView.findViewById(R.id.imgvCover);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
holder.failure = convertView.findViewById(R.id.itxtvFailure);
|
||||
holder.count = convertView.findViewById(R.id.txtvCount);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (FeedHolder) convertView.getTag();
|
||||
|
@ -26,7 +26,6 @@ import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.joanzapata.iconify.Iconify;
|
||||
|
||||
import de.danoeh.antennapod.core.util.ThemeUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
@ -42,6 +41,7 @@ import de.danoeh.antennapod.core.util.Converter;
|
||||
import de.danoeh.antennapod.core.util.DateUtils;
|
||||
import de.danoeh.antennapod.core.util.LongList;
|
||||
import de.danoeh.antennapod.core.util.NetworkUtils;
|
||||
import de.danoeh.antennapod.core.util.ThemeUtils;
|
||||
import de.danoeh.antennapod.fragment.ItemFragment;
|
||||
import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler;
|
||||
|
||||
@ -135,19 +135,19 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap
|
||||
|
||||
public ViewHolder(View v) {
|
||||
super(v);
|
||||
container = (FrameLayout) v.findViewById(R.id.container);
|
||||
dragHandle = (ImageView) v.findViewById(R.id.drag_handle);
|
||||
placeholder = (TextView) v.findViewById(R.id.txtvPlaceholder);
|
||||
cover = (ImageView) v.findViewById(R.id.imgvCover);
|
||||
title = (TextView) v.findViewById(R.id.txtvTitle);
|
||||
container = v.findViewById(R.id.container);
|
||||
dragHandle = v.findViewById(R.id.drag_handle);
|
||||
placeholder = v.findViewById(R.id.txtvPlaceholder);
|
||||
cover = v.findViewById(R.id.imgvCover);
|
||||
title = v.findViewById(R.id.txtvTitle);
|
||||
if(Build.VERSION.SDK_INT >= 23) {
|
||||
title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
|
||||
}
|
||||
pubDate = (TextView) v.findViewById(R.id.txtvPubDate);
|
||||
progressLeft = (TextView) v.findViewById(R.id.txtvProgressLeft);
|
||||
progressRight = (TextView) v.findViewById(R.id.txtvProgressRight);
|
||||
butSecondary = (ImageButton) v.findViewById(R.id.butSecondaryAction);
|
||||
progressBar = (ProgressBar) v.findViewById(R.id.progressBar);
|
||||
pubDate = v.findViewById(R.id.txtvPubDate);
|
||||
progressLeft = v.findViewById(R.id.txtvProgressLeft);
|
||||
progressRight = v.findViewById(R.id.txtvProgressRight);
|
||||
butSecondary = v.findViewById(R.id.butSecondaryAction);
|
||||
progressBar = v.findViewById(R.id.progressBar);
|
||||
v.setTag(this);
|
||||
v.setOnClickListener(this);
|
||||
v.setOnCreateContextMenuListener(this);
|
||||
|
@ -62,13 +62,13 @@ public class SearchlistAdapter extends BaseAdapter {
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
convertView = inflater.inflate(R.layout.searchlist_item, parent, false);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
if(Build.VERSION.SDK_INT >= 23) {
|
||||
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
|
||||
}
|
||||
holder.cover = (ImageView) convertView
|
||||
holder.cover = convertView
|
||||
.findViewById(R.id.imgvFeedimage);
|
||||
holder.subtitle = (TextView) convertView
|
||||
holder.subtitle = convertView
|
||||
.findViewById(R.id.txtvSubtitle);
|
||||
|
||||
convertView.setTag(holder);
|
||||
|
@ -63,9 +63,9 @@ public class StatisticsListAdapter extends BaseAdapter {
|
||||
|
||||
convertView = inflater.inflate(R.layout.statistics_listitem, parent, false);
|
||||
|
||||
holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.time = (TextView) convertView.findViewById(R.id.txtvTime);
|
||||
holder.image = convertView.findViewById(R.id.imgvCover);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
holder.time = convertView.findViewById(R.id.txtvTime);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (StatisticsHolder) convertView.getTag();
|
||||
|
@ -90,9 +90,9 @@ public class SubscriptionsAdapter extends BaseAdapter implements AdapterView.OnI
|
||||
LayoutInflater layoutInflater =
|
||||
(LayoutInflater) mainActivityRef.get().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = layoutInflater.inflate(R.layout.subscription_item, parent, false);
|
||||
holder.feedTitle = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvCover);
|
||||
holder.count = (TriangleLabelView) convertView.findViewById(R.id.triangleCountView);
|
||||
holder.feedTitle = convertView.findViewById(R.id.txtvTitle);
|
||||
holder.imageView = convertView.findViewById(R.id.imgvCover);
|
||||
holder.count = convertView.findViewById(R.id.triangleCountView);
|
||||
|
||||
|
||||
convertView.setTag(holder);
|
||||
|
@ -41,10 +41,10 @@ public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> {
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
convertView = inflater.inflate(R.layout.gpodnet_podcast_listitem, parent, false);
|
||||
holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.subscribers = (TextView) convertView.findViewById(R.id.txtvSubscribers);
|
||||
holder.url = (TextView) convertView.findViewById(R.id.txtvUrl);
|
||||
holder.image = convertView.findViewById(R.id.imgvCover);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
holder.subscribers = convertView.findViewById(R.id.txtvSubscribers);
|
||||
holder.url = convertView.findViewById(R.id.txtvUrl);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (Holder) convertView.getTag();
|
||||
|
@ -34,8 +34,8 @@ public class TagListAdapter extends ArrayAdapter<GpodnetTag> {
|
||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
convertView = inflater.inflate(R.layout.gpodnet_tag_listitem, parent, false);
|
||||
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
|
||||
holder.usage = (TextView) convertView.findViewById(R.id.txtvUsage);
|
||||
holder.title = convertView.findViewById(R.id.txtvTitle);
|
||||
holder.usage = convertView.findViewById(R.id.txtvUsage);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (Holder) convertView.getTag();
|
||||
|
@ -185,9 +185,9 @@ public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> {
|
||||
* @param view GridView cell
|
||||
*/
|
||||
PodcastViewHolder(View view){
|
||||
coverView = (ImageView) view.findViewById(R.id.imgvCover);
|
||||
titleView = (TextView) view.findViewById(R.id.txtvTitle);
|
||||
urlView = (TextView) view.findViewById(R.id.txtvUrl);
|
||||
coverView = view.findViewById(R.id.imgvCover);
|
||||
titleView = view.findViewById(R.id.txtvTitle);
|
||||
urlView = view.findViewById(R.id.txtvUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import de.danoeh.antennapod.core.ClientConfig;
|
||||
*/
|
||||
class ClientConfigurator {
|
||||
|
||||
private ClientConfigurator(){}
|
||||
|
||||
static {
|
||||
ClientConfig.USER_AGENT = "AntennaPod/" + BuildConfig.VERSION_NAME;
|
||||
ClientConfig.applicationCallbacks = new ApplicationCallbacksImpl();
|
||||
|
@ -2,7 +2,6 @@ package de.danoeh.antennapod.config;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import android.os.Build;
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.activity.AudioplayerActivity;
|
||||
|
@ -35,11 +35,11 @@ public abstract class AuthenticationDialog extends Dialog {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.authentication_dialog);
|
||||
final EditText etxtUsername = (EditText) findViewById(R.id.etxtUsername);
|
||||
final EditText etxtPassword = (EditText) findViewById(R.id.etxtPassword);
|
||||
final CheckBox saveUsernamePassword = (CheckBox) findViewById(R.id.chkSaveUsernamePassword);
|
||||
final Button butConfirm = (Button) findViewById(R.id.butConfirm);
|
||||
final Button butCancel = (Button) findViewById(R.id.butCancel);
|
||||
final EditText etxtUsername = findViewById(R.id.etxtUsername);
|
||||
final EditText etxtPassword = findViewById(R.id.etxtPassword);
|
||||
final CheckBox saveUsernamePassword = findViewById(R.id.chkSaveUsernamePassword);
|
||||
final Button butConfirm = findViewById(R.id.butConfirm);
|
||||
final Button butCancel = findViewById(R.id.butCancel);
|
||||
|
||||
if (titleRes != 0) {
|
||||
setTitle(titleRes);
|
||||
|
@ -29,9 +29,9 @@ public class AutoFlattrPreferenceDialog {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
|
||||
@SuppressLint("InflateParams") View view = activity.getLayoutInflater().inflate(R.layout.autoflattr_preference_dialog, null);
|
||||
final CheckBox chkAutoFlattr = (CheckBox) view.findViewById(R.id.chkAutoFlattr);
|
||||
final SeekBar skbPercent = (SeekBar) view.findViewById(R.id.skbPercent);
|
||||
final TextView txtvStatus = (TextView) view.findViewById(R.id.txtvStatus);
|
||||
final CheckBox chkAutoFlattr = view.findViewById(R.id.chkAutoFlattr);
|
||||
final SeekBar skbPercent = view.findViewById(R.id.skbPercent);
|
||||
final TextView txtvStatus = view.findViewById(R.id.txtvStatus);
|
||||
|
||||
chkAutoFlattr.setChecked(UserPreferences.isAutoFlattr());
|
||||
skbPercent.setEnabled(chkAutoFlattr.isChecked());
|
||||
|
@ -1,5 +1,6 @@
|
||||
package de.danoeh.antennapod.dialog;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
@ -84,7 +85,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.episodes_apply_action_fragment, container, false);
|
||||
|
||||
mListView = (ListView) view.findViewById(android.R.id.list);
|
||||
mListView = view.findViewById(android.R.id.list);
|
||||
mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
|
||||
mListView.setOnItemClickListener((ListView, view1, position, rowId) -> {
|
||||
long id = episodes.get(position).getId();
|
||||
@ -95,6 +96,28 @@ public class EpisodesApplyActionFragment extends Fragment {
|
||||
}
|
||||
refreshCheckboxes();
|
||||
});
|
||||
mListView.setOnItemLongClickListener((adapterView, view12, position, id) -> {
|
||||
new AlertDialog.Builder(getActivity())
|
||||
.setItems(R.array.batch_long_press_options, (dialogInterface, item) -> {
|
||||
int direction;
|
||||
if (item == 0) {
|
||||
direction = -1;
|
||||
} else {
|
||||
direction = 1;
|
||||
}
|
||||
|
||||
int currentPosition = position + direction;
|
||||
while (currentPosition >= 0 && currentPosition < episodes.size()) {
|
||||
long id1 = episodes.get(currentPosition).getId();
|
||||
if (!checkedIds.contains(id1)) {
|
||||
checkedIds.add(id1);
|
||||
}
|
||||
currentPosition += direction;
|
||||
}
|
||||
refreshCheckboxes();
|
||||
}).show();
|
||||
return true;
|
||||
});
|
||||
|
||||
for(FeedItem episode : episodes) {
|
||||
titles.add(episode.getTitle());
|
||||
@ -106,7 +129,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
||||
checkAll();
|
||||
|
||||
int lastVisibleDiv = 0;
|
||||
btnAddToQueue = (Button) view.findViewById(R.id.btnAddToQueue);
|
||||
btnAddToQueue = view.findViewById(R.id.btnAddToQueue);
|
||||
if((actions & ACTION_QUEUE) != 0) {
|
||||
btnAddToQueue.setOnClickListener(v -> queueChecked());
|
||||
lastVisibleDiv = R.id.divider1;
|
||||
@ -114,7 +137,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
||||
btnAddToQueue.setVisibility(View.GONE);
|
||||
view.findViewById(R.id.divider1).setVisibility(View.GONE);
|
||||
}
|
||||
btnMarkAsPlayed = (Button) view.findViewById(R.id.btnMarkAsPlayed);
|
||||
btnMarkAsPlayed = view.findViewById(R.id.btnMarkAsPlayed);
|
||||
if((actions & ACTION_MARK_PLAYED) != 0) {
|
||||
btnMarkAsPlayed.setOnClickListener(v -> markedCheckedPlayed());
|
||||
lastVisibleDiv = R.id.divider2;
|
||||
@ -122,7 +145,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
||||
btnMarkAsPlayed.setVisibility(View.GONE);
|
||||
view.findViewById(R.id.divider2).setVisibility(View.GONE);
|
||||
}
|
||||
btnMarkAsUnplayed = (Button) view.findViewById(R.id.btnMarkAsUnplayed);
|
||||
btnMarkAsUnplayed = view.findViewById(R.id.btnMarkAsUnplayed);
|
||||
if((actions & ACTION_MARK_UNPLAYED) != 0) {
|
||||
btnMarkAsUnplayed.setOnClickListener(v -> markedCheckedUnplayed());
|
||||
lastVisibleDiv = R.id.divider3;
|
||||
@ -130,7 +153,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
||||
btnMarkAsUnplayed.setVisibility(View.GONE);
|
||||
view.findViewById(R.id.divider3).setVisibility(View.GONE);
|
||||
}
|
||||
btnDownload = (Button) view.findViewById(R.id.btnDownload);
|
||||
btnDownload = view.findViewById(R.id.btnDownload);
|
||||
if((actions & ACTION_DOWNLOAD) != 0) {
|
||||
btnDownload.setOnClickListener(v -> downloadChecked());
|
||||
lastVisibleDiv = R.id.divider4;
|
||||
@ -138,7 +161,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
||||
btnDownload.setVisibility(View.GONE);
|
||||
view.findViewById(R.id.divider4).setVisibility(View.GONE);
|
||||
}
|
||||
btnDelete = (Button) view.findViewById(R.id.btnDelete);
|
||||
btnDelete = view.findViewById(R.id.btnDelete);
|
||||
if((actions & ACTION_REMOVE) != 0) {
|
||||
btnDelete.setOnClickListener(v -> deleteChecked());
|
||||
} else {
|
||||
|
@ -17,6 +17,9 @@ import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
|
||||
* Creates a dialog that lets the user change the hostname for the gpodder.net service.
|
||||
*/
|
||||
public class GpodnetSetHostnameDialog {
|
||||
|
||||
private GpodnetSetHostnameDialog(){}
|
||||
|
||||
private static final String TAG = "GpodnetSetHostnameDialog";
|
||||
|
||||
public static AlertDialog createDialog(final Context context) {
|
||||
|
@ -34,7 +34,6 @@ import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import rx.Observable;
|
||||
import rx.Subscriber;
|
||||
import rx.Subscription;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.schedulers.Schedulers;
|
||||
@ -102,7 +101,7 @@ public class ProxyDialog {
|
||||
.autoDismiss(false)
|
||||
.build();
|
||||
View view = dialog.getCustomView();
|
||||
spType = (Spinner) view.findViewById(R.id.spType);
|
||||
spType = view.findViewById(R.id.spType);
|
||||
String[] types = { Proxy.Type.DIRECT.name(), Proxy.Type.HTTP.name() };
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context,
|
||||
android.R.layout.simple_spinner_item, types);
|
||||
@ -110,22 +109,22 @@ public class ProxyDialog {
|
||||
spType.setAdapter(adapter);
|
||||
ProxyConfig proxyConfig = UserPreferences.getProxyConfig();
|
||||
spType.setSelection(adapter.getPosition(proxyConfig.type.name()));
|
||||
etHost = (EditText) view.findViewById(R.id.etHost);
|
||||
etHost = view.findViewById(R.id.etHost);
|
||||
if(!TextUtils.isEmpty(proxyConfig.host)) {
|
||||
etHost.setText(proxyConfig.host);
|
||||
}
|
||||
etHost.addTextChangedListener(requireTestOnChange);
|
||||
etPort = (EditText) view.findViewById(R.id.etPort);
|
||||
etPort = view.findViewById(R.id.etPort);
|
||||
if(proxyConfig.port > 0) {
|
||||
etPort.setText(String.valueOf(proxyConfig.port));
|
||||
}
|
||||
etPort.addTextChangedListener(requireTestOnChange);
|
||||
etUsername = (EditText) view.findViewById(R.id.etUsername);
|
||||
etUsername = view.findViewById(R.id.etUsername);
|
||||
if(!TextUtils.isEmpty(proxyConfig.username)) {
|
||||
etUsername.setText(proxyConfig.username);
|
||||
}
|
||||
etUsername.addTextChangedListener(requireTestOnChange);
|
||||
etPassword = (EditText) view.findViewById(R.id.etPassword);
|
||||
etPassword = view.findViewById(R.id.etPassword);
|
||||
if(!TextUtils.isEmpty(proxyConfig.password)) {
|
||||
etPassword.setText(proxyConfig.username);
|
||||
}
|
||||
@ -146,7 +145,7 @@ public class ProxyDialog {
|
||||
enableSettings(false);
|
||||
}
|
||||
});
|
||||
txtvMessage = (TextView) view.findViewById(R.id.txtvMessage);
|
||||
txtvMessage = view.findViewById(R.id.txtvMessage);
|
||||
checkValidity();
|
||||
return dialog;
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ import de.danoeh.antennapod.R;
|
||||
|
||||
public class RatingDialog {
|
||||
|
||||
private RatingDialog(){}
|
||||
|
||||
private static final String TAG = RatingDialog.class.getSimpleName();
|
||||
private static final int AFTER_DAYS = 7;
|
||||
|
||||
|
@ -61,11 +61,11 @@ public abstract class SleepTimerDialog {
|
||||
dialog = builder.build();
|
||||
|
||||
View view = dialog.getView();
|
||||
etxtTime = (EditText) view.findViewById(R.id.etxtTime);
|
||||
spTimeUnit = (Spinner) view.findViewById(R.id.spTimeUnit);
|
||||
cbShakeToReset = (CheckBox) view.findViewById(R.id.cbShakeToReset);
|
||||
cbVibrate = (CheckBox) view.findViewById(R.id.cbVibrate);
|
||||
chAutoEnable = (CheckBox) view.findViewById(R.id.chAutoEnable);
|
||||
etxtTime = view.findViewById(R.id.etxtTime);
|
||||
spTimeUnit = view.findViewById(R.id.spTimeUnit);
|
||||
cbShakeToReset = view.findViewById(R.id.cbShakeToReset);
|
||||
cbVibrate = view.findViewById(R.id.cbVibrate);
|
||||
chAutoEnable = view.findViewById(R.id.chAutoEnable);
|
||||
|
||||
etxtTime.setText(SleepTimerPreferences.lastTimerValue());
|
||||
etxtTime.addTextChangedListener(new TextWatcher() {
|
||||
|
@ -32,18 +32,18 @@ public class AddFeedFragment extends Fragment {
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
View root = inflater.inflate(R.layout.addfeed, container, false);
|
||||
|
||||
final EditText etxtFeedurl = (EditText) root.findViewById(R.id.etxtFeedurl);
|
||||
final EditText etxtFeedurl = root.findViewById(R.id.etxtFeedurl);
|
||||
|
||||
Bundle args = getArguments();
|
||||
if (args != null && args.getString(ARG_FEED_URL) != null) {
|
||||
etxtFeedurl.setText(args.getString(ARG_FEED_URL));
|
||||
}
|
||||
|
||||
Button butSearchITunes = (Button) root.findViewById(R.id.butSearchItunes);
|
||||
Button butBrowserGpoddernet = (Button) root.findViewById(R.id.butBrowseGpoddernet);
|
||||
Button butSearchFyyd = (Button) root.findViewById(R.id.butSearchFyyd);
|
||||
Button butOpmlImport = (Button) root.findViewById(R.id.butOpmlImport);
|
||||
Button butConfirm = (Button) root.findViewById(R.id.butConfirm);
|
||||
Button butSearchITunes = root.findViewById(R.id.butSearchItunes);
|
||||
Button butBrowserGpoddernet = root.findViewById(R.id.butBrowseGpoddernet);
|
||||
Button butSearchFyyd = root.findViewById(R.id.butSearchFyyd);
|
||||
Button butOpmlImport = root.findViewById(R.id.butOpmlImport);
|
||||
Button butConfirm = root.findViewById(R.id.butConfirm);
|
||||
|
||||
final MainActivity activity = (MainActivity) getActivity();
|
||||
activity.getSupportActionBar().setTitle(R.string.add_feed_label);
|
||||
|
@ -313,7 +313,7 @@ public class AllEpisodesFragment extends Fragment {
|
||||
|
||||
View root = inflater.inflate(fragmentResource, container, false);
|
||||
|
||||
recyclerView = (RecyclerView) root.findViewById(android.R.id.list);
|
||||
recyclerView = root.findViewById(android.R.id.list);
|
||||
RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
|
||||
if (animator instanceof SimpleItemAnimator) {
|
||||
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
|
||||
@ -323,7 +323,7 @@ public class AllEpisodesFragment extends Fragment {
|
||||
recyclerView.setHasFixedSize(true);
|
||||
recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).build());
|
||||
|
||||
progLoading = (ProgressBar) root.findViewById(R.id.progLoading);
|
||||
progLoading = root.findViewById(R.id.progLoading);
|
||||
|
||||
if (!itemsLoaded) {
|
||||
progLoading.setVisibility(View.VISIBLE);
|
||||
|
@ -1,8 +1,6 @@
|
||||
package de.danoeh.antennapod.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.ListFragment;
|
||||
import android.util.Log;
|
||||
@ -12,9 +10,6 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.joanzapata.iconify.IconDrawable;
|
||||
import com.joanzapata.iconify.fonts.FontAwesomeIcons;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
@ -22,7 +17,6 @@ import de.danoeh.antennapod.activity.MainActivity;
|
||||
import de.danoeh.antennapod.adapter.DownloadedEpisodesListAdapter;
|
||||
import de.danoeh.antennapod.core.feed.EventDistributor;
|
||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.storage.DBReader;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.util.FeedItemUtil;
|
||||
|
@ -23,7 +23,6 @@ import de.danoeh.antennapod.core.util.playback.Playable;
|
||||
public class CoverFragment extends Fragment implements MediaplayerInfoContentFragment {
|
||||
|
||||
private static final String TAG = "CoverFragment";
|
||||
private static final String ARG_PLAYABLE = "arg.playable";
|
||||
|
||||
private Playable media;
|
||||
|
||||
@ -50,9 +49,9 @@ public class CoverFragment extends Fragment implements MediaplayerInfoContentFra
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
root = inflater.inflate(R.layout.cover_fragment, container, false);
|
||||
txtvPodcastTitle = (TextView) root.findViewById(R.id.txtvPodcastTitle);
|
||||
txtvEpisodeTitle = (TextView) root.findViewById(R.id.txtvEpisodeTitle);
|
||||
imgvCover = (ImageView) root.findViewById(R.id.imgvCover);
|
||||
txtvPodcastTitle = root.findViewById(R.id.txtvPodcastTitle);
|
||||
txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle);
|
||||
imgvCover = root.findViewById(R.id.imgvCover);
|
||||
return root;
|
||||
}
|
||||
|
||||
|
@ -12,10 +12,10 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import android.widget.TextView;
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.adapter.DownloadLogAdapter;
|
||||
import de.danoeh.antennapod.core.feed.EventDistributor;
|
||||
|
@ -38,12 +38,12 @@ public class DownloadsFragment extends Fragment {
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
View root = inflater.inflate(R.layout.pager_fragment, container, false);
|
||||
|
||||
viewPager = (ViewPager)root.findViewById(R.id.viewpager);
|
||||
viewPager = root.findViewById(R.id.viewpager);
|
||||
DownloadsPagerAdapter pagerAdapter = new DownloadsPagerAdapter(getChildFragmentManager(), getResources());
|
||||
viewPager.setAdapter(pagerAdapter);
|
||||
|
||||
// Give the TabLayout the ViewPager
|
||||
tabLayout = (TabLayout) root.findViewById(R.id.sliding_tabs);
|
||||
tabLayout = root.findViewById(R.id.sliding_tabs);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
|
||||
return root;
|
||||
|
@ -46,11 +46,11 @@ public class EpisodesFragment extends Fragment {
|
||||
((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.episodes_label);
|
||||
|
||||
View rootView = inflater.inflate(R.layout.pager_fragment, container, false);
|
||||
viewPager = (ViewPager)rootView.findViewById(R.id.viewpager);
|
||||
viewPager = rootView.findViewById(R.id.viewpager);
|
||||
viewPager.setAdapter(new EpisodesPagerAdapter(getChildFragmentManager(), getResources()));
|
||||
|
||||
// Give the TabLayout the ViewPager
|
||||
tabLayout = (TabLayout) rootView.findViewById(R.id.sliding_tabs);
|
||||
tabLayout = rootView.findViewById(R.id.sliding_tabs);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
|
||||
return rootView;
|
||||
|
@ -21,10 +21,10 @@ import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.core.feed.MediaType;
|
||||
import de.danoeh.antennapod.core.glide.ApGlideSettings;
|
||||
import de.danoeh.antennapod.core.service.playback.PlaybackService;
|
||||
import de.danoeh.antennapod.core.util.Converter;
|
||||
import de.danoeh.antennapod.core.util.playback.Playable;
|
||||
import de.danoeh.antennapod.core.util.playback.PlaybackController;
|
||||
import rx.Single;
|
||||
import rx.Subscription;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
@ -42,6 +42,7 @@ public class ExternalPlayerFragment extends Fragment {
|
||||
private TextView mFeedName;
|
||||
private ProgressBar mProgressBar;
|
||||
private PlaybackController controller;
|
||||
private Subscription subscription;
|
||||
|
||||
public ExternalPlayerFragment() {
|
||||
super();
|
||||
@ -52,12 +53,12 @@ public class ExternalPlayerFragment extends Fragment {
|
||||
Bundle savedInstanceState) {
|
||||
View root = inflater.inflate(R.layout.external_player_fragment,
|
||||
container, false);
|
||||
fragmentLayout = (ViewGroup) root.findViewById(R.id.fragmentLayout);
|
||||
imgvCover = (ImageView) root.findViewById(R.id.imgvCover);
|
||||
txtvTitle = (TextView) root.findViewById(R.id.txtvTitle);
|
||||
butPlay = (ImageButton) root.findViewById(R.id.butPlay);
|
||||
mFeedName = (TextView) root.findViewById(R.id.txtvAuthor);
|
||||
mProgressBar = (ProgressBar) root.findViewById(R.id.episodeProgress);
|
||||
fragmentLayout = root.findViewById(R.id.fragmentLayout);
|
||||
imgvCover = root.findViewById(R.id.imgvCover);
|
||||
txtvTitle = root.findViewById(R.id.txtvTitle);
|
||||
butPlay = root.findViewById(R.id.butPlay);
|
||||
mFeedName = root.findViewById(R.id.txtvAuthor);
|
||||
mProgressBar = root.findViewById(R.id.episodeProgress);
|
||||
|
||||
fragmentLayout.setOnClickListener(v -> {
|
||||
Log.d(TAG, "layoutInfo was clicked");
|
||||
@ -82,7 +83,7 @@ public class ExternalPlayerFragment extends Fragment {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
controller = setupPlaybackController();
|
||||
butPlay.setOnClickListener(v -> {
|
||||
if(controller != null) {
|
||||
if (controller != null) {
|
||||
controller.playPause();
|
||||
}
|
||||
});
|
||||
@ -143,6 +144,9 @@ public class ExternalPlayerFragment extends Fragment {
|
||||
if (controller != null) {
|
||||
controller.release();
|
||||
}
|
||||
if (subscription != null) {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -163,7 +167,7 @@ public class ExternalPlayerFragment extends Fragment {
|
||||
controller = setupPlaybackController();
|
||||
if (butPlay != null) {
|
||||
butPlay.setOnClickListener(v -> {
|
||||
if(controller != null) {
|
||||
if (controller != null) {
|
||||
controller.playPause();
|
||||
}
|
||||
});
|
||||
@ -178,7 +182,10 @@ public class ExternalPlayerFragment extends Fragment {
|
||||
return false;
|
||||
}
|
||||
|
||||
Single.create(subscriber -> subscriber.onSuccess(controller.getMedia()))
|
||||
if (subscription != null) {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
subscription = Single.create(subscriber -> subscriber.onSuccess(controller.getMedia()))
|
||||
.subscribeOn(Schedulers.newThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(media -> updateUi((Playable) media));
|
||||
@ -208,15 +215,10 @@ public class ExternalPlayerFragment extends Fragment {
|
||||
butPlay.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
Log.w(TAG, "loadMediaInfo was called while the media object of playbackService was null!");
|
||||
Log.w(TAG, "loadMediaInfo was called while the media object of playbackService was null!");
|
||||
}
|
||||
}
|
||||
|
||||
private String getPositionString(int position, int duration) {
|
||||
return Converter.getDurationStringLong(position) + " / "
|
||||
+ Converter.getDurationStringLong(duration);
|
||||
}
|
||||
|
||||
public PlaybackController getPlaybackControllerTestingOnly() {
|
||||
return controller;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class FyydSearchFragment extends Fragment {
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
View root = inflater.inflate(R.layout.fragment_itunes_search, container, false);
|
||||
gridView = (GridView) root.findViewById(R.id.gridView);
|
||||
gridView = root.findViewById(R.id.gridView);
|
||||
adapter = new ItunesAdapter(getActivity(), new ArrayList<>());
|
||||
gridView.setAdapter(adapter);
|
||||
|
||||
@ -87,10 +87,10 @@ public class FyydSearchFragment extends Fragment {
|
||||
intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, podcast.title);
|
||||
startActivity(intent);
|
||||
});
|
||||
progressBar = (ProgressBar) root.findViewById(R.id.progressBar);
|
||||
txtvError = (TextView) root.findViewById(R.id.txtvError);
|
||||
butRetry = (Button) root.findViewById(R.id.butRetry);
|
||||
txtvEmpty = (TextView) root.findViewById(android.R.id.empty);
|
||||
progressBar = root.findViewById(R.id.progressBar);
|
||||
txtvError = root.findViewById(R.id.txtvError);
|
||||
butRetry = root.findViewById(R.id.butRetry);
|
||||
txtvEmpty = root.findViewById(android.R.id.empty);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
@ -35,8 +35,6 @@ import com.bumptech.glide.request.RequestOptions;
|
||||
import com.joanzapata.iconify.Iconify;
|
||||
import com.joanzapata.iconify.widget.IconButton;
|
||||
|
||||
import de.danoeh.antennapod.core.service.playback.PlaybackService;
|
||||
import de.danoeh.antennapod.core.util.NetworkUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import java.util.List;
|
||||
@ -54,16 +52,17 @@ import de.danoeh.antennapod.core.feed.FeedMedia;
|
||||
import de.danoeh.antennapod.core.glide.ApGlideSettings;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.service.download.Downloader;
|
||||
import de.danoeh.antennapod.core.service.playback.PlaybackService;
|
||||
import de.danoeh.antennapod.core.storage.DBReader;
|
||||
import de.danoeh.antennapod.core.storage.DBTasks;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.storage.DownloadRequestException;
|
||||
import de.danoeh.antennapod.core.storage.DownloadRequester;
|
||||
import de.danoeh.antennapod.core.util.Converter;
|
||||
import de.danoeh.antennapod.core.util.DateUtils;
|
||||
import de.danoeh.antennapod.core.util.Flavors;
|
||||
import de.danoeh.antennapod.core.util.IntentUtils;
|
||||
import de.danoeh.antennapod.core.util.LongList;
|
||||
import de.danoeh.antennapod.core.util.NetworkUtils;
|
||||
import de.danoeh.antennapod.core.util.ShareUtils;
|
||||
import de.danoeh.antennapod.core.util.playback.Timeline;
|
||||
import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler;
|
||||
@ -167,25 +166,25 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
View layout = inflater.inflate(R.layout.feeditem_fragment, container, false);
|
||||
|
||||
root = (ViewGroup) layout.findViewById(R.id.content_root);
|
||||
root = layout.findViewById(R.id.content_root);
|
||||
|
||||
LinearLayout header = (LinearLayout) root.findViewById(R.id.header);
|
||||
LinearLayout header = root.findViewById(R.id.header);
|
||||
if(feedItems.length > 0) {
|
||||
header.setOnTouchListener((v, event) -> headerGestureDetector.onTouchEvent(event));
|
||||
}
|
||||
|
||||
txtvPodcast = (TextView) layout.findViewById(R.id.txtvPodcast);
|
||||
txtvPodcast = layout.findViewById(R.id.txtvPodcast);
|
||||
txtvPodcast.setOnClickListener(v -> openPodcast());
|
||||
txtvTitle = (TextView) layout.findViewById(R.id.txtvTitle);
|
||||
txtvTitle = layout.findViewById(R.id.txtvTitle);
|
||||
if(Build.VERSION.SDK_INT >= 23) {
|
||||
txtvTitle.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
|
||||
}
|
||||
txtvDuration = (TextView) layout.findViewById(R.id.txtvDuration);
|
||||
txtvPublished = (TextView) layout.findViewById(R.id.txtvPublished);
|
||||
txtvDuration = layout.findViewById(R.id.txtvDuration);
|
||||
txtvPublished = layout.findViewById(R.id.txtvPublished);
|
||||
if (Build.VERSION.SDK_INT >= 14) { // ellipsize is causing problems on old versions, see #448
|
||||
txtvTitle.setEllipsize(TextUtils.TruncateAt.END);
|
||||
}
|
||||
webvDescription = (WebView) layout.findViewById(R.id.webvDescription);
|
||||
webvDescription = layout.findViewById(R.id.webvDescription);
|
||||
if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark ||
|
||||
UserPreferences.getTheme() == R.style.Theme_AntennaPod_TrueBlack) {
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
|
||||
@ -217,12 +216,12 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
|
||||
});
|
||||
registerForContextMenu(webvDescription);
|
||||
|
||||
imgvCover = (ImageView) layout.findViewById(R.id.imgvCover);
|
||||
imgvCover = layout.findViewById(R.id.imgvCover);
|
||||
imgvCover.setOnClickListener(v -> openPodcast());
|
||||
progbarDownload = (ProgressBar) layout.findViewById(R.id.progbarDownload);
|
||||
progbarLoading = (ProgressBar) layout.findViewById(R.id.progbarLoading);
|
||||
butAction1 = (IconButton) layout.findViewById(R.id.butAction1);
|
||||
butAction2 = (IconButton) layout.findViewById(R.id.butAction2);
|
||||
progbarDownload = layout.findViewById(R.id.progbarDownload);
|
||||
progbarLoading = layout.findViewById(R.id.progbarLoading);
|
||||
butAction1 = layout.findViewById(R.id.butAction1);
|
||||
butAction2 = layout.findViewById(R.id.butAction2);
|
||||
|
||||
butAction1.setOnClickListener(v -> {
|
||||
if (item == null) {
|
||||
|
@ -4,8 +4,6 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LightingColorFilter;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.ListFragment;
|
||||
@ -29,16 +27,15 @@ import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.joanzapata.iconify.IconDrawable;
|
||||
import com.joanzapata.iconify.Iconify;
|
||||
import com.joanzapata.iconify.fonts.FontAwesomeIcons;
|
||||
import com.joanzapata.iconify.widget.IconTextView;
|
||||
|
||||
import de.danoeh.antennapod.activity.FeedSettingsActivity;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.activity.FeedInfoActivity;
|
||||
import de.danoeh.antennapod.activity.FeedSettingsActivity;
|
||||
import de.danoeh.antennapod.activity.MainActivity;
|
||||
import de.danoeh.antennapod.adapter.DefaultActionButtonCallback;
|
||||
import de.danoeh.antennapod.adapter.FeedItemlistAdapter;
|
||||
@ -56,7 +53,6 @@ import de.danoeh.antennapod.core.feed.FeedItemFilter;
|
||||
import de.danoeh.antennapod.core.feed.FeedMedia;
|
||||
import de.danoeh.antennapod.core.glide.ApGlideSettings;
|
||||
import de.danoeh.antennapod.core.glide.FastBlurTransformation;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.service.download.DownloadService;
|
||||
import de.danoeh.antennapod.core.service.download.Downloader;
|
||||
import de.danoeh.antennapod.core.storage.DBReader;
|
||||
@ -418,13 +414,10 @@ public class ItemlistFragment extends ListFragment {
|
||||
|
||||
}
|
||||
|
||||
private boolean insideOnFragmentLoaded = false;
|
||||
|
||||
private void onFragmentLoaded() {
|
||||
if(!isVisible()) {
|
||||
return;
|
||||
}
|
||||
insideOnFragmentLoaded = true;
|
||||
if (adapter == null) {
|
||||
setListAdapter(null);
|
||||
setupHeaderView();
|
||||
@ -441,9 +434,6 @@ public class ItemlistFragment extends ListFragment {
|
||||
if (feed != null && feed.getNextPageLink() == null && listFooter != null) {
|
||||
getListView().removeFooterView(listFooter.getRoot());
|
||||
}
|
||||
|
||||
insideOnFragmentLoaded = false;
|
||||
|
||||
}
|
||||
|
||||
private void refreshHeaderView() {
|
||||
@ -487,14 +477,14 @@ public class ItemlistFragment extends ListFragment {
|
||||
View header = inflater.inflate(R.layout.feeditemlist_header, lv, false);
|
||||
lv.addHeaderView(header);
|
||||
|
||||
txtvTitle = (TextView) header.findViewById(R.id.txtvTitle);
|
||||
TextView txtvAuthor = (TextView) header.findViewById(R.id.txtvAuthor);
|
||||
imgvBackground = (ImageView) header.findViewById(R.id.imgvBackground);
|
||||
imgvCover = (ImageView) header.findViewById(R.id.imgvCover);
|
||||
ImageButton butShowInfo = (ImageButton) header.findViewById(R.id.butShowInfo);
|
||||
ImageButton butShowSettings = (ImageButton) header.findViewById(R.id.butShowSettings);
|
||||
txtvInformation = (TextView) header.findViewById(R.id.txtvInformation);
|
||||
txtvFailure = (IconTextView) header.findViewById(R.id.txtvFailure);
|
||||
txtvTitle = header.findViewById(R.id.txtvTitle);
|
||||
TextView txtvAuthor = header.findViewById(R.id.txtvAuthor);
|
||||
imgvBackground = header.findViewById(R.id.imgvBackground);
|
||||
imgvCover = header.findViewById(R.id.imgvCover);
|
||||
ImageButton butShowInfo = header.findViewById(R.id.butShowInfo);
|
||||
ImageButton butShowSettings = header.findViewById(R.id.butShowSettings);
|
||||
txtvInformation = header.findViewById(R.id.txtvInformation);
|
||||
txtvFailure = header.findViewById(R.id.txtvFailure);
|
||||
|
||||
txtvTitle.setText(feed.getTitle());
|
||||
txtvAuthor.setText(feed.getAuthor());
|
||||
|
@ -109,7 +109,7 @@ public class ItunesSearchFragment extends Fragment {
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
View root = inflater.inflate(R.layout.fragment_itunes_search, container, false);
|
||||
gridView = (GridView) root.findViewById(R.id.gridView);
|
||||
gridView = root.findViewById(R.id.gridView);
|
||||
adapter = new ItunesAdapter(getActivity(), new ArrayList<>());
|
||||
gridView.setAdapter(adapter);
|
||||
|
||||
@ -170,10 +170,10 @@ public class ItunesSearchFragment extends Fragment {
|
||||
});
|
||||
}
|
||||
});
|
||||
progressBar = (ProgressBar) root.findViewById(R.id.progressBar);
|
||||
txtvError = (TextView) root.findViewById(R.id.txtvError);
|
||||
butRetry = (Button) root.findViewById(R.id.butRetry);
|
||||
txtvEmpty = (TextView) root.findViewById(android.R.id.empty);
|
||||
progressBar = root.findViewById(R.id.progressBar);
|
||||
txtvError = root.findViewById(R.id.txtvError);
|
||||
butRetry = root.findViewById(R.id.butRetry);
|
||||
txtvEmpty = root.findViewById(android.R.id.empty);
|
||||
|
||||
loadToplist();
|
||||
|
||||
|
@ -380,8 +380,8 @@ public class QueueFragment extends Fragment {
|
||||
((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.queue_label);
|
||||
|
||||
View root = inflater.inflate(R.layout.queue_fragment, container, false);
|
||||
infoBar = (TextView) root.findViewById(R.id.info_bar);
|
||||
recyclerView = (RecyclerView) root.findViewById(R.id.recyclerView);
|
||||
infoBar = root.findViewById(R.id.info_bar);
|
||||
recyclerView = root.findViewById(R.id.recyclerView);
|
||||
RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
|
||||
if (animator instanceof SimpleItemAnimator) {
|
||||
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
|
||||
@ -487,16 +487,16 @@ public class QueueFragment extends Fragment {
|
||||
|
||||
private void reallyMoved(int from, int to) {
|
||||
// Write drag operation to database
|
||||
Log.d(TAG, "Write to database move(" + dragFrom + ", " + dragTo + ")");
|
||||
DBWriter.moveQueueItem(dragFrom, dragTo, true);
|
||||
Log.d(TAG, "Write to database move(" + from + ", " + to + ")");
|
||||
DBWriter.moveQueueItem(from, to, true);
|
||||
}
|
||||
}
|
||||
);
|
||||
itemTouchHelper.attachToRecyclerView(recyclerView);
|
||||
|
||||
txtvEmpty = (TextView) root.findViewById(android.R.id.empty);
|
||||
txtvEmpty = root.findViewById(android.R.id.empty);
|
||||
txtvEmpty.setVisibility(View.GONE);
|
||||
progLoading = (ProgressBar) root.findViewById(R.id.progLoading);
|
||||
progLoading = root.findViewById(R.id.progLoading);
|
||||
progLoading.setVisibility(View.VISIBLE);
|
||||
|
||||
return root;
|
||||
@ -537,8 +537,8 @@ public class QueueFragment extends Fragment {
|
||||
for(FeedItem item : queue) {
|
||||
if(item.getMedia() != null) {
|
||||
timeLeft +=
|
||||
(item.getMedia().getDuration() - item.getMedia().getPosition())
|
||||
/ playbackSpeed;
|
||||
(long) ((item.getMedia().getDuration() - item.getMedia().getPosition())
|
||||
/ playbackSpeed);
|
||||
}
|
||||
}
|
||||
info += " \u2022 ";
|
||||
|
@ -1,7 +1,6 @@
|
||||
package de.danoeh.antennapod.fragment;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.util.Log;
|
||||
@ -16,7 +15,6 @@ import android.widget.GridView;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.activity.MainActivity;
|
||||
import de.danoeh.antennapod.activity.MediaplayerInfoActivity;
|
||||
import de.danoeh.antennapod.adapter.SubscriptionsAdapter;
|
||||
import de.danoeh.antennapod.core.asynctask.FeedRemover;
|
||||
import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
|
||||
@ -70,7 +68,7 @@ public class SubscriptionFragment extends Fragment {
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View root = inflater.inflate(R.layout.fragment_subscriptions, container, false);
|
||||
subscriptionGridLayout = (GridView) root.findViewById(R.id.subscriptions_grid);
|
||||
subscriptionGridLayout = root.findViewById(R.id.subscriptions_grid);
|
||||
registerForContextMenu(subscriptionGridLayout);
|
||||
return root;
|
||||
}
|
||||
|
@ -31,12 +31,12 @@ public class GpodnetMainFragment extends Fragment {
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
View root = inflater.inflate(R.layout.pager_fragment, container, false);
|
||||
|
||||
viewPager = (ViewPager)root.findViewById(R.id.viewpager);
|
||||
viewPager = root.findViewById(R.id.viewpager);
|
||||
GpodnetPagerAdapter pagerAdapter = new GpodnetPagerAdapter(getChildFragmentManager(), getResources());
|
||||
viewPager.setAdapter(pagerAdapter);
|
||||
|
||||
// Give the TabLayout the ViewPager
|
||||
tabLayout = (TabLayout) root.findViewById(R.id.sliding_tabs);
|
||||
tabLayout = root.findViewById(R.id.sliding_tabs);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
|
||||
return root;
|
||||
|
@ -78,10 +78,10 @@ public abstract class PodcastListFragment extends Fragment {
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View root = inflater.inflate(R.layout.gpodnet_podcast_list, container, false);
|
||||
|
||||
gridView = (GridView) root.findViewById(R.id.gridView);
|
||||
progressBar = (ProgressBar) root.findViewById(R.id.progressBar);
|
||||
txtvError = (TextView) root.findViewById(R.id.txtvError);
|
||||
butRetry = (Button) root.findViewById(R.id.butRetry);
|
||||
gridView = root.findViewById(R.id.gridView);
|
||||
progressBar = root.findViewById(R.id.progressBar);
|
||||
txtvError = root.findViewById(R.id.txtvError);
|
||||
butRetry = root.findViewById(R.id.butRetry);
|
||||
|
||||
gridView.setOnItemClickListener((parent, view, position, id) ->
|
||||
onPodcastSelected((GpodnetPodcast) gridView.getAdapter().getItem(position)));
|
||||
|
@ -30,6 +30,9 @@ import de.danoeh.antennapod.core.util.ShareUtils;
|
||||
* Handles interactions with the FeedItemMenu.
|
||||
*/
|
||||
public class FeedMenuHandler {
|
||||
|
||||
private FeedMenuHandler(){ }
|
||||
|
||||
private static final String TAG = "FeedMenuHandler";
|
||||
|
||||
public static boolean onCreateOptionsMenu(MenuInflater inflater, Menu menu) {
|
||||
|
@ -19,7 +19,7 @@ public class MenuItemUtils extends de.danoeh.antennapod.core.menuhandler.MenuIte
|
||||
|
||||
public static void adjustTextColor(Context context, SearchView sv) {
|
||||
if(Build.VERSION.SDK_INT < 14) {
|
||||
EditText searchEditText = (EditText) sv.findViewById(R.id.search_src_text);
|
||||
EditText searchEditText = sv.findViewById(R.id.search_src_text);
|
||||
if (UserPreferences.getTheme() == de.danoeh.antennapod.R.style.Theme_AntennaPod_Dark
|
||||
|| UserPreferences.getTheme() == R.style.Theme_AntennaPod_TrueBlack) {
|
||||
searchEditText.setTextColor(Color.WHITE);
|
||||
|
@ -9,6 +9,7 @@ import android.support.v7.preference.PreferenceViewHolder;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.widget.TextView;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
|
||||
public class MasterSwitchPreference extends SwitchPreference {
|
||||
|
@ -8,6 +8,7 @@ import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.EditText;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
|
||||
public class NumberPickerPreference extends Preference {
|
||||
|
@ -36,24 +36,9 @@ import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
|
||||
import com.bytehamster.lib.preferencesearch.SearchConfiguration;
|
||||
import com.bytehamster.lib.preferencesearch.SearchPreference;
|
||||
import de.danoeh.antennapod.activity.AboutActivity;
|
||||
import de.danoeh.antennapod.activity.ImportExportActivity;
|
||||
import de.danoeh.antennapod.activity.MediaplayerActivity;
|
||||
import de.danoeh.antennapod.activity.OpmlImportFromPathActivity;
|
||||
import de.danoeh.antennapod.activity.PreferenceActivity;
|
||||
import de.danoeh.antennapod.activity.StatisticsActivity;
|
||||
import de.danoeh.antennapod.core.export.html.HtmlWriter;
|
||||
import de.danoeh.antennapod.core.export.opml.OpmlWriter;
|
||||
import de.danoeh.antennapod.core.service.GpodnetSyncService;
|
||||
import de.danoeh.antennapod.dialog.AuthenticationDialog;
|
||||
import de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog;
|
||||
import de.danoeh.antennapod.dialog.GpodnetSetHostnameDialog;
|
||||
import de.danoeh.antennapod.dialog.ProxyDialog;
|
||||
import de.danoeh.antennapod.dialog.VariableSpeedDialog;
|
||||
import de.danoeh.antennapod.core.util.gui.PictureInPictureUtil;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import java.io.File;
|
||||
@ -67,14 +52,29 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import de.danoeh.antennapod.CrashReportWriter;
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.activity.AboutActivity;
|
||||
import de.danoeh.antennapod.activity.DirectoryChooserActivity;
|
||||
import de.danoeh.antennapod.activity.ImportExportActivity;
|
||||
import de.danoeh.antennapod.activity.MainActivity;
|
||||
import de.danoeh.antennapod.activity.MediaplayerActivity;
|
||||
import de.danoeh.antennapod.activity.OpmlImportFromPathActivity;
|
||||
import de.danoeh.antennapod.activity.PreferenceActivity;
|
||||
import de.danoeh.antennapod.activity.StatisticsActivity;
|
||||
import de.danoeh.antennapod.asynctask.ExportWorker;
|
||||
import de.danoeh.antennapod.core.export.ExportWriter;
|
||||
import de.danoeh.antennapod.core.export.html.HtmlWriter;
|
||||
import de.danoeh.antennapod.core.export.opml.OpmlWriter;
|
||||
import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.service.GpodnetSyncService;
|
||||
import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
|
||||
import de.danoeh.antennapod.core.util.gui.PictureInPictureUtil;
|
||||
import de.danoeh.antennapod.dialog.AuthenticationDialog;
|
||||
import de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog;
|
||||
import de.danoeh.antennapod.dialog.ChooseDataFolderDialog;
|
||||
import de.danoeh.antennapod.dialog.GpodnetSetHostnameDialog;
|
||||
import de.danoeh.antennapod.dialog.ProxyDialog;
|
||||
import de.danoeh.antennapod.dialog.VariableSpeedDialog;
|
||||
import rx.Observable;
|
||||
import rx.Subscription;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
@ -227,6 +227,9 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
|
||||
return true;
|
||||
});
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
ui.findPreference(UserPreferences.PREF_EXPANDED_NOTIFICATION).setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void setupStorageScreen() {
|
||||
|
@ -33,7 +33,7 @@ public class SPAUtil {
|
||||
* sent before.
|
||||
*/
|
||||
public static synchronized boolean sendSPAppsQueryFeedsIntent(Context context) {
|
||||
if (context == null) throw new IllegalArgumentException("context = null");
|
||||
assert context != null : "context = null";
|
||||
final Context appContext = context.getApplicationContext();
|
||||
if (appContext == null) {
|
||||
Log.wtf(TAG, "Unable to get application context");
|
||||
|
@ -1,4 +1,4 @@
|
||||
AntennaPod ist ein Podcast-Manager und -Player, der Dir unmittelbar Zugriff auf Millionen von freien und bezahlten Podcasts ermöglicht, angefangen von unabhängigen Podcastern zu großen Rundfunkanstalten oder Hörfunksendern wie BBC, NPR und CNN. Abonniere, importiere und exportiere deine Feeds mühelos mit Hilfe des iTunes-Verzeichnisses, OPML-Dateien oder einfachen RSS-URLs. Reduziere Aufwand, Stromverbrauch und Datenverbrauch durch die Kontrolle der Downloads (bestimmte Uhrzeiten, Intervalle, WiFi-Netze) und des Löschens von Episoden (basierend auf deinen Favoriten und weiteren Einstellungen).<br>
|
||||
AntennaPod ist ein Podcast-Manager und -Player, der Dir unmittelbar Zugriff auf Millionen von freien und kostenpflichtigen Podcasts ermöglicht, angefangen von unabhängigen Podcastern bis hin zu großen Rundfunkanstalten wie BBC, NPR und CNN. Abonniere, importiere und exportiere deine Feeds mühelos mit Hilfe des iTunes-Verzeichnisses, OPML-Dateien oder einfachen RSS-URLs. Reduziere Aufwand, Stromverbrauch und Datenverbrauch durch die Kontrolle der Downloads (bestimmte Uhrzeiten, Intervalle, WiFi-Netze) und des Löschens von Episoden (basierend auf deinen Favoriten und weiteren Einstellungen).<br>
|
||||
Aber am wichtigsten: Downloade, streame oder füge Episoden zur Abspielliste hinzu und genieße sie mit einstellbarer Abspielgeschwindigkeit, Unterstützung von Kapiteln und Schlummerfunktion. Mit Flattr kannst du den Podcastern sogar deine Wertschätzung zeigen.
|
||||
|
||||
AntennaPod ist, von Podcast-Enthusiasten gemacht, frei im Sinne des Wortes: Open Source, keine Kosten, keine Werbung.
|
||||
@ -24,7 +24,7 @@ STEUER DAS SYSTEM<br>
|
||||
• Passe das Aussehen mit dem hellen oder dunklen Theme an<br>
|
||||
• Sichere deine Abonnements mit gPodder.net oder über den OPML-Export
|
||||
|
||||
<b>Trete der AntennaPod-Community bei!</b><br>
|
||||
<b>Tritt der AntennaPod-Community bei!</b><br>
|
||||
AntennaPod wird aktiv von Freiwilligen weiterentwickelt. Auch du kannst bei der Entwicklung mit Quellcode oder Kommentaren mitwirken!
|
||||
|
||||
Wir verwenden GitHub für Funktionswünsche (Feature Requests), Fehlerberichte (Bug Reports) und zum Beisteuern von Code (Code Contributions).
|
||||
|
@ -8,7 +8,7 @@
|
||||
<Preference
|
||||
android:key="prefScreenInterface"
|
||||
android:title="@string/user_interface_label"
|
||||
android:icon="?attr/type_video" />
|
||||
android:icon="?attr/ic_cellphone_text" />
|
||||
|
||||
<Preference
|
||||
android:key="prefScreenPlayback"
|
||||
|
@ -0,0 +1,118 @@
|
||||
package android.support.v4.app;
|
||||
|
||||
import android.app.job.JobParameters;
|
||||
import android.app.job.JobServiceEngine;
|
||||
import android.app.job.JobWorkItem;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
public abstract class SafeJobIntentService extends JobIntentService {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
mJobImpl = new SafeJobServiceEngineImpl(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of a safe JobServiceEngine for interaction with JobIntentService.
|
||||
*/
|
||||
@RequiresApi(26)
|
||||
static final class SafeJobServiceEngineImpl extends JobServiceEngine
|
||||
implements JobIntentService.CompatJobEngine {
|
||||
static final String TAG = "JobServiceEngineImpl";
|
||||
|
||||
static final boolean DEBUG = false;
|
||||
|
||||
final JobIntentService mService;
|
||||
final Object mLock = new Object();
|
||||
JobParameters mParams;
|
||||
|
||||
final class WrapperWorkItem implements JobIntentService.GenericWorkItem {
|
||||
final JobWorkItem mJobWork;
|
||||
|
||||
WrapperWorkItem(JobWorkItem jobWork) {
|
||||
mJobWork = jobWork;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent getIntent() {
|
||||
return mJobWork.getIntent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete() {
|
||||
synchronized (mLock) {
|
||||
if (mParams != null) {
|
||||
try {
|
||||
mParams.completeWork(mJobWork);
|
||||
} catch (SecurityException e) {
|
||||
Log.e(TAG, Log.getStackTraceString(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SafeJobServiceEngineImpl(JobIntentService service) {
|
||||
super(service);
|
||||
mService = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder compatGetBinder() {
|
||||
return getBinder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStartJob(JobParameters params) {
|
||||
if (DEBUG) Log.d(TAG, "onStartJob: " + params);
|
||||
mParams = params;
|
||||
// We can now start dequeuing work!
|
||||
mService.ensureProcessorRunningLocked(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStopJob(JobParameters params) {
|
||||
if (DEBUG) Log.d(TAG, "onStartJob: " + params);
|
||||
boolean result = mService.doStopCurrentWork();
|
||||
synchronized (mLock) {
|
||||
// Once we return, the job is stopped, so its JobParameters are no
|
||||
// longer valid and we should not be doing anything with them.
|
||||
mParams = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dequeue some work.
|
||||
*/
|
||||
@Override
|
||||
public JobIntentService.GenericWorkItem dequeueWork() {
|
||||
JobWorkItem work = null;
|
||||
synchronized (mLock) {
|
||||
if (mParams == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
work = mParams.dequeueWork();
|
||||
} catch (SecurityException e) {
|
||||
Log.e(TAG, Log.getStackTraceString(e));
|
||||
}
|
||||
}
|
||||
if (work != null) {
|
||||
work.getIntent().setExtrasClassLoader(mService.getClassLoader());
|
||||
return new WrapperWorkItem(work);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -10,20 +10,15 @@ import android.util.Log;
|
||||
|
||||
import org.antennapod.audio.MediaPlayer;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import de.danoeh.antennapod.core.feed.Feed;
|
||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.storage.DBReader;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
|
||||
/*
|
||||
* This class's job is do perform maintenance tasks whenever the app has been updated
|
||||
*/
|
||||
class UpdateManager {
|
||||
|
||||
private UpdateManager(){}
|
||||
|
||||
private static final String TAG = UpdateManager.class.getSimpleName();
|
||||
|
||||
private static final String PREF_NAME = "app_version";
|
||||
|
@ -2,14 +2,12 @@ package de.danoeh.antennapod.core.asynctask;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import de.danoeh.antennapod.core.R;
|
||||
import de.danoeh.antennapod.core.feed.Feed;
|
||||
import de.danoeh.antennapod.core.service.download.DownloadService;
|
||||
import de.danoeh.antennapod.core.service.playback.PlaybackService;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.util.IntentUtils;
|
||||
|
@ -10,7 +10,6 @@ import android.support.v4.app.NotificationCompat;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
|
||||
import org.shredzone.flattr4j.exception.FlattrException;
|
||||
|
||||
import java.util.LinkedList;
|
||||
@ -27,6 +26,7 @@ import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.util.NetworkUtils;
|
||||
import de.danoeh.antennapod.core.util.flattr.FlattrThing;
|
||||
import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
|
||||
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
|
||||
|
||||
/**
|
||||
* Performs a click action in a background thread.
|
||||
|
@ -19,11 +19,9 @@ import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
|
||||
|
||||
public class FlattrStatusFetcher extends Thread {
|
||||
private static final String TAG = "FlattrStatusFetcher";
|
||||
private final Context context;
|
||||
|
||||
public FlattrStatusFetcher(Context context) {
|
||||
super();
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,7 +50,7 @@ public abstract class FeedComponent {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null || !(o instanceof FeedComponent)) return false;
|
||||
|
||||
FeedComponent that = (FeedComponent) o;
|
||||
|
||||
@ -62,4 +62,4 @@ public abstract class FeedComponent {
|
||||
public int hashCode() {
|
||||
return (int) (id ^ (id >>> 32));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,8 @@ package de.danoeh.antennapod.core.feed;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import de.danoeh.antennapod.core.asynctask.ImageResource;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
@ -15,6 +14,7 @@ import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import de.danoeh.antennapod.core.asynctask.ImageResource;
|
||||
import de.danoeh.antennapod.core.storage.DBReader;
|
||||
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
||||
import de.danoeh.antennapod.core.util.ShownotesProvider;
|
||||
@ -194,7 +194,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
|
||||
if (other.link != null) {
|
||||
link = other.link;
|
||||
}
|
||||
if (other.pubDate != null && other.pubDate != pubDate) {
|
||||
if (other.pubDate != null && other.pubDate.equals(pubDate)) {
|
||||
pubDate = other.pubDate;
|
||||
}
|
||||
if (other.media != null) {
|
||||
|
@ -532,8 +532,8 @@ public class FeedMedia extends FeedFile implements Playable {
|
||||
UserPreferences.isAutoFlattr() &&
|
||||
item.getPaymentLink() != null &&
|
||||
item.getFlattrStatus().getUnflattred() &&
|
||||
(completed && autoFlattrThreshold <= 1.0f ||
|
||||
played_duration >= autoFlattrThreshold * duration)) {
|
||||
((completed && autoFlattrThreshold <= 1.0f) ||
|
||||
(played_duration >= autoFlattrThreshold * duration))) {
|
||||
DBTasks.flattrItemIfLoggedIn(context, item);
|
||||
}
|
||||
}
|
||||
@ -626,6 +626,9 @@ public class FeedMedia extends FeedFile implements Playable {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null) {
|
||||
return false;
|
||||
}
|
||||
if (FeedMediaFlavorHelper.instanceOfRemoteMedia(o)) {
|
||||
return o.equals(this);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
* The settings that AntennaPod will use for various Glide options
|
||||
*/
|
||||
public class ApGlideSettings {
|
||||
private ApGlideSettings(){}
|
||||
|
||||
public static final DiskCacheStrategy AP_DISK_CACHE_STRATEGY = DiskCacheStrategy.ALL;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class GpodnetEpisodeAction {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null || !(o instanceof GpodnetEpisodeAction)) return false;
|
||||
|
||||
GpodnetEpisodeAction that = (GpodnetEpisodeAction) o;
|
||||
|
||||
|
@ -24,6 +24,8 @@ import de.danoeh.antennapod.core.service.GpodnetSyncService;
|
||||
*/
|
||||
public class GpodnetPreferences {
|
||||
|
||||
private GpodnetPreferences(){}
|
||||
|
||||
private static final String TAG = "GpodnetPreferences";
|
||||
|
||||
private static final String PREF_NAME = "gpodder.net";
|
||||
|
@ -23,7 +23,6 @@ public class SleepTimerPreferences {
|
||||
private static final String DEFAULT_VALUE = "15";
|
||||
private static final int DEFAULT_TIME_UNIT = 1;
|
||||
|
||||
private static Context context;
|
||||
private static SharedPreferences prefs;
|
||||
|
||||
/**
|
||||
|
@ -8,14 +8,7 @@ import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import de.danoeh.antennapod.core.R;
|
||||
import de.danoeh.antennapod.core.service.download.ProxyConfig;
|
||||
import de.danoeh.antennapod.core.storage.APCleanupAlgorithm;
|
||||
import de.danoeh.antennapod.core.storage.APNullCleanupAlgorithm;
|
||||
import de.danoeh.antennapod.core.storage.APQueueCleanupAlgorithm;
|
||||
import de.danoeh.antennapod.core.storage.EpisodeCleanupAlgorithm;
|
||||
import de.danoeh.antennapod.core.util.Converter;
|
||||
import de.danoeh.antennapod.core.util.download.AutoUpdateManager;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
@ -27,6 +20,15 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import de.danoeh.antennapod.core.R;
|
||||
import de.danoeh.antennapod.core.service.download.ProxyConfig;
|
||||
import de.danoeh.antennapod.core.storage.APCleanupAlgorithm;
|
||||
import de.danoeh.antennapod.core.storage.APNullCleanupAlgorithm;
|
||||
import de.danoeh.antennapod.core.storage.APQueueCleanupAlgorithm;
|
||||
import de.danoeh.antennapod.core.storage.EpisodeCleanupAlgorithm;
|
||||
import de.danoeh.antennapod.core.util.Converter;
|
||||
import de.danoeh.antennapod.core.util.download.AutoUpdateManager;
|
||||
|
||||
/**
|
||||
* Provides access to preferences set by the user in the settings screen. A
|
||||
* private instance of this class must first be instantiated via
|
||||
@ -34,6 +36,7 @@ import java.util.concurrent.TimeUnit;
|
||||
* when called.
|
||||
*/
|
||||
public class UserPreferences {
|
||||
private UserPreferences(){}
|
||||
|
||||
private static final String IMPORT_DIR = "import/";
|
||||
|
||||
@ -44,7 +47,7 @@ public class UserPreferences {
|
||||
public static final String PREF_HIDDEN_DRAWER_ITEMS = "prefHiddenDrawerItems";
|
||||
private static final String PREF_DRAWER_FEED_ORDER = "prefDrawerFeedOrder";
|
||||
private static final String PREF_DRAWER_FEED_COUNTER = "prefDrawerFeedIndicator";
|
||||
private static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify";
|
||||
public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify";
|
||||
private static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify";
|
||||
public static final String PREF_COMPACT_NOTIFICATION_BUTTONS = "prefCompactNotificationButtons";
|
||||
public static final String PREF_LOCKSCREEN_BACKGROUND = "prefLockscreenBackground";
|
||||
|
@ -6,10 +6,11 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
import de.danoeh.antennapod.core.service.PlayerWidgetJobService;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import de.danoeh.antennapod.core.service.PlayerWidgetJobService;
|
||||
|
||||
|
||||
public class PlayerWidget extends AppWidgetProvider {
|
||||
private static final String TAG = "PlayerWidget";
|
||||
|
@ -5,6 +5,7 @@ import android.app.job.JobService;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.util.Log;
|
||||
|
||||
import de.danoeh.antennapod.core.ClientConfig;
|
||||
import de.danoeh.antennapod.core.preferences.UserPreferences;
|
||||
import de.danoeh.antennapod.core.util.FeedUpdateUtils;
|
||||
|
@ -6,8 +6,8 @@ import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.JobIntentService;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.app.SafeJobIntentService;
|
||||
import android.support.v4.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
@ -44,7 +44,7 @@ import de.danoeh.antennapod.core.util.gui.NotificationUtils;
|
||||
* Synchronizes local subscriptions with gpodder.net service. The service should be started with ACTION_SYNC as an action argument.
|
||||
* This class also provides static methods for starting the GpodnetSyncService.
|
||||
*/
|
||||
public class GpodnetSyncService extends JobIntentService {
|
||||
public class GpodnetSyncService extends SafeJobIntentService {
|
||||
|
||||
private static final String TAG = "GpodnetSyncService";
|
||||
|
||||
|
@ -9,23 +9,24 @@ import android.content.ServiceConnection;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.JobIntentService;
|
||||
import android.support.v4.app.SafeJobIntentService;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import de.danoeh.antennapod.core.R;
|
||||
import de.danoeh.antennapod.core.receiver.MediaButtonReceiver;
|
||||
import de.danoeh.antennapod.core.receiver.PlayerWidget;
|
||||
import de.danoeh.antennapod.core.service.playback.PlaybackService;
|
||||
import de.danoeh.antennapod.core.service.playback.PlayerStatus;
|
||||
import de.danoeh.antennapod.core.util.Converter;
|
||||
import de.danoeh.antennapod.core.util.playback.Playable;
|
||||
import de.danoeh.antennapod.core.receiver.PlayerWidget;
|
||||
|
||||
/**
|
||||
* Updates the state of the player widget
|
||||
*/
|
||||
public class PlayerWidgetJobService extends JobIntentService {
|
||||
public class PlayerWidgetJobService extends SafeJobIntentService {
|
||||
|
||||
private static final String TAG = "PlayerWidgetJobService";
|
||||
|
||||
|
@ -40,6 +40,9 @@ import okhttp3.internal.http.StatusLine;
|
||||
* Provides access to a HttpClient singleton.
|
||||
*/
|
||||
public class AntennapodHttpClient {
|
||||
|
||||
private AntennapodHttpClient(){}
|
||||
|
||||
private static final String TAG = "AntennapodHttpClient";
|
||||
|
||||
private static final int CONNECTION_TIMEOUT = 30000;
|
||||
|
@ -124,7 +124,7 @@ public class DownloadRequest implements Parcelable {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null || !(o instanceof DownloadRequest)) return false;
|
||||
|
||||
DownloadRequest that = (DownloadRequest) o;
|
||||
|
||||
|
@ -14,14 +14,13 @@ import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import android.webkit.URLUtil;
|
||||
|
||||
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
||||
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
@ -31,10 +30,8 @@ import java.net.HttpURLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.CompletionService;
|
||||
@ -69,12 +66,14 @@ import de.danoeh.antennapod.core.storage.DBTasks;
|
||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||
import de.danoeh.antennapod.core.storage.DownloadRequestException;
|
||||
import de.danoeh.antennapod.core.storage.DownloadRequester;
|
||||
import de.danoeh.antennapod.core.storage.PodDBAdapter;
|
||||
import de.danoeh.antennapod.core.syndication.handler.FeedHandler;
|
||||
import de.danoeh.antennapod.core.syndication.handler.FeedHandlerResult;
|
||||
import de.danoeh.antennapod.core.syndication.handler.UnsupportedFeedtypeException;
|
||||
import de.danoeh.antennapod.core.util.ChapterUtils;
|
||||
import de.danoeh.antennapod.core.util.DownloadError;
|
||||
import de.danoeh.antennapod.core.util.InvalidFeedException;
|
||||
import de.danoeh.antennapod.core.util.gui.NotificationUtils;
|
||||
import de.greenrobot.event.EventBus;
|
||||
|
||||
/**
|
||||
@ -117,11 +116,6 @@ public class DownloadService extends Service {
|
||||
private CompletionService<Downloader> downloadExecutor;
|
||||
private FeedSyncThread feedSyncThread;
|
||||
|
||||
/**
|
||||
* Number of threads of downloadExecutor.
|
||||
*/
|
||||
private static final int NUM_PARALLEL_DOWNLOADS = 6;
|
||||
|
||||
private DownloadRequester requester;
|
||||
|
||||
|
||||
@ -862,22 +856,6 @@ public class DownloadService extends Service {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete files that aren't needed anymore
|
||||
*/
|
||||
private void cleanup(Feed feed) {
|
||||
if (feed.getFile_url() != null) {
|
||||
if (new File(feed.getFile_url()).delete()) {
|
||||
Log.d(TAG, "Successfully deleted cache file.");
|
||||
} else {
|
||||
Log.e(TAG, "Failed to delete cache file.");
|
||||
}
|
||||
feed.setFile_url(null);
|
||||
} else {
|
||||
Log.d(TAG, "Didn't delete cache file: File url is not set.");
|
||||
}
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
isActive = false;
|
||||
if (isCollectingRequests) {
|
||||
|
@ -304,7 +304,7 @@ public class HttpDownloader extends Downloader {
|
||||
String encoded = ByteString.of(bytes).base64();
|
||||
return "Basic " + encoded;
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new AssertionError();
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.service.playback;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.view.SurfaceHolder;
|
||||
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.DefaultLoadControl;
|
||||
import com.google.android.exoplayer2.DefaultRenderersFactory;
|
||||
@ -22,9 +23,11 @@ import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
|
||||
import com.google.android.exoplayer2.upstream.DataSource;
|
||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||
import com.google.android.exoplayer2.util.Util;
|
||||
import de.danoeh.antennapod.core.util.playback.IPlayer;
|
||||
|
||||
import org.antennapod.audio.MediaPlayer;
|
||||
|
||||
import de.danoeh.antennapod.core.util.playback.IPlayer;
|
||||
|
||||
|
||||
public class ExoPlayerWrapper implements IPlayer {
|
||||
private final Context mContext;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user