From fbd692c449e5ae7db6b50b4f0fd4debe47251d44 Mon Sep 17 00:00:00 2001 From: Robert Spencer Date: Thu, 16 Feb 2017 02:40:58 -0800 Subject: [PATCH] Remove splash screen activity from sample app Summary: The yoga splash screen that runs at the beginning of the app is unnecessary and can be removed for simplicty. Reviewed By: emilsjolander Differential Revision: D4571624 fbshipit-source-id: 3eb12f7c3447805f4546bd192df9670c5427572a --- android/sample/AndroidManifest.xml | 9 +--- .../facebook/samples/yoga/MainActivity.java | 2 + .../samples/yoga/SplashScreenActivity.java | 50 ------------------- android/sample/res/layout/splash_layout.xml | 27 ---------- android/sample/res/values/styles.xml | 7 --- 5 files changed, 4 insertions(+), 91 deletions(-) delete mode 100644 android/sample/java/com/facebook/samples/yoga/SplashScreenActivity.java delete mode 100644 android/sample/res/layout/splash_layout.xml diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml index 7e3c5284..33761d78 100644 --- a/android/sample/AndroidManifest.xml +++ b/android/sample/AndroidManifest.xml @@ -30,21 +30,16 @@ > - - + diff --git a/android/sample/java/com/facebook/samples/yoga/MainActivity.java b/android/sample/java/com/facebook/samples/yoga/MainActivity.java index 2c61f3a4..52649a1a 100644 --- a/android/sample/java/com/facebook/samples/yoga/MainActivity.java +++ b/android/sample/java/com/facebook/samples/yoga/MainActivity.java @@ -13,6 +13,7 @@ import android.support.v7.app.ActionBarActivity; import android.view.LayoutInflater; import com.facebook.samples.yoga.R; +import com.facebook.soloader.SoLoader; import com.facebook.yoga.android.YogaViewLayoutFactory; /** @@ -26,6 +27,7 @@ public class MainActivity extends ActionBarActivity { public void onCreate(Bundle savedInstanceState) { LayoutInflater.from(this).setFactory(YogaViewLayoutFactory.getInstance()); super.onCreate(savedInstanceState); + SoLoader.init(this, false); setContentView(R.layout.main_layout); } diff --git a/android/sample/java/com/facebook/samples/yoga/SplashScreenActivity.java b/android/sample/java/com/facebook/samples/yoga/SplashScreenActivity.java deleted file mode 100644 index 6905d687..00000000 --- a/android/sample/java/com/facebook/samples/yoga/SplashScreenActivity.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the license found in the - * LICENSE-examples file in the root directory of this source tree. - */ - -package com.facebook.samples.yoga; - -import android.content.Intent; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.support.v7.app.ActionBarActivity; -import android.view.LayoutInflater; - -import com.facebook.samples.yoga.R; -import com.facebook.soloader.SoLoader; -import com.facebook.yoga.android.YogaViewLayoutFactory; - -/** - * A (non-interactive) splash screen. Displays for two seconds before calling the main activity. - */ -public class SplashScreenActivity extends ActionBarActivity { - - @Override - public void onCreate(Bundle savedInstanceState) { - LayoutInflater.from(this).setFactory(YogaViewLayoutFactory.getInstance()); - super.onCreate(savedInstanceState); - SoLoader.init(this, false); - - setContentView(R.layout.splash_layout); - - new Handler(Looper.getMainLooper()).postDelayed( - new Runnable() { - @Override - public void run() { - startMainActivity(); - } - }, - 2000); - } - - private void startMainActivity() { - Intent intent = new Intent(this, MainActivity.class); - startActivity(intent); - this.finish(); - } -} diff --git a/android/sample/res/layout/splash_layout.xml b/android/sample/res/layout/splash_layout.xml deleted file mode 100644 index 051276ca..00000000 --- a/android/sample/res/layout/splash_layout.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/android/sample/res/values/styles.xml b/android/sample/res/values/styles.xml index 0276b8df..fc129ba8 100644 --- a/android/sample/res/values/styles.xml +++ b/android/sample/res/values/styles.xml @@ -20,11 +20,4 @@ - -