diff --git a/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerActivity.java b/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerActivity.java index 1481209b..9f211421 100644 --- a/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerActivity.java +++ b/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerActivity.java @@ -349,9 +349,14 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { @Override public void createAnnotation(PointF position) { - // Allow creating annotations only when paused - if (playerFragment.getState() != PlayerFragment.State.PAUSED) { + + // No annotating while pause is already going on + if (playerFragment.getState() == PlayerFragment.State.ANNOTATION_PAUSED) { return; + + } else if (playerFragment.getState() != PlayerFragment.State.PAUSED) { + playerFragment.pause(); + playerFragment.setState(PlayerFragment.State.PAUSED); } // Disallow creating annotations when an annotation is being edited if (areAnnotationControlsVisible()) { @@ -498,7 +503,6 @@ public void onPlaybackStateChanged(PlayerFragment.State state) { case PLAYING: enableControls(); - hideControlsOverlay(); playPauseButton.setImageResource(R.drawable.ic_action_pause); break; @@ -563,9 +567,6 @@ public boolean dispatchTouchEvent(@Nonnull MotionEvent event) { cancelControlsOverlayHide(); break; - case MotionEvent.ACTION_UP: - hideControlsOverlay(); - break; } return super.dispatchTouchEvent(event); diff --git a/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerFragment.java b/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerFragment.java index 51c5822f..7d24e591 100644 --- a/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerFragment.java +++ b/app/src/main/java/fi/aalto/legroup/achso/playback/PlayerFragment.java @@ -273,7 +273,7 @@ public LinearLayout getSubtitleContainer() { return subtitleContainer; } - private void setState(State state) { + public void setState(State state) { this.state = state; if (listener != null) { diff --git a/app/src/main/res/drawable/floating_controls_background.xml b/app/src/main/res/drawable/floating_controls_background.xml index e029ed77..0393e500 100644 --- a/app/src/main/res/drawable/floating_controls_background.xml +++ b/app/src/main/res/drawable/floating_controls_background.xml @@ -10,7 +10,7 @@ android:top="16dp" /> + android:color="#00000000" /> diff --git a/app/src/main/res/layout/activity_player.xml b/app/src/main/res/layout/activity_player.xml index 46106132..a8e9ac4d 100644 --- a/app/src/main/res/layout/activity_player.xml +++ b/app/src/main/res/layout/activity_player.xml @@ -20,7 +20,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:layout_margin="16dp" /> + android:layout_marginRight="8dp" + android:layout_marginLeft="8dp" + android:layout_marginBottom="8dp" + android:layout_marginTop="8dp" />