|
@@ -41,7 +41,6 @@ import androidx.recyclerview.widget.LinearLayoutManager; |
|
@@ -41,7 +41,6 @@ import androidx.recyclerview.widget.LinearLayoutManager; |
41
|
import androidx.recyclerview.widget.RecyclerView;
|
41
|
import androidx.recyclerview.widget.RecyclerView;
|
42
|
|
42
|
|
43
|
import com.bumptech.glide.Glide;
|
43
|
import com.bumptech.glide.Glide;
|
44
|
-import com.bumptech.glide.request.RequestOptions;
|
|
|
45
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
44
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
46
|
import com.chad.library.adapter.base.BaseViewHolder;
|
45
|
import com.chad.library.adapter.base.BaseViewHolder;
|
47
|
import com.donkingliang.imageselector.utils.ImageSelector;
|
46
|
import com.donkingliang.imageselector.utils.ImageSelector;
|
|
@@ -53,7 +52,6 @@ import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer; |
|
@@ -53,7 +52,6 @@ import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer; |
53
|
import com.yinhebairong.clasmanage.Config;
|
52
|
import com.yinhebairong.clasmanage.Config;
|
54
|
import com.yinhebairong.clasmanage.R;
|
53
|
import com.yinhebairong.clasmanage.R;
|
55
|
import com.yinhebairong.clasmanage.adapter.imageselect.SquareImageView;
|
54
|
import com.yinhebairong.clasmanage.adapter.imageselect.SquareImageView;
|
56
|
-import com.yinhebairong.clasmanage.adapter.jxtadapter.TzMbAdatper;
|
|
|
57
|
import com.yinhebairong.clasmanage.adapter.jxtadapter.TztjmbAdapter;
|
55
|
import com.yinhebairong.clasmanage.adapter.jxtadapter.TztjmbAdapter;
|
58
|
import com.yinhebairong.clasmanage.base.BaseActivity;
|
56
|
import com.yinhebairong.clasmanage.base.BaseActivity;
|
59
|
import com.yinhebairong.clasmanage.base.instant.Layout;
|
57
|
import com.yinhebairong.clasmanage.base.instant.Layout;
|
|
@@ -65,9 +63,6 @@ import com.yinhebairong.clasmanage.entity.PostFiel; |
|
@@ -65,9 +63,6 @@ import com.yinhebairong.clasmanage.entity.PostFiel; |
65
|
import com.yinhebairong.clasmanage.entity.VideoEntity;
|
63
|
import com.yinhebairong.clasmanage.entity.VideoEntity;
|
66
|
import com.yinhebairong.clasmanage.m.M;
|
64
|
import com.yinhebairong.clasmanage.m.M;
|
67
|
import com.yinhebairong.clasmanage.network.ApiService;
|
65
|
import com.yinhebairong.clasmanage.network.ApiService;
|
68
|
-import com.yinhebairong.clasmanage.ui.jxt.activity.Fbzy_Activity;
|
|
|
69
|
-import com.yinhebairong.clasmanage.ui.jxt.activity.Jsbj_Activity;
|
|
|
70
|
-import com.yinhebairong.clasmanage.ui.jxt.activity.Jsbj_Activity_ViewBinding;
|
|
|
71
|
import com.yinhebairong.clasmanage.ui.jxt.fragment.Jl.JsjlActivity;
|
66
|
import com.yinhebairong.clasmanage.ui.jxt.fragment.Jl.JsjlActivity;
|
72
|
import com.yinhebairong.clasmanage.utils.AudioUtils;
|
67
|
import com.yinhebairong.clasmanage.utils.AudioUtils;
|
73
|
import com.yinhebairong.clasmanage.widget.CircularProgressBar;
|
68
|
import com.yinhebairong.clasmanage.widget.CircularProgressBar;
|
|
@@ -130,10 +125,11 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -130,10 +125,11 @@ public class FbtzA_ctivity extends BaseActivity { |
130
|
String teacherIds = "";
|
125
|
String teacherIds = "";
|
131
|
String content = "";
|
126
|
String content = "";
|
132
|
private final static int STRAT_ID = 1998;
|
127
|
private final static int STRAT_ID = 1998;
|
133
|
- private final static int HDXZ_ID = 1999;
|
128
|
+ private final static int TZXZ_ID = 1999;
|
134
|
@BindView(R.id.et_tzzt)
|
129
|
@BindView(R.id.et_tzzt)
|
135
|
EditText etTzzt;
|
130
|
EditText etTzzt;
|
136
|
TzMbBean.DataBean.ItemBean tzmb_item = new TzMbBean.DataBean.ItemBean();
|
131
|
TzMbBean.DataBean.ItemBean tzmb_item = new TzMbBean.DataBean.ItemBean();
|
|
|
132
|
+ TzMbBean.DataBean.ItemBean itemBean;
|
137
|
List<String> links_list = new ArrayList<>();
|
133
|
List<String> links_list = new ArrayList<>();
|
138
|
String audio = "";
|
134
|
String audio = "";
|
139
|
String img = "";
|
135
|
String img = "";
|
|
@@ -160,6 +156,11 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -160,6 +156,11 @@ public class FbtzA_ctivity extends BaseActivity { |
160
|
TztjmbAdapter tzMbAdatper;
|
156
|
TztjmbAdapter tzMbAdatper;
|
161
|
String title;
|
157
|
String title;
|
162
|
String contextText;
|
158
|
String contextText;
|
|
|
159
|
+ @BindView(R.id.select_text)
|
|
|
160
|
+ TextView selectText;
|
|
|
161
|
+ @BindView(R.id.tv_xbjf)
|
|
|
162
|
+ TextView tvXbjf;
|
|
|
163
|
+
|
163
|
@Override
|
164
|
@Override
|
164
|
protected void initData() {
|
165
|
protected void initData() {
|
165
|
title = getIntent().getStringExtra("title");
|
166
|
title = getIntent().getStringExtra("title");
|
|
@@ -176,177 +177,19 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -176,177 +177,19 @@ public class FbtzA_ctivity extends BaseActivity { |
176
|
// mediaPlayer.setVolume(0.5f, 0.5f);
|
177
|
// mediaPlayer.setVolume(0.5f, 0.5f);
|
177
|
getMbDAta();
|
178
|
getMbDAta();
|
178
|
includeName.setText("发布通知");
|
179
|
includeName.setText("发布通知");
|
179
|
- includeBack.setOnClickListener(new View.OnClickListener() {
|
|
|
180
|
- @Override
|
|
|
181
|
- public void onClick(View v) {
|
|
|
182
|
- finish();
|
|
|
183
|
- }
|
|
|
184
|
- });
|
|
|
185
|
- classSelect.setOnClickListener(new View.OnClickListener() {
|
|
|
186
|
- @Override
|
|
|
187
|
- public void onClick(View view) {
|
|
|
188
|
- Intent intent = new Intent();
|
|
|
189
|
- intent.setClass(FbtzA_ctivity.this, JsjlActivity.class);
|
|
|
190
|
- startActivityForResult(intent, STRAT_ID);
|
|
|
191
|
- }
|
|
|
192
|
- });
|
|
|
193
|
-
|
|
|
194
|
- addTzmb.setOnClickListener(new View.OnClickListener() {
|
|
|
195
|
- @Override
|
|
|
196
|
- public void onClick(View v) {
|
|
|
197
|
- Intent intent = new Intent(FbtzA_ctivity.this, Tzmb_Activity.class);
|
|
|
198
|
- startActivity(intent);
|
|
|
199
|
- startActivityForResult(intent, HDXZ_ID);
|
|
|
200
|
- }
|
|
|
201
|
- });
|
|
|
202
|
- fabutzBut.setOnClickListener(new View.OnClickListener() {
|
|
|
203
|
- @Override
|
|
|
204
|
- public void onClick(View view) {
|
|
|
205
|
- if (!classId.equals("")) {
|
|
|
206
|
- if (!parentIds.equals("")) {
|
|
|
207
|
- name = etTzzt.getText().toString();
|
|
|
208
|
- if (!name.equals("")) {
|
|
|
209
|
- content = contentEd.getText().toString();
|
|
|
210
|
- if (!content.equals("")) {
|
|
|
211
|
- WaitDialog.show(FbtzA_ctivity.this, "请稍候...");
|
|
|
212
|
- ArrayList<String> videos = new ArrayList<>();
|
|
|
213
|
- for (int i = 0; i < frequencyUrl.size(); i++) {
|
|
|
214
|
- videos.add(frequencyUrl.get(i).getVideoPath());
|
|
|
215
|
- }
|
|
|
216
|
- audio = TextUtils.join(",", videos);
|
|
|
217
|
- img = TextUtils.join(",",ImagesUrl);
|
|
|
218
|
- video = TextUtils.join(",",videoUrl);
|
|
|
219
|
- links = TextUtils.join(",",links_list);
|
|
|
220
|
- Log.i("录音", "onClick: " + audio);
|
|
|
221
|
- Api().fbtz(Config.Token, classId, teacherIds, parentIds, name, content, tzmb_item.getCall(), tzmb_item.getInscription(), img, audio, video,links).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<FbtzEntity>() {
|
|
|
222
|
- @Override
|
|
|
223
|
- public void onSubscribe(Disposable d) {
|
|
|
224
|
-
|
|
|
225
|
- }
|
|
|
226
|
-
|
|
|
227
|
- @Override
|
|
|
228
|
- public void onNext(FbtzEntity fbtzEntity) {
|
|
|
229
|
- if (fbtzEntity.getCode() == M.success) {
|
|
|
230
|
- finish();
|
|
|
231
|
- } else {
|
|
|
232
|
- Toast.makeText(ctx, "" + fbtzEntity.getMsg(), Toast.LENGTH_SHORT).show();
|
|
|
233
|
- WaitDialog.dismiss();
|
|
|
234
|
- }
|
|
|
235
|
- }
|
|
|
236
|
-
|
|
|
237
|
- @Override
|
|
|
238
|
- public void onError(Throwable e) {
|
|
|
239
|
-
|
|
|
240
|
- }
|
|
|
241
|
-
|
|
|
242
|
- @Override
|
|
|
243
|
- public void onComplete() {
|
|
|
244
|
-
|
|
|
245
|
- }
|
|
|
246
|
- });
|
|
|
247
|
- } else {
|
|
|
248
|
- Toast.makeText(ctx, "请输入通知内容", Toast.LENGTH_SHORT).show();
|
|
|
249
|
- }
|
|
|
250
|
- } else {
|
|
|
251
|
- Toast.makeText(ctx, "请输入通知的标题", Toast.LENGTH_SHORT).show();
|
|
|
252
|
- }
|
|
|
253
|
- } else {
|
|
|
254
|
- Toast.makeText(ctx, "请选择接收通知的家长", Toast.LENGTH_SHORT).show();
|
|
|
255
|
- }
|
|
|
256
|
- } else {
|
|
|
257
|
- Toast.makeText(ctx, "请选择接受的班级", Toast.LENGTH_SHORT).show();
|
|
|
258
|
- }
|
|
|
259
|
- }
|
|
|
260
|
- });
|
|
|
261
|
-
|
|
|
262
|
- addTzmb.setOnClickListener(new View.OnClickListener() {
|
|
|
263
|
- @Override
|
|
|
264
|
- public void onClick(View view) {
|
|
|
265
|
- Intent intent = new Intent();
|
|
|
266
|
- intent.setClass(FbtzA_ctivity.this, Tzmb_Activity.class);
|
|
|
267
|
- startActivityForResult(intent, HDXZ_ID);
|
|
|
268
|
- }
|
|
|
269
|
- });
|
|
|
270
|
- imageAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
271
|
- @Override
|
|
|
272
|
- public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
273
|
- imgPop(picAndVideo, position);
|
|
|
274
|
- }
|
|
|
275
|
- });
|
|
|
276
|
- audioAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
277
|
- @Override
|
|
|
278
|
- public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
279
|
- text_time = view.findViewById(R.id.text_time);
|
|
|
280
|
- List<VideoEntity> data = audioAdapter.getData();
|
|
|
281
|
- for (int i = 0; i < data.size(); i++) {
|
|
|
282
|
- data.get(i).setChecked(false);
|
|
|
283
|
- }
|
|
|
284
|
-
|
|
|
285
|
- try {
|
|
|
286
|
- if (mediaPlayer.isPlaying()) {
|
|
|
287
|
- mediaPlayer.reset();
|
|
|
288
|
- data.get(position).setChecked(true);
|
|
|
289
|
- mediaPlayer.setDataSource(data.get(position).getVideoPath());
|
|
|
290
|
- mediaPlayer.prepare();
|
|
|
291
|
- mediaPlayer.start();
|
|
|
292
|
- updateDescTv();
|
|
|
293
|
- } else {
|
|
|
294
|
- mediaPlayer.reset();
|
|
|
295
|
- mediaPlayer.setDataSource(data.get(position).getVideoPath());
|
|
|
296
|
- mediaPlayer.prepare();
|
|
|
297
|
- mediaPlayer.start();
|
|
|
298
|
- updateDescTv();
|
|
|
299
|
- }
|
|
|
300
|
- mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
|
|
301
|
- @Override
|
|
|
302
|
- public void onCompletion(MediaPlayer mediaPlayer) {
|
|
|
303
|
- int duration = mediaPlayer.getDuration();
|
|
|
304
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
|
|
|
305
|
- Date date = new Date(duration);
|
|
|
306
|
- String format = simpleDateFormat.format(date);
|
|
|
307
|
- text_time.setText(format);
|
|
|
308
|
- }
|
|
|
309
|
- });
|
|
|
310
|
- } catch (IOException e) {
|
|
|
311
|
- e.printStackTrace();
|
|
|
312
|
- }
|
|
|
313
|
- adapter.notifyDataSetChanged();
|
|
|
314
|
- }
|
|
|
315
|
- });
|
|
|
316
|
- audioAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
|
|
317
|
- @Override
|
|
|
318
|
- public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
319
|
- List<VideoEntity> data = audioAdapter.getData();
|
|
|
320
|
- data.remove(position);
|
|
|
321
|
- mediaPlayer.stop();
|
|
|
322
|
- audioAdapter.notifyDataSetChanged();
|
|
|
323
|
- }
|
|
|
324
|
- });
|
|
|
325
|
- imgRecycle.setLayoutManager(new GridLayoutManager(this, 3));
|
|
|
326
|
- imgRecycle.setAdapter(imageAdapter);
|
|
|
327
|
- imageAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
|
|
328
|
- @Override
|
|
|
329
|
- public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
330
|
- switch (view.getId()) {
|
|
|
331
|
- case R.id.v_delete:
|
|
|
332
|
- if (picAndVideo.get(position).getType() == 1) {
|
|
|
333
|
- ImagesUrl.remove(picAndVideo.get(position).getPath());
|
|
|
334
|
- } else if (picAndVideo.get(position).getType() == 2) {
|
|
|
335
|
- videoUrl.remove(picAndVideo.get(position).getPath());
|
|
|
336
|
- } else if (picAndVideo.get(position).getType() == 3) {
|
|
|
337
|
- frequencyUrl.remove(picAndVideo.get(position).getPath());
|
|
|
338
|
- }
|
|
|
339
|
- picAndVideo.remove(position);
|
|
|
340
|
- adapter.notifyDataSetChanged();
|
|
|
341
|
- break;
|
|
|
342
|
- case R.id.item_select_pic_video:
|
|
|
343
|
-
|
|
|
344
|
- break;
|
|
|
345
|
- }
|
|
|
346
|
- }
|
|
|
347
|
- });
|
|
|
348
|
}
|
180
|
}
|
349
|
|
181
|
|
|
|
182
|
+// @Override
|
|
|
183
|
+// protected void onResume() {
|
|
|
184
|
+// super.onResume();
|
|
|
185
|
+// if (getIntent().getExtras() != null) {
|
|
|
186
|
+// Intent intent = getIntent();
|
|
|
187
|
+// Bundle tzmb_item = intent.getExtras();
|
|
|
188
|
+// itemBean = (TzMbBean.DataBean.ItemBean) tzmb_item.getSerializable("tzmb_item");
|
|
|
189
|
+// classType.setText(itemBean.getTitle());
|
|
|
190
|
+// }
|
|
|
191
|
+// }
|
|
|
192
|
+
|
350
|
private void getMbDAta() {
|
193
|
private void getMbDAta() {
|
351
|
Api().tjmb(Config.Token)
|
194
|
Api().tjmb(Config.Token)
|
352
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
195
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
|
@@ -358,27 +201,27 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -358,27 +201,27 @@ public class FbtzA_ctivity extends BaseActivity { |
358
|
|
201
|
|
359
|
@Override
|
202
|
@Override
|
360
|
public void onNext(TztjmbBean tztjmbBean) {
|
203
|
public void onNext(TztjmbBean tztjmbBean) {
|
361
|
- if (tztjmbBean.getCode() == M.success){
|
|
|
362
|
- if (tzMbAdatper==null){
|
|
|
363
|
- tzMbAdatper = new TztjmbAdapter(R.layout.item_fbhdxqtem,tztjmbBean.getData());
|
204
|
+ if (tztjmbBean.getCode() == M.success) {
|
|
|
205
|
+ if (tzMbAdatper == null) {
|
|
|
206
|
+ tzMbAdatper = new TztjmbAdapter(R.layout.item_fbhdxqtem, tztjmbBean.getData());
|
364
|
moBanRv.setAdapter(tzMbAdatper);
|
207
|
moBanRv.setAdapter(tzMbAdatper);
|
365
|
tzMbAdatper.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
208
|
tzMbAdatper.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
366
|
@Override
|
209
|
@Override
|
367
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
210
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
368
|
TextView hdtext = view.findViewById(R.id.hdtext);
|
211
|
TextView hdtext = view.findViewById(R.id.hdtext);
|
369
|
- if (tzMbAdatper.getData().get(position).isChecked()){
|
212
|
+ if (tzMbAdatper.getData().get(position).isChecked()) {
|
370
|
hdtext.setEnabled(false);
|
213
|
hdtext.setEnabled(false);
|
371
|
tzMbAdatper.getData().get(position).setChecked(false);
|
214
|
tzMbAdatper.getData().get(position).setChecked(false);
|
372
|
tzMbAdatper.getData().get(position).getContent();
|
215
|
tzMbAdatper.getData().get(position).getContent();
|
373
|
etTzzt.setText(tzMbAdatper.getData().get(position).getTitle());
|
216
|
etTzzt.setText(tzMbAdatper.getData().get(position).getTitle());
|
374
|
contentEd.setText(tzMbAdatper.getData().get(position).getContent());
|
217
|
contentEd.setText(tzMbAdatper.getData().get(position).getContent());
|
375
|
- }else {
|
218
|
+ } else {
|
376
|
tzMbAdatper.getData().get(position).setChecked(true);
|
219
|
tzMbAdatper.getData().get(position).setChecked(true);
|
377
|
hdtext.setEnabled(true);
|
220
|
hdtext.setEnabled(true);
|
378
|
}
|
221
|
}
|
379
|
}
|
222
|
}
|
380
|
});
|
223
|
});
|
381
|
- }else {
|
224
|
+ } else {
|
382
|
tzMbAdatper.setNewData(tztjmbBean.getData());
|
225
|
tzMbAdatper.setNewData(tztjmbBean.getData());
|
383
|
tzMbAdatper.notifyDataSetChanged();
|
226
|
tzMbAdatper.notifyDataSetChanged();
|
384
|
}
|
227
|
}
|
|
@@ -498,11 +341,11 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -498,11 +341,11 @@ public class FbtzA_ctivity extends BaseActivity { |
498
|
|
341
|
|
499
|
|
342
|
|
500
|
private void AudioPop() {
|
343
|
private void AudioPop() {
|
501
|
- View view = LayoutInflater.from(FbtzA_ctivity.this).inflate(R.layout.pop_ly_window,null);
|
344
|
+ View view = LayoutInflater.from(FbtzA_ctivity.this).inflate(R.layout.pop_ly_window, null);
|
502
|
// 弹窗
|
345
|
// 弹窗
|
503
|
final PopupWindow popupWindow = new PopupWindow(view, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
|
346
|
final PopupWindow popupWindow = new PopupWindow(view, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
|
504
|
ImageView ly_but = view.findViewById(R.id.ly_but);
|
347
|
ImageView ly_but = view.findViewById(R.id.ly_but);
|
505
|
- time_text= view.findViewById(R.id.time_text);
|
348
|
+ time_text = view.findViewById(R.id.time_text);
|
506
|
TextView ly_style = view.findViewById(R.id.ly_style);
|
349
|
TextView ly_style = view.findViewById(R.id.ly_style);
|
507
|
Circular_bar = view.findViewById(R.id.Circular_bar);
|
350
|
Circular_bar = view.findViewById(R.id.Circular_bar);
|
508
|
Circular_bar.setMax(600);
|
351
|
Circular_bar.setMax(600);
|
|
@@ -510,13 +353,13 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -510,13 +353,13 @@ public class FbtzA_ctivity extends BaseActivity { |
510
|
RelativeLayout luyi_rl = view.findViewById(R.id.luyi_rl);
|
353
|
RelativeLayout luyi_rl = view.findViewById(R.id.luyi_rl);
|
511
|
LinearLayout ly_li = view.findViewById(R.id.ly_li);
|
354
|
LinearLayout ly_li = view.findViewById(R.id.ly_li);
|
512
|
ViewGroup.LayoutParams layoutParams = ly_li.getLayoutParams();
|
355
|
ViewGroup.LayoutParams layoutParams = ly_li.getLayoutParams();
|
513
|
- layoutParams.height = layoutParams.height+M.getNavigationBarHeight(this);
|
356
|
+ layoutParams.height = layoutParams.height + M.getNavigationBarHeight(this);
|
514
|
ly_li.setLayoutParams(layoutParams);
|
357
|
ly_li.setLayoutParams(layoutParams);
|
515
|
popupWindow.setOutsideTouchable(true);
|
358
|
popupWindow.setOutsideTouchable(true);
|
516
|
popupWindow.setTouchable(true);
|
359
|
popupWindow.setTouchable(true);
|
517
|
popupWindow.setFocusable(true);
|
360
|
popupWindow.setFocusable(true);
|
518
|
setBackgroundAlpha(0.5f);//设置屏幕透明度
|
361
|
setBackgroundAlpha(0.5f);//设置屏幕透明度
|
519
|
- popupWindow.showAtLocation(view,Gravity.BOTTOM,0,M.getNavigationBarHeight(this));
|
362
|
+ popupWindow.showAtLocation(view, Gravity.BOTTOM, 0, M.getNavigationBarHeight(this));
|
520
|
Circular_bar.setVisibility(View.GONE);
|
363
|
Circular_bar.setVisibility(View.GONE);
|
521
|
AudioUtils audioUtils = new AudioUtils(FbtzA_ctivity.this);
|
364
|
AudioUtils audioUtils = new AudioUtils(FbtzA_ctivity.this);
|
522
|
luyi_rl.setOnClickListener(new View.OnClickListener() {
|
365
|
luyi_rl.setOnClickListener(new View.OnClickListener() {
|
|
@@ -527,8 +370,8 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -527,8 +370,8 @@ public class FbtzA_ctivity extends BaseActivity { |
527
|
int checkSelfPermission = ContextCompat.checkSelfPermission(FbtzA_ctivity.this,
|
370
|
int checkSelfPermission = ContextCompat.checkSelfPermission(FbtzA_ctivity.this,
|
528
|
Manifest.permission.RECORD_AUDIO);
|
371
|
Manifest.permission.RECORD_AUDIO);
|
529
|
if (permission == PackageManager.PERMISSION_GRANTED) {
|
372
|
if (permission == PackageManager.PERMISSION_GRANTED) {
|
530
|
- if (checkSelfPermission==PackageManager.PERMISSION_GRANTED){
|
|
|
531
|
- if (ly_but.isEnabled()){
|
373
|
+ if (checkSelfPermission == PackageManager.PERMISSION_GRANTED) {
|
|
|
374
|
+ if (ly_but.isEnabled()) {
|
532
|
ly_but.setEnabled(false);
|
375
|
ly_but.setEnabled(false);
|
533
|
Circular_bar.setVisibility(View.VISIBLE);
|
376
|
Circular_bar.setVisibility(View.VISIBLE);
|
534
|
ly_style.setText("点击结束录音");
|
377
|
ly_style.setText("点击结束录音");
|
|
@@ -536,18 +379,18 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -536,18 +379,18 @@ public class FbtzA_ctivity extends BaseActivity { |
536
|
audioUtils.StratAudio();
|
379
|
audioUtils.StratAudio();
|
537
|
popupWindow.dismiss();
|
380
|
popupWindow.dismiss();
|
538
|
|
381
|
|
539
|
- }else {
|
382
|
+ } else {
|
540
|
ly_but.setEnabled(true);
|
383
|
ly_but.setEnabled(true);
|
541
|
Circular_bar.setVisibility(View.GONE);
|
384
|
Circular_bar.setVisibility(View.GONE);
|
542
|
audioUtils.EndAudio();
|
385
|
audioUtils.EndAudio();
|
543
|
String filePath = audioUtils.getFilePath();
|
386
|
String filePath = audioUtils.getFilePath();
|
544
|
- postFile(filePath,3,"");
|
387
|
+ postFile(filePath, 3, "");
|
545
|
ly_style.setText("点击录音");
|
388
|
ly_style.setText("点击录音");
|
546
|
// Log.i(TAG, "onClick: "+filePath);
|
389
|
// Log.i(TAG, "onClick: "+filePath);
|
547
|
handler.removeCallbacks(runnable);
|
390
|
handler.removeCallbacks(runnable);
|
548
|
endTime();
|
391
|
endTime();
|
549
|
}
|
392
|
}
|
550
|
- }else {
|
393
|
+ } else {
|
551
|
//没有权限,申请权限。
|
394
|
//没有权限,申请权限。
|
552
|
ActivityCompat.requestPermissions(FbtzA_ctivity.this,
|
395
|
ActivityCompat.requestPermissions(FbtzA_ctivity.this,
|
553
|
new String[]{Manifest.permission.RECORD_AUDIO}, 1);
|
396
|
new String[]{Manifest.permission.RECORD_AUDIO}, 1);
|
|
@@ -576,7 +419,6 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -576,7 +419,6 @@ public class FbtzA_ctivity extends BaseActivity { |
576
|
}
|
419
|
}
|
577
|
|
420
|
|
578
|
|
421
|
|
579
|
-
|
|
|
580
|
/*--------------------------------------------查看大图详情----------------------------------------------------------*/
|
422
|
/*--------------------------------------------查看大图详情----------------------------------------------------------*/
|
581
|
float x1 = 0, x2 = 0; // 滑动坐标轴
|
423
|
float x1 = 0, x2 = 0; // 滑动坐标轴
|
582
|
int pageSze; // 页数
|
424
|
int pageSze; // 页数
|
|
@@ -741,8 +583,175 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -741,8 +583,175 @@ public class FbtzA_ctivity extends BaseActivity { |
741
|
|
583
|
|
742
|
@Override
|
584
|
@Override
|
743
|
protected void setEvent() {
|
585
|
protected void setEvent() {
|
|
|
586
|
+ includeBack.setOnClickListener(new View.OnClickListener() {
|
|
|
587
|
+ @Override
|
|
|
588
|
+ public void onClick(View v) {
|
|
|
589
|
+ finish();
|
|
|
590
|
+ }
|
|
|
591
|
+ });
|
|
|
592
|
+ classSelect.setOnClickListener(new View.OnClickListener() {
|
|
|
593
|
+ @Override
|
|
|
594
|
+ public void onClick(View view) {
|
|
|
595
|
+ Intent intent = new Intent();
|
|
|
596
|
+ intent.setClass(FbtzA_ctivity.this, JsjlActivity.class);
|
|
|
597
|
+ startActivityForResult(intent, STRAT_ID);
|
|
|
598
|
+ }
|
|
|
599
|
+ });
|
|
|
600
|
+
|
|
|
601
|
+ addTzmb.setOnClickListener(new View.OnClickListener() {
|
|
|
602
|
+ @Override
|
|
|
603
|
+ public void onClick(View v) {
|
|
|
604
|
+ Intent intent = new Intent(FbtzA_ctivity.this, Tzmb_Activity.class);
|
|
|
605
|
+ startActivity(intent);
|
|
|
606
|
+ startActivityForResult(intent, TZXZ_ID);
|
|
|
607
|
+ }
|
|
|
608
|
+ });
|
|
|
609
|
+ fabutzBut.setOnClickListener(new View.OnClickListener() {
|
|
|
610
|
+ @Override
|
|
|
611
|
+ public void onClick(View view) {
|
|
|
612
|
+ if (!classId.equals("")) {
|
|
|
613
|
+ if (!parentIds.equals("")) {
|
|
|
614
|
+ name = etTzzt.getText().toString();
|
|
|
615
|
+ if (!name.equals("")) {
|
|
|
616
|
+ content = contentEd.getText().toString();
|
|
|
617
|
+ if (!content.equals("")) {
|
|
|
618
|
+ WaitDialog.show(FbtzA_ctivity.this, "请稍候...");
|
|
|
619
|
+ ArrayList<String> videos = new ArrayList<>();
|
|
|
620
|
+ for (int i = 0; i < frequencyUrl.size(); i++) {
|
|
|
621
|
+ videos.add(frequencyUrl.get(i).getVideoPath());
|
|
|
622
|
+ }
|
|
|
623
|
+ audio = TextUtils.join(",", videos);
|
|
|
624
|
+ img = TextUtils.join(",", ImagesUrl);
|
|
|
625
|
+ video = TextUtils.join(",", videoUrl);
|
|
|
626
|
+ links = TextUtils.join(",", links_list);
|
|
|
627
|
+ Log.i("录音", "onClick: " + audio);
|
|
|
628
|
+ Api().fbtz(Config.Token, classId, teacherIds, parentIds, name, content, tzmb_item.getCall(), tzmb_item.getInscription(), img, audio, video, links).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<FbtzEntity>() {
|
|
|
629
|
+ @Override
|
|
|
630
|
+ public void onSubscribe(Disposable d) {
|
|
|
631
|
+
|
|
|
632
|
+ }
|
|
|
633
|
+
|
|
|
634
|
+ @Override
|
|
|
635
|
+ public void onNext(FbtzEntity fbtzEntity) {
|
|
|
636
|
+ if (fbtzEntity.getCode() == M.success) {
|
|
|
637
|
+ finish();
|
|
|
638
|
+ } else {
|
|
|
639
|
+ Toast.makeText(ctx, "" + fbtzEntity.getMsg(), Toast.LENGTH_SHORT).show();
|
|
|
640
|
+ WaitDialog.dismiss();
|
|
|
641
|
+ }
|
|
|
642
|
+ }
|
|
|
643
|
+
|
|
|
644
|
+ @Override
|
|
|
645
|
+ public void onError(Throwable e) {
|
|
|
646
|
+
|
|
|
647
|
+ }
|
|
|
648
|
+
|
|
|
649
|
+ @Override
|
|
|
650
|
+ public void onComplete() {
|
|
|
651
|
+
|
|
|
652
|
+ }
|
|
|
653
|
+ });
|
|
|
654
|
+ } else {
|
|
|
655
|
+ Toast.makeText(ctx, "请输入通知内容", Toast.LENGTH_SHORT).show();
|
|
|
656
|
+ }
|
|
|
657
|
+ } else {
|
|
|
658
|
+ Toast.makeText(ctx, "请输入通知的标题", Toast.LENGTH_SHORT).show();
|
|
|
659
|
+ }
|
|
|
660
|
+ } else {
|
|
|
661
|
+ Toast.makeText(ctx, "请选择接收通知的家长", Toast.LENGTH_SHORT).show();
|
|
|
662
|
+ }
|
|
|
663
|
+ } else {
|
|
|
664
|
+ Toast.makeText(ctx, "请选择接受的班级", Toast.LENGTH_SHORT).show();
|
|
|
665
|
+ }
|
|
|
666
|
+ }
|
|
|
667
|
+ });
|
|
|
668
|
+
|
|
|
669
|
+ addTzmb.setOnClickListener(new View.OnClickListener() {
|
|
|
670
|
+ @Override
|
|
|
671
|
+ public void onClick(View view) {
|
|
|
672
|
+ Intent intent = new Intent();
|
|
|
673
|
+ intent.setClass(FbtzA_ctivity.this, Tzmb_Activity.class);
|
|
|
674
|
+ startActivityForResult(intent, TZXZ_ID);
|
|
|
675
|
+ }
|
|
|
676
|
+ });
|
|
|
677
|
+ imageAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
678
|
+ @Override
|
|
|
679
|
+ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
680
|
+ imgPop(picAndVideo, position);
|
|
|
681
|
+ }
|
|
|
682
|
+ });
|
|
|
683
|
+ audioAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
684
|
+ @Override
|
|
|
685
|
+ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
686
|
+ text_time = view.findViewById(R.id.text_time);
|
|
|
687
|
+ List<VideoEntity> data = audioAdapter.getData();
|
|
|
688
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
689
|
+ data.get(i).setChecked(false);
|
|
|
690
|
+ }
|
744
|
|
691
|
|
|
|
692
|
+ try {
|
|
|
693
|
+ if (mediaPlayer.isPlaying()) {
|
|
|
694
|
+ mediaPlayer.reset();
|
|
|
695
|
+ data.get(position).setChecked(true);
|
|
|
696
|
+ mediaPlayer.setDataSource(data.get(position).getVideoPath());
|
|
|
697
|
+ mediaPlayer.prepare();
|
|
|
698
|
+ mediaPlayer.start();
|
|
|
699
|
+ updateDescTv();
|
|
|
700
|
+ } else {
|
|
|
701
|
+ mediaPlayer.reset();
|
|
|
702
|
+ mediaPlayer.setDataSource(data.get(position).getVideoPath());
|
|
|
703
|
+ mediaPlayer.prepare();
|
|
|
704
|
+ mediaPlayer.start();
|
|
|
705
|
+ updateDescTv();
|
|
|
706
|
+ }
|
|
|
707
|
+ mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
|
|
708
|
+ @Override
|
|
|
709
|
+ public void onCompletion(MediaPlayer mediaPlayer) {
|
|
|
710
|
+ int duration = mediaPlayer.getDuration();
|
|
|
711
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
|
|
|
712
|
+ Date date = new Date(duration);
|
|
|
713
|
+ String format = simpleDateFormat.format(date);
|
|
|
714
|
+ text_time.setText(format);
|
|
|
715
|
+ }
|
|
|
716
|
+ });
|
|
|
717
|
+ } catch (IOException e) {
|
|
|
718
|
+ e.printStackTrace();
|
|
|
719
|
+ }
|
|
|
720
|
+ adapter.notifyDataSetChanged();
|
|
|
721
|
+ }
|
|
|
722
|
+ });
|
|
|
723
|
+ audioAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
|
|
724
|
+ @Override
|
|
|
725
|
+ public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
726
|
+ List<VideoEntity> data = audioAdapter.getData();
|
|
|
727
|
+ data.remove(position);
|
|
|
728
|
+ mediaPlayer.stop();
|
|
|
729
|
+ audioAdapter.notifyDataSetChanged();
|
|
|
730
|
+ }
|
|
|
731
|
+ });
|
|
|
732
|
+ imgRecycle.setLayoutManager(new GridLayoutManager(this, 3));
|
|
|
733
|
+ imgRecycle.setAdapter(imageAdapter);
|
|
|
734
|
+ imageAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
|
|
735
|
+ @Override
|
|
|
736
|
+ public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
737
|
+ switch (view.getId()) {
|
|
|
738
|
+ case R.id.v_delete:
|
|
|
739
|
+ if (picAndVideo.get(position).getType() == 1) {
|
|
|
740
|
+ ImagesUrl.remove(picAndVideo.get(position).getPath());
|
|
|
741
|
+ } else if (picAndVideo.get(position).getType() == 2) {
|
|
|
742
|
+ videoUrl.remove(picAndVideo.get(position).getPath());
|
|
|
743
|
+ } else if (picAndVideo.get(position).getType() == 3) {
|
|
|
744
|
+ frequencyUrl.remove(picAndVideo.get(position).getPath());
|
|
|
745
|
+ }
|
|
|
746
|
+ picAndVideo.remove(position);
|
|
|
747
|
+ adapter.notifyDataSetChanged();
|
|
|
748
|
+ break;
|
|
|
749
|
+ case R.id.item_select_pic_video:
|
745
|
|
750
|
|
|
|
751
|
+ break;
|
|
|
752
|
+ }
|
|
|
753
|
+ }
|
|
|
754
|
+ });
|
746
|
}
|
755
|
}
|
747
|
|
756
|
|
748
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
757
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
|
@@ -827,9 +836,6 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -827,9 +836,6 @@ public class FbtzA_ctivity extends BaseActivity { |
827
|
|
836
|
|
828
|
}
|
837
|
}
|
829
|
|
838
|
|
830
|
-
|
|
|
831
|
-
|
|
|
832
|
-
|
|
|
833
|
/*--------------------------------------------------------------------------图片适配器----------------------------------------------------------------*/
|
839
|
/*--------------------------------------------------------------------------图片适配器----------------------------------------------------------------*/
|
834
|
class ImageAdapter extends BaseQuickAdapter<JxtImageEntity, BaseViewHolder> {
|
840
|
class ImageAdapter extends BaseQuickAdapter<JxtImageEntity, BaseViewHolder> {
|
835
|
public ImageAdapter(int layoutResId, @Nullable List<JxtImageEntity> data) {
|
841
|
public ImageAdapter(int layoutResId, @Nullable List<JxtImageEntity> data) {
|
|
@@ -897,6 +903,7 @@ public class FbtzA_ctivity extends BaseActivity { |
|
@@ -897,6 +903,7 @@ public class FbtzA_ctivity extends BaseActivity { |
897
|
String format = simpleDateFormat.format(date);
|
903
|
String format = simpleDateFormat.format(date);
|
898
|
time_text.setText(format);
|
904
|
time_text.setText(format);
|
899
|
}
|
905
|
}
|
|
|
906
|
+
|
900
|
private void endTime() {
|
907
|
private void endTime() {
|
901
|
time = 0;
|
908
|
time = 0;
|
902
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
|
909
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
|