1414 * Email:crazycodeboy@gmail.com
1515 */
1616public class SplashScreen {
17- private static int NULL_ID = 0 ;
1817 private static Dialog mSplashDialog ;
1918 private static WeakReference <Activity > mActivity ;
2019
2120 /**
2221 * 打开启动屏
2322 */
24- public static void show (final Activity activity , final boolean fullScreen , final int themeResId ) {
23+ public static void show (final Activity activity , final int themeResId ) {
2524 if (activity == null ) return ;
2625 mActivity = new WeakReference <Activity >(activity );
2726 activity .runOnUiThread (new Runnable () {
2827 @ Override
2928 public void run () {
3029 if (!activity .isFinishing ()) {
31-
32- mSplashDialog = new Dialog (
33- activity ,
34- themeResId != NULL_ID ? themeResId
35- : fullScreen ? R .style .SplashScreen_Fullscreen
36- : R .style .SplashScreen_SplashTheme
37- );
30+ mSplashDialog = new Dialog (activity , themeResId );
3831 mSplashDialog .setContentView (R .layout .launch_screen );
3932 mSplashDialog .setCancelable (false );
4033
@@ -50,7 +43,9 @@ public void run() {
5043 * 打开启动屏
5144 */
5245 public static void show (final Activity activity , final boolean fullScreen ) {
53- show (activity , fullScreen , 0 );
46+ int resourceId = fullScreen ? R .style .SplashScreen_Fullscreen : R .style .SplashScreen_SplashTheme ;
47+
48+ show (activity , resourceId );
5449 }
5550
5651 /**
0 commit comments