소스 검색

1.增加style文件
2.增加开机图

FailedToRead 3 년 전
부모
커밋
90ca8eb1f0

BIN
.idea/caches/build_file_checksums.ser


+ 2 - 0
.idea/modules/app/proj.android-studio.efunbox-ott-launcher.iml

@@ -192,6 +192,8 @@
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/debug" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/debug" type="java-resource" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/debug" type="java-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/src" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/src/main/res" type="java-resource" />
       <excludeFolder url="file://$MODULE_DIR$/../../../app/.cxx" />
       <excludeFolder url="file://$MODULE_DIR$/../../../app/.externalNativeBuild" />
       <excludeFolder url="file://$MODULE_DIR$/../../../app/.gradle" />

+ 3 - 3
app/AndroidManifest.xml

@@ -8,12 +8,12 @@
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
+    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
 
     <application
             android:name="org.cocos2dx.javascript.application.EApplication"
             android:allowBackup="true"
-            android:icon="@mipmap/ic_launcher"
+            android:icon="@drawable/icon"
             android:label="@string/app_name"
             android:usesCleartextTraffic="true">
         <!-- Tell Cocos2dxActivity the name of our .so -->
@@ -28,7 +28,7 @@
                 android:launchMode="singleTask"
                 android:screenOrientation="sensorLandscape"
                 android:taskAffinity=""
-                android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
+                android:theme="@style/AppStartTheme">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

+ 2 - 2
app/build.gradle

@@ -10,8 +10,8 @@ android {
         applicationId "com.edufound.ott.launcher"
         minSdkVersion PROP_MIN_SDK_VERSION
         targetSdkVersion PROP_TARGET_SDK_VERSION
-        versionCode 1
-        versionName "1.0"
+        versionCode 91000
+        versionName "9.1"
 
         externalNativeBuild {
             ndkBuild {

+ 24 - 0
app/src/main/res/values/styles.xml

@@ -0,0 +1,24 @@
+<resources xmlns:tools="http://schemas.android.com/tools">
+
+
+    <!-- Activity无标题栏+全屏 开始-->
+    <style name="NoTitle" parent="@android:style/Theme.NoTitleBar.Fullscreen">
+        <item name="android:windowNoTitle">true</item>
+        <!-- 兼容API 7-->
+        <item name="android:windowActionBar">false</item>
+        <!-- Activity全屏 开始-->
+        <item name="android:windowFullscreen">true</item>
+        <!--        <item name="android:windowBackground">@color/black</item>-->
+    </style>
+
+    <style name="AppStartTheme" parent="NoTitle">
+        <!-- <item name="android:windowIsTranslucent">true</item>-->
+        <!-- 兼容API 7-->
+        <item name="android:background">@android:color/transparent</item>
+        <item name="android:windowActionBar">false</item>
+        <item name="android:windowBackground">@drawable/openimg</item>
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:windowFullscreen">true</item>
+    </style>
+
+</resources>

+ 32 - 29
game/AndroidManifest.xml

@@ -1,31 +1,32 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:dist="http://schemas.android.com/apk/distribution"
-    xmlns:tools="http://schemas.android.com/tools"
-    package="org.cocos2dx.javascript">
+        xmlns:dist="http://schemas.android.com/apk/distribution"
+        xmlns:tools="http://schemas.android.com/tools"
+        package="org.cocos2dx.javascript">
+
     <dist:module dist:instant="true" />
     <application
-        android:allowBackup="true"
-        android:icon="@mipmap/ic_launcher"
-        android:label="@string/app_name"
-        android:roundIcon="@mipmap/ic_launcher"
-        android:usesCleartextTraffic="true"
-        android:supportsRtl="true">
+            android:allowBackup="true"
+            android:icon="@drawable/icon"
+            android:label="@string/app_name"
+            android:supportsRtl="true"
+            android:usesCleartextTraffic="true">
         <meta-data
-            android:name="aia-compat-api-min-version"
-            android:value="1" />
+                android:name="aia-compat-api-min-version"
+                android:value="1" />
 
-        <meta-data android:name="android.app.lib_name"
-            android:value="cocos2djs" />
+        <meta-data
+                android:name="android.app.lib_name"
+                android:value="cocos2djs" />
 
         <activity
-            android:name="org.cocos2dx.javascript.AppActivity"
-            android:screenOrientation="sensorLandscape"
-            android:configChanges="orientation|keyboardHidden|screenSize|screenLayout"
-            android:label="@string/app_name"
-            android:launchMode="singleTask"
-            android:taskAffinity=""
-            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
+                android:name="org.cocos2dx.javascript.AppActivity"
+                android:configChanges="orientation|keyboardHidden|screenSize|screenLayout"
+                android:label="@string/app_name"
+                android:launchMode="singleTask"
+                android:screenOrientation="sensorLandscape"
+                android:taskAffinity=""
+                android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
 
             <intent-filter android:order="1">
                 <action android:name="android.intent.action.VIEW" />
@@ -41,15 +42,17 @@
     </application>
 
     <uses-feature android:glEsVersion="0x00020000" />
-    <uses-permission android:name="android.permission.INTERNET"/>
-    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
-    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
-    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.RESTART_PACKAGES" />
-    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
-        tools:ignore="ProtectedPermissions" />
+    <uses-permission
+            android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
+            tools:ignore="ProtectedPermissions" />
     <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
 </manifest>

BIN
res/drawable/icon.png


BIN
res/drawable/openimg.jpg


+ 1 - 1
res/values/strings.xml

@@ -1,3 +1,3 @@
 <resources>
-    <string name="app_name" translatable="false">efunbox-ott-launcher</string>
+    <string name="app_name" translatable="false">义方快乐学堂</string>
 </resources>

+ 29 - 1
src/org/cocos2dx/javascript/AppActivity.java

@@ -25,22 +25,30 @@
 package org.cocos2dx.javascript;
 
 import org.cocos2dx.javascript.presenter.MainPresenter;
-import org.cocos2dx.javascript.util.Logger;
 import org.cocos2dx.lib.Cocos2dxActivity;
 import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
 
+import android.annotation.SuppressLint;
 import android.graphics.PixelFormat;
 import android.os.Bundle;
 
 import android.content.Intent;
 import android.content.res.Configuration;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+
+import com.edufound.ott.launcher.R;
 
 public class AppActivity extends Cocos2dxActivity {
 
     MainPresenter mPresenter;
+    ImageView mSplashImage;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
+        setTheme(android.R.style.Theme_Black_NoTitleBar_Fullscreen);
         super.onCreate(savedInstanceState);
         // Workaround in
         // https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508
@@ -52,11 +60,31 @@ public class AppActivity extends Cocos2dxActivity {
             return;
         }
         // DO OTHER INITIALIZATION BELOW
+
         SDKWrapper.getInstance().init(this);
+        showSplash();
         mPresenter = new MainPresenter(this);
 
     }
 
+    @SuppressLint("ResourceType")
+    public void showSplash() {
+        mSplashImage = new ImageView(this);
+        mSplashImage.setImageDrawable(getResources().getDrawable(R.drawable.openimg));
+        mSplashImage.setScaleType(ImageView.ScaleType.FIT_XY);
+        addContentView(mSplashImage,
+                new WindowManager.LayoutParams(
+                        FrameLayout.LayoutParams.MATCH_PARENT,
+                        FrameLayout.LayoutParams.MATCH_PARENT
+                )
+        );
+    }
+
+    public void removeSplashImage() {
+        mSplashImage.setVisibility(View.GONE);
+    }
+
+
     @Override
     public Cocos2dxGLSurfaceView onCreateView() {
         Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);

+ 13 - 0
src/org/cocos2dx/javascript/presenter/MainPresenter.java

@@ -7,6 +7,7 @@ import com.google.gson.Gson;
 
 import org.cocos2dx.javascript.AppActivity;
 import org.cocos2dx.javascript.util.DeviceUtil;
+import org.cocos2dx.javascript.util.Logger;
 import org.cocos2dx.javascript.util.PackageUtil;
 
 public class MainPresenter {
@@ -19,6 +20,8 @@ public class MainPresenter {
         mActivity = activity;
         mGson = new Gson();
         mDeviceUtil = new DeviceUtil();
+        Logger.e("getWidth:" + mDeviceUtil.getWidth(mActivity));
+        Logger.e("getHeight:" + mDeviceUtil.getHeight(mActivity));
         mPackageUtil = new PackageUtil(activity);
     }
 
@@ -56,4 +59,14 @@ public class MainPresenter {
     }
 
 
+    public static void hideSplashImage() {
+        mActivity.runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                mActivity.removeSplashImage();
+            }
+        });
+
+    }
+
 }