fix fullscreen button on popup

This commit is contained in:
Schabi 2017-12-23 17:34:47 +01:00
parent ec8fff421a
commit 9f5d4034e3
3 changed files with 17 additions and 1 deletions

View File

@ -44,6 +44,7 @@ import android.view.Gravity;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.PopupMenu; import android.widget.PopupMenu;
import android.widget.RemoteViews; import android.widget.RemoteViews;
import android.widget.SeekBar; import android.widget.SeekBar;
@ -401,6 +402,7 @@ public final class PopupVideoPlayer extends Service {
protected class VideoPlayerImpl extends VideoPlayer { protected class VideoPlayerImpl extends VideoPlayer {
private TextView resizingIndicator; private TextView resizingIndicator;
private ImageButton fullScreenButton;
@Override @Override
public void handleIntent(Intent intent) { public void handleIntent(Intent intent) {
@ -418,6 +420,13 @@ public final class PopupVideoPlayer extends Service {
public void initViews(View rootView) { public void initViews(View rootView) {
super.initViews(rootView); super.initViews(rootView);
resizingIndicator = rootView.findViewById(R.id.resizing_indicator); resizingIndicator = rootView.findViewById(R.id.resizing_indicator);
fullScreenButton = rootView.findViewById(R.id.fullScreenButton);
fullScreenButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onFullScreenButtonClicked();
}
});
} }
@Override @Override

View File

@ -75,7 +75,13 @@ import static org.schabi.newpipe.util.AnimationUtils.animateView;
* @author mauriciocolli * @author mauriciocolli
*/ */
@SuppressWarnings({"WeakerAccess", "unused"}) @SuppressWarnings({"WeakerAccess", "unused"})
public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer.VideoListener, SeekBar.OnSeekBarChangeListener, View.OnClickListener, Player.EventListener, PopupMenu.OnMenuItemClickListener, PopupMenu.OnDismissListener { public abstract class VideoPlayer extends BasePlayer
implements SimpleExoPlayer.VideoListener,
SeekBar.OnSeekBarChangeListener,
View.OnClickListener,
Player.EventListener,
PopupMenu.OnMenuItemClickListener,
PopupMenu.OnDismissListener {
public static final boolean DEBUG = BasePlayer.DEBUG; public static final boolean DEBUG = BasePlayer.DEBUG;
public final String TAG; public final String TAG;

View File

@ -92,6 +92,7 @@
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:background="#00ffffff" android:background="#00ffffff"
android:clickable="true" android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@drawable/ic_fullscreen_white" android:src="@drawable/ic_fullscreen_white"
tools:ignore="ContentDescription,RtlHardcoded"/> tools:ignore="ContentDescription,RtlHardcoded"/>