diff --git a/app/build.gradle b/app/build.gradle index c9eee76d4aca09a513fac14b4bf4672938cd5646..52eeee9edca1df90aaf77a3629ad9b0a9d1b5a3a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,6 +10,16 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } + signingConfigs { + // These are public keys provided by AOSP, Use different passcode protected keys for production + debug { + storeFile file('keys/platform.jks') + storePassword 'platform' + keyAlias 'platform' + keyPassword 'platform' + } + } + defaultConfig { applicationId "foundation.e.camera" minSdkVersion 25 @@ -27,7 +37,8 @@ android { buildTypes { debug { - applicationIdSuffix ".debug" + //applicationIdSuffix ".debug" + signingConfig signingConfigs.debug } release { diff --git a/app/keys/platform.jks b/app/keys/platform.jks new file mode 100644 index 0000000000000000000000000000000000000000..b778840542e79c048bcf570aa960243eeb9b9d53 Binary files /dev/null and b/app/keys/platform.jks differ diff --git a/app/src/androidTest/java/net/sourceforge/opencamera/InstrumentedTest.java b/app/src/androidTest/java/net/sourceforge/opencamera/InstrumentedTest.java index a7fd9bdd8c73fda1c856e0528a592aa6990da0c1..cc26f5496256554b6359c0090920b4dc914cfbe4 100644 --- a/app/src/androidTest/java/net/sourceforge/opencamera/InstrumentedTest.java +++ b/app/src/androidTest/java/net/sourceforge/opencamera/InstrumentedTest.java @@ -7,7 +7,11 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.endsWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import android.annotation.TargetApi; import android.content.Intent; @@ -39,6 +43,8 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicReference; +import foundation.e.camera.R; + interface PhotoTests {} interface HDRTests {} @@ -6168,7 +6174,7 @@ public class InstrumentedTest { if( !single_tap_photo && !double_tap_photo ) { mActivityRule.getScenario().onActivity(activity -> { - View takePhotoButton = activity.findViewById(net.sourceforge.opencamera.R.id.take_photo); + View takePhotoButton = activity.findViewById(R.id.take_photo); assertFalse( activity.hasThumbnailAnimation() ); Log.d(TAG, "about to click take photo"); clickView(takePhotoButton); diff --git a/app/src/androidTest/java/net/sourceforge/opencamera/TestUtils.java b/app/src/androidTest/java/net/sourceforge/opencamera/TestUtils.java index 92c980f52345bd0bfb1a9bdfb50d92c71e5bb9b1..0e5182e8ecd3011463238a9534f0b58a87839219 100644 --- a/app/src/androidTest/java/net/sourceforge/opencamera/TestUtils.java +++ b/app/src/androidTest/java/net/sourceforge/opencamera/TestUtils.java @@ -1,6 +1,11 @@ package net.sourceforge.opencamera; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import android.annotation.TargetApi; import android.content.ContentUris; @@ -23,8 +28,8 @@ import android.renderscript.Allocation; import android.util.Log; import android.view.View; -import androidx.annotation.RequiresApi; import androidx.exifinterface.media.ExifInterface; +import androidx.test.filters.SdkSuppress; import net.sourceforge.opencamera.preview.Preview; @@ -41,6 +46,8 @@ import java.util.Date; import java.util.List; import java.util.Locale; +import foundation.e.camera.R; + /** Helper class for testing. This method should not include any code specific to any test framework * (e.g., shouldn't be specific to ActivityInstrumentationTestCase2). */ @@ -356,7 +363,7 @@ public class TestUtils { * We check that we have a single range of non-zero values. * @param bitmap The bitmap to compute and check a histogram for. */ - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public static HistogramDetails checkHistogram(MainActivity activity, Bitmap bitmap) { int [] histogram = activity.getApplicationInterface().getHDRProcessor().computeHistogram(bitmap, true); assertEquals(256, histogram.length); @@ -778,17 +785,17 @@ public class TestUtils { public static void waitForTakePhotoChecks(MainActivity activity, long time_s) { Preview preview = activity.getPreview(); - View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); - View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); - View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); - //View flashButton = activity.findViewById(net.sourceforge.opencamera.R.id.flash); - //View focusButton = activity.findViewById(net.sourceforge.opencamera.R.id.focus_mode); - View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); - View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); - View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); - View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); - View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); - View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); + View switchCameraButton = activity.findViewById(R.id.switch_camera); + View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); + View switchVideoButton = activity.findViewById(R.id.switch_video); + //View flashButton = activity.findViewById(R.id.flash); + //View focusButton = activity.findViewById(R.id.focus_mode); + View exposureButton = activity.findViewById(R.id.exposure); + View exposureLockButton = activity.findViewById(R.id.exposure_lock); + View audioControlButton = activity.findViewById(R.id.audio_control); + View popupButton = activity.findViewById(R.id.popup); + View trashButton = activity.findViewById(R.id.trash); + View shareButton = activity.findViewById(R.id.share); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity); boolean is_focus_bracketing = activity.supportsFocusBracketing() && sharedPreferences.getString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_std").equals("preference_photo_mode_focus_bracketing"); boolean is_panorama = activity.supportsPanorama() && sharedPreferences.getString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_std").equals("preference_photo_mode_panorama"); @@ -1227,15 +1234,15 @@ public class TestUtils { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity); boolean has_audio_control_button = !sharedPreferences.getString(PreferenceKeys.AudioControlPreferenceKey, "none").equals("none"); - View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); - View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); - View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); - View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); - View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); - View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); - View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); - View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); - View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); + View switchCameraButton = activity.findViewById(R.id.switch_camera); + View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); + View switchVideoButton = activity.findViewById(R.id.switch_video); + View exposureButton = activity.findViewById(R.id.exposure); + View exposureLockButton = activity.findViewById(R.id.exposure_lock); + View audioControlButton = activity.findViewById(R.id.audio_control); + View popupButton = activity.findViewById(R.id.popup); + View trashButton = activity.findViewById(R.id.trash); + View shareButton = activity.findViewById(R.id.share); // trash/share only shown when preview is paused after taking a photo boolean pause_preview = sharedPreferences.getBoolean(PreferenceKeys.PausePreviewPreferenceKey, false); @@ -1296,17 +1303,17 @@ public class TestUtils { boolean has_audio_control_button = !sharedPreferences.getString(PreferenceKeys.AudioControlPreferenceKey, "none").equals("none"); - View switchCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); - View switchMultiCameraButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_multi_camera); - View switchVideoButton = activity.findViewById(net.sourceforge.opencamera.R.id.switch_video); - //View flashButton = activity.findViewById(net.sourceforge.opencamera.R.id.flash); - //View focusButton = activity.findViewById(net.sourceforge.opencamera.R.id.focus_mode); - View exposureButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure); - View exposureLockButton = activity.findViewById(net.sourceforge.opencamera.R.id.exposure_lock); - View audioControlButton = activity.findViewById(net.sourceforge.opencamera.R.id.audio_control); - View popupButton = activity.findViewById(net.sourceforge.opencamera.R.id.popup); - View trashButton = activity.findViewById(net.sourceforge.opencamera.R.id.trash); - View shareButton = activity.findViewById(net.sourceforge.opencamera.R.id.share); + View switchCameraButton = activity.findViewById(R.id.switch_camera); + View switchMultiCameraButton = activity.findViewById(R.id.switch_multi_camera); + View switchVideoButton = activity.findViewById(R.id.switch_video); + //View flashButton = activity.findViewById(R.id.flash); + //View focusButton = activity.findViewById(R.id.focus_mode); + View exposureButton = activity.findViewById(R.id.exposure); + View exposureLockButton = activity.findViewById(R.id.exposure_lock); + View audioControlButton = activity.findViewById(R.id.audio_control); + View popupButton = activity.findViewById(R.id.popup); + View trashButton = activity.findViewById(R.id.trash); + View shareButton = activity.findViewById(R.id.share); assertEquals(switchCameraButton.getVisibility(), (immersive_mode ? View.GONE : (activity.getPreview().getCameraControllerManager().getNumberOfCameras() > 1 ? View.VISIBLE : View.GONE))); assertEquals(switchMultiCameraButton.getVisibility(), (immersive_mode ? View.GONE : (activity.showSwitchMultiCamIcon() ? View.VISIBLE : View.GONE))); assertEquals(switchVideoButton.getVisibility(), (immersive_mode ? View.GONE : View.VISIBLE)); diff --git a/app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java b/app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java index b1db2c87b7d97d40191bb5b4b700d3a3ae6b5d68..34aa71a0159e123793bea6c4dda634924f1481af 100644 --- a/app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java +++ b/app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java @@ -1,44 +1,9 @@ package net.sourceforge.opencamera.test; -import java.io.File; -import java.io.FileDescriptor; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Set; - -import net.sourceforge.opencamera.LocationSupplier; -import net.sourceforge.opencamera.MyPreferenceFragment; -import net.sourceforge.opencamera.TestUtils; -import net.sourceforge.opencamera.cameracontroller.CameraController2; -import net.sourceforge.opencamera.HDRProcessor; -import net.sourceforge.opencamera.HDRProcessorException; -import net.sourceforge.opencamera.ImageSaver; -import net.sourceforge.opencamera.MainActivity; -import net.sourceforge.opencamera.MyApplicationInterface; -import net.sourceforge.opencamera.PreferenceKeys; -import net.sourceforge.opencamera.preview.ApplicationInterface; -import net.sourceforge.opencamera.preview.VideoProfile; -import net.sourceforge.opencamera.SaveLocationHistory; -import net.sourceforge.opencamera.cameracontroller.CameraController; -import net.sourceforge.opencamera.preview.Preview; -import net.sourceforge.opencamera.ui.DrawPreview; -import net.sourceforge.opencamera.ui.FolderChooserDialog; -import net.sourceforge.opencamera.ui.MainUI; -import net.sourceforge.opencamera.ui.PopupView; - import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.Intent; import android.content.SharedPreferences; -//import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Point; @@ -64,6 +29,37 @@ import android.widget.SeekBar; import android.widget.TextView; import android.widget.ZoomControls; +import net.sourceforge.opencamera.HDRProcessor; +import net.sourceforge.opencamera.HDRProcessorException; +import net.sourceforge.opencamera.ImageSaver; +import net.sourceforge.opencamera.LocationSupplier; +import net.sourceforge.opencamera.MainActivity; +import net.sourceforge.opencamera.MyApplicationInterface; +import net.sourceforge.opencamera.MyPreferenceFragment; +import net.sourceforge.opencamera.PreferenceKeys; +import net.sourceforge.opencamera.SaveLocationHistory; +import net.sourceforge.opencamera.TestUtils; +import net.sourceforge.opencamera.cameracontroller.CameraController; +import net.sourceforge.opencamera.cameracontroller.CameraController2; +import net.sourceforge.opencamera.preview.ApplicationInterface; +import net.sourceforge.opencamera.preview.Preview; +import net.sourceforge.opencamera.preview.VideoProfile; +import net.sourceforge.opencamera.ui.DrawPreview; +import net.sourceforge.opencamera.ui.FolderChooserDialog; +import net.sourceforge.opencamera.ui.MainUI; +import net.sourceforge.opencamera.ui.PopupView; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; + +import foundation.e.camera.R; + // ignore warning about "Call to Thread.sleep in a loop", this is only test code @SuppressWarnings("BusyWait") public class MainActivityTest extends ActivityInstrumentationTestCase2 { @@ -252,7 +248,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { Log.d(TAG, "switch camera"); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); @@ -980,7 +976,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { Log.d(TAG, "switch camera"); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); @@ -1374,7 +1370,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { int cameraId = mPreview.getCameraId(); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); // check face detection already started @@ -1649,22 +1645,22 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { int cameraId = mPreview.getCameraId(); Log.d(TAG, "cameraId? "+ cameraId); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); //mActivity.clickedSwitchCamera(switchCameraButton); clickView(switchCameraButton); waitUntilCameraOpened(); @@ -1830,7 +1826,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 0); - String next_string = mActivity.getResources().getString(next ? net.sourceforge.opencamera.R.string.next : net.sourceforge.opencamera.R.string.previous); + String next_string = mActivity.getResources().getString(next ? R.string.next : R.string.previous); assertTrue(next_string.length() > 0); assertTrue(content_description.startsWith(next_string + " " + title)); } @@ -1855,16 +1851,16 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_video_capture_rate, "VIDEOCAPTURERATE", false, false); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_video_capture_rate, "VIDEOCAPTURERATE", true, true); + subTestPopupButtonContentDescription(R.string.preference_video_capture_rate, "VIDEOCAPTURERATE", false, false); + subTestPopupButtonContentDescription(R.string.preference_video_capture_rate, "VIDEOCAPTURERATE", true, true); } - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_timer, "TIMER", false, false); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_timer, "TIMER", true, true); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_burst_mode, "REPEAT_MODE", false, false); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_burst_mode, "REPEAT_MODE", true, true); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.grid, "GRID", false, true); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.grid, "GRID", true, true); + subTestPopupButtonContentDescription(R.string.preference_timer, "TIMER", false, false); + subTestPopupButtonContentDescription(R.string.preference_timer, "TIMER", true, true); + subTestPopupButtonContentDescription(R.string.preference_burst_mode, "REPEAT_MODE", false, false); + subTestPopupButtonContentDescription(R.string.preference_burst_mode, "REPEAT_MODE", true, true); + subTestPopupButtonContentDescription(R.string.grid, "GRID", false, true); + subTestPopupButtonContentDescription(R.string.grid, "GRID", true, true); int saved_count = mPreview.count_cameraAutoFocus; Log.d(TAG, "0 count_cameraAutoFocus: " + saved_count); @@ -1906,7 +1902,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { int cameraId = mPreview.getCameraId(); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); int new_cameraId = mPreview.getCameraId(); @@ -1917,14 +1913,14 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_video_capture_rate, "VIDEOCAPTURERATE", false, false); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_video_capture_rate, "VIDEOCAPTURERATE", true, true); + subTestPopupButtonContentDescription(R.string.preference_video_capture_rate, "VIDEOCAPTURERATE", false, false); + subTestPopupButtonContentDescription(R.string.preference_video_capture_rate, "VIDEOCAPTURERATE", true, true); } - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_timer, "TIMER", false, false); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_timer, "TIMER", true, true); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_burst_mode, "REPEAT_MODE", false, false); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.preference_burst_mode, "REPEAT_MODE", true, true); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.grid, "GRID", false, true); - subTestPopupButtonContentDescription(net.sourceforge.opencamera.R.string.grid, "GRID", true, true); + subTestPopupButtonContentDescription(R.string.preference_timer, "TIMER", false, false); + subTestPopupButtonContentDescription(R.string.preference_timer, "TIMER", true, true); + subTestPopupButtonContentDescription(R.string.preference_burst_mode, "REPEAT_MODE", false, false); + subTestPopupButtonContentDescription(R.string.preference_burst_mode, "REPEAT_MODE", true, true); + subTestPopupButtonContentDescription(R.string.grid, "GRID", false, true); + subTestPopupButtonContentDescription(R.string.grid, "GRID", true, true); clickView(switchVideoButton); waitUntilCameraOpened(); @@ -2024,7 +2020,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 saved_count_cameraContinuousFocusMoving ); // switch to video - View switchVideoButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_video); + View switchVideoButton = mActivity.findViewById(R.id.switch_video); clickView(switchVideoButton); waitUntilCameraOpened(); String focus_value = mPreview.getCameraController().getFocusValue(); @@ -2071,7 +2067,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { Log.d(TAG, "switch camera"); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); @@ -2936,10 +2932,10 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { Log.d(TAG, "switch camera"); int old_max = mPreview.getMaximumISO(); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); @@ -3080,7 +3076,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ? View.VISIBLE : View.GONE))); assertEquals(switchMultiCameraButton.getVisibility(), (immersive_mode ? View.GONE : (mActivity.showSwitchMultiCamIcon() ? View.VISIBLE : View.GONE))); assertEquals(switchVideoButton.getVisibility(), (immersive_mode ? View.GONE : View.VISIBLE)); @@ -4504,7 +4500,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ? View.VISIBLE : View.GONE)); assertEquals(switchMultiCameraButton.getVisibility(), (mActivity.showSwitchMultiCamIcon() ? View.VISIBLE : View.GONE)); assertEquals(switchVideoButton.getVisibility(), View.VISIBLE); @@ -4661,7 +4657,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ? View.VISIBLE : View.GONE)); assertEquals(switchMultiCameraButton.getVisibility(), (mActivity.showSwitchMultiCamIcon() ? View.VISIBLE : View.GONE)); assertEquals(switchVideoButton.getVisibility(), View.VISIBLE); @@ -5021,7 +5017,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { int cameraId = mPreview.getCameraId(); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); while( switchCameraButton.getVisibility() != View.VISIBLE ) { // wait until photo is taken and button is visible again } @@ -5155,7 +5151,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { int cameraId = mPreview.getCameraId(); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); while( switchCameraButton.getVisibility() != View.VISIBLE ) { // wait until photo is taken and button is visible again } @@ -5251,23 +5247,23 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ? View.VISIBLE : View.GONE))); assertEquals(switchMultiCameraButton.getVisibility(), (immersive_mode ? View.GONE : (mActivity.showSwitchMultiCamIcon() ? View.VISIBLE : View.GONE))); assertEquals(switchVideoButton.getVisibility(), (immersive_mode ? View.GONE : View.VISIBLE)); @@ -5321,9 +5317,9 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2= Build.VERSION_CODES.N ) assertEquals(pauseVideoButton.getVisibility(), View.VISIBLE); else @@ -5378,10 +5374,10 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ? View.VISIBLE : View.GONE)); assertEquals(switchMultiCameraButton.getVisibility(), (mActivity.showSwitchMultiCamIcon() ? View.VISIBLE : View.GONE)); assertEquals(switchVideoButton.getVisibility(), View.VISIBLE); @@ -7102,7 +7098,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { Log.d(TAG, "switch camera"); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); subTestVideoPopup(false); @@ -8005,7 +8001,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { Log.d(TAG, "switch camera"); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); subTestVideoPopup(true); @@ -8249,20 +8245,20 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); assertTrue(mActivity.getLocationSupplier().hasLocationListeners()); @@ -8609,7 +8605,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { int cameraId = mPreview.getCameraId(); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); this.getInstrumentation().waitForIdleSync(); @@ -8708,7 +8704,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); // shouldn't need to wait for test_has_received_location to be true, as should remember from before switching camera @@ -8806,7 +8802,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ) { Log.d(TAG, "switch camera"); - View switchCameraButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.switch_camera); + View switchCameraButton = mActivity.findViewById(R.id.switch_camera); clickView(switchCameraButton); waitUntilCameraOpened(); assertNotNull(mPreview.getCameraControllerManager()); @@ -10352,7 +10348,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 1 ? View.VISIBLE : View.GONE)); @@ -11581,7 +11577,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 + + + + +