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 d2fc36ed255d753005bb69c11f31f5a81f817b0d..b99fe6bf0bfb6d0b76d111122ed4dd08ae61e463 100644 --- a/app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java +++ b/app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java @@ -8184,125 +8184,6 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2 0); - assertTrue(popup_height > 0); - assertEquals(popup_width, test_popup_width); - assertEquals(popup_height, test_popup_height); - - // now reopen popup view, and check the same dimensions - clickView(popupButton); - while( mActivity.popupIsOpen() ) { - } - - clickView(popupButton); - while( !mActivity.popupIsOpen() ) { - } - - int new_popup_width = popup_view.getWidth(); - int new_popup_height = popup_view.getHeight(); - test_popup_width = mActivity.getMainUI().test_saved_popup_width; - test_popup_height = mActivity.getMainUI().test_saved_popup_height; - Log.d(TAG, "new_popup_width: " + new_popup_width); - Log.d(TAG, "new_popup_height: " + new_popup_height); - Log.d(TAG, "test_popup_width: " + test_popup_width); - Log.d(TAG, "test_popup_height: " + test_popup_height); - assertEquals(popup_width, new_popup_width); - assertEquals(popup_height, new_popup_height); - assertEquals(popup_width, test_popup_width); - assertEquals(popup_height, test_popup_height); - } - - /* Tests with ui_right vs ui_top layout. - */ - public void testRightLayout() { - Log.d(TAG, "testRightLayout"); - - setToDefault(); - { - SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mActivity); - SharedPreferences.Editor editor = settings.edit(); - editor.putString(PreferenceKeys.UIPlacementPreferenceKey, "ui_right"); - editor.apply(); - updateForSettings(); - } - - View popupButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.popup); - assertFalse(mActivity.popupIsOpen()); - clickView(popupButton); - while( !mActivity.popupIsOpen() ) { - } - - Point display_size = new Point(); - { - Display display = mActivity.getWindowManager().getDefaultDisplay(); - display.getSize(display_size); - Log.d(TAG, "display_size: " + display_size.x + " x " + display_size.y); - } - View settingsButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.settings); - View galleryButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.gallery); - - Log.d(TAG, "settings right: " + settingsButton.getRight()); - Log.d(TAG, "settings top: " + settingsButton.getTop()); - Log.d(TAG, "gallery right: " + galleryButton.getRight()); - Log.d(TAG, "gallery top: " + galleryButton.getTop()); - - assertTrue(settingsButton.getRight() > (int)(0.8*display_size.x)); - assertEquals(0, settingsButton.getTop()); - assertEquals(display_size.x, galleryButton.getRight()); - assertEquals(0, galleryButton.getTop()); - - { - SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mActivity); - SharedPreferences.Editor editor = settings.edit(); - editor.putString(PreferenceKeys.UIPlacementPreferenceKey, "ui_top"); - editor.apply(); - updateForSettings(); - } - - Log.d(TAG, "settings right: " + settingsButton.getRight()); - Log.d(TAG, "settings top: " + settingsButton.getTop()); - Log.d(TAG, "gallery right: " + galleryButton.getRight()); - Log.d(TAG, "gallery top: " + galleryButton.getTop()); - - assertTrue(settingsButton.getRight() < (int)(0.2*display_size.x)); - assertEquals(0, settingsButton.getTop()); - assertEquals(display_size.x, galleryButton.getRight()); - assertEquals(0, galleryButton.getTop()); - - assertFalse(mActivity.popupIsOpen()); - clickView(popupButton); - while( !mActivity.popupIsOpen() ) { - } - } - /* Tests layout bug with popup menu. * Note, in practice this doesn't seem to reproduce the problem, but keep the test anyway. * Currently not autotested as the problem isn't fixed, and this would just be a test that diff --git a/app/src/main/java/net/sourceforge/opencamera/PreferenceKeys.java b/app/src/main/java/net/sourceforge/opencamera/PreferenceKeys.java index cc8732db0d865d9abb0dd714d5c87e5bb13e0a6b..bb283902b0fcedfeb4828127c5935282853c2207 100644 --- a/app/src/main/java/net/sourceforge/opencamera/PreferenceKeys.java +++ b/app/src/main/java/net/sourceforge/opencamera/PreferenceKeys.java @@ -174,8 +174,6 @@ public class PreferenceKeys { public static final String Camera2PhotoVideoRecordingPreferenceKey = "preference_camera2_photo_video_recording"; - public static final String UIPlacementPreferenceKey = "preference_ui_placement"; - public static final String TouchCapturePreferenceKey = "preference_touch_capture"; public static final String PausePreviewPreferenceKey = "preference_pause_preview"; diff --git a/app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java b/app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java index 8e4246c959a81579c1fc70fbb477833ecebece75..818b2f3e2451c8644387f5c4975a4df7a03c39b1 100644 --- a/app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java +++ b/app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java @@ -168,16 +168,7 @@ public class MainUI { } private UIPlacement computeUIPlacement() { - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(main_activity); - String ui_placement_string = sharedPreferences.getString(PreferenceKeys.UIPlacementPreferenceKey, "ui_top"); - switch (ui_placement_string) { - case "ui_left": - return UIPlacement.UIPLACEMENT_LEFT; - case "ui_top": - return UIPlacement.UIPLACEMENT_TOP; - default: - return UIPlacement.UIPLACEMENT_RIGHT; - } + return UIPlacement.UIPLACEMENT_TOP; } private void layoutUI(boolean popup_container_only) { diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index f4e9ed12e16fd797f7f3dd652363ec4a48e88f4f..8086dc1430f55bc6b86ded96d25cf5d3aa98813a 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -562,15 +562,6 @@ android:title="@string/preference_screen_gui" android:icon="@drawable/ic_more_horiz_white_48dp" android:persistent="false"> - -