diff options
Diffstat (limited to 'app/src')
63 files changed, 252 insertions, 419 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java b/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java index 14a3b27b0..3ca7906cb 100644 --- a/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java +++ b/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java @@ -2,15 +2,15 @@ package de.test.antennapod.gpodnet; import android.test.AndroidTestCase; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import de.danoeh.antennapod.core.gpoddernet.GpodnetService; import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetDevice; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetTag; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - /** * Test class for GpodnetService */ diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java index 9ac92c2f9..2f53ea8a6 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java @@ -23,8 +23,8 @@ import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedPreferences; import de.danoeh.antennapod.core.feed.MediaType; -import de.danoeh.antennapod.core.service.playback.PlaybackServiceMediaPlayer; import de.danoeh.antennapod.core.service.playback.LocalPSMP; +import de.danoeh.antennapod.core.service.playback.PlaybackServiceMediaPlayer; import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.util.playback.Playable; diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java index 6ab6e5c61..8be57a074 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTaskManagerTest.java @@ -9,10 +9,10 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import de.danoeh.antennapod.core.event.QueueEvent; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedItem; -import de.danoeh.antennapod.core.event.QueueEvent; import de.danoeh.antennapod.core.service.playback.PlaybackServiceTaskManager; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.util.playback.Playable; diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBQueueCleanupAlgorithmTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBQueueCleanupAlgorithmTest.java index 3bd508eaf..d602d150b 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBQueueCleanupAlgorithmTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBQueueCleanupAlgorithmTest.java @@ -5,7 +5,6 @@ import android.test.FlakyTest; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Date; import java.util.List; import de.danoeh.antennapod.core.feed.Feed; diff --git a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java index bd9057b47..aec0265a6 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java @@ -15,6 +15,7 @@ import java.util.List; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.activity.OnlineFeedViewActivity; +import de.danoeh.antennapod.activity.PreferenceActivity; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.PodDBAdapter; @@ -22,7 +23,6 @@ import de.danoeh.antennapod.fragment.DownloadsFragment; import de.danoeh.antennapod.fragment.EpisodesFragment; import de.danoeh.antennapod.fragment.PlaybackHistoryFragment; import de.danoeh.antennapod.fragment.QueueFragment; -import de.danoeh.antennapod.preferences.PreferenceController; /** * User interface tests for MainActivity @@ -155,7 +155,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv public void testGoToPreferences() { openNavDrawer(); solo.clickOnText(solo.getString(R.string.settings_label)); - solo.waitForActivity(PreferenceController.getPreferenceActivity()); + solo.waitForActivity(PreferenceActivity.class); } public void testDrawerPreferencesHideSomeElements() { diff --git a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java index 91928f01e..e18c9ca16 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java @@ -3,7 +3,6 @@ package de.test.antennapod.ui; import android.content.Context; import android.content.res.Resources; import android.test.ActivityInstrumentationTestCase2; -import android.util.Log; import com.robotium.solo.Solo; import com.robotium.solo.Timeout; diff --git a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java index 432d4a4e6..eeb001ea1 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java @@ -22,12 +22,12 @@ import java.util.List; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; +import de.danoeh.antennapod.core.event.QueueEvent; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; -import de.danoeh.antennapod.core.event.QueueEvent; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.util.playback.PlaybackController; import de.danoeh.antennapod.fragment.ExternalPlayerFragment; @@ -39,7 +39,6 @@ import de.test.antennapod.util.syndication.feedgenerator.RSS2Generator; * Utility methods for UI tests. * Starts a web server that hosts feeds, episodes and images. */ -@TargetApi(Build.VERSION_CODES.HONEYCOMB) public class UITestUtils { private static final String TAG = UITestUtils.class.getSimpleName(); @@ -49,7 +48,6 @@ public class UITestUtils { public static final int NUM_FEEDS = 5; public static final int NUM_ITEMS_PER_FEED = 10; - public static final int HOME_VIEW = (Build.VERSION.SDK_INT >= 11) ? android.R.id.home : R.id.home; public static final String TEST_FILE_NAME = "3sec.mp3"; diff --git a/app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java b/app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java index cb2d012e0..a36b3b65a 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java +++ b/app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java @@ -1,11 +1,12 @@ package de.test.antennapod.util; +import android.test.AndroidTestCase; +import android.text.TextUtils; + import java.io.File; import java.io.IOException; import de.danoeh.antennapod.core.util.FileNameGenerator; -import android.test.AndroidTestCase; -import android.text.TextUtils; public class FilenameGeneratorTest extends AndroidTestCase { diff --git a/app/src/androidTest/java/de/test/antennapod/util/RewindAfterPauseUtilTest.java b/app/src/androidTest/java/de/test/antennapod/util/RewindAfterPauseUtilTest.java index fcfb16eb4..d564d0492 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/RewindAfterPauseUtilTest.java +++ b/app/src/androidTest/java/de/test/antennapod/util/RewindAfterPauseUtilTest.java @@ -1,8 +1,8 @@ package de.test.antennapod.util; -import junit.framework.*; +import junit.framework.TestCase; -import de.danoeh.antennapod.core.util.*; +import de.danoeh.antennapod.core.util.RewindAfterPauseUtils; /** * Tests for {@link RewindAfterPauseUtils}. diff --git a/app/src/androidTest/java/de/test/antennapod/util/URIUtilTest.java b/app/src/androidTest/java/de/test/antennapod/util/URIUtilTest.java index 7bdcfb898..2cca6b4dc 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/URIUtilTest.java +++ b/app/src/androidTest/java/de/test/antennapod/util/URIUtilTest.java @@ -1,6 +1,7 @@ package de.test.antennapod.util; import android.test.AndroidTestCase; + import de.danoeh.antennapod.core.util.URIUtil; /** diff --git a/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java b/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java index aa197b6e1..1b444bfa9 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java @@ -1,6 +1,7 @@ package de.test.antennapod.util; import android.test.AndroidTestCase; + import de.danoeh.antennapod.core.util.URLChecker; /** diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java index 4e5d0297f..809b9769a 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java +++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java @@ -1,7 +1,7 @@ package de.test.antennapod.util.syndication; import android.test.InstrumentationTestCase; -import de.danoeh.antennapod.core.util.syndication.FeedDiscoverer; + import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -9,6 +9,8 @@ import java.io.File; import java.io.FileOutputStream; import java.util.Map; +import de.danoeh.antennapod.core.util.syndication.FeedDiscoverer; + /** * Test class for FeedDiscoverer */ diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/FeedGenerator.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/FeedGenerator.java index fe5afd847..142e3cb57 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/FeedGenerator.java +++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/FeedGenerator.java @@ -1,10 +1,10 @@ package de.test.antennapod.util.syndication.feedgenerator; -import de.danoeh.antennapod.core.feed.Feed; - import java.io.IOException; import java.io.OutputStream; +import de.danoeh.antennapod.core.feed.Feed; + /** * Generates a machine-readable, platform-independent representation of a Feed object. */ diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/RSS2Generator.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/RSS2Generator.java index 27e89620d..f2d53799d 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/RSS2Generator.java +++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/RSS2Generator.java @@ -1,14 +1,16 @@ package de.test.antennapod.util.syndication.feedgenerator; import android.util.Xml; -import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedItem; -import de.danoeh.antennapod.core.util.DateUtils; + import org.xmlpull.v1.XmlSerializer; import java.io.IOException; import java.io.OutputStream; +import de.danoeh.antennapod.core.feed.Feed; +import de.danoeh.antennapod.core.feed.FeedItem; +import de.danoeh.antennapod.core.util.DateUtils; + /** * Creates RSS 2.0 feeds. See FeedGenerator for more information. */ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 919511a6f..8c3c86358 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -97,15 +97,6 @@ android:launchMode="singleInstance"/> <activity - android:name=".activity.PreferenceActivityGingerbread" - android:configChanges="keyboardHidden|orientation|screenSize" - android:label="@string/settings_label"> - <meta-data - android:name="android.support.PARENT_ACTIVITY" - android:value="de.danoeh.antennapod.activity.MainActivity"/> - </activity> - - <activity android:name=".activity.PreferenceActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:label="@string/settings_label"> diff --git a/app/src/main/java/de/danoeh/antennapod/PodcastApp.java b/app/src/main/java/de/danoeh/antennapod/PodcastApp.java index f6a8db5fb..3abf7557a 100644 --- a/app/src/main/java/de/danoeh/antennapod/PodcastApp.java +++ b/app/src/main/java/de/danoeh/antennapod/PodcastApp.java @@ -41,10 +41,8 @@ public class PodcastApp extends Application { .detectLeakedSqlLiteObjects() .penaltyLog() .penaltyDropBox(); - if (Build.VERSION.SDK_INT >= 11) { - builder.detectActivityLeaks(); - builder.detectLeakedClosableObjects(); - } + builder.detectActivityLeaks(); + builder.detectLeakedClosableObjects(); if(Build.VERSION.SDK_INT >= 16) { builder.detectLeakedRegistrationObjects(); } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java index 2a58d5104..cc9db5e6e 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -88,16 +88,10 @@ public class FeedInfoActivity extends AppCompatActivity { public void onClick(View v) { if(feed != null && feed.getDownload_url() != null) { String url = feed.getDownload_url(); - if (android.os.Build.VERSION.SDK_INT >= 11) { - ClipData clipData = ClipData.newPlainText(url, url); - android.content.ClipboardManager cm = (android.content.ClipboardManager) FeedInfoActivity.this - .getSystemService(Context.CLIPBOARD_SERVICE); - cm.setPrimaryClip(clipData); - } else { - android.text.ClipboardManager cm = (android.text.ClipboardManager) FeedInfoActivity.this - .getSystemService(Context.CLIPBOARD_SERVICE); - cm.setText(url); - } + ClipData clipData = ClipData.newPlainText(url, url); + android.content.ClipboardManager cm = (android.content.ClipboardManager) FeedInfoActivity.this + .getSystemService(Context.CLIPBOARD_SERVICE); + cm.setPrimaryClip(clipData); Toast t = Toast.makeText(FeedInfoActivity.this, R.string.copied_url_msg, Toast.LENGTH_SHORT); t.show(); } @@ -385,7 +379,7 @@ public class FeedInfoActivity extends AppCompatActivity { } } - private class ApplyToEpisodesDialog extends ConfirmationDialog { + private static class ApplyToEpisodesDialog extends ConfirmationDialog { private final Feed feed; private final boolean autoDownload; diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java index be1c9f9e6..d9c250b38 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java @@ -18,7 +18,6 @@ import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.util.flattr.FlattrUtils; -import de.danoeh.antennapod.preferences.PreferenceController; /** Guides the user through the authentication process */ @@ -104,7 +103,7 @@ public class FlattrAuthActivity extends ActionBarActivity { switch (item.getItemId()) { case android.R.id.home: if (authSuccessful) { - Intent intent = new Intent(this, PreferenceController.getPreferenceActivity()); + Intent intent = new Intent(this, PreferenceActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); } else { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index f0fcdca90..9949c01a0 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -64,7 +64,6 @@ import de.danoeh.antennapod.fragment.PlaybackHistoryFragment; import de.danoeh.antennapod.fragment.QueueFragment; import de.danoeh.antennapod.fragment.SubscriptionFragment; import de.danoeh.antennapod.menuhandler.NavDrawerActivity; -import de.danoeh.antennapod.preferences.PreferenceController; import de.greenrobot.event.EventBus; import rx.Observable; import rx.Subscription; @@ -173,7 +172,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi findViewById(R.id.nav_settings).setOnClickListener(v -> { drawerLayout.closeDrawer(navDrawer); - startActivity(new Intent(MainActivity.this, PreferenceController.getPreferenceActivity())); + startActivity(new Intent(MainActivity.this, PreferenceActivity.class)); }); FragmentTransaction transaction = fm.beginTransaction(); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java index 21a0fa66f..b0cbd355b 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -11,6 +11,7 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; +import android.support.v4.app.ActivityOptionsCompat; import android.support.v7.app.AlertDialog; import android.util.Log; import android.view.Menu; @@ -368,7 +369,16 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); + + View cover = findViewById(R.id.imgvCover); + if (cover != null && Build.VERSION.SDK_INT >= 16) { + ActivityOptionsCompat options = ActivityOptionsCompat. + makeSceneTransitionAnimation(MediaplayerActivity.this, + cover, "coverTransition"); + startActivity(intent, options.toBundle()); + } else { + startActivity(intent); + } return true; } else { if (media != null) { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java index b3cda69d3..d85c2fe8f 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java @@ -6,6 +6,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Build; +import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.AppBarLayout; import android.support.design.widget.Snackbar; @@ -60,7 +61,6 @@ import de.danoeh.antennapod.fragment.PlaybackHistoryFragment; import de.danoeh.antennapod.fragment.QueueFragment; import de.danoeh.antennapod.fragment.SubscriptionFragment; import de.danoeh.antennapod.menuhandler.NavDrawerActivity; -import de.danoeh.antennapod.preferences.PreferenceController; import de.greenrobot.event.EventBus; import rx.Observable; import rx.Subscription; @@ -77,7 +77,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem private static final int POS_CHAPTERS = 2; private static final int NUM_CONTENT_FRAGMENTS = 3; - final String TAG = "MediaplayerInfoActivity"; + final static String TAG = "MediaplayerInfoActivity"; private static final String PREFS = "AudioPlayerActivityPreferences"; private static final String PREF_KEY_SELECTED_FRAGMENT_POSITION = "selectedFragmentPosition"; @@ -113,6 +113,12 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem } @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + supportPostponeEnterTransition(); + } + + @Override protected void onStop() { super.onStop(); Log.d(TAG, "onStop()"); @@ -263,7 +269,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem findViewById(R.id.nav_settings).setOnClickListener(v -> { drawerLayout.closeDrawer(navDrawer); - startActivity(new Intent(MediaplayerInfoActivity.this, PreferenceController.getPreferenceActivity())); + startActivity(new Intent(MediaplayerInfoActivity.this, PreferenceActivity.class)); }); butPlaybackSpeed = (Button) findViewById(R.id.butPlaybackSpeed); @@ -277,6 +283,8 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem pageIndicator.setViewPager(pager); loadLastFragment(); pager.onSaveInstanceState(); + + navList.post(this::supportStartPostponedEnterTransition); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java index dd932814f..12d918a76 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java @@ -1,9 +1,7 @@ package de.danoeh.antennapod.activity; -import android.annotation.TargetApi; import android.app.Activity; import android.content.Intent; -import android.os.Build; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceFragment; @@ -30,7 +28,6 @@ public class PreferenceActivity extends AppCompatActivity { private PreferenceController preferenceController; private MainFragment prefFragment; private final PreferenceController.PreferenceUI preferenceUI = new PreferenceController.PreferenceUI() { - @TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override public Preference findPreference(CharSequence key) { return prefFragment.findPreference(key); @@ -42,7 +39,6 @@ public class PreferenceActivity extends AppCompatActivity { } }; - @TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override protected void onCreate(Bundle savedInstanceState) { // This must be the FIRST thing we do, otherwise other code may not have the @@ -95,7 +91,6 @@ public class PreferenceActivity extends AppCompatActivity { } } - @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static class MainFragment extends PreferenceFragment { @Override diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivityGingerbread.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivityGingerbread.java deleted file mode 100644 index 390bec15c..000000000 --- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivityGingerbread.java +++ /dev/null @@ -1,97 +0,0 @@ -package de.danoeh.antennapod.activity; - -import android.annotation.SuppressLint; -import android.app.Activity; -import android.content.Intent; -import android.content.res.Resources.Theme; -import android.os.Bundle; -import android.preference.Preference; -import android.preference.PreferenceScreen; - -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.preferences.PreferenceController; - -/** - * PreferenceActivity for API 10. In order to change the behavior of the preference UI, see - * PreferenceController. - */ -public class PreferenceActivityGingerbread extends android.preference.PreferenceActivity { - private static final String TAG = "PreferenceActivity"; - private final PreferenceController.PreferenceUI preferenceUI = new PreferenceController.PreferenceUI() { - - @SuppressWarnings("deprecation") - @Override - public Preference findPreference(CharSequence key) { - return PreferenceActivityGingerbread.this.findPreference(key); - } - - @Override - public Activity getActivity() { - return PreferenceActivityGingerbread.this; - } - }; - private PreferenceController preferenceController; - - @SuppressLint("NewApi") - @SuppressWarnings("deprecation") - @Override - public void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); - - addPreferencesFromResource(R.xml.preferences); - preferenceController = new PreferenceController(preferenceUI); - preferenceController.onCreate(); - } - - - @Override - protected void onResume() { - super.onResume(); - preferenceController.onResume(); - } - - @Override - protected void onPause() { - preferenceController.onPause(); - super.onPause(); - } - - @Override - protected void onStop() { - preferenceController.onStop(); - super.onStop(); - } - - @Override - protected void onApplyThemeResource(Theme theme, int resid, boolean first) { - theme.applyStyle(UserPreferences.getTheme(), true); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - preferenceController.onActivityResult(requestCode, resultCode, data); - } - - @SuppressWarnings("deprecation") - @Override - public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, - Preference preference) { - super.onPreferenceTreeClick(preferenceScreen, preference); - if (preference != null) - if (preference instanceof PreferenceScreen) - if (((PreferenceScreen) preference).getDialog() != null) - ((PreferenceScreen) preference) - .getDialog() - .getWindow() - .getDecorView() - .setBackgroundDrawable( - this.getWindow().getDecorView() - .getBackground().getConstantState() - .newDrawable() - ); - return false; - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index 8531a7356..fb5c4d273 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -152,16 +152,9 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected void onAwaitingVideoSurface() { + setupVideoAspectRatio(); if (videoSurfaceCreated && controller != null) { Log.d(TAG, "Videosurface already created, setting videosurface now"); - - Pair<Integer, Integer> videoSize = controller.getVideoSize(); - if (videoSize != null && videoSize.first > 0 && videoSize.second > 0) { - Log.d(TAG, "Width,height of video: " + videoSize.first + ", " + videoSize.second); - videoview.setVideoSize(videoSize.first, videoSize.second); - } else { - Log.e(TAG, "Could not determine video size"); - } controller.setVideoSurface(videoview.getHolder()); } } @@ -199,6 +192,18 @@ public class VideoplayerActivity extends MediaplayerActivity { videoControlsHider.start(); } + private void setupVideoAspectRatio() { + if (videoSurfaceCreated && controller != null) { + Pair<Integer, Integer> videoSize = controller.getVideoSize(); + if (videoSize != null && videoSize.first > 0 && videoSize.second > 0) { + Log.d(TAG, "Width,height of video: " + videoSize.first + ", " + videoSize.second); + videoview.setVideoSize(videoSize.first, videoSize.second); + } else { + Log.e(TAG, "Could not determine video size"); + } + } + } + private void toggleVideoControlsVisibility() { if (videoControlsShowing) { getSupportActionBar().hide(); @@ -247,7 +252,7 @@ public class VideoplayerActivity extends MediaplayerActivity { Log.e(TAG, "Couldn't attach surface to mediaplayer - reference to service was null"); } } - + setupVideoAspectRatio(); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java index 8ede947c5..31d0fb1a3 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java @@ -171,11 +171,7 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity { return null; } }; - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - authTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, service); - } else { - authTask.execute(); - } + authTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, service); } }); } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java index 3e8bbc488..6611cd35a 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java @@ -21,7 +21,6 @@ import android.widget.TextView; import com.bumptech.glide.Glide; import com.joanzapata.iconify.Iconify; -import com.nineoldandroids.view.ViewHelper; import java.lang.ref.WeakReference; @@ -129,9 +128,9 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR holder.statusUnread.setVisibility(View.VISIBLE); } if(item.isPlayed()) { - ViewHelper.setAlpha(holder.content, 0.5f); + holder.content.setAlpha(0.5f); } else { - ViewHelper.setAlpha(holder.content, 1.0f); + holder.content.setAlpha(1.0f); } FeedMedia media = item.getMedia(); @@ -174,7 +173,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR holder.progress.setVisibility(View.VISIBLE); } } else { - holder.progress.setVisibility(View.GONE); + holder.progress.setVisibility(View.INVISIBLE); } if(media.isCurrentlyPlaying()) { @@ -183,7 +182,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR holder.container.setBackgroundColor(normalBackGroundColor); } } else { - holder.progress.setVisibility(View.GONE); + holder.progress.setVisibility(View.INVISIBLE); holder.txtvDuration.setVisibility(View.GONE); } @@ -272,12 +271,12 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR @Override public void onItemSelected() { - ViewHelper.setAlpha(itemView, 0.5f); + itemView.setAlpha(0.5f); } @Override public void onItemClear() { - ViewHelper.setAlpha(itemView, 1.0f); + itemView.setAlpha(1.0f); } public FeedItem getFeedItem() { return item; } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java index 75514abb1..f55fe72b4 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java @@ -9,7 +9,6 @@ import android.text.Spannable; import android.text.Spanned; import android.text.style.ClickableSpan; import android.text.util.Linkify; -import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java b/app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java index 538af8c79..ba6e7b25d 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java @@ -1,7 +1,6 @@ package de.danoeh.antennapod.adapter; import android.graphics.drawable.Drawable; -import android.net.Uri; import android.view.View; import android.widget.ImageView; import android.widget.TextView; diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java index e271b5eed..679aca989 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java @@ -29,7 +29,7 @@ import de.danoeh.antennapod.core.storage.DownloadRequestException; /** Displays a list of DownloadStatus entries. */ public class DownloadLogAdapter extends BaseAdapter { - private final String TAG = "DownloadLogAdapter"; + private static final String TAG = "DownloadLogAdapter"; private Context context; diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java index 6907e467b..807a32d8a 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java @@ -12,7 +12,6 @@ import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; -import com.nineoldandroids.view.ViewHelper; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItem; @@ -87,9 +86,9 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter { .into(holder.imageView); if(item.isPlayed()) { - ViewHelper.setAlpha(convertView, 0.5f); + convertView.setAlpha(0.5f); } else { - ViewHelper.setAlpha(convertView, 1.0f); + convertView.setAlpha(1.0f); } holder.title.setText(item.getTitle()); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java index 35c42725c..71d162645 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -17,8 +17,6 @@ import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; -import com.nineoldandroids.view.ViewHelper; - import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; @@ -43,7 +41,7 @@ public class FeedItemlistAdapter extends BaseAdapter { private boolean makePlayedItemsTransparent; private final ActionButtonUtils actionButtonUtils; - public static final int SELECTION_NONE = -1; + private static final int SELECTION_NONE = -1; private final int playingBackGroundColor; private final int normalBackGroundColor; @@ -145,9 +143,9 @@ public class FeedItemlistAdapter extends BaseAdapter { holder.statusUnread.setVisibility(View.INVISIBLE); } if(item.isPlayed() && makePlayedItemsTransparent) { - ViewHelper.setAlpha(convertView, 0.5f); + convertView.setAlpha(0.5f); } else { - ViewHelper.setAlpha(convertView, 1.0f); + convertView.setAlpha(1.0f); } String pubDateStr = DateUtils.formatAbbrev(context, item.getPubDate()); @@ -157,7 +155,7 @@ public class FeedItemlistAdapter extends BaseAdapter { FeedMedia media = item.getMedia(); if (media == null) { - holder.episodeProgress.setVisibility(View.GONE); + holder.episodeProgress.setVisibility(View.INVISIBLE); holder.inPlaylist.setVisibility(View.INVISIBLE); holder.type.setVisibility(View.INVISIBLE); holder.lenSize.setVisibility(View.INVISIBLE); @@ -176,7 +174,7 @@ public class FeedItemlistAdapter extends BaseAdapter { holder.episodeProgress.setProgress(itemAccess.getItemDownloadProgressPercent(item)); } else { if(media.getPosition() == 0) { - holder.episodeProgress.setVisibility(View.GONE); + holder.episodeProgress.setVisibility(View.INVISIBLE); } } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java index c6ddc6c86..8eebc919a 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java @@ -24,7 +24,6 @@ import android.widget.TextView; import com.bumptech.glide.Glide; import com.joanzapata.iconify.Iconify; -import com.nineoldandroids.view.ViewHelper; import org.apache.commons.lang3.ArrayUtils; @@ -198,12 +197,12 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap @Override public void onItemSelected() { - ViewHelper.setAlpha(itemView, 0.5f); + itemView.setAlpha(0.5f); } @Override public void onItemClear() { - ViewHelper.setAlpha(itemView, 1.0f); + itemView.setAlpha(1.0f); } public void bind(FeedItem item) { @@ -280,7 +279,7 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap progressLeft.setText(""); } progressRight.setText(Converter.getDurationStringLong(media.getDuration())); - progressBar.setVisibility(View.GONE); + progressBar.setVisibility(View.INVISIBLE); } if(media.isCurrentlyPlaying()) { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java index 8e1aa24e0..beb62b3bb 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java @@ -11,7 +11,6 @@ import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; -import com.nineoldandroids.view.ViewHelper; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.Feed; @@ -97,7 +96,7 @@ public class SearchlistAdapter extends BaseAdapter { holder.subtitle.setText(result.getSubtitle()); } - ViewHelper.setAlpha(convertView, item.isPlayed() ? 0.5f : 1.0f); + convertView.setAlpha(item.isPlayed() ? 0.5f : 1.0f); Glide.with(context) .load(item.getFeed().getImageLocation()) diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java index f1f8be559..64912ba9b 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java @@ -162,7 +162,7 @@ public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> { /** * View holder object for the GridView */ - class PodcastViewHolder { + static class PodcastViewHolder { /** * ImageView holding the Podcast image diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java index 4449d82c2..fcd5cff00 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java @@ -56,13 +56,8 @@ public class OpmlFeedQueuer extends AsyncTask<Void, Void, Void> { return null; } - @SuppressLint("NewApi") public void executeAsync() { - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(THREAD_POOL_EXECUTOR); - } else { - execute(); - } + executeOnExecutor(THREAD_POOL_EXECUTOR); } } diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java index 62ea85811..88bd35b7c 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlImportWorker.java @@ -93,13 +93,8 @@ public class OpmlImportWorker extends return exception != null; } - @SuppressLint("NewApi") public void executeAsync() { - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - executeOnExecutor(THREAD_POOL_EXECUTOR); - } else { - execute(); - } + executeOnExecutor(THREAD_POOL_EXECUTOR); } } diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index ac073141d..3d577553c 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -32,7 +32,7 @@ import de.danoeh.antennapod.core.util.LongList; public class EpisodesApplyActionFragment extends Fragment { - public String TAG = "EpisodeActionFragment"; + public static final String TAG = "EpisodeActionFragment"; public static final int ACTION_QUEUE = 1; public static final int ACTION_MARK_PLAYED = 2; diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java index db6b48735..e64f1e08b 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java @@ -8,6 +8,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.LinearLayout; + import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.gpoddernet.GpodnetService; import de.danoeh.antennapod.core.preferences.GpodnetPreferences; diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java index 7d6a66a54..5bb3f09c3 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java @@ -1,7 +1,6 @@ package de.danoeh.antennapod.dialog; import android.content.Context; -import android.support.design.widget.Snackbar; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; @@ -9,7 +8,6 @@ import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.ArrayAdapter; import android.widget.CheckBox; -import android.widget.CompoundButton; import android.widget.EditText; import android.widget.Spinner; import android.widget.Toast; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java index 52a38ccb9..5d29f4bde 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java @@ -78,7 +78,7 @@ public class DownloadsFragment extends Fragment { viewPager.setCurrentItem(lastPosition); } - public class DownloadsPagerAdapter extends FragmentPagerAdapter { + public static class DownloadsPagerAdapter extends FragmentPagerAdapter { Resources resources; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index 1e385728a..5bb8e0a2d 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -1,6 +1,9 @@ package de.danoeh.antennapod.fragment; +import android.content.Intent; +import android.os.Build; import android.os.Bundle; +import android.support.v4.app.ActivityOptionsCompat; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; @@ -14,6 +17,7 @@ import android.widget.TextView; import com.bumptech.glide.Glide; 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; @@ -56,8 +60,15 @@ public class ExternalPlayerFragment extends Fragment { Log.d(TAG, "layoutInfo was clicked"); if (controller != null && controller.getMedia() != null) { - startActivity(PlaybackService.getPlayerActivityIntent( - getActivity(), controller.getMedia())); + Intent intent = PlaybackService.getPlayerActivityIntent(getActivity(), controller.getMedia()); + + if (Build.VERSION.SDK_INT >= 16 && controller.getMedia().getMediaType() == MediaType.AUDIO) { + ActivityOptionsCompat options = ActivityOptionsCompat. + makeSceneTransitionAnimation(getActivity(), imgvCover, "coverTransition"); + startActivity(intent, options.toBundle()); + } else { + startActivity(intent); + } } }); return root; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index a0586fe16..f6bdfddda 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -112,9 +112,7 @@ public class ItemDescriptionFragment extends Fragment implements MediaplayerInfo Bundle savedInstanceState) { Log.d(TAG, "Creating view"); webvDescription = new WebView(getActivity().getApplicationContext()); - if (Build.VERSION.SDK_INT >= 11) { - webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null); - } + webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null); TypedArray ta = getActivity().getTheme().obtainStyledAttributes(new int[] {android.R.attr.colorBackground}); int backgroundColor = ta.getColor(0, UserPreferences.getTheme() == @@ -238,17 +236,11 @@ public class ItemDescriptionFragment extends Fragment implements MediaplayerInfo ShareUtils.shareLink(getActivity(), selectedURL); break; case R.id.copy_url_item: - if (android.os.Build.VERSION.SDK_INT >= 11) { - ClipData clipData = ClipData.newPlainText(selectedURL, - selectedURL); - android.content.ClipboardManager cm = (android.content.ClipboardManager) getActivity() - .getSystemService(Context.CLIPBOARD_SERVICE); - cm.setPrimaryClip(clipData); - } else { - android.text.ClipboardManager cm = (android.text.ClipboardManager) getActivity() - .getSystemService(Context.CLIPBOARD_SERVICE); - cm.setText(selectedURL); - } + ClipData clipData = ClipData.newPlainText(selectedURL, + selectedURL); + android.content.ClipboardManager cm = (android.content.ClipboardManager) getActivity() + .getSystemService(Context.CLIPBOARD_SERVICE); + cm.setPrimaryClip(clipData); Toast t = Toast.makeText(getActivity(), R.string.copied_url_msg, Toast.LENGTH_SHORT); t.show(); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 7939dcb23..da7fc5299 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -184,8 +184,7 @@ public class ItemFragment extends Fragment implements OnSwipeGesture { } webvDescription = (WebView) layout.findViewById(R.id.webvDescription); if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) { - if (Build.VERSION.SDK_INT >= 11 - && Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { webvDescription.setLayerType(View.LAYER_TYPE_SOFTWARE, null); } webvDescription.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.black)); @@ -483,17 +482,11 @@ public class ItemFragment extends Fragment implements OnSwipeGesture { ShareUtils.shareLink(getActivity(), selectedURL); break; case R.id.copy_url_item: - if (android.os.Build.VERSION.SDK_INT >= 11) { - ClipData clipData = ClipData.newPlainText(selectedURL, - selectedURL); - android.content.ClipboardManager cm = (android.content.ClipboardManager) getActivity() - .getSystemService(Context.CLIPBOARD_SERVICE); - cm.setPrimaryClip(clipData); - } else { - android.text.ClipboardManager cm = (android.text.ClipboardManager) getActivity() - .getSystemService(Context.CLIPBOARD_SERVICE); - cm.setText(selectedURL); - } + ClipData clipData = ClipData.newPlainText(selectedURL, + selectedURL); + android.content.ClipboardManager cm = (android.content.ClipboardManager) getActivity() + .getSystemService(Context.CLIPBOARD_SERVICE); + cm.setPrimaryClip(clipData); Toast t = Toast.makeText(getActivity(), R.string.copied_url_msg, Toast.LENGTH_SHORT); t.show(); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java index a118673a6..d819e68d2 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -350,16 +350,6 @@ public class ItemlistFragment extends ListFragment { } } - - @Override - public void setListAdapter(ListAdapter adapter) { - // This workaround prevents the ListFragment from setting a list adapter when its state is restored. - // This is only necessary on API 10 because addFooterView throws an internal exception in this case. - if (Build.VERSION.SDK_INT > 10 || insideOnFragmentLoaded) { - super.setListAdapter(adapter); - } - } - @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java index 183c10f3d..c136eb6ae 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java @@ -7,8 +7,6 @@ import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helper.ItemTouchHelper; import android.util.Log; import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java index 15e9c9943..a54c90862 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java @@ -160,10 +160,6 @@ public abstract class PodcastListFragment extends Fragment { } }; - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - loaderTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - loaderTask.execute(); - } + loaderTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java index 33a35fa90..4f963756c 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java @@ -1,11 +1,11 @@ package de.danoeh.antennapod.fragment.gpodnet; +import java.util.List; + import de.danoeh.antennapod.core.gpoddernet.GpodnetService; import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetPodcast; -import java.util.List; - /** * */ diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java index d2c7f32dd..1e46b1ac5 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java @@ -135,11 +135,7 @@ public class TagListFragment extends ListFragment { } } }; - if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) { - loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } else { - loadTask.execute(); - } + loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } } diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index e8c35b9a7..5da6f1fb0 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -24,7 +24,6 @@ import android.preference.PreferenceManager; import android.preference.PreferenceScreen; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; import android.support.v4.content.FileProvider; import android.support.v7.app.AlertDialog; import android.text.Editable; @@ -58,11 +57,8 @@ import de.danoeh.antennapod.activity.AboutActivity; import de.danoeh.antennapod.activity.DirectoryChooserActivity; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.activity.MediaplayerActivity; -import de.danoeh.antennapod.activity.PreferenceActivity; -import de.danoeh.antennapod.activity.PreferenceActivityGingerbread; import de.danoeh.antennapod.activity.StatisticsActivity; import de.danoeh.antennapod.asynctask.ExportWorker; -import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.export.ExportWriter; import de.danoeh.antennapod.core.export.html.HtmlWriter; import de.danoeh.antennapod.core.export.opml.OpmlWriter; @@ -101,8 +97,8 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc private static final String PREF_CHOOSE_DATA_DIR = "prefChooseDataDir"; private static final String AUTO_DL_PREF_SCREEN = "prefAutoDownloadSettings"; private static final String PREF_PLAYBACK_SPEED_LAUNCHER = "prefPlaybackSpeedLauncher"; - public static final String PREF_PLAYBACK_REWIND_DELTA_LAUNCHER = "prefPlaybackRewindDeltaLauncher"; - public static final String PREF_PLAYBACK_FAST_FORWARD_DELTA_LAUNCHER = "prefPlaybackFastForwardDeltaLauncher"; + private static final String PREF_PLAYBACK_REWIND_DELTA_LAUNCHER = "prefPlaybackRewindDeltaLauncher"; + private static final String PREF_PLAYBACK_FAST_FORWARD_DELTA_LAUNCHER = "prefPlaybackFastForwardDeltaLauncher"; private static final String PREF_GPODNET_LOGIN = "pref_gpodnet_authenticate"; private static final String PREF_GPODNET_SETLOGIN_INFORMATION = "pref_gpodnet_setlogin_information"; private static final String PREF_GPODNET_SYNC = "pref_gpodnet_sync"; @@ -136,19 +132,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc .registerOnSharedPreferenceChangeListener(this); } - /** - * Returns the preference activity that should be used on this device. - * - * @return PreferenceActivity if the API level is greater than 10, PreferenceActivityGingerbread otherwise. - */ - public static Class<? extends Activity> getPreferenceActivity() { - if (Build.VERSION.SDK_INT > 10) { - return PreferenceActivity.class; - } else { - return PreferenceActivityGingerbread.class; - } - } - @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if(key.equals(UserPreferences.PREF_SONIC)) { @@ -240,12 +223,8 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc .setOnPreferenceChangeListener( (preference, newValue) -> { Intent i = new Intent(activity, MainActivity.class); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK - | Intent.FLAG_ACTIVITY_NEW_TASK); - } else { - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - } + i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK + | Intent.FLAG_ACTIVITY_NEW_TASK); activity.finish(); activity.startActivity(i); return true; @@ -523,7 +502,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc alert.setTitle(R.string.export_error_label); alert.setMessage(error.getMessage()); alert.show(); - }, () -> progressDialog.dismiss()); + }, progressDialog::dismiss); return true; } @@ -796,61 +775,56 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc WifiManager wifiservice = (WifiManager) activity.getApplicationContext().getSystemService(Context.WIFI_SERVICE); List<WifiConfiguration> networks = wifiservice.getConfiguredNetworks(); - if (networks != null) { - Collections.sort(networks, new Comparator<WifiConfiguration>() { - @Override - public int compare(WifiConfiguration x, WifiConfiguration y) { - return x.SSID.compareTo(y.SSID); + if (networks == null) { + Log.e(TAG, "Couldn't get list of configure Wi-Fi networks"); + return; + } + Collections.sort(networks, (x, y) -> x.SSID.compareTo(y.SSID)); + selectedNetworks = new CheckBoxPreference[networks.size()]; + List<String> prefValues = Arrays.asList(UserPreferences + .getAutodownloadSelectedNetworks()); + PreferenceScreen prefScreen = (PreferenceScreen) ui.findPreference(PreferenceController.AUTO_DL_PREF_SCREEN); + Preference.OnPreferenceClickListener clickListener = preference -> { + if (preference instanceof CheckBoxPreference) { + String key = preference.getKey(); + List<String> prefValuesList = new ArrayList<>( + Arrays.asList(UserPreferences + .getAutodownloadSelectedNetworks()) + ); + boolean newValue = ((CheckBoxPreference) preference) + .isChecked(); + Log.d(TAG, "Selected network " + key + ". New state: " + newValue); + + int index = prefValuesList.indexOf(key); + if (index >= 0 && !newValue) { + // remove network + prefValuesList.remove(index); + } else if (index < 0 && newValue) { + prefValuesList.add(key); } - }); - selectedNetworks = new CheckBoxPreference[networks.size()]; - List<String> prefValues = Arrays.asList(UserPreferences - .getAutodownloadSelectedNetworks()); - PreferenceScreen prefScreen = (PreferenceScreen) ui.findPreference(PreferenceController.AUTO_DL_PREF_SCREEN); - Preference.OnPreferenceClickListener clickListener = preference -> { - if (preference instanceof CheckBoxPreference) { - String key = preference.getKey(); - List<String> prefValuesList = new ArrayList<>( - Arrays.asList(UserPreferences - .getAutodownloadSelectedNetworks()) - ); - boolean newValue = ((CheckBoxPreference) preference) - .isChecked(); - Log.d(TAG, "Selected network " + key + ". New state: " + newValue); - - int index = prefValuesList.indexOf(key); - if (index >= 0 && !newValue) { - // remove network - prefValuesList.remove(index); - } else if (index < 0 && newValue) { - prefValuesList.add(key); - } - UserPreferences.setAutodownloadSelectedNetworks( - prefValuesList.toArray(new String[prefValuesList.size()]) - ); - return true; - } else { - return false; - } - }; - // create preference for each known network. attach listener and set - // value - for (int i = 0; i < networks.size(); i++) { - WifiConfiguration config = networks.get(i); - - CheckBoxPreference pref = new CheckBoxPreference(activity); - String key = Integer.toString(config.networkId); - pref.setTitle(config.SSID); - pref.setKey(key); - pref.setOnPreferenceClickListener(clickListener); - pref.setPersistent(false); - pref.setChecked(prefValues.contains(key)); - selectedNetworks[i] = pref; - prefScreen.addPreference(pref); + UserPreferences.setAutodownloadSelectedNetworks( + prefValuesList.toArray(new String[prefValuesList.size()]) + ); + return true; + } else { + return false; } - } else { - Log.e(TAG, "Couldn't get list of configure Wi-Fi networks"); + }; + // create preference for each known network. attach listener and set + // value + for (int i = 0; i < networks.size(); i++) { + WifiConfiguration config = networks.get(i); + + CheckBoxPreference pref = new CheckBoxPreference(activity); + String key = Integer.toString(config.networkId); + pref.setTitle(config.SSID); + pref.setKey(key); + pref.setOnPreferenceClickListener(clickListener); + pref.setPersistent(false); + pref.setChecked(prefValues.contains(key)); + selectedNetworks[i] = pref; + prefScreen.addPreference(pref); } } diff --git a/app/src/main/java/de/danoeh/antennapod/receiver/PlayerWidget.java b/app/src/main/java/de/danoeh/antennapod/receiver/PlayerWidget.java index f0d4014ed..a90f0f706 100644 --- a/app/src/main/java/de/danoeh/antennapod/receiver/PlayerWidget.java +++ b/app/src/main/java/de/danoeh/antennapod/receiver/PlayerWidget.java @@ -1,7 +1,5 @@ package de.danoeh.antennapod.receiver; -import java.util.Arrays; - import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.Context; @@ -10,6 +8,8 @@ import android.content.SharedPreferences; import android.text.TextUtils; import android.util.Log; +import java.util.Arrays; + import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.service.PlayerWidgetService; diff --git a/app/src/main/res/layout/cover_fragment.xml b/app/src/main/res/layout/cover_fragment.xml index 9ad1ff9c6..05b927da4 100644 --- a/app/src/main/res/layout/cover_fragment.xml +++ b/app/src/main/res/layout/cover_fragment.xml @@ -16,6 +16,7 @@ android:scaleType="fitCenter" app:layout_aspectRatio="100%" app:layout_widthPercent="82%" + android:transitionName="coverTransition" tools:src="@android:drawable/sym_def_app_icon" /> <LinearLayout diff --git a/app/src/main/res/layout/downloaded_episodeslist_item.xml b/app/src/main/res/layout/downloaded_episodeslist_item.xml index 760b6b9db..770b88c7e 100644 --- a/app/src/main/res/layout/downloaded_episodeslist_item.xml +++ b/app/src/main/res/layout/downloaded_episodeslist_item.xml @@ -1,9 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> - <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="@dimen/listitem_threeline_height" + android:layout_height="wrap_content" android:orientation="horizontal" tools:background="@android:color/darker_gray"> @@ -18,64 +17,68 @@ android:contentDescription="@string/cover_label" android:scaleType="centerCrop" tools:src="@drawable/ic_stat_antenna_default" - tools:background="@android:color/holo_green_dark" /> + tools:background="@android:color/holo_green_dark"/> + - <RelativeLayout + <LinearLayout android:layout_width="0dp" - android:layout_height="@dimen/thumbnail_length_downloaded_item" + android:layout_height="wrap_content" android:layout_marginLeft="@dimen/listitem_threeline_textleftpadding" android:layout_marginRight="@dimen/listitem_threeline_textrightpadding" android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" + android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" android:layout_weight="1" + android:orientation="vertical" tools:background="@android:color/holo_red_dark"> <TextView android:id="@+id/txtvTitle" style="@style/AntennaPod.TextView.ListItemPrimaryTitle" - android:layout_width="0dp" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_alignParentRight="true" - android:layout_alignParentTop="true" - android:layout_centerVertical="true" android:layout_marginBottom="4dp" tools:text="Downloaded episode title" - tools:background="@android:color/holo_green_dark" /> + tools:background="@android:color/holo_green_dark"/> - <TextView - android:id="@+id/txtvSize" - style="@style/AntennaPod.TextView.ListItemSecondaryTitle" - android:layout_width="wrap_content" + <LinearLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_alignParentBottom="true" - tools:text="23 MB" - tools:background="@android:color/holo_green_dark" /> + tools:background="@android:color/holo_red_dark" > - <TextView - android:id="@+id/txtvPublished" - style="@style/AntennaPod.TextView.ListItemSecondaryTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_alignParentBottom="true" - android:layout_marginLeft="8dp" - tools:text="Jan 23" - tools:background="@android:color/holo_green_dark" /> + <TextView + android:id="@+id/txtvSize" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + tools:text="23 MB" + tools:background="@android:color/holo_green_dark"/> + + <View + android:layout_width="0dip" + android:layout_height="1dip" + android:layout_weight="1" /> + + <ImageView + android:id="@+id/imgvInPlaylist" + android:layout_width="@dimen/enc_icons_size" + android:layout_height="@dimen/enc_icons_size" + android:contentDescription="@string/in_queue_label" + android:src="?attr/stat_playlist" + android:visibility="visible" + tools:src="@drawable/ic_list_white_24dp" + tools:background="@android:color/holo_red_light"/> - <ImageView - android:id="@+id/imgvInPlaylist" - android:layout_width="@dimen/enc_icons_size" - android:layout_height="@dimen/enc_icons_size" - android:layout_toLeftOf="@id/txtvPublished" - android:layout_alignParentBottom="true" - android:contentDescription="@string/in_queue_label" - android:src="?attr/stat_playlist" - android:visibility="visible" - tools:src="@drawable/ic_list_white_24dp" - tools:background="@android:color/holo_red_light" /> + <TextView + android:id="@+id/txtvPublished" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="8dp" + tools:text="Jan 23" + tools:background="@android:color/holo_green_dark"/> - </RelativeLayout> + </LinearLayout> + </LinearLayout> <include layout="@layout/vertical_list_divider"/> diff --git a/app/src/main/res/layout/downloadlist_item.xml b/app/src/main/res/layout/downloadlist_item.xml index e7694502b..97f3ac1a1 100644 --- a/app/src/main/res/layout/downloadlist_item.xml +++ b/app/src/main/res/layout/downloadlist_item.xml @@ -2,13 +2,13 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="@dimen/listitem_threeline_height" + android:layout_height="wrap_content" android:orientation="horizontal" tools:background="@android:color/darker_gray"> <LinearLayout android:layout_width="0dp" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical"> diff --git a/app/src/main/res/layout/downloadlog_item.xml b/app/src/main/res/layout/downloadlog_item.xml index 7b4773bca..27b179f4e 100644 --- a/app/src/main/res/layout/downloadlog_item.xml +++ b/app/src/main/res/layout/downloadlog_item.xml @@ -12,8 +12,8 @@ <com.joanzapata.iconify.widget.IconTextView android:id="@+id/txtvIcon" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="48sp" + android:layout_height="48sp" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:textSize="48sp" diff --git a/app/src/main/res/layout/external_player_fragment.xml b/app/src/main/res/layout/external_player_fragment.xml index fb7abde55..c0eb9211f 100644 --- a/app/src/main/res/layout/external_player_fragment.xml +++ b/app/src/main/res/layout/external_player_fragment.xml @@ -22,6 +22,7 @@ android:scaleType="centerCrop" tools:src="@drawable/ic_drag_vertical_white_48dp" tools:background="@android:color/holo_green_dark" + android:transitionName="coverTransition" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true"/> diff --git a/app/src/main/res/layout/feedinfo.xml b/app/src/main/res/layout/feedinfo.xml index 4b545e3cc..69b835ee1 100644 --- a/app/src/main/res/layout/feedinfo.xml +++ b/app/src/main/res/layout/feedinfo.xml @@ -313,13 +313,11 @@ <RadioButton android:id="@+id/radio_filter_include" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/episode_filters_include" - android:onClick="onRadioButtonClicked"/> + android:text="@string/episode_filters_include" /> <RadioButton android:id="@+id/radio_filter_exclude" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/episode_filters_exclude" - android:onClick="onRadioButtonClicked"/> + android:text="@string/episode_filters_exclude" /> </RadioGroup> <EditText diff --git a/app/src/main/res/layout/feeditemlist_item.xml b/app/src/main/res/layout/feeditemlist_item.xml index d2b85e7df..5a2f091ec 100644 --- a/app/src/main/res/layout/feeditemlist_item.xml +++ b/app/src/main/res/layout/feeditemlist_item.xml @@ -5,7 +5,7 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" - android:layout_height="@dimen/listitem_threeline_height" + android:layout_height="wrap_content" android:orientation="horizontal" tools:background="@android:color/darker_gray"> @@ -14,6 +14,8 @@ android:layout_height="match_parent" android:layout_marginLeft="@dimen/listitem_threeline_horizontalpadding" android:layout_weight="1" + android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" + android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" tools:background="@android:color/holo_orange_dark"> <TextView @@ -23,7 +25,6 @@ android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" - android:layout_marginTop="16dp" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" tools:text="NEW" @@ -36,8 +37,7 @@ android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" - android:layout_marginBottom="8dp" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" + android:layout_marginBottom="4dp" android:layout_toLeftOf="@id/statusUnread" tools:text="Episode title" tools:background="@android:color/holo_green_dark" /> @@ -101,8 +101,7 @@ tools:background="@android:color/holo_blue_light" android:max="100" android:progress="42" - android:indeterminate="false" - /> + android:indeterminate="false" /> </RelativeLayout> diff --git a/app/src/main/res/layout/mediaplayerinfo_activity.xml b/app/src/main/res/layout/mediaplayerinfo_activity.xml index 0f68b503e..64738eb45 100644 --- a/app/src/main/res/layout/mediaplayerinfo_activity.xml +++ b/app/src/main/res/layout/mediaplayerinfo_activity.xml @@ -152,6 +152,7 @@ android:src="?attr/av_fast_forward" android:textSize="@dimen/text_size_medium" android:textAllCaps="false" + android:maxLines="1" tools:visibility="gone" tools:background="@android:color/holo_green_dark" /> diff --git a/app/src/main/res/layout/new_episodes_listitem.xml b/app/src/main/res/layout/new_episodes_listitem.xml index 944711aec..d533ee642 100644 --- a/app/src/main/res/layout/new_episodes_listitem.xml +++ b/app/src/main/res/layout/new_episodes_listitem.xml @@ -10,10 +10,11 @@ <LinearLayout android:id="@+id/content" android:layout_width="match_parent" - android:layout_height="@dimen/listitem_threeline_height" + android:layout_height="wrap_content" android:background="?attr/selectableItemBackground" android:orientation="horizontal" - tools:background="@android:color/darker_gray"> + tools:background="@android:color/darker_gray" + android:gravity="center_vertical"> <RelativeLayout android:layout_width="wrap_content" @@ -48,7 +49,7 @@ <RelativeLayout android:layout_width="0dp" - android:layout_height="match_parent" + android:layout_height="wrap_content" android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" android:layout_marginLeft="@dimen/listitem_threeline_textleftpadding" android:layout_marginRight="@dimen/listitem_threeline_textrightpadding" @@ -120,11 +121,10 @@ <ProgressBar android:id="@+id/pbar_progress" - style="?android:attr/progressBarStyleHorizontal" + style="?attr/progressBarTheme" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="4dp" android:layout_below="@id/txtvDuration" - android:layout_marginTop="-2dp" android:max="100" /> </RelativeLayout> diff --git a/app/src/main/res/layout/player_widget.xml b/app/src/main/res/layout/player_widget.xml index d9f442f96..4c98895a0 100644 --- a/app/src/main/res/layout/player_widget.xml +++ b/app/src/main/res/layout/player_widget.xml @@ -45,7 +45,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="8dp" - android:textColor="?android:attr/textColorSecondary" /> + android:textColor="@color/white" /> </LinearLayout> </RelativeLayout> diff --git a/app/src/main/res/layout/queue_listitem.xml b/app/src/main/res/layout/queue_listitem.xml index 8de80e355..7d18b386d 100644 --- a/app/src/main/res/layout/queue_listitem.xml +++ b/app/src/main/res/layout/queue_listitem.xml @@ -9,7 +9,7 @@ <LinearLayout android:layout_width="match_parent" - android:layout_height="@dimen/listitem_threeline_height" + android:layout_height="wrap_content" android:background="?attr/selectableItemBackground" android:orientation="horizontal" android:gravity="center_vertical" @@ -122,11 +122,10 @@ <ProgressBar android:id="@+id/progressBar" - style="?android:attr/progressBarStyleHorizontal" + style="?attr/progressBarTheme" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="4dp" android:layout_below="@id/txtvProgressLeft" - android:layout_marginTop="-2dp" android:max="100" tools:background="@android:color/holo_blue_light" /> diff --git a/app/src/main/res/layout/searchlist_item.xml b/app/src/main/res/layout/searchlist_item.xml index a8b8e7b62..83ba39cd5 100644 --- a/app/src/main/res/layout/searchlist_item.xml +++ b/app/src/main/res/layout/searchlist_item.xml @@ -2,8 +2,10 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="@dimen/listitem_threeline_height" - tools:background="@android:color/darker_gray"> + android:layout_height="wrap_content" + tools:background="@android:color/darker_gray" + android:paddingTop="@dimen/listitem_threeline_verticalpadding" + android:paddingBottom="@dimen/listitem_threeline_verticalpadding"> <ImageView android:id="@+id/imgvFeedimage" @@ -11,9 +13,7 @@ android:layout_height="@dimen/thumbnail_length_itemlist" android:layout_alignParentLeft="true" android:layout_centerVertical="true" - android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" android:layout_marginLeft="@dimen/listitem_threeline_horizontalpadding" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" android:contentDescription="@string/cover_label" android:scaleType="centerCrop" tools:src="@drawable/ic_stat_antenna_default" @@ -24,7 +24,6 @@ android:layout_height="match_parent" android:layout_marginLeft="@dimen/listitem_iconwithtext_textleftpadding" android:layout_marginRight="@dimen/listitem_threeline_verticalpadding" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" android:layout_toRightOf="@id/imgvFeedimage" android:orientation="vertical" tools:background="@android:color/holo_red_dark"> diff --git a/app/src/main/res/layout/simplechapter_item.xml b/app/src/main/res/layout/simplechapter_item.xml index 21bbc9545..28cdb08c3 100644 --- a/app/src/main/res/layout/simplechapter_item.xml +++ b/app/src/main/res/layout/simplechapter_item.xml @@ -2,7 +2,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="@dimen/listitem_threeline_height" + android:layout_height="wrap_content" android:orientation="horizontal" tools:background="@android:color/darker_gray"> |