Commit e02f778f9371bdc06bd1aa8bdd4376e1acceee70

Authored by 韩亚云
1 parent 02845e5b

Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/newModuleStrike

# Conflicts:
#	app/strike/src/main/java/com/cnlive/strike/MainActivity.java
app/strike/src/main/java/com/cnlive/strike/imgutil/ImgActivity.java
... ... @@ -20,9 +20,11 @@ import com.cnlive.core.imageload.config.PriorityMode;
20 20 import com.cnlive.core.imageload.config.ScaleMode;
21 21 import com.cnlive.core.imageload.loader.ImageLoader;
22 22 import com.cnlive.core.imageload.preview.PreviewImageViewActivity;
  23 +import com.cnlive.core.imageload.preview.model.ImagePreviewShowInfo;
23 24 import com.cnlive.core.imageload.preview.model.PreviewData;
24 25 import com.cnlive.core.imageload.util.DownLoadImageService;
25 26 import com.cnlive.strike.R;
  27 +import com.cnlive.strike.user.auth.UserService;
26 28  
27 29 import java.io.File;
28 30 import java.util.ArrayList;
... ... @@ -106,11 +108,21 @@ public class ImgActivity extends AppCompatActivity {
106 108 .into(iv_test1);
107 109  
108 110 PreviewData data = new PreviewData();
109   - data.setLife(false);
110   - data.setFriend(false);
111   - data.setScan(false);
112   - data.setCollection(false);
  111 + data.setCollection(true);
  112 + data.setSid(UserService.getUid(this));
113 113 data.setType("1");
  114 + data.setUserId(UserService.getUid(this));
  115 + data.setCollection(true);
  116 + data.setSave(true);
  117 +
  118 + ArrayList<ImagePreviewShowInfo> list = new ArrayList<>();
  119 + ImagePreviewShowInfo info = new ImagePreviewShowInfo();
  120 + info.setImgPath(URL1);
  121 + info.setPreviewPath(URL1);
  122 + list.add(info);
  123 + data.setPicList(list);
  124 +
  125 +
114 126 data.setShowImg(URL1);
115 127 iv_test1.setOnClickListener(view -> PreviewImageViewActivity.startPreviewPictrue(this, view, data));
116 128  
... ...
core/app_qr/src/main/java/com/cnlive/strike/moudle/qr/api/ApiServiceQrcode.java
... ... @@ -89,7 +89,14 @@ public interface ApiServiceQrcode {
89 89  
90 90 @POST("Daren/order/addOrderMHT.action")
91 91 Observable<BaseResult<CottonCandyInfo>> getCottonCandy(@QueryMap Map<String, String> param);
  92 + /**
  93 + * 生成棉花糖订单信息
  94 + * @param param
  95 + * @return
  96 + */
92 97  
  98 + @POST("Daren/group/userAddGroup.action")
  99 + Observable<BaseResult> userAddGroup(@QueryMap Map<String, String> param);
93 100  
94 101 /**
95 102 * 音箱家庭邀请成员
... ... @@ -99,14 +106,4 @@ public interface ApiServiceQrcode {
99 106 @POST("Daren/sound/familyGroupInviteYD.action")
100 107 Observable<BaseResult> familyGroupInviteYD(@QueryMap() Map<String, String> map);
101 108  
102   -
103   - /**
104   - * 生成棉花糖订单信息
105   - * @param param
106   - * @return
107   - */
108   -
109   - @POST("Daren/group/userAddGroup.action")
110   - Observable<BaseResult> userAddGroup(@QueryMap Map<String, String> param);
111   -
112 109 }
... ...
core/app_qr/src/main/java/com/cnlive/strike/moudle/qr/routers/QrRouters.java
... ... @@ -198,4 +198,21 @@ public class QrRouters {
198 198 .withBoolean("isStarPage", isStarPage)
199 199 .navigation(context);
200 200 }
  201 +
  202 +
  203 + public static void startChatActivity(Context context,String groupId,String groupName){
  204 +
  205 + ARouter.getInstance().build("/chat/ChatActivity")
  206 + .withString("targetId", groupId)
  207 + .withString("chatType", "Private")
  208 + .withString("conversationName", groupName)
  209 + .navigation(context);
  210 + }
  211 + public static void startChatGroupDetailActivity(Context context,String groupId,String groupName){
  212 +
  213 + ARouter.getInstance().build("/cnconversation/ChatGroupDetailActivity")
  214 + .withString("groupId", groupId)
  215 + .withString("groupName", groupName)
  216 + .navigation(context);
  217 + }
201 218 }
... ...
core/app_qr/src/main/java/com/cnlive/strike/moudle/qr/ui/activity/SpeakerBindStateActivity.java
... ... @@ -3,6 +3,7 @@ package com.cnlive.strike.moudle.qr.ui.activity;
3 3 import android.content.Context;
4 4 import android.content.Intent;
5 5  
  6 +import com.alibaba.android.arouter.facade.annotation.Route;
6 7 import com.cnlive.core.libs.base.frame.activity.BaseActivity;
7 8 import com.cnlive.strike.moudle.qr.R;
8 9 import com.cnlive.strike.moudle.qr.databinding.ActivitySpeakerBindStateBinding;
... ... @@ -17,6 +18,7 @@ import com.cnlive.strike.moudle.qr.frame.view.SpeakerBindStateView;
17 18 * <p>
18 19 * 简介: 音响绑定状态
19 20 */
  21 +@Route(path = "/qr/SpeakerBindStateActivity")
20 22 public class SpeakerBindStateActivity extends BaseActivity<SpeakerBindStateView, SpeakerBindStatePresenter> {
21 23  
22 24 public ActivitySpeakerBindStateBinding binding;
... ...
core/app_qr/src/main/java/com/cnlive/strike/moudle/qr/uitl/QrContentUtil.java
... ... @@ -60,8 +60,6 @@ public class QrContentUtil {
60 60 public QrContentBean getQrContentBean(String result) {
61 61 QrContentBean bean = new QrContentBean();
62 62 JSONObject jsonObject = null;
63   -
64   -
65 63 try {
66 64 if (!TextUtils.isEmpty(result) && result.startsWith("http://apps.pay.cnlive.com/cash-register/payauto/default?")) {
67 65 Uri uri = Uri.parse(result);
... ... @@ -130,6 +128,7 @@ public class QrContentUtil {
130 128 bean.setContent(homepageId);
131 129 bean.setType(type);
132 130 break;
  131 +
133 132 case "subscriShareType":
134 133 String homepageid = (String) jsonObject.get("homepageId");
135 134 if (TextUtils.isEmpty(homepageid)) {
... ... @@ -151,6 +150,18 @@ public class QrContentUtil {
151 150 bean.setContent(content);
152 151 bean.setType(type);
153 152 break;
  153 + case "groupQrType":
  154 + String qrContent = (String) jsonObject.get("content");
  155 + if (TextUtils.isEmpty(qrContent)) {
  156 + bean.setType("other");
  157 + bean.setContent(result);
  158 + return bean;
  159 + }
  160 + bean.setContent(qrContent);
  161 + bean.setType(type);
  162 +
  163 + break;
  164 +
154 165  
155 166 default:
156 167 bean.setType("other");
... ... @@ -179,6 +190,7 @@ public class QrContentUtil {
179 190 return bean;
180 191 }
181 192  
  193 +
182 194 public void getQrContent(Context mContext, String content, IdentifyTheQRCodeCallback successfulCallback) {
183 195 if (TextUtils.isEmpty(content)) AlertUtil.showDeftToast(mContext, "请选择有效的二维码");
184 196  
... ... @@ -217,16 +229,23 @@ public class QrContentUtil {
217 229 jumpWitnessInfo(mContext, data.getContent(), successfulCallback);
218 230 break;
219 231 case "dazhongQrType":
  232 + //大众体育
220 233 jumpSportInfo(mContext, data.getContent(), successfulCallback);
221 234 break;
222 235 case "starMoodShareType":
223   - jumpStartInfo(mContext, data.getContent(), successfulCallback,true);
  236 + //明星主页
  237 + jumpStartInfo(mContext, data.getContent(), successfulCallback, true);
224 238 break;
225 239 case "xiaoJiaSpeakerType":
  240 + //小家音响
226 241 jumpXiaoJiaSpeaker(mContext, data.getContent(), successfulCallback);
227 242 break;
228 243 case "subscriShareType":
229   - jumpStartInfo(mContext, data.getContent(), successfulCallback,false);
  244 + jumpStartInfo(mContext, data.getContent(), successfulCallback, false);
  245 + break;
  246 + case "groupQrType":
  247 + //公共群组
  248 + jumpGroupInfo(mContext, data.getContent(), successfulCallback);
230 249 break;
231 250  
232 251 default:
... ... @@ -243,11 +262,18 @@ public class QrContentUtil {
243 262 );
244 263 }
245 264  
  265 + /**
  266 + * 小家音响
  267 + *
  268 + * @param mContext
  269 + * @param content
  270 + * @param successfulCallback
  271 + */
246 272 private void jumpXiaoJiaSpeaker(Context mContext, String content, IdentifyTheQRCodeCallback successfulCallback) {
247   - if (!TextUtils.isEmpty(content)){
248   - SpeakerBindStateActivity.startActivity(mContext,content);
  273 + if (!TextUtils.isEmpty(content)) {
  274 + SpeakerBindStateActivity.startActivity(mContext, content);
249 275 successfulCallback.qRCodeCallback(true, "");
250   - }else {
  276 + } else {
251 277 successfulCallback.qRCodeCallback(false, "数据异常");
252 278 }
253 279  
... ... @@ -271,6 +297,50 @@ public class QrContentUtil {
271 297 }
272 298  
273 299  
  300 + /**
  301 + * 公共群组
  302 + *
  303 + * @param context
  304 + * @param content
  305 + * @param successfulCallback
  306 + */
  307 + public static void jumpGroupInfo(Context context, String content, IdentifyTheQRCodeCallback successfulCallback) {
  308 + try {
  309 + JSONObject jsonObject = new JSONObject(content);
  310 +
  311 + String groupId = jsonObject.getString("groupId");
  312 + String groupName = jsonObject.getString("groupName");
  313 +
  314 + QrRouters.startChatGroupDetailActivity(context, groupId, groupName);
  315 + successfulCallback.qRCodeCallback(true, "");
  316 +// HashMap<String, String> hashMap = new HashMap<>();
  317 +// hashMap.put("groupId",groupId);
  318 +// hashMap.put("sid",UserService.getUid(context));
  319 +// Logic.create(hashMap).action(new Logic.Action<Map<String, String>, BaseInfo>() {
  320 +// @Override
  321 +// public Disposable action(Map<String, String> stringStringMap, DataCallback<BaseInfo> dataCallback) {
  322 +// return ApiRequest.service(ApiServiceQrcode.class, apiServiceQrcode -> apiServiceQrcode.userAddGroup(stringStringMap)).subscribe(context, dataCallback);
  323 +// }
  324 +// }).<BaseInfo>event().setFailureCallback(new FailureCallback() {
  325 +// @Override
  326 +// public void onFailure(int i, String s) {
  327 +// successfulCallback.qRCodeCallback(false, s);
  328 +// }
  329 +// }).setSuccessCallback(new SuccessCallback<BaseInfo>() {
  330 +// @Override
  331 +// public void onSuccess(BaseInfo baseInfo) {
  332 +// QrRouters.startChatActivity(context, groupId, groupName);
  333 +// successfulCallback.qRCodeCallback(true, "");
  334 +// }
  335 +// }).start();
  336 +//
  337 +
  338 + } catch (JSONException e) {
  339 + e.printStackTrace();
  340 + successfulCallback.qRCodeCallback(false, "数据异常");
  341 + }
  342 + }
  343 +
274 344 private void scanCottonCandyActivity(Context mContext, QrContentBean data, IdentifyTheQRCodeCallback successfulCallback) {
275 345  
276 346 if (mContext == null) return;
... ...
core/imageload/src/main/AndroidManifest.xml
... ... @@ -3,8 +3,23 @@
3 3 package="com.cnlive.core.imageload">
4 4  
5 5 <application>
6   - <activity android:name=".preview.DataProcessingActivity"></activity>
7   - <activity android:name=".preview.PreviewImageViewActivity" />
  6 + <activity
  7 + android:name=".preview.PreviewImageViewActivity"
  8 + android:configChanges="keyboardHidden|screenSize|smallestScreenSize|screenLayout|orientation"
  9 + android:launchMode="singleTop"
  10 + android:theme="@style/Theme.AppCompat.NoActionBar"/>
  11 + <activity
  12 + android:name=".preview.DataProcessingActivity"
  13 + android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  14 + android:launchMode="singleTop"
  15 + android:theme="@style/ProcessHtmlDialogActivityTheme">
  16 + <intent-filter>
  17 + <action android:name="com.cnlive.strike.moudle.preview.ui.DataProcessingActivity" />
  18 + <category android:name="android.intent.category.DEFAULT" />
  19 + <!-- 文字类型 -->
  20 + <data android:mimeType="text/plain" />
  21 + </intent-filter>
  22 + </activity>
8 23 </application>
9 24  
10 25 </manifest>
11 26 \ No newline at end of file
... ...
core/imageload/src/main/java/com/cnlive/core/imageload/preview/PreviewImageViewActivity.java
... ... @@ -66,6 +66,7 @@ public class PreviewImageViewActivity extends BaseActivity&lt;PreviewImageView, Pre
66 66 getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT);
67 67 StatusBarUtil.setTransparentForWindow(this);
68 68 StatusBarUtil.addTranslucentView(this,0);
  69 + if (getPresenter()!=null)getPresenter().processData(PreviewImageViewActivity.this,getIntent());
69 70 }
70 71  
71 72 @Override
... ...
core/imageload/src/main/res/values/style.xml
... ... @@ -28,4 +28,15 @@
28 28 <item name="android:background">@drawable/qmui_tip_dialog_bg</item>
29 29 </style>
30 30  
  31 + <style name="ProcessHtmlDialogActivityTheme" parent="Theme.AppCompat.Dialog">
  32 + <item name="android:windowFrame">@android:color/transparent</item><!--边框-->
  33 + <item name="android:windowIsFloating">true</item><!--是否浮现在activity之上-->
  34 + <item name="android:windowIsTranslucent">true</item><!--半透明-->
  35 + <item name="android:windowBackground">@android:color/transparent</item><!--背景透明-->
  36 + <item name="windowNoTitle">true</item>
  37 + <item name="windowActionBar">true</item>
  38 + <item name="android:windowActionBar">true</item>
  39 + <item name="android:windowCloseOnTouchOutside">false</item>
  40 + </style>
  41 +
31 42 </resources>
32 43 \ No newline at end of file
... ...
module/pedometer/src/main/java/com/cnlive/moudle/pedometer/frame/presenter/RunningFinishFragmetPresenter.java
... ... @@ -468,6 +468,6 @@ public class RunningFinishFragmetPresenter extends BasePresenter&lt;RunningFinishFr
468 468 // });
469 469 ////
470 470 // }
471   -// }, 2000);
  471 +// }, 2000);u
472 472 //
473 473 }
... ...