diff --git a/android/app/src/main/assets/hifi_domains.json b/android/app/src/main/assets/hifi_domains.json index 216b24e639..a63ef7b6aa 100644 --- a/android/app/src/main/assets/hifi_domains.json +++ b/android/app/src/main/assets/hifi_domains.json @@ -1,7 +1,7 @@ { "hifi_domains" : [ { - "name": "You last location", + "name": "Your last location", "url": "", "thumbnail": "" }, diff --git a/android/app/src/main/java/io/highfidelity/hifiinterface/HomeActivity.java b/android/app/src/main/java/io/highfidelity/hifiinterface/HomeActivity.java index 14dec0ea74..aa68818b05 100644 --- a/android/app/src/main/java/io/highfidelity/hifiinterface/HomeActivity.java +++ b/android/app/src/main/java/io/highfidelity/hifiinterface/HomeActivity.java @@ -59,7 +59,7 @@ public class HomeActivity extends AppCompatActivity implements NavigationView.On mNavigationView = (NavigationView) findViewById(R.id.nav_view); mNavigationView.setNavigationItemSelectedListener(this); - TabHost tabs=(TabHost)findViewById(R.id.tabhost); + TabHost tabs = (TabHost)findViewById(R.id.tabhost); tabs.setup(); TabHost.TabSpec spec=tabs.newTabSpec("featured"); @@ -67,12 +67,12 @@ public class HomeActivity extends AppCompatActivity implements NavigationView.On spec.setIndicator(getString(R.string.featured)); tabs.addTab(spec); - spec=tabs.newTabSpec("popular"); + spec = tabs.newTabSpec("popular"); spec.setContent(R.id.popular); spec.setIndicator(getString(R.string.popular)); tabs.addTab(spec); - spec=tabs.newTabSpec("bookmarks"); + spec = tabs.newTabSpec("bookmarks"); spec.setContent(R.id.bookmarks); spec.setIndicator(getString(R.string.bookmarks)); tabs.addTab(spec); @@ -80,7 +80,7 @@ public class HomeActivity extends AppCompatActivity implements NavigationView.On tabs.setCurrentTab(0); TabWidget tabwidget=tabs.getTabWidget(); - for(int i=0;i #include #include -#include class AndroidHelper : public QObject { Q_OBJECT diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2703453f72..f496f68c35 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -7866,71 +7866,29 @@ void Application::saveNextPhysicsStats(QString filename) { void Application::openAndroidActivity(const QString& activityName) { #if defined(Q_OS_ANDROID) - qDebug() << "[Background-HIFI] Application::openAndroidActivity"; - //getActiveDisplayPlugin()->deactivate(); AndroidHelper::instance().requestActivity(activityName); - connect(&AndroidHelper::instance(), &AndroidHelper::backFromAndroidActivity, this, &Application::restoreAfterAndroidActivity); -#endif -} - -void Application::restoreAfterAndroidActivity() { -#if defined(Q_OS_ANDROID) - qDebug() << "[Background-HIFI] restoreAfterAndroidActivity: this wouldn't be needed"; - - /*if (!getActiveDisplayPlugin() || !getActiveDisplayPlugin()->activate()) { - qWarning() << "Could not re-activate display plugin"; - }*/ - disconnect(&AndroidHelper::instance(), &AndroidHelper::backFromAndroidActivity, this, &Application::restoreAfterAndroidActivity); #endif } #if defined(Q_OS_ANDROID) void Application::enterBackground() { - qDebug() << "[Background-HIFI] enterBackground begin"; QMetaObject::invokeMethod(DependencyManager::get().data(), "stop", Qt::BlockingQueuedConnection); - qDebug() << "[Background-HIFI] deactivating display plugin"; getActiveDisplayPlugin()->deactivate(); - qDebug() << "[Background-HIFI] enterBackground end"; } void Application::enterForeground() { - qDebug() << "[Background-HIFI] enterForeground qApp?" << (qApp?"yeah":"false"); if (qApp && DependencyManager::isSet()) { - qDebug() << "[Background-HIFI] audioclient.start()"; QMetaObject::invokeMethod(DependencyManager::get().data(), "start", Qt::BlockingQueuedConnection); } else { - qDebug() << "[Background-HIFI] audioclient.start() not done"; + qDebug() << "Could not start AudioClient"; } if (!getActiveDisplayPlugin() || !getActiveDisplayPlugin()->activate()) { - qWarning() << "[Background-HIFI] Could not re-activate display plugin"; + qWarning() << "Could not re-activate display plugin"; } } - -extern "C" { - - -JNIEXPORT void -Java_io_highfidelity_hifiinterface_InterfaceActivity_nativeEnterBackground(JNIEnv *env, jobject obj) { - qDebug() << "[Background-HIFI] nativeEnterBackground"; - if (qApp) { - qDebug() << "[Background-HIFI] nativeEnterBackground begin (qApp)"; - qApp->enterBackground(); - } -} - -JNIEXPORT void -Java_io_highfidelity_hifiinterface_InterfaceActivity_nativeEnterForeground(JNIEnv *env, jobject obj) { - qDebug() << "[Background-HIFI] nativeEnterForeground"; - if (qApp) { - qDebug() << "[Background-HIFI] nativeEnterForeground begin (qApp)"; - qApp->enterForeground(); - } -} - - -} +#include "Application_jni.cpp" #endif diff --git a/interface/src/Application.h b/interface/src/Application.h index ec49aa055f..568cce2ab6 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -459,8 +459,6 @@ private slots: void handleSandboxStatus(QNetworkReply* reply); void switchDisplayMode(); - void restoreAfterAndroidActivity(); - private: static void initDisplay(); void init(); diff --git a/interface/src/Application_jni.cpp b/interface/src/Application_jni.cpp new file mode 100644 index 0000000000..83641ad8c6 --- /dev/null +++ b/interface/src/Application_jni.cpp @@ -0,0 +1,18 @@ +extern "C" { + +JNIEXPORT void +Java_io_highfidelity_hifiinterface_InterfaceActivity_nativeEnterBackground(JNIEnv *env, jobject obj) { + if (qApp) { + qApp->enterBackground(); + } +} + +JNIEXPORT void +Java_io_highfidelity_hifiinterface_InterfaceActivity_nativeEnterForeground(JNIEnv *env, jobject obj) { + if (qApp) { + qApp->enterForeground(); + } +} + + +} diff --git a/interface/src/java/io/highfidelity/interface/InterfaceActivity.java b/interface/src/java/io/highfidelity/interface/InterfaceActivity.java index c7cbdd3dff..ae10c320f8 100644 --- a/interface/src/java/io/highfidelity/interface/InterfaceActivity.java +++ b/interface/src/java/io/highfidelity/interface/InterfaceActivity.java @@ -15,7 +15,6 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.WindowManager; -import android.util.Log; import org.qtproject.qt5.android.bindings.QtActivity; public class InterfaceActivity extends QtActivity { diff --git a/scripts/system/+android/actionbar.js b/scripts/system/+android/actionbar.js index 7e1b27720e..1f0872d5ee 100644 --- a/scripts/system/+android/actionbar.js +++ b/scripts/system/+android/actionbar.js @@ -38,11 +38,11 @@ function init() { } function onBackPressed() { - App.openAndroidActivity("Goto"); + App.openAndroidActivity("Home"); } -Script.scriptEnding.connect(function () { +Script.scriptEnding.connect(function() { if(backButton) { backButton.clicked.disconnect(onBackPressed); } diff --git a/scripts/system/+android/bottombar.js b/scripts/system/+android/bottombar.js index a254c87859..526cd128e5 100644 --- a/scripts/system/+android/bottombar.js +++ b/scripts/system/+android/bottombar.js @@ -248,12 +248,12 @@ function handleLogin() { function onUsernameChanged(username) { if (Account.isLoggedIn()) { - MyAvatar.displayName=username; + MyAvatar.displayName = username; } } function handleLogout() { - MyAvatar.displayName=""; + MyAvatar.displayName = ""; if (loginBtn) { loginBtn.editProperties({text: "LOG IN"}); } diff --git a/scripts/system/+android/goto.js b/scripts/system/+android/goto.js index 540705c673..750844a2a4 100644 --- a/scripts/system/+android/goto.js +++ b/scripts/system/+android/goto.js @@ -34,7 +34,7 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See module.exports.onHidden(); break; case 'openAndroidActivity': - App.openAndroidActivity("Goto"); + App.openAndroidActivity("Home"); break; default: print('[goto-android.js] Unrecognized message from AddressBarDialog.qml:', JSON.stringify(message)); diff --git a/scripts/system/+android/modes.js b/scripts/system/+android/modes.js index 3e855da115..f5b3609c26 100644 --- a/scripts/system/+android/modes.js +++ b/scripts/system/+android/modes.js @@ -39,7 +39,7 @@ function init() { radar.setUniqueColor(uniqueColor); radar.init(); - barQml = new QmlFragment({ + barQml = new QmlFragment({ qml: "hifi/modesbar.qml" }); modeButton = barQml.addButton({