liuzhenxing1118 il y a 8 mois
Parent
commit
edb7cd65be

+ 1 - 0
app/build.gradle

@@ -57,6 +57,7 @@ dependencies {
     implementation(fileTree("libs"))
     implementation 'com.makeramen:roundedimageview:2.3.0'
     implementation 'com.google.code.gson:gson:2.8.0'
+    implementation 'com.makeramen:roundedimageview:2.3.0'
 
     //implementation 'io.github.juphoon-app:jcsdk:x.y.z'
 }

+ 8 - 2
app/src/main/AndroidManifest.xml

@@ -19,8 +19,14 @@
     <uses-permission android:name="android.permission.BLUETOOTH" />
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
 
+    <uses-permission android:name="com.xplora.provider" />
+    <queries>
+        <package android:name="com.sikey.WatchContactProvider" />
+        <package android:name="com.sikey.WatchChatProvider" />
+    </queries>
 
     <application
+        android:name=".VideoApplication"
         android:allowBackup="true"
         android:dataExtractionRules="@xml/data_extraction_rules"
         android:fullBackupContent="@xml/backup_rules"
@@ -34,10 +40,10 @@
             android:name=".activity.MainActivity"
             android:exported="true"
             android:configChanges="keyboardHidden|orientation|screenSize"
-            android:launchMode="singleInstance">
+            >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
+<!--                <category android:name="android.intent.category.LAUNCHER" />-->
             </intent-filter>
         </activity>
 

+ 1 - 0
app/src/main/java/com/xplora/xpvideo/activity/MainActivity.java

@@ -361,6 +361,7 @@ public class MainActivity extends Activity implements Listener.VideoListener {
         Log.d(TAG, "onDestroy: ");
         super.onDestroy();
         removeCanvas();
+        mVideoManager.clear();
         mVideoManager = null;
         mMediaPlayerUtils = null;
     }

+ 1 - 0
app/src/main/java/com/xplora/xpvideo/manager/DatabaseUtils.java

@@ -22,6 +22,7 @@ public class DatabaseUtils {
 
     @SuppressLint("Range")
     public ContactBean loadContact(String userId) {
+        Log.d(TAG, "loadContact: ");
         if (Macros.DEBUG) {
             ContactBean bean = new ContactBean();
             bean.userId = userId;

+ 6 - 4
app/src/main/java/com/xplora/xpvideo/manager/VideoManager.java

@@ -152,10 +152,6 @@ public class VideoManager implements JCClientCallback, JCCallCallback, JCMediaDe
         // 销毁远端视频画面
         item.stopOtherVideo();
 
-        JCMediaDevice.destroy();
-        JCCall.destroy();
-        JCClient.destroy();
-
         if (mVideoListener != null) {
             mVideoListener.onCallItemRemove();
         }
@@ -233,4 +229,10 @@ public class VideoManager implements JCClientCallback, JCCallCallback, JCMediaDe
     public void onNeedKeyFrame() {
 
     }
+
+    public void clear() {
+        JCMediaDevice.destroy();
+        JCCall.destroy();
+        JCClient.destroy();
+    }
 }

+ 1 - 1
app/src/main/java/com/xplora/xpvideo/utils/Macros.java

@@ -1,5 +1,5 @@
 package com.xplora.xpvideo.utils;
 
 public class Macros {
-    public static boolean DEBUG = true;
+    public static boolean DEBUG = false;
 }

+ 6 - 2
app/src/main/res/layout/activity_main.xml

@@ -3,6 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="#000000"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     >
 
     <RelativeLayout
@@ -39,12 +40,15 @@
             android:layout_height="wrap_content"
             android:layout_marginTop="30dp"
             >
-            <ImageView
+            <com.makeramen.roundedimageview.RoundedImageView
                 android:id="@+id/iconIv"
                 android:layout_width="30dp"
                 android:layout_height="30dp"
                 android:layout_marginStart="10dp"
-                android:background="@drawable/default_avatar"
+                app:riv_oval="true"
+                app:riv_corner_radius="15dp"
+                android:scaleType="centerCrop"
+                android:src="@drawable/default_avatar"
                 />
             <TextView
                 android:id="@+id/nameTv"