Extend play/pause functionality to Image Cover

This commit is contained in:
Wagubi Brian 2019-07-01 10:36:57 +03:00
parent 1580e93b94
commit e887996053
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);
txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle);
imgvCover = root.findViewById(R.id.imgvCover);
imgvCover.setOnClickListener(v -> onPlayPause());
return root;
}
@ -114,4 +115,11 @@ public class CoverFragment extends Fragment {
disposable.dispose();
}
}
void onPlayPause() {
if (controller == null) {
return;
}
controller.playPause();
}
}

View File

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