Browse Source

个人中心改版

xiongzhu 7 years ago
parent
commit
9527bc7f95
28 changed files with 453 additions and 224 deletions
  1. 11 8
      app/build.gradle
  2. 10 0
      app/src/main/AndroidManifest.xml
  3. 69 10
      app/src/main/java/com/android/chmo/app/ChmoApplication.java
  4. 13 10
      app/src/main/java/com/android/chmo/app/VChatManager.java
  5. 1 0
      app/src/main/java/com/android/chmo/http/response/VideoPriceRes.java
  6. 12 0
      app/src/main/java/com/android/chmo/http/service/ModelService.java
  7. 6 0
      app/src/main/java/com/android/chmo/http/service/UserService.java
  8. 135 2
      app/src/main/java/com/android/chmo/ui/activity/MainActivity.java
  9. 5 1
      app/src/main/java/com/android/chmo/ui/activity/model/ModelDetailActivity.java
  10. 1 1
      app/src/main/java/com/android/chmo/ui/activity/promote/ShareActivity.java
  11. 23 14
      app/src/main/java/com/android/chmo/ui/fragment/MineFragment.java
  12. 16 17
      app/src/main/java/com/android/chmo/utils/XUtilsImage.java
  13. BIN
      app/src/main/res/drawable-xxhdpi-v4/into_icon_shenqing.png
  14. BIN
      app/src/main/res/drawable-xxhdpi-v4/into_icon_yuyuedingdan.png
  15. 5 0
      app/src/main/res/drawable/bg_btn_promote.xml
  16. 5 0
      app/src/main/res/drawable/bg_mine_promote.xml
  17. 89 114
      app/src/main/res/layout/page_mine.xml
  18. BIN
      app/src/main/res/mipmap-hdpi/into_icon_shenqing.png
  19. BIN
      app/src/main/res/mipmap-hdpi/into_icon_yuyuedingdan.png
  20. BIN
      app/src/main/res/mipmap-xhdpi/into_icon_shenqing.png
  21. BIN
      app/src/main/res/mipmap-xhdpi/into_icon_yuyuedingdan.png
  22. BIN
      app/src/main/res/mipmap-xxxhdpi/into_icon_shenqing.png
  23. BIN
      app/src/main/res/mipmap-xxxhdpi/into_icon_yuyuedingdan.png
  24. 5 0
      app/src/main/res/xml/file_paths.xml
  25. 7 7
      avchatkit/build.gradle
  26. 31 31
      avchatkit/src/main/java/com/netease/nim/avchatkit/activity/AVChatActivity.java
  27. 4 4
      faceunity/build.gradle
  28. 5 5
      uikit/build.gradle

+ 11 - 8
app/build.gradle

@@ -1,14 +1,14 @@
 apply plugin: 'com.android.application'
 
 android {
-    compileSdkVersion 26
+    compileSdkVersion 28
     buildToolsVersion '28.0.3'
     defaultConfig {
         applicationId "com.android.chmo"
         minSdkVersion 14
-        targetSdkVersion 26
-        versionCode 101
-        versionName "1.0.1"
+        targetSdkVersion 28
+        versionCode 106
+        versionName "1.0.6"
         ndk {
             abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
         }
@@ -76,13 +76,14 @@ task copyDownloadableDepsToLibs(type: Copy) {
 
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
-    implementation 'com.android.support:appcompat-v7:26.1.0'
+    implementation 'com.android.support:appcompat-v7:28.0.0'
+    implementation 'com.android.support:design:28.0.0'
     implementation 'com.android.support.constraint:constraint-layout:1.1.3'
     annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
     implementation 'com.jakewharton:butterknife:8.8.1'
     implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.5.1'
     implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.5.1'
-    implementation 'com.google.code.gson:gson:2.2.4'
+    implementation 'com.google.code.gson:gson:2.8.2'
     implementation 'org.xutils:xutils:3.5.0'
     implementation 'com.contrarywind:Android-PickerView:4.1.6'
     implementation 'org.greenrobot:eventbus:3.1.1'
@@ -104,9 +105,11 @@ dependencies {
     implementation 'com.netease.nimlib:avchat:5.4.0'
     implementation project(':avchatkit')
     implementation 'com.github.dmytrodanylyk.shadow-layout:library:1.0.3'
-    implementation 'com.android.support:support-v4:26.1.0'
+    implementation 'com.android.support:support-v4:28.0.0'
     implementation 'com.github.kenglxn.QRGen:android:2.5.0'
-    implementation 'com.android.support:recyclerview-v7:26.1.0'
+    implementation 'com.android.support:recyclerview-v7:28.0.0'
     implementation 'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'
     implementation 'com.google.android:flexbox:1.0.0'
+    implementation 'com.liulishuo.filedownloader:library:1.7.5'
+    implementation 'com.blankj:utilcode:1.10.0'
 }

+ 10 - 0
app/src/main/AndroidManifest.xml

@@ -288,6 +288,16 @@
             android:exported="true"
             android:label="@string/app_name" />
 
+        <provider
+            android:name="android.support.v4.content.FileProvider"
+            android:authorities="com.android.chmo.fileProvider"
+            android:exported="false"
+            android:grantUriPermissions="true">
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/file_paths" />
+        </provider>
+
         <meta-data
             android:name="com.amap.api.v2.apikey"
             android:value="41da1ae28c42ca83d6de30edec201135" />

+ 69 - 10
app/src/main/java/com/android/chmo/app/ChmoApplication.java

@@ -1,7 +1,14 @@
 package com.android.chmo.app;
 
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
 import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
@@ -11,22 +18,35 @@ import android.text.TextUtils;
 
 import com.android.chmo.R;
 import com.android.chmo.base.BaseApplication;
+import com.android.chmo.http.RequestCallback;
+import com.android.chmo.http.response.ModelListRes;
+import com.android.chmo.http.service.ModelService;
+import com.android.chmo.http.service.UserService;
 import com.android.chmo.im.SessionHelper;
 import com.android.chmo.im.location.ChmoLocationProvider;
 import com.android.chmo.mixpush.ChmoMixPushMessageHandler;
 import com.android.chmo.model.LoginUser;
+import com.android.chmo.model.ModelInfo;
 import com.android.chmo.receiver.VChatReceiver;
 import com.android.chmo.ui.activity.WelcomeActivity;
+import com.android.chmo.ui.activity.model.ModelDetailActivity;
 import com.android.chmo.utils.LoginUtils;
 import com.android.chmo.utils.NotifyUtils;
 import com.android.chmo.utils.PixelUtils;
 import com.android.chmo.utils.crash.AppCrashHandler;
+import com.blankj.utilcode.util.AppUtils;
+import com.blankj.utilcode.util.Utils;
+import com.google.gson.Gson;
+import com.liulishuo.filedownloader.BaseDownloadTask;
+import com.liulishuo.filedownloader.FileDownloadListener;
+import com.liulishuo.filedownloader.FileDownloader;
 import com.netease.nim.avchatkit.AVChatKit;
 import com.netease.nim.avchatkit.config.AVChatOptions;
 import com.netease.nim.avchatkit.model.ITeamDataProvider;
 import com.netease.nim.avchatkit.model.IUserInfoProvider;
 import com.netease.nim.uikit.api.NimUIKit;
 import com.netease.nim.uikit.api.UIKitOptions;
+import com.netease.nim.uikit.api.model.session.SessionEventListener;
 import com.netease.nim.uikit.business.team.helper.TeamHelper;
 import com.netease.nim.uikit.business.uinfo.UserInfoHelper;
 import com.netease.nimlib.sdk.NIMClient;
@@ -39,10 +59,15 @@ import com.netease.nimlib.sdk.mixpush.NIMPushClient;
 import com.netease.nimlib.sdk.msg.MsgServiceObserve;
 import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
 import com.netease.nimlib.sdk.msg.model.CustomNotification;
+import com.netease.nimlib.sdk.msg.model.IMMessage;
 import com.netease.nimlib.sdk.uinfo.UserInfoProvider;
 import com.netease.nimlib.sdk.uinfo.model.UserInfo;
 import com.netease.nimlib.sdk.util.NIMUtil;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.File;
 import java.io.IOException;
 
 /**
@@ -51,9 +76,9 @@ import java.io.IOException;
 
 public class ChmoApplication extends BaseApplication {
     private static ChmoApplication app;
-    private LoginUser loginUser;
-    private String code; // 验证码
-    public static boolean isInit;
+    private        LoginUser       loginUser;
+    private        String          code; // 验证码
+    public static  boolean         isInit;
 
     @Override
     public void onCreate() {
@@ -78,13 +103,15 @@ public class ChmoApplication extends BaseApplication {
             initAVChatKit();
         }
 
-        IntentFilter filter = new IntentFilter();
-        filter.addAction("android.chmo.action.CALL");
-        filter.addAction("android.chmo.action.INCOMING");
-        filter.addAction("android.chmo.action.BEGIN_VIDEO");
-        filter.addAction("android.chmo.action.END_VIDEO");
-        VChatReceiver receiver = new VChatReceiver();
-//        registerReceiver(receiver, filter);
+        // IntentFilter filter = new IntentFilter();
+        // filter.addAction("android.chmo.action.CALL");
+        // filter.addAction("android.chmo.action.INCOMING");
+        // filter.addAction("android.chmo.action.BEGIN_VIDEO");
+        // filter.addAction("android.chmo.action.END_VIDEO");
+        // VChatReceiver receiver = new VChatReceiver();
+        // registerReceiver(receiver, filter);
+        FileDownloader.setup(this);
+        Utils.init(this);
     }
 
     public static ChmoApplication getApp() {
@@ -234,6 +261,38 @@ public class ChmoApplication extends BaseApplication {
                 }
             }
         }, true);
+        SessionEventListener listener = new SessionEventListener() {
+            @Override
+            public void onAvatarClicked(Context context, IMMessage message) {
+                ModelService.getModelInfoByMemberPK(message.getSessionId(), new RequestCallback() {
+                    @Override
+                    public void onSuccess(String result) {
+                        ModelListRes res = new Gson().fromJson(result, ModelListRes.class);
+                        if (res.data != null && res.data.size() > 0) {
+                            ModelInfo model = res.data.get(0);
+                            Intent intent = new Intent(context, ModelDetailActivity.class);
+                            intent.putExtra("model", model);
+                            intent.putExtra("modelPk", model.modelpk);
+                            startActivity(intent);
+                            ((Activity) context).overridePendingTransition(R.anim.push_right_in, R.anim.push_left_out);
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(String error) {
+                    }
+                });
+            }
+
+            @Override
+            public void onAvatarLongClicked(Context context, IMMessage message) {
+            }
+
+            @Override
+            public void onAckMsgClicked(Context context, IMMessage message) {
+            }
+        };
+        NimUIKit.setSessionListener(listener);
     }
 
     private UIKitOptions buildUIKitOptions() {

+ 13 - 10
app/src/main/java/com/android/chmo/app/VChatManager.java

@@ -37,14 +37,11 @@ public class VChatManager {
 
     private String videoPk;
 
-    private long beginTime;
-    private long endTime;
-
-    private int duration;
-
-    private Timer timer;
-
+    private long  beginTime;
+    private long  endTime;
+    private int   duration;
     private float vPrice = 10;
+    private Timer timer;
 
 
     private VChatManager() {
@@ -60,12 +57,10 @@ public class VChatManager {
 
     public void showPromptDialog(final Context activity, final float vPrice, final VChatCallback callback) {
         this.vPrice = vPrice;
-
         if (!checkBalance(vPrice)) {
             showBalanceOutDialog(activity);
             return;
         }
-
         String timeMsg = "您的余额只够通话" + getLimitVideoTime(vPrice) + "分钟,请尽快充值吧";
         new ConfirmDialog(activity)
                 .setOutTouchDismiss(false)
@@ -116,6 +111,14 @@ public class VChatManager {
             public void onSuccess(String result) {
                 final VideoPriceRes res = new Gson().fromJson(result, VideoPriceRes.class);
                 if (res.msg.equals("success")) {
+                    if (res.is_a == 0) {
+                        Toast.makeText(activity, "模特当前离线", Toast.LENGTH_SHORT).show();
+                        return;
+                    }
+                    if (res.is_a == 2) {
+                        Toast.makeText(activity, "模特正在通话中,请稍后再试", Toast.LENGTH_SHORT).show();
+                        return;
+                    }
                     VChatManager.getInstance().showPromptDialog(activity, res.vprice, new VChatManager.VChatCallback() {
                         @Override
                         public void startVChat() {
@@ -212,7 +215,7 @@ public class VChatManager {
             timer.cancel();
             timer = null;
         }
-        int times = getLimitVideoTime(this.vPrice) * 60 * 1000;
+        int times = getLimitVideoTime(this.vPrice) * 60 * 1000 - 1000;
         timer = new Timer();
         timer.schedule(new TimerTask() {
             @Override

+ 1 - 0
app/src/main/java/com/android/chmo/http/response/VideoPriceRes.java

@@ -7,4 +7,5 @@ package com.android.chmo.http.response;
 public class VideoPriceRes extends Res {
     public String modelpk;
     public float vprice;
+    public int is_a;
 }

+ 12 - 0
app/src/main/java/com/android/chmo/http/service/ModelService.java

@@ -97,6 +97,18 @@ public class ModelService {
         return HttpApi.GET(params, callback);
     }
 
+    /**
+     * 获取模特信息
+     */
+    public static Callback.Cancelable getModelInfoByMemberPK(String modelMemberPK, RequestCallback callback) {
+        LoginUser user = ChmoApplication.getApp().getLoginUser();
+        RequestParams params = getRequestParams();
+        params.addQueryStringParameter("action", "doModelInfoByPk");
+        params.addQueryStringParameter("modelMemberPK", modelMemberPK);
+        params.addQueryStringParameter("memberpk", user.pk);
+        return HttpApi.GET(params, callback);
+    }
+
 
     public static Callback.Cancelable getModelDetailInfo(String modelPk, RequestCallback callback) {
         RequestParams params = getRequestParams();

+ 6 - 0
app/src/main/java/com/android/chmo/http/service/UserService.java

@@ -161,4 +161,10 @@ public class UserService {
         params.addQueryStringParameter("memberpk", user.pk);
         return HttpApi.GET(params, callback);
     }
+
+    public static Callback.Cancelable checkUpdate(RequestCallback callback) {
+        RequestParams params = getRequestParams();
+        params.addQueryStringParameter("action", "appVersion");
+        return HttpApi.GET(params, callback);
+    }
 }

+ 135 - 2
app/src/main/java/com/android/chmo/ui/activity/MainActivity.java

@@ -1,9 +1,13 @@
 package com.android.chmo.ui.activity;
 
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentPagerAdapter;
@@ -11,7 +15,10 @@ import android.view.View;
 import android.widget.TextView;
 
 import com.android.chmo.R;
+import com.android.chmo.app.ChmoApplication;
 import com.android.chmo.base.BaseActivity;
+import com.android.chmo.http.RequestCallback;
+import com.android.chmo.http.service.UserService;
 import com.android.chmo.ui.fragment.BrokerFragment;
 import com.android.chmo.ui.fragment.FindFragment;
 import com.android.chmo.ui.fragment.HomeFragment;
@@ -19,9 +26,18 @@ import com.android.chmo.ui.fragment.MeFragment;
 import com.android.chmo.ui.fragment.MessageFragment;
 import com.android.chmo.ui.fragment.MineFragment;
 import com.android.chmo.ui.view.NoSlideViewPager;
+import com.blankj.utilcode.util.AppUtils;
+import com.liulishuo.filedownloader.BaseDownloadTask;
+import com.liulishuo.filedownloader.FileDownloadListener;
+import com.liulishuo.filedownloader.FileDownloader;
 import com.netease.nimlib.sdk.NIMClient;
 import com.netease.nimlib.sdk.msg.MsgService;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.File;
+
 import butterknife.BindView;
 import butterknife.OnClick;
 
@@ -55,8 +71,8 @@ public class MainActivity extends BaseActivity {
 
     private View curTab;
 
-    private int curFragment;
-
+    private int     curFragment;
+    private boolean checkAgain;
 
     @Override
     protected int getContentResId() {
@@ -71,12 +87,16 @@ public class MainActivity extends BaseActivity {
         curTab.setSelected(true);
 
         registerObserver(true);
+        checkUpdate();
     }
 
     @Override
     protected void onResume() {
         super.onResume();
         fillUnreadView();
+        if (checkAgain) {
+            checkUpdate();
+        }
     }
 
     @Override
@@ -185,4 +205,117 @@ public class MainActivity extends BaseActivity {
 
         super.onBackPressed();
     }
+
+
+    private void checkUpdate() {
+        UserService.checkUpdate(new RequestCallback() {
+            @Override
+            public void onSuccess(String result) {
+                try {
+                    JSONObject obj = new JSONObject(result);
+                    JSONObject android = obj.getJSONObject("data").getJSONObject("android");
+                    String currentVersion = getVersion();
+                    String latestVersion = android.getString("version");
+                    boolean force = android.getBoolean("force");
+                    String url = android.getString("url");
+                    if (convertVersion(currentVersion) < convertVersion(latestVersion)) {
+                        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT)
+                                .setTitle("提示").setMessage("发现新版本" + latestVersion).setPositiveButton("立即更新", (dialog, which) -> {
+                                    dialog.dismiss();
+                                    downloadUpdate(url);
+                                });
+                        if (!force) {
+                            builder.setNegativeButton("取消", (dialog, which) -> dialog.dismiss());
+                        }
+                        builder.setCancelable(false).show();
+                    }
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            @Override
+            public void onFailure(String error) {
+
+            }
+        });
+    }
+
+    private void downloadUpdate(String url) {
+        final File file = new File(getExternalCacheDir(), "update.apk");
+        final ProgressDialog progressDialog = new ProgressDialog(this, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
+        progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
+        progressDialog.setTitle("正在下载");
+        progressDialog.setProgress(0);
+        progressDialog.setCancelable(false);
+        FileDownloader.getImpl().create(url)
+                .setPath(file.getPath())
+                .setListener(new FileDownloadListener() {
+                    @Override
+                    protected void pending(BaseDownloadTask task, int soFarBytes, int totalBytes) {
+                    }
+
+                    @Override
+                    protected void connected(BaseDownloadTask task, String etag, boolean isContinue, int soFarBytes, int totalBytes) {
+                        progressDialog.show();
+                    }
+
+                    @Override
+                    protected void progress(BaseDownloadTask task, int soFarBytes, int totalBytes) {
+                        progressDialog.setProgress(soFarBytes * 100 / totalBytes);
+                    }
+
+                    @Override
+                    protected void blockComplete(BaseDownloadTask task) {
+                    }
+
+                    @Override
+                    protected void retry(final BaseDownloadTask task, final Throwable ex, final int retryingTimes, final int soFarBytes) {
+                    }
+
+                    @Override
+                    protected void completed(BaseDownloadTask task) {
+                        AppUtils.installApp(file, "com.android.chmo.fileProvider");
+                        progressDialog.dismiss();
+                    }
+
+                    @Override
+                    protected void paused(BaseDownloadTask task, int soFarBytes, int totalBytes) {
+                    }
+
+                    @Override
+                    protected void error(BaseDownloadTask task, Throwable e) {
+                        progressDialog.dismiss();
+                        new AlertDialog.Builder(MainActivity.this, AlertDialog.THEME_DEVICE_DEFAULT_LIGHT)
+                                .setPositiveButton("重试", (dialog, which) -> downloadUpdate(url))
+                                .setTitle("下载失败")
+                                .setCancelable(false)
+                                .show();
+                    }
+
+                    @Override
+                    protected void warn(BaseDownloadTask task) {
+                    }
+                }).start();
+    }
+
+    public String getVersion() {
+        PackageManager manager = this.getPackageManager();
+        try {
+            PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0);
+            return info.versionName;
+        } catch (PackageManager.NameNotFoundException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+    private int convertVersion(String version) {
+        try {
+            return Integer.valueOf(version.replace(".", ""));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return 0;
+    }
 }

+ 5 - 1
app/src/main/java/com/android/chmo/ui/activity/model/ModelDetailActivity.java

@@ -425,10 +425,14 @@ public class ModelDetailActivity extends BaseActivity {
     // 视频
     @OnClick(R.id.sendVideo)
     public void sendVideo() {
-        if (model.is_a != 1) {
+        if (model.is_a == 0) {
             showToast("模特当前离线");
             return;
         }
+        if (model.is_a == 2) {
+            showToast("模特正在通话中,请稍后再试");
+            return;
+        }
         VChatManager.getInstance().startVChat(this, model.memberpk, model.name, model.vprice);
     }
 

+ 1 - 1
app/src/main/java/com/android/chmo/ui/activity/promote/ShareActivity.java

@@ -69,7 +69,7 @@ public class ShareActivity extends BaseActivity implements ShareDialog.OnShareLi
         WXWebpageObject webpageObject = new WXWebpageObject(HttpApi.BASE_URL + "share.jsp?type=1&code=" + ChmoApplication.getApp().getLoginUser().qrcode);
         WXMediaMessage message = new WXMediaMessage();
         message.mediaObject = webpageObject;
-        message.title = "千模";
+        message.title = "千模通告";
         message.description = "模特,网红,空姐,校花,邀您一键视频验证";
         Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
         message.setThumbImage(bmp);

+ 23 - 14
app/src/main/java/com/android/chmo/ui/fragment/MineFragment.java

@@ -1,5 +1,6 @@
 package com.android.chmo.ui.fragment;
 
+import android.app.Dialog;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -19,6 +20,7 @@ import com.android.chmo.ui.activity.me.SettingsActivity;
 import com.android.chmo.ui.activity.order.MyOrderActivity;
 import com.android.chmo.ui.activity.order.VideoOrderActivity;
 import com.android.chmo.ui.activity.promote.PromoteActivity;
+import com.android.chmo.ui.dialog.ConfirmDialog;
 import com.android.chmo.utils.LoginUtils;
 import com.android.chmo.utils.XUtilsImage;
 import com.google.gson.Gson;
@@ -34,7 +36,7 @@ public class MineFragment extends BaseFragment {
     @BindView(R.id.iv_avatar)
     ImageView ivAvatar;
     @BindView(R.id.tv_name)
-    TextView tvName;
+    TextView  tvName;
 
     @Override
     public int getLayoutRes() {
@@ -79,21 +81,12 @@ public class MineFragment extends BaseFragment {
         });
     }
 
-    @OnClick({R.id.ll_no_pay, R.id.ll_doing, R.id.ll_done, R.id.ll_all,
-            R.id.ll_wallet, R.id.ll_video_order, R.id.ll_share, R.id.ll_about,
+    @OnClick({R.id.ll_order, R.id.btn_promote, R.id.ll_jump,
+            R.id.ll_wallet, R.id.ll_video_order, R.id.ll_about,
             R.id.iv_settings, R.id.iv_avatar})
     void onClick(View v) {
         switch (v.getId()) {
-            case R.id.ll_no_pay:
-                openPage(MyOrderActivity.class);
-                break;
-            case R.id.ll_doing:
-                openPage(MyOrderActivity.class);
-                break;
-            case R.id.ll_done:
-                openPage(MyOrderActivity.class);
-                break;
-            case R.id.ll_all:
+            case R.id.ll_order:
                 openPage(MyOrderActivity.class);
                 break;
             case R.id.ll_wallet:
@@ -102,7 +95,7 @@ public class MineFragment extends BaseFragment {
             case R.id.ll_video_order:
                 openPage(VideoOrderActivity.class);
                 break;
-            case R.id.ll_share:
+            case R.id.btn_promote:
                 openPage(PromoteActivity.class);
                 break;
             case R.id.ll_about:
@@ -112,6 +105,22 @@ public class MineFragment extends BaseFragment {
             case R.id.iv_avatar:
                 openPage(SettingsActivity.class);
                 break;
+            case R.id.ll_jump:
+                new ConfirmDialog(this.getActivity())
+                        .setButton("确定", "取消")
+                        .setMsg("模特版仅对iOS用户开放,请在AppStore中搜索\"千模模特版\"")
+                        .setDialogListener(new ConfirmDialog.DialogListener() {
+                            @Override
+                            public void onOk(Dialog dialog) {
+                                dialog.dismiss();
+                            }
+
+                            @Override
+                            public void onCancel(Dialog dialog) {
+                                dialog.dismiss();
+                            }
+                        }).show();
+                break;
         }
     }
 

+ 16 - 17
app/src/main/java/com/android/chmo/utils/XUtilsImage.java

@@ -37,10 +37,10 @@ public class XUtilsImage {
                 .setImageScaleType(ImageView.ScaleType.CENTER_CROP)
                 .setIgnoreGif(false)//是否忽略gif图。false表示不忽略。不写这句,默认是true
                 .build();
-        x.image().bind(imageView, iconUrl,imageOptions);
+        x.image().bind(imageView, iconUrl, imageOptions);
     }
 
-    public static void display(ImageView imageView, String iconUrl, int failResId) {
+    public static void display(ImageView imageView, String iconUrl, int placeholderResId) {
         if (TextUtils.isEmpty(iconUrl)) {
             Log.d("XUtilsImage", "url is null");
             return;
@@ -48,31 +48,31 @@ public class XUtilsImage {
         ImageOptions imageOptions = new ImageOptions.Builder()
                 .setImageScaleType(ImageView.ScaleType.CENTER_CROP)
                 .setIgnoreGif(false)//是否忽略gif图。false表示不忽略。不写这句,默认是true
-                .setFailureDrawableId(failResId)
+                .setFailureDrawableId(placeholderResId)
+                .setLoadingDrawableId(placeholderResId)
                 .build();
-        x.image().bind(imageView, iconUrl,imageOptions);
+        x.image().bind(imageView, iconUrl, imageOptions);
     }
 
 
     /**
      * 显示图片(默认情况)
-     *
      */
-    public static void display(ImageView imageView, String iconUrl, ImageView.ScaleType scaleType,int failResId) {
+    public static void display(ImageView imageView, String iconUrl, ImageView.ScaleType scaleType, int placeholderResId) {
         if (TextUtils.isEmpty(iconUrl)) {
             return;
         }
         ImageOptions imageOptions = new ImageOptions.Builder()
                 .setImageScaleType(scaleType)
                 .setIgnoreGif(false)//是否忽略gif图。false表示不忽略。不写这句,默认是true
-                .setFailureDrawableId(failResId)
+                .setFailureDrawableId(placeholderResId)
+                .setLoadingDrawableId(placeholderResId)
                 .build();
-        x.image().bind(imageView, iconUrl,imageOptions);
+        x.image().bind(imageView, iconUrl, imageOptions);
     }
 
     /**
      * 显示图片(默认情况)
-     *
      */
     public static void display(ImageView imageView, String iconUrl, ImageView.ScaleType scaleType) {
         if (TextUtils.isEmpty(iconUrl)) {
@@ -82,12 +82,11 @@ public class XUtilsImage {
                 .setImageScaleType(scaleType)
                 .setIgnoreGif(false)//是否忽略gif图。false表示不忽略。不写这句,默认是true
                 .build();
-        x.image().bind(imageView, iconUrl,imageOptions);
+        x.image().bind(imageView, iconUrl, imageOptions);
     }
 
     /**
      * 显示图片(默认情况)
-     *
      */
     public static void display(final ImageView imageView, String iconUrl, ImageView.ScaleType scaleType, final View loadingView) {
         if (TextUtils.isEmpty(iconUrl)) {
@@ -102,6 +101,7 @@ public class XUtilsImage {
                 .build();
         x.image().bind(imageView, iconUrl, imageOptions, new Callback.CacheCallback<Drawable>() {
             Drawable result;
+
             @Override
             public boolean onCache(Drawable result) {
                 imageView.setImageDrawable(result);
@@ -160,8 +160,8 @@ public class XUtilsImage {
     /**
      * 显示圆形头像,第三个参数为true
      *
-     * @param imageView  图像控件
-     * @param iconUrl    图片地址
+     * @param imageView 图像控件
+     * @param iconUrl   图片地址
      */
     public static void displayCircluar(ImageView imageView, String iconUrl) {
         if (TextUtils.isEmpty(iconUrl)) {
@@ -197,7 +197,6 @@ public class XUtilsImage {
 
     /**
      * 方法说明:保存文件到本地
-     *
      */
     public static boolean saveImage(String urlPath, String savePath, String filename) {
         File saveFile = new File(savePath);
@@ -228,16 +227,16 @@ public class XUtilsImage {
         }
     }
 
-    public static void displayWithSize(ImageView imageView, String iconUrl,int width,int height) {
+    public static void displayWithSize(ImageView imageView, String iconUrl, int width, int height) {
         if (TextUtils.isEmpty(iconUrl)) {
             Log.d("XUtilsImage", "url is null");
             return;
         }
         ImageOptions imageOptions = new ImageOptions.Builder()
-                .setSize(width,height)
+                .setSize(width, height)
                 .setImageScaleType(ImageView.ScaleType.CENTER_CROP)
                 .setIgnoreGif(false)//是否忽略gif图。false表示不忽略。不写这句,默认是true
                 .build();
-        x.image().bind(imageView, iconUrl,imageOptions);
+        x.image().bind(imageView, iconUrl, imageOptions);
     }
 }

BIN
app/src/main/res/drawable-xxhdpi-v4/into_icon_shenqing.png


BIN
app/src/main/res/drawable-xxhdpi-v4/into_icon_yuyuedingdan.png


+ 5 - 0
app/src/main/res/drawable/bg_btn_promote.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/white" />
+    <corners android:radius="17dp" />
+</shape>

+ 5 - 0
app/src/main/res/drawable/bg_mine_promote.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#26FF4095" />
+    <corners android:radius="4dp" />
+</shape>

+ 89 - 114
app/src/main/res/layout/page_mine.xml

@@ -29,123 +29,61 @@
             android:textSize="22sp"
             android:textStyle="bold" />
 
-        <com.dd.ShadowLayout
+        <RelativeLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="8dp"
-            android:layout_marginTop="3dp"
-            android:layout_marginRight="8dp"
-            android:background="#ffffff"
-            app:sl_cornerRadius="12dp"
-            app:sl_dx="0dp"
-            app:sl_dy="6dp"
-            app:sl_shadowColor="#14000000"
-            app:sl_shadowRadius="12dp">
+            android:layout_height="86dp"
+            android:layout_marginLeft="20dp"
+            android:layout_marginTop="16dp"
+            android:layout_marginRight="20dp"
+            android:background="@drawable/bg_mine_promote">
 
             <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="80dp"
-                android:background="@drawable/bg_order_menu"
-                android:gravity="center"
-                android:orientation="horizontal">
-
-                <LinearLayout
-                    android:id="@+id/ll_no_pay"
-                    android:layout_width="0dp"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:gravity="center"
-                    android:orientation="vertical">
-
-                    <ImageView
-                        android:layout_width="30dp"
-                        android:layout_height="30dp"
-                        android:src="@mipmap/into_icon_daifukuan" />
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="6dp"
-                        android:text="未付款"
-                        android:textColor="#ff000000"
-                        android:textSize="12sp" />
-                </LinearLayout>
-
-                <LinearLayout
-                    android:id="@+id/ll_doing"
-                    android:layout_width="0dp"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:gravity="center"
-                    android:orientation="vertical">
-
-                    <ImageView
-                        android:layout_width="30dp"
-                        android:layout_height="30dp"
-                        android:src="@mipmap/into_icon_jinxingzhong" />
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="6dp"
-                        android:text="进行中"
-                        android:textColor="#ff000000"
-                        android:textSize="12sp" />
-                </LinearLayout>
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="18sp"
+                android:gravity="left|center"
+                android:orientation="vertical">
 
-                <LinearLayout
-                    android:id="@+id/ll_done"
-                    android:layout_width="0dp"
+                <TextView
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:gravity="center"
-                    android:orientation="vertical">
-
-                    <ImageView
-                        android:layout_width="30dp"
-                        android:layout_height="30dp"
-                        android:src="@mipmap/into_icon_yiwancheng" />
+                    android:text="邀请用户"
+                    android:textColor="@color/black"
+                    android:textSize="18sp"
+                    android:textStyle="bold" />
 
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="6dp"
-                        android:text="已完成"
-                        android:textColor="#ff000000"
-                        android:textSize="12sp" />
-                </LinearLayout>
-
-                <View
-                    android:layout_width="1dp"
-                    android:layout_height="30dp"
-                    android:layout_marginLeft="6dp"
-                    android:layout_marginRight="6dp"
-                    android:background="#F2F4F5" />
-
-                <LinearLayout
-                    android:id="@+id/ll_all"
-                    android:layout_width="0dp"
+                <TextView
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:gravity="center"
-                    android:orientation="vertical">
-
-                    <ImageView
-                        android:layout_width="30dp"
-                        android:layout_height="30dp"
-                        android:src="@mipmap/into_icon_quanbu" />
-
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="6dp"
-                        android:text="全部订单"
-                        android:textColor="#ff000000"
-                        android:textSize="12sp" />
-                </LinearLayout>
+                    android:layout_marginTop="4dp"
+                    android:text="推广三位用户可得奖励20元"
+                    android:textColor="@color/black"
+                    android:textSize="13sp" />
             </LinearLayout>
 
-        </com.dd.ShadowLayout>
+            <com.dd.ShadowLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignParentRight="true"
+                android:layout_centerVertical="true"
+                android:layout_marginRight="6dp"
+                app:sl_dx="0dp"
+                app:sl_dy="6dp"
+                app:sl_shadowColor="#14000000"
+                app:sl_shadowRadius="10dp">
+
+                <Button
+                    android:id="@+id/btn_promote"
+                    style="@style/Widget.AppCompat.Button.Borderless"
+                    android:layout_width="90dp"
+                    android:layout_height="34dp"
+                    android:background="@drawable/bg_btn_promote"
+                    android:text="立即推广"
+                    android:textColor="#FF4095"
+                    android:textSize="13sp"
+                    android:textStyle="bold" />
+            </com.dd.ShadowLayout>
+        </RelativeLayout>
 
         <ScrollView
             android:layout_width="match_parent"
@@ -159,7 +97,7 @@
                 android:orientation="vertical">
 
                 <LinearLayout
-                    android:id="@+id/ll_wallet"
+                    android:id="@+id/ll_order"
                     android:layout_width="match_parent"
                     android:layout_height="60dp"
                     android:gravity="left|center"
@@ -169,14 +107,14 @@
                         android:layout_width="30dp"
                         android:layout_height="30dp"
                         android:layout_marginLeft="20dp"
-                        android:src="@mipmap/into_icon_qianbao" />
+                        android:src="@mipmap/into_icon_yuyuedingdan" />
 
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginLeft="15dp"
                         android:layout_weight="1"
-                        android:text="我的钱包"
+                        android:text="预约订单"
                         android:textColor="#000000"
                         android:textSize="15sp" />
 
@@ -231,7 +169,44 @@
                     android:background="#F2F4F5" />
 
                 <LinearLayout
-                    android:id="@+id/ll_share"
+                    android:id="@+id/ll_wallet"
+                    android:layout_width="match_parent"
+                    android:layout_height="60dp"
+                    android:gravity="left|center"
+                    android:orientation="horizontal">
+
+                    <ImageView
+                        android:layout_width="30dp"
+                        android:layout_height="30dp"
+                        android:layout_marginLeft="20dp"
+                        android:src="@mipmap/into_icon_qianbao" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="15dp"
+                        android:layout_weight="1"
+                        android:text="我的钱包"
+                        android:textColor="#000000"
+                        android:textSize="15sp" />
+
+                    <ImageView
+                        android:layout_width="20dp"
+                        android:layout_height="20dp"
+                        android:layout_marginRight="20dp"
+                        android:src="@mipmap/icon_inter" />
+                </LinearLayout>
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_marginRight="20dp"
+                    android:background="#F2F4F5" />
+
+
+                <LinearLayout
+                    android:id="@+id/ll_jump"
                     android:layout_width="match_parent"
                     android:layout_height="60dp"
                     android:gravity="left|center"
@@ -241,14 +216,14 @@
                         android:layout_width="30dp"
                         android:layout_height="30dp"
                         android:layout_marginLeft="20dp"
-                        android:src="@mipmap/into_icon_yaoqing" />
+                        android:src="@mipmap/into_icon_shenqing" />
 
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginLeft="15dp"
                         android:layout_weight="1"
-                        android:text="推广奖励"
+                        android:text="申请模特"
                         android:textColor="#000000"
                         android:textSize="15sp" />
 

BIN
app/src/main/res/mipmap-hdpi/into_icon_shenqing.png


BIN
app/src/main/res/mipmap-hdpi/into_icon_yuyuedingdan.png


BIN
app/src/main/res/mipmap-xhdpi/into_icon_shenqing.png


BIN
app/src/main/res/mipmap-xhdpi/into_icon_yuyuedingdan.png


BIN
app/src/main/res/mipmap-xxxhdpi/into_icon_shenqing.png


BIN
app/src/main/res/mipmap-xxxhdpi/into_icon_yuyuedingdan.png


+ 5 - 0
app/src/main/res/xml/file_paths.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<paths>
+    <external-path path="Android/data/com.android.chmo/" name="files_root" />
+    <external-path path="." name="external_storage_root" />
+</paths>

+ 7 - 7
avchatkit/build.gradle

@@ -1,16 +1,16 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 26
+    compileSdkVersion 28
     buildToolsVersion '28.0.3'
 
     defaultConfig {
         minSdkVersion 14
-        targetSdkVersion 26
+        targetSdkVersion 28
         versionCode 1
         versionName "1.0"
 
-        renderscriptTargetApi 26
+        renderscriptTargetApi 28
         renderscriptSupportModeEnabled true
     }
 
@@ -27,10 +27,10 @@ android {
 
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
-    implementation 'com.android.support:appcompat-v7:26.+'
-    implementation 'com.android.support:recyclerview-v7:26.+'
-    implementation 'com.android.support:design:26.+'
-    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
+    implementation 'com.android.support:appcompat-v7:28.0.0'
+    implementation 'com.android.support:recyclerview-v7:28.0.0'
+    implementation 'com.android.support:design:28.0.0'
+    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
     implementation 'com.github.bumptech.glide:glide:4.2.0'
     annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
     implementation 'jp.wasabeef:glide-transformations:3.0.1'

+ 31 - 31
avchatkit/src/main/java/com/netease/nim/avchatkit/activity/AVChatActivity.java

@@ -53,6 +53,9 @@ import com.netease.nimlib.sdk.avchat.model.AVChatData;
 import com.netease.nimlib.sdk.avchat.model.AVChatOnlineAckEvent;
 import com.netease.nimlib.sdk.avchat.model.AVChatVideoFrame;
 
+import java.util.Timer;
+import java.util.TimerTask;
+
 /**
  * 音视频主界面
  * 1、初始化
@@ -66,18 +69,18 @@ import com.netease.nimlib.sdk.avchat.model.AVChatVideoFrame;
 
 public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallback, AVSwitchListener {
     // constant
-    private static final String TAG = "AVChatActivity";
-    private static final String KEY_IN_CALLING = "KEY_IN_CALLING";
-    private static final String KEY_ACCOUNT = "KEY_ACCOUNT";
-    private static final String KEY_DISPLAY_NAME = "KEY_DISPLAY_NAME";
-    private static final String KEY_CALL_TYPE = "KEY_CALL_TYPE";
-    private static final String KEY_SOURCE = "source";
-    private static final String KEY_CALL_CONFIG = "KEY_CALL_CONFIG";
-    public static final String INTENT_ACTION_AVCHAT = "INTENT_ACTION_AVCHAT";
+    private static final String TAG                  = "AVChatActivity";
+    private static final String KEY_IN_CALLING       = "KEY_IN_CALLING";
+    private static final String KEY_ACCOUNT          = "KEY_ACCOUNT";
+    private static final String KEY_DISPLAY_NAME     = "KEY_DISPLAY_NAME";
+    private static final String KEY_CALL_TYPE        = "KEY_CALL_TYPE";
+    private static final String KEY_SOURCE           = "source";
+    private static final String KEY_CALL_CONFIG      = "KEY_CALL_CONFIG";
+    public static final  String INTENT_ACTION_AVCHAT = "INTENT_ACTION_AVCHAT";
 
     public static final int FROM_BROADCASTRECEIVER = 0; // 来自广播
-    public static final int FROM_INTERNAL = 1; // 来自发起方
-    public static final int FROM_UNKNOWN = -1; // 未知的入口
+    public static final int FROM_INTERNAL          = 1; // 来自发起方
+    public static final int FROM_UNKNOWN           = -1; // 未知的入口
 
     // view
     private View root;
@@ -86,21 +89,21 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
     private View surfaceRoot;
 
     // state
-    private static boolean needFinish = true; // 若来电或去电未接通时,点击home。另外一方挂断通话。从最近任务列表恢复,则finish
-    private boolean mIsInComingCall = false;// is incoming call or outgoing call
-    private boolean isCallEstablished = false; // 电话是否接通
-    private boolean isUserFinish = false;
-    private boolean hasOnPause = false; // 是否暂停音视频
+    private static boolean needFinish        = true; // 若来电或去电未接通时,点击home。另外一方挂断通话。从最近任务列表恢复,则finish
+    private        boolean mIsInComingCall   = false;// is incoming call or outgoing call
+    private        boolean isCallEstablished = false; // 电话是否接通
+    private        boolean isUserFinish      = false;
+    private        boolean hasOnPause        = false; // 是否暂停音视频
 
     // data
     private AVChatData avChatData; // config for connect video server
-    private int state; // calltype 音频或视频
-    private String receiverId; // 对方的account
-    private String displayName; // 对方的显示昵称
+    private int        state; // calltype 音频或视频
+    private String     receiverId; // 对方的account
+    private String     displayName; // 对方的显示昵称
 
     private AVChatController avChatController;
-    private AVChatAudioUI avChatAudioUI; // 音频界面
-    private AVChatVideoUI avChatVideoUI; // 视频界面
+    private AVChatAudioUI    avChatAudioUI; // 音频界面
+    private AVChatVideoUI    avChatVideoUI; // 视频界面
 
     // face unity
     private FaceU faceU;
@@ -202,10 +205,10 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
     protected void onDestroy() {
         super.onDestroy();
 
-        if(avChatController != null){ //界面销毁时强制尝试挂断,防止出现红米Note 4X等手机在切后台点击杀死程序时,实际没有杀死的情况
+        if (avChatController != null) { //界面销毁时强制尝试挂断,防止出现红米Note 4X等手机在切后台点击杀死程序时,实际没有杀死的情况
             try {
                 avChatController.hangUp(AVChatExitCode.HANGUP);
-            }catch (Exception e){
+            } catch (Exception e) {
 
             }
         }
@@ -273,9 +276,9 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
         PhoneCallStateObserver.getInstance().observeAutoHangUpForLocalPhone(autoHangUpForLocalPhoneObserver, register);
         //放到所有UI的基类里面注册,所有的UI实现onKickOut接口
         NIMClient.getService(AuthServiceObserver.class).observeOnlineStatus(userStatusObserver, register);
-        if(register) {
+        if (register) {
             registerReceiver(handUpReceiver, new IntentFilter("android.chmo.action.STOP"));
-        }else {
+        } else {
             unregisterReceiver(handUpReceiver);
         }
     }
@@ -313,7 +316,7 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
                 AVChatSoundPlayer.instance().play(AVChatSoundPlayer.RingerTypeEnum.CONNECTING);
                 avChatAudioUI.doOutGoingCall(receiverId);
             }
-        }else {
+        } else {
             if (mIsInComingCall) {
                 // 来电
                 AVChatSoundPlayer.instance().play(AVChatSoundPlayer.RingerTypeEnum.RING);
@@ -373,7 +376,7 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
 
         @Override
         public void onJoinedChannel(int code, String audioFile, String videoFile, int i) {
-            LogUtil.d(TAG, "audioFile -> " + audioFile+" videoFile -> " + videoFile);
+            LogUtil.d(TAG, "audioFile -> " + audioFile + " videoFile -> " + videoFile);
             handleWithConnectServerResult(code);
         }
 
@@ -389,7 +392,6 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
         public void onUserLeave(String account, int event) {
             LogUtil.d(TAG, "onUserLeave -> " + account);
             avChatController.hangUp(AVChatExitCode.HANGUP);
-
             finish();
         }
 
@@ -409,7 +411,6 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
                 avChatVideoUI.showVideoInitLayout();
             }
             isCallEstablished = true;
-
             // 已接通 通知到上层
             Intent intent = new Intent("android.chmo.action.BEGIN_VIDEO");
             intent.putExtra("account", avChatData != null ? avChatData.getAccount() : receiverId);
@@ -752,7 +753,6 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
     };
 
 
-
     public void checkCameraPermission() {
         MPermission.with(this)
                 .setRequestCode(80)
@@ -766,12 +766,12 @@ public class AVChatActivity extends UI implements AVChatVideoUI.TouchZoneCallbac
     }
 
     @OnMPermissionGranted(80)
-    public void onCameraPermissionSuccess(){
+    public void onCameraPermissionSuccess() {
         showCall();
     }
 
     @OnMPermissionDenied(80)
-    public void onCameraPermissionFailed(){
+    public void onCameraPermissionFailed() {
         Toast.makeText(this, "摄像头所需权限未授权", Toast.LENGTH_SHORT).show();
     }
 }

+ 4 - 4
faceunity/build.gradle

@@ -1,12 +1,12 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 26
+    compileSdkVersion 28
     buildToolsVersion '28.0.3'
 
     defaultConfig {
         minSdkVersion 14
-        targetSdkVersion 26
+        targetSdkVersion 28
     }
 
     sourceSets {
@@ -30,7 +30,7 @@ android {
 
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
-    implementation "com.android.support:appcompat-v7:26.1.0"
-    compileOnly "com.android.support:recyclerview-v7:26.1.0"
+    implementation "com.android.support:appcompat-v7:28.0.0"
+    compileOnly "com.android.support:recyclerview-v7:28.0.0"
     implementation 'org.adw.library:discrete-seekbar:1.0.1'
 }

+ 5 - 5
uikit/build.gradle

@@ -1,12 +1,12 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 26
+    compileSdkVersion 28
     buildToolsVersion '28.0.3'
 
     defaultConfig {
         minSdkVersion 14
-        targetSdkVersion 26
+        targetSdkVersion 28
         versionCode 1
         versionName "1.0"
 
@@ -35,10 +35,10 @@ android {
 
 dependencies {
     implementation fileTree(include: '*.jar', dir: 'libs')
-    implementation 'com.android.support:appcompat-v7:26.1.0'
-    implementation 'com.android.support:design:26.1.0'
+    implementation 'com.android.support:appcompat-v7:28.0.0'
+    implementation 'com.android.support:design:28.0.0'
     implementation 'com.android.support.constraint:constraint-layout:1.1.3'
-    implementation 'com.android.support:support-v4:26.1.0'
+    implementation 'com.android.support:support-v4:28.0.0'
     implementation 'me.everything:overscroll-decor-android:1.0.4'
     implementation 'me.leolin:ShortcutBadger:1.1.17@aar'
     implementation 'com.github.bumptech.glide:glide:4.2.0'