Automatically switch into full screen when changing orientation #698
This commit is contained in:
parent
577e5b3067
commit
c39cff7e27
|
@ -22,6 +22,7 @@ import android.content.DialogInterface;
|
|||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.MediaPlayer;
|
||||
|
@ -455,6 +456,19 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
setFullscreen(FullScreenMediaController.fullscreen.ON);
|
||||
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
|
||||
setFullscreen(FullScreenMediaController.fullscreen.OFF);
|
||||
}
|
||||
change();
|
||||
fullScreenMediaController.changeIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRetrievePeertubeComments(APIResponse apiResponse) {
|
||||
if( apiResponse == null || (apiResponse.getError() != null && apiResponse.getError().getStatusCode() != 404) ){
|
||||
|
|
|
@ -122,7 +122,7 @@ public class FullScreenMediaController extends MediaController {
|
|||
resolution.setText(String.format("%sp",resolutionVal));
|
||||
}
|
||||
|
||||
private void changeIcon(){
|
||||
public void changeIcon(){
|
||||
//fullscreen indicator from intent
|
||||
if(((PeertubeActivity)getContext()).getFullscreen() == fullscreen.ON){
|
||||
Resources resources = getResources();
|
||||
|
|
Loading…
Reference in New Issue