From ee77ef91cf5a72cc2921d01c3e2474f0d8350c90 Mon Sep 17 00:00:00 2001 From: mohammadreza Date: Mon, 17 May 2021 13:25:16 +0430 Subject: [PATCH 1/2] fixed system bugs --- assets/2048 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/2048 b/assets/2048 index 7a477ebd..c5b77004 160000 --- a/assets/2048 +++ b/assets/2048 @@ -1 +1 @@ -Subproject commit 7a477ebd511a500076dc46742938db67f21aab94 +Subproject commit c5b77004a87c0df61602ad4dc6cf4b667ca280c6 From 4a6c65dd44d2e48d91584b89833d56a29b68f429 Mon Sep 17 00:00:00 2001 From: mohammadreza Date: Mon, 17 May 2021 14:51:49 +0430 Subject: [PATCH 2/2] 180 rotate bug fixed --- AndroidManifest.xml | 5 ++-- src/com/uberspot/a2048/MainActivity.java | 32 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 032c9e13..b34aa15f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -6,12 +6,13 @@ android:allowBackup="true" android:icon="@drawable/ic_2048" android:label="@string/app_name" - android:theme="@style/AppTheme"> + android:theme="@style/AppTheme" + > + android:screenOrientation="fullSensor"> diff --git a/src/com/uberspot/a2048/MainActivity.java b/src/com/uberspot/a2048/MainActivity.java index 85d42c49..036c732f 100644 --- a/src/com/uberspot/a2048/MainActivity.java +++ b/src/com/uberspot/a2048/MainActivity.java @@ -2,16 +2,23 @@ import android.annotation.SuppressLint; import android.app.Activity; +import android.content.Context; import android.content.SharedPreferences.Editor; import android.content.pm.ActivityInfo; import android.content.res.Configuration; +import android.hardware.SensorManager; +import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; +import android.support.annotation.RequiresApi; import android.util.Log; +import android.view.Display; import android.view.MotionEvent; +import android.view.OrientationEventListener; import android.view.Window; +import android.view.WindowManager; import android.view.WindowManager.LayoutParams; import android.webkit.WebSettings; import android.webkit.WebSettings.RenderPriority; @@ -34,11 +41,36 @@ public class MainActivity extends Activity { private static final long mTouchThreshold = 2000; private Toast pressBackToast; + @RequiresApi(api = Build.VERSION_CODES.M) @SuppressLint({"SetJavaScriptEnabled", "ShowToast", "ClickableViewAccessibility"}) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); +// final WindowManager mWindowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE); +// +// OrientationEventListener orientationEventListener = new OrientationEventListener(this, +// SensorManager.SENSOR_DELAY_NORMAL) { +// @Override +// public void onOrientationChanged(int orientation) { +// if (orientation == ORIENTATION_UNKNOWN) { +// return; +// } +// Display display = mWindowManager.getDefaultDisplay(); +// int rotation = display.getRotation(); +// if (rotation != mLastRotation) { +// // do something with your views +// mLastRotation = rotation; +// } +// } +// }; +// +// if (orientationEventListener.canDetectOrientation()) { +// orientationEventListener.enable(); +// } +// + + // Don't show an action bar or title requestWindowFeature(Window.FEATURE_NO_TITLE);