Fix full screen

This commit is contained in:
Thomas 2020-10-02 15:23:36 +02:00
parent 34ed36f9ae
commit 92a0af8b36
1 changed files with 5 additions and 2 deletions

View File

@ -28,9 +28,9 @@ import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.media.session.MediaSessionCompat;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@ -781,7 +781,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
@Override
public void onConfigurationChanged(@NotNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Log.v(Helper.TAG,"onConfigurationChanged: " + newConfig.orientation);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
if (mode != Helper.VIDEO_MODE_WEBVIEW) {
openFullscreenDialog();
@ -1007,6 +1006,10 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}else {
closeFullscreenDialog();
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Handler handler = new Handler();
handler.postDelayed(() -> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR), 2000);
}
});
}