Showing the changes to android/apps/interface/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java (1 of 4 files). Show all
Unified · Split
| @@ -24,6 +24,7 @@ import android.net.Uri; · 23 unmodified lines | |||
| 24 | import android.os.Build; | 24 | import android.os.Build; |
| 25 | import android.os.Bundle; | 25 | import android.os.Bundle; |
| 26 | import android.os.Vibrator; | 26 | import android.os.Vibrator; |
| 27 | import android.text.TextUtils; | ||
| 27 | import android.util.Log; | 28 | import android.util.Log; |
| 28 | import android.view.LayoutInflater; | 29 | import android.view.LayoutInflater; |
| 29 | import android.view.View; | 30 | import android.view.View; |
| @@ -53,6 +54,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW · 23 unmodified lines | |||
| 53 | public static final String DOMAIN_URL = "url"; | 54 | public static final String DOMAIN_URL = "url"; |
| 54 | public static final String EXTRA_GOTO_USERNAME = "gotousername"; | 55 | public static final String EXTRA_GOTO_USERNAME = "gotousername"; |
| 55 | private static final String TAG = "Interface"; | 56 | private static final String TAG = "Interface"; |
| 57 | public static final String EXTRA_ARGS = "args"; | ||
| 56 | private static final int WEB_DRAWER_RIGHT_MARGIN = 262; | 58 | private static final int WEB_DRAWER_RIGHT_MARGIN = 262; |
| 57 | private static final int WEB_DRAWER_BOTTOM_MARGIN = 150; | 59 | private static final int WEB_DRAWER_BOTTOM_MARGIN = 150; |
| 58 | private static final int NORMAL_DPI = 160; | 60 | private static final int NORMAL_DPI = 160; |
| @@ -77,6 +79,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW · 18 unmodified lines | |||
| 77 | 79 | ||
| 78 | private boolean nativeEnterBackgroundCallEnqueued = false; | 80 | private boolean nativeEnterBackgroundCallEnqueued = false; |
| 79 | private SlidingDrawer mWebSlidingDrawer; | 81 | private SlidingDrawer mWebSlidingDrawer; |
| 82 | private boolean mStartInDomain; | ||
| 80 | // private GvrApi gvrApi; | 83 | // private GvrApi gvrApi; |
| 81 | // Opaque native pointer to the Application C++ object. | 84 | // Opaque native pointer to the Application C++ object. |
| 82 | // This object is owned by the InterfaceActivity instance and passed to the native methods. | 85 | // This object is owned by the InterfaceActivity instance and passed to the native methods. |
| @@ -92,8 +95,14 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW · 9 unmodified lines | |||
| 92 | public void onCreate(Bundle savedInstanceState) { | 95 | public void onCreate(Bundle savedInstanceState) { |
| 93 | super.isLoading = true; | 96 | super.isLoading = true; |
| 94 | Intent intent = getIntent(); | 97 | Intent intent = getIntent(); |
| 95 | if (intent.hasExtra(DOMAIN_URL) && !intent.getStringExtra(DOMAIN_URL).isEmpty()) { | 98 | if (intent.hasExtra(DOMAIN_URL) && !TextUtils.isEmpty(intent.getStringExtra(DOMAIN_URL))) { |
| 96 | intent.putExtra("applicationArguments", "--url " + intent.getStringExtra(DOMAIN_URL)); | 99 | intent.putExtra("applicationArguments", "--url " + intent.getStringExtra(DOMAIN_URL)); |
| 100 | } else if (intent.hasExtra(EXTRA_ARGS)) { | ||
| 101 | String args = intent.getStringExtra(EXTRA_ARGS); | ||
| 102 | if (!TextUtils.isEmpty(args)) { | ||
| 103 | mStartInDomain = true; | ||
| 104 | intent.putExtra("applicationArguments", args); | ||
| 105 | } | ||
| 97 | } | 106 | } |
| 98 | super.onCreate(savedInstanceState); | 107 | super.onCreate(savedInstanceState); |
| 99 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | 108 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); |
| @@ -124,7 +133,10 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW · 24 unmodified lines | |||
| 124 | getActionBar().hide(); | 133 | getActionBar().hide(); |
| 125 | } | 134 | } |
| 126 | }); | 135 | }); |
| 127 | startActivity(new Intent(this, SplashActivity.class)); | 136 | Intent splashIntent = new Intent(this, SplashActivity.class); |
| 137 | splashIntent.putExtra(SplashActivity.EXTRA_START_IN_DOMAIN, mStartInDomain); | ||
| 138 | startActivity(splashIntent); | ||
| 139 | |||
| 128 | mVibrator = (Vibrator) this.getSystemService(VIBRATOR_SERVICE); | 140 | mVibrator = (Vibrator) this.getSystemService(VIBRATOR_SERVICE); |
| 129 | headsetStateReceiver = new HeadsetStateReceiver(); | 141 | headsetStateReceiver = new HeadsetStateReceiver(); |
| 130 | } | 142 | } |