Android - Workaround for Joystick disappearing problem in Adreno devices + No excessive rotation in loading moment

This commit is contained in:
Cristian Luis Duarte 2018-04-25 20:13:04 -03:00
parent 52ef935acb
commit 751f8f59d7
5 changed files with 13 additions and 5 deletions

View file

@ -54,7 +54,6 @@
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name=".InterfaceActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:launchMode="singleTop"
>
@ -79,6 +78,7 @@
<activity
android:name=".SplashActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Translucent.NoActionBar" />
</application>

View file

@ -127,6 +127,9 @@ public class InterfaceActivity extends QtActivity {
@Override
protected void onStart() {
super.onStart();
if (!isLoading) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
// TODO Fix displayPlugin deactivate so it doesn't leave us with a black screen Interface
//nativeEnterForeground();
}

View file

@ -3,6 +3,7 @@ package io.highfidelity.hifiinterface;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashActivity extends Activity {
@ -26,7 +27,10 @@ public class SplashActivity extends Activity {
}
public void onAppLoadedComplete() {
startActivity(new Intent(this, HomeActivity.class));
finish();
// Give interface more time so textures don't fail(got deleted) on Adreno (joystick)
new Handler(getMainLooper()).postDelayed(() -> {
startActivity(new Intent(this, HomeActivity.class));
new Handler(getMainLooper()).postDelayed(() -> SplashActivity.this.finish(), 1000);
}, 500);
}
}

View file

@ -19,7 +19,8 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimaryDark"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
android:elevation="4dp"
/>
<include layout="@layout/content_home" />

View file

@ -5,7 +5,7 @@
android:id="@+id/root_activity_splash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
android:background="@color/backgroundLight">
<!-- TODO -->