Minor changes

This commit is contained in:
Martin Fietz 2016-01-26 11:50:49 +01:00
parent 59129c6c88
commit 150042e913
3 changed files with 14 additions and 22 deletions

View File

@ -6,11 +6,11 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.app.ListFragment;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
@ -129,7 +129,6 @@ public class AudioplayerActivity extends MediaplayerActivity implements NavDrawe
if(mPager == null) {
return;
}
Log.d(TAG, "Saving preferences");
SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE);
prefs.edit()
@ -172,7 +171,6 @@ public class AudioplayerActivity extends MediaplayerActivity implements NavDrawe
mPagerAdapter.onMediaChanged(media);
}
EventDistributor.getInstance().register(contentUpdate);
loadData();
}
@ -258,13 +256,11 @@ public class AudioplayerActivity extends MediaplayerActivity implements NavDrawe
});
mPager = (ViewPager) findViewById(R.id.pager);
if(mPager.getAdapter() == null) {
mPagerAdapter = new AudioplayerPagerAdapter(getSupportFragmentManager());
mPager.setAdapter(mPagerAdapter);
CirclePageIndicator pageIndicator = (CirclePageIndicator) findViewById(R.id.page_indicator);
pageIndicator.setViewPager(mPager);
loadLastFragment();
}
mPagerAdapter = new AudioplayerPagerAdapter(getSupportFragmentManager());
mPager.setAdapter(mPagerAdapter);
CirclePageIndicator pageIndicator = (CirclePageIndicator) findViewById(R.id.page_indicator);
pageIndicator.setViewPager(mPager);
loadLastFragment();
mPager.onSaveInstanceState();
}
@ -552,7 +548,6 @@ public class AudioplayerActivity extends MediaplayerActivity implements NavDrawe
}
}
@Override
public int getCount() {
return NUM_CONTENT_FRAGMENTS;

View File

@ -71,14 +71,12 @@ public class CoverFragment extends Fragment implements AudioplayerContentFragmen
Log.d(TAG, "episode title: " + media.getEpisodeTitle());
txtvPodcastTitle.setText(media.getFeedTitle());
txtvEpisodeTitle.setText(media.getEpisodeTitle());
imgvCover.post(() -> {
Glide.with(this)
.load(media.getImageUri())
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.dontAnimate()
.fitCenter()
.into(imgvCover);
});
Glide.with(this)
.load(media.getImageUri())
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.dontAnimate()
.fitCenter()
.into(imgvCover);
} else {
Log.w(TAG, "loadMediaInfo was called while media was null");
}

View File

@ -21,7 +21,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
@ -67,7 +67,6 @@ public class ItemDescriptionFragment extends Fragment implements AudioplayerCont
private ShownotesProvider shownotesProvider;
private Playable media;
private Subscription webViewLoader;
/**
@ -124,7 +123,7 @@ public class ItemDescriptionFragment extends Fragment implements AudioplayerCont
ta.recycle();
webvDescription.setBackgroundColor(backgroundColor);
webvDescription.getSettings().setUseWideViewPort(false);
webvDescription.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
webvDescription.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
webvDescription.getSettings().setLoadWithOverviewMode(true);
webvDescription.setOnLongClickListener(webViewLongClickListener);
webvDescription.setWebViewClient(new WebViewClient() {