Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf80665c authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊 Committed by Nishith Khanna
Browse files

camera: Rotate camera ui on tablet

parent 285673a4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package net.sourceforge.opencamera;

import android.content.Context;
import android.os.Build;

import java.util.Locale;
@@ -42,4 +43,9 @@ public class DeviceSettings {
    public static boolean isMurenaTwo() {
        return Build.DEVICE.toLowerCase(Locale.US).contains("two");
    }

    public static boolean isTablet(Context context) {
        int smallestScreenWidth = context.getResources().getConfiguration().smallestScreenWidthDp;
        return smallestScreenWidth >= 600;
    }
}
+3 −1
Original line number Diff line number Diff line
package net.sourceforge.opencamera.ui;

import net.sourceforge.opencamera.DeviceSettings;
import net.sourceforge.opencamera.MyApplicationInterface;
import net.sourceforge.opencamera.ScaleUtils;
import net.sourceforge.opencamera.cameracontroller.CameraController;
@@ -226,7 +227,8 @@ public class MainUI {

        MainActivity.SystemOrientation system_orientation = main_activity.getSystemOrientation();
        boolean system_orientation_portrait = system_orientation == MainActivity.SystemOrientation.PORTRAIT;
        boolean system_orientation_reversed_landscape = system_orientation == MainActivity.SystemOrientation.REVERSE_LANDSCAPE;
        boolean system_orientation_reversed_landscape = !DeviceSettings.isTablet(main_activity) &&
                system_orientation == MainActivity.SystemOrientation.REVERSE_LANDSCAPE;
        if( MyDebug.LOG ) {
            Log.d(TAG, "    system_orientation = " + system_orientation);
            Log.d(TAG, "    system_orientation_portrait? " + system_orientation_portrait);