remove unneeded code

This commit is contained in:
Tony Tam 2020-07-16 00:14:39 -07:00
parent dba3aee7b0
commit 7f8ac6c681
1 changed files with 1 additions and 11 deletions

View File

@ -55,7 +55,6 @@ public class CoverFragment extends Fragment {
private int displayedChapterIndex = -2; private int displayedChapterIndex = -2;
private Playable media; private Playable media;
private int orientation = Configuration.ORIENTATION_UNDEFINED; private int orientation = Configuration.ORIENTATION_UNDEFINED;
private int _position = -1;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
@ -85,8 +84,7 @@ public class CoverFragment extends Fragment {
} else { } else {
emitter.onComplete(); emitter.onComplete();
} }
}) }).subscribeOn(Schedulers.io())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(media -> { .subscribe(media -> {
this.media = media; this.media = media;
@ -108,7 +106,6 @@ public class CoverFragment extends Fragment {
root = null; root = null;
} }
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
@ -146,7 +143,6 @@ public class CoverFragment extends Fragment {
} }
private void displayCoverImage(int position) { private void displayCoverImage(int position) {
_position = position;
int chapter = ChapterUtils.getCurrentChapterIndex(media, position); int chapter = ChapterUtils.getCurrentChapterIndex(media, position);
if (chapter != displayedChapterIndex) { if (chapter != displayedChapterIndex) {
displayedChapterIndex = chapter; displayedChapterIndex = chapter;
@ -191,7 +187,6 @@ public class CoverFragment extends Fragment {
} }
private void configureForOrientation(int orientation, Configuration newConfig) { private void configureForOrientation(int orientation, Configuration newConfig) {
View textContainer = getView().findViewById(R.id.cover_fragment_text_container);
LinearLayout mainContainer = getView().findViewById(R.id.cover_fragment); LinearLayout mainContainer = getView().findViewById(R.id.cover_fragment);
if (orientation == Configuration.ORIENTATION_PORTRAIT) { if (orientation == Configuration.ORIENTATION_PORTRAIT) {
mainContainer.setOrientation(LinearLayout.VERTICAL); mainContainer.setOrientation(LinearLayout.VERTICAL);
@ -206,13 +201,8 @@ public class CoverFragment extends Fragment {
imgvCover.getLayoutParams().width = imgvCover.getLayoutParams().height; imgvCover.getLayoutParams().width = imgvCover.getLayoutParams().height;
} }
} }
if (_position > -1) {
displayCoverImage(_position);
}
imgvCover.requestLayout();
} }
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();