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
This commit is contained in:
committed by
Facebook Github Bot
parent
2199a7908d
commit
fbd692c449
@@ -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);
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user