浏览代码

添加demo资源内容

trevorHsu 3 年之前
父节点
当前提交
adf17c6bc7

+ 17 - 2
demo/src/main/AndroidManifest.xml

@@ -1,13 +1,28 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     package="com.yyxx.commsdk.demo">
 
     <application
         android:allowBackup="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
-        android:roundIcon="@mipmap/ic_launcher_round"
         android:supportsRtl="true"
-        android:theme="@style/Theme.YYXXCommSdk" />
+       >
+
+
+    <activity
+        android:name="com.yyxx.commsdk.demo.DemoActivity"
+        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
+        android:exported="true"
+        android:launchMode="singleTask"
+        android:screenOrientation="sensorLandscape">
+        <intent-filter>
+            <action android:name="android.intent.action.MAIN" />
+            <category android:name="android.intent.category.LAUNCHER" />
+        </intent-filter>
+    </activity>
+
+    </application>
 
 </manifest>

二进制
demo/src/main/res/drawable-xhdpi/qsgame_welcome.png


二进制
demo/src/main/res/mipmap-xhdpi/ic_launcher.png


+ 10 - 0
demo/src/main/res/values/colors.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="purple_200">#FFBB86FC</color>
+    <color name="purple_500">#FF6200EE</color>
+    <color name="purple_700">#FF3700B3</color>
+    <color name="teal_200">#FF03DAC5</color>
+    <color name="teal_700">#FF018786</color>
+    <color name="black">#FF000000</color>
+    <color name="white">#FFFFFFFF</color>
+</resources>

+ 3 - 0
demo/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">融合通用SDK</string>
+</resources>

+ 5 - 0
demo/src/main/res/values/styles.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="android:Theme.Light.NoTitleBar.Fullscreen" />
+</resources>

+ 21 - 0
library_base/src/main/java/cn/yyxx/commsdk/YYXXApplication.java

@@ -0,0 +1,21 @@
+package cn.yyxx.commsdk;
+
+import android.app.Application;
+import android.content.Context;
+
+import cn.yyxx.commsdk.base.YYXXCommSdk;
+
+public class YYXXApplication extends Application {
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        YYXXCommSdk.getInstance().initApplication(this);
+    }
+
+    @Override
+    protected void attachBaseContext(Context base) {
+        super.attachBaseContext(base);
+        YYXXCommSdk.getInstance().attachBaseContext(this,base);
+    }
+
+}

+ 20 - 0
library_base/src/main/java/cn/yyxx/commsdk/base/YYXXCommSdk.java

@@ -4,6 +4,7 @@ import android.app.Activity;
 import android.app.Application;
 import android.content.Context;
 import android.content.Intent;
+import android.content.res.Configuration;
 import android.os.Build;
 import android.text.TextUtils;
 import android.webkit.WebView;
@@ -404,6 +405,25 @@ public final class YYXXCommSdk {
                 new Object[]{activity, permissions, callback});
     }
 
+
+
+    public void onConfigurationChanged(Configuration newConfigs) {
+        if (checkSdkBridgeNull(Function.ON_CONFIGURATION_CHANGED, null)) {
+            return;
+        }
+        SdkBridgeManager.call(Function.ON_CONFIGURATION_CHANGED, new Class[]{Intent.class}, new Object[]{newConfigs});
+    }
+
+
+    public void onRequestPermissionsResult(int requestCode,String[] permissions,int[] grantResults){
+        if (checkSdkBridgeNull(Function.ON_REQUEST_PERMISSIONS_RESULT, null)) {
+            return;
+        }
+
+        SdkBridgeManager.call(Function.ON_REQUEST_PERMISSIONS_RESULT, new Class[]{int.class,String[].class,int[].class}, new Object[]{requestCode,permissions,grantResults});
+    }
+
+
     public String getCurrentOpenId() {
         if (checkSdkBridgeNull(Function.GET_CURRENT_USER_ID, null)) {
             return "";