Merge pull request #3249 from archibishop/imagecover-playpause-fuctionality

Extend play/pause functionality to Image Cover
This commit is contained in:
H. Lehmann 2019-07-06 15:00:30 +02:00 committed by GitHub
commit ce649ec087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -44,6 +44,7 @@ public class CoverFragment extends Fragment {
txtvPodcastTitle = root.findViewById(R.id.txtvPodcastTitle); txtvPodcastTitle = root.findViewById(R.id.txtvPodcastTitle);
txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle); txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle);
imgvCover = root.findViewById(R.id.imgvCover); imgvCover = root.findViewById(R.id.imgvCover);
imgvCover.setOnClickListener(v -> onPlayPause());
return root; return root;
} }
@ -114,4 +115,11 @@ public class CoverFragment extends Fragment {
disposable.dispose(); disposable.dispose();
} }
} }
void onPlayPause() {
if (controller == null) {
return;
}
controller.playPause();
}
} }

View File

@ -26,7 +26,8 @@
android:contentDescription="@string/cover_label" android:contentDescription="@string/cover_label"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:transitionName="coverTransition" android:transitionName="coverTransition"
tools:src="@android:drawable/sym_def_app_icon" /> tools:src="@android:drawable/sym_def_app_icon"
android:foreground="?attr/selectableItemBackground" />
<TextView <TextView
android:id="@+id/txtvEpisodeTitle" android:id="@+id/txtvEpisodeTitle"