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

Commit 316ba10a authored by Mark Harman's avatar Mark Harman
Browse files

Target Android 15.

parent d5dfe88a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ UPDATED Improved performance for resuming application with Camera2 API on device
        camera vendor extensions.
UPDATED Double tapping will now cancel focus and metering area.
UPDATED Single handed touch zoom by double tap and drag up/down.
UPDATED Improvements for edge-to-edge mode support on Android 15.
UPDATED Allow some more dialogs to run while still showing camera preview.
UPDATED Support longer exposure time (0.5s) on Samsung Galaxy S devices.
UPDATED OnePlus devices on Android 14+ now default to Camera2 API for new installs.
+8 −3
Original line number Diff line number Diff line
apply plugin: 'com.android.application'

android {
    compileSdk 34
    compileSdk 35
    compileOptions.encoding = 'UTF-8'

    defaultConfig {
        applicationId "net.sourceforge.opencamera"
        minSdkVersion 21
        targetSdkVersion 34
        targetSdkVersion 35
        //compileSdkVersion 31 // needed to support appcompat:1.4.0 (which we need for emoji policy support, and not yet ready to target SDK 30)

        renderscriptTargetApi 21
@@ -46,15 +46,20 @@ android {
dependencies {
    androidTestImplementation 'androidx.test.ext:junit:1.2.1'

    //implementation 'androidx.activity:activity:1.9.3' // needed for EdgeToEdge.enable(this)

    // appcompat version must be 1.4.0 or later to satisfy emoji policy!
    implementation 'androidx.appcompat:appcompat:1.7.0'

    // needed to fix errors since upgrading to appcompat:1.7.0, see https://stackoverflow.com/questions/75263047/duplicate-class-in-kotlin-android
    implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
    implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.0"))

    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    // 1.4.0 has bug where exif_new.setAttribute(ExifInterface.TAG_XMP, null); in ImageSaver.removeExifTags() crashes - so only update
    // when fixed in a newer version; can be tested via testTakePhotoRemoveExifKeepDatetime
    implementation 'androidx.exifinterface:exifinterface:1.3.7'
    //implementation 'androidx.exifinterface:exifinterface:1.4.0'

    testImplementation 'junit:junit:4.13.2'

+9 −2
Original line number Diff line number Diff line
@@ -160,8 +160,9 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen

    //private boolean ui_placement_right = true;

    private boolean edge_to_edge_mode = false; // whether running always in edge-to-edge mode
    //private boolean edge_to_edge_mode = Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM; // whether running always in edge-to-edge mode
    //private final boolean edge_to_edge_mode = false; // whether running always in edge-to-edge mode
    //private final boolean edge_to_edge_mode = true; // whether running always in edge-to-edge mode
    private final boolean edge_to_edge_mode = Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM; // whether running always in edge-to-edge mode
    private boolean want_no_limits; // whether we want to run with FLAG_LAYOUT_NO_LIMITS
    private boolean set_window_insets_listener; // whether we've enabled a setOnApplyWindowInsetsListener()
    private int navigation_gap; // gap for navigation bar along bottom (portrait) or right (landscape)
@@ -268,6 +269,7 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
        activity_count++;
        if( MyDebug.LOG )
            Log.d(TAG, "activity_count: " + activity_count);
        //EdgeToEdge.enable(this, SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT), SystemBarStyle.dark(Color.TRANSPARENT)); // test edge-to-edge on pre-Android 15
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);
@@ -1568,6 +1570,11 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
        // Note that we do it here rather than customising the theme's android:windowBackground, so this doesn't affect other views - in particular, the MyPreferenceFragment settings
        getWindow().getDecorView().getRootView().setBackgroundColor(Color.BLACK);

        if( edge_to_edge_mode && Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM ) {
            // needed on Android 15, otherwise the navigation bar is not transparent
            getWindow().setNavigationBarContrastEnforced(false);
        }

        registerDisplayListener();

        mSensorManager.registerListener(accelerometerListener, mSensorAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);