作者 123

add

... ... @@ -52,7 +52,7 @@ public class ActiveSignEntity implements Serializable {
this.data = data;
}
public static class DataBean implements Serializable{
public static class DataBean implements Serializable {
private int id;// 40,
private int teacher_id;// 40,
... ... @@ -85,6 +85,15 @@ public class ActiveSignEntity implements Serializable {
private int is_sign;//0=未报名1=已报名
private String teacher_photo;
private int is_online;//是否已截止报名:0=否,1=是
private int is_can_forward;//是否可以转发:0=否,1=是
public int getIs_can_forward() {
return is_can_forward;
}
public void setIs_can_forward(int is_can_forward) {
this.is_can_forward = is_can_forward;
}
public int getIs_online() {
return is_online;
... ... @@ -333,7 +342,8 @@ public class ActiveSignEntity implements Serializable {
public void setRate(int rate) {
this.rate = rate;
}
public static class ListBean implements Serializable{
public static class ListBean implements Serializable {
private List<SeeBean> un_view;
private List<SeeBean> re_view;
... ... @@ -353,7 +363,7 @@ public class ActiveSignEntity implements Serializable {
this.re_view = re_view;
}
public static class SeeBean implements Serializable{
public static class SeeBean implements Serializable {
/**
* id : 1
* parent_name : 吴冠儒
... ...
... ... @@ -97,6 +97,7 @@ public class JxtEntity implements Serializable {
private String teacher_photo;
private int uncomment_num;
private int comment_num;
private int is_can_forward;//是否可以转发:0=否,1=是
private String deadline_text;//截止时间
private int task_type;//作业类型:1=线上提交,2=线上查看,3=线下作业,4=校外作业
private List<String> audio;
... ... @@ -106,6 +107,14 @@ public class JxtEntity implements Serializable {
private List<UncommentListBean> uncomment_list;
private List<CommentListBean> comment_list;
public int getIs_can_forward() {
return is_can_forward;
}
public void setIs_can_forward(int is_can_forward) {
this.is_can_forward = is_can_forward;
}
public String getDeadline_text() {
return deadline_text;
}
... ...
... ... @@ -274,6 +274,9 @@ public class Fbhd_Activity extends BaseActivity {
bean1.setId(bean);
outStudent.add(bean1);
}
workTitle.setEnabled(false);
contentEd.setEnabled(false);
popleNum.setEnabled(false);
}
mAddHdBean.setTitle(mInfo.getData().getTitle());//主题
workTitle.setText(mInfo.getData().getTitle());
... ... @@ -381,6 +384,10 @@ public class Fbhd_Activity extends BaseActivity {
isTj.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (outStudent.size() > 0) {//转发
Toast.makeText(Fbhd_Activity.this, "不可编辑", Toast.LENGTH_SHORT).show();
return;
}
if (isHaveTj.isEnabled()) {
mAddHdBean.setOpen_switch(0);//否
isHaveTj.setEnabled(false);
... ... @@ -407,6 +414,7 @@ public class Fbhd_Activity extends BaseActivity {
Intent intent = new Intent();
intent.putExtra("AllDate", getClassListEntity);
if (outStudent.size() > 0) {
intent.putExtra("isShowTeacher", 1);//不显示老师
intent.putExtra("class_id", mInfo.getData().getClass_id() + "");//班级id
intent.putExtra("screenPersion", outStudent);//要筛掉的人
}
... ... @@ -415,6 +423,7 @@ public class Fbhd_Activity extends BaseActivity {
} else {
Intent intent = new Intent();
if (outStudent.size() > 0) {
intent.putExtra("isShowTeacher", 1);//不显示老师
intent.putExtra("class_id", mInfo.getData().getClass_id() + "");//班级id
intent.putExtra("screenPersion", outStudent);//要筛掉的人
}
... ... @@ -426,6 +435,10 @@ public class Fbhd_Activity extends BaseActivity {
hdSelect.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (outStudent.size() > 0) {//转发
Toast.makeText(Fbhd_Activity.this, "不可编辑", Toast.LENGTH_SHORT).show();
return;
}
Intent intent = new Intent();
intent.setClass(Fbhd_Activity.this, HdMbActivity.class);
startActivityForResult(intent, HDXZ_ID);
... ... @@ -434,6 +447,10 @@ public class Fbhd_Activity extends BaseActivity {
ll_jiezhi.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (outStudent.size() > 0) {//转发
Toast.makeText(Fbhd_Activity.this, "不可编辑", Toast.LENGTH_SHORT).show();
return;
}
hintKbTwo();
endTime.setTag(1);
DebugLog.e("ll_jiezhi-===" + endTime.getTag());
... ... @@ -446,6 +463,10 @@ public class Fbhd_Activity extends BaseActivity {
endTime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (outStudent.size() > 0) {//转发
Toast.makeText(Fbhd_Activity.this, "不可编辑", Toast.LENGTH_SHORT).show();
return;
}
hintKbTwo();
endTime.setTag(0);
DebugLog.e("endTime-===" + endTime.getTag());
... ... @@ -460,6 +481,10 @@ public class Fbhd_Activity extends BaseActivity {
imageAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
if (outStudent.size() > 0) {//转发
Toast.makeText(Fbhd_Activity.this, "不可编辑", Toast.LENGTH_SHORT).show();
return;
}
switch (view.getId()) {
case R.id.v_delete:
if (picAndVideo.get(position).getType() == 1) {
... ... @@ -705,6 +730,10 @@ public class Fbhd_Activity extends BaseActivity {
@OnClick({R.id.ly_img, R.id.tp_img, R.id.sp_img, R.id.lj_img})
public void onViewClicked(View view) {
if (outStudent.size() > 0) {//转发
Toast.makeText(Fbhd_Activity.this, "不可编辑", Toast.LENGTH_SHORT).show();
return;
}
switch (view.getId()) {
case R.id.ly_img:
hintKbTwo();
... ... @@ -909,6 +938,10 @@ public class Fbhd_Activity extends BaseActivity {
tzMbAdatper.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
if (outStudent.size() > 0) {//转发
Toast.makeText(Fbhd_Activity.this, "不可编辑", Toast.LENGTH_SHORT).show();
return;
}
for (HdTjmbBean.DataBean bean : tzMbAdatper.getData()) {
bean.setChecked(false);
}
... ...
... ... @@ -426,6 +426,7 @@ public class Hdxq_Activity extends BaseActivity {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
Date date = new Date(duration);
String format = simpleDateFormat.format(date);
DebugLog.e("format===" + format);
text_time.setText(format);
}
});
... ... @@ -716,6 +717,9 @@ public class Hdxq_Activity extends BaseActivity {
tydpPopupwindow.setFocusable(true);
tydpPopupwindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
tydpPopupwindow.showAtLocation(view, Gravity.BOTTOM, 0, M.getNavigationBarHeight(this));
if (mInfo.getData().getIs_can_forward() == 0) {
view.findViewById(R.id.tv_zhuanfa).setVisibility(View.GONE);
}
view.findViewById(R.id.tv_excel).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
... ... @@ -1140,6 +1144,7 @@ public class Hdxq_Activity extends BaseActivity {
mediaPlayer = null;
}
mHandler.removeCallbacksAndMessages(null);
myHandler.removeCallbacksAndMessages(null);
}
}
... ...
... ... @@ -547,6 +547,7 @@ public class FbtzA_ctivity extends BaseActivity {
Intent intent = new Intent();
intent.putExtra("AllDate", getClassListEntity);
if (outStudent.size() > 0) {
intent.putExtra("isShowTeacher", 1);//不显示老师
intent.putExtra("class_id", tzxqEntity.getData().getClass_id() + "");//班级id
intent.putExtra("screenPersion", outStudent);//要筛掉的人
}
... ... @@ -555,6 +556,7 @@ public class FbtzA_ctivity extends BaseActivity {
} else {
Intent intent = new Intent();
if (outStudent.size() > 0) {
intent.putExtra("isShowTeacher", 1);//不显示老师
intent.putExtra("class_id", tzxqEntity.getData().getClass_id() + "");//班级id
intent.putExtra("screenPersion", outStudent);//要筛掉的人
}
... ...
... ... @@ -685,6 +685,26 @@ public class ZytjActivity extends BaseActivity {
}
}
/**
* 上传录音前的准备工作
* 录音如果很长不会马上保存完成,需要等一会,用这个定时任务来处理,activity销毁一定要removeCallbacksAndMessages
*/
AudioUtils audioUtils = new AudioUtils(ZytjActivity.this);
Handler uploadhandler = new Handler();
Runnable uploadRunnable = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
//要做的事情
if (audioUtils.getFilePath() != null) {
DebugLog.e("哈哈");
postFile(audioUtils.getFilePath(), 3, "");
} else {
DebugLog.e("哈哈null");
uploadhandler.postDelayed(this, 1000);
}
}
};
/*--------------------------------------------录音PopWindow----------------------------------------------------------*/
private Handler handler = new Handler();
CircularProgressBar Circular_bar;
... ... @@ -738,7 +758,6 @@ public class ZytjActivity extends BaseActivity {
setBackgroundAlpha(0.5f);//设置屏幕透明度
popupWindow.showAtLocation(view, Gravity.BOTTOM, 0, M.getNavigationBarHeight(this));
Circular_bar.setVisibility(View.GONE);
AudioUtils audioUtils = new AudioUtils(ZytjActivity.this);
luyi_rl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
... ... @@ -759,7 +778,7 @@ public class ZytjActivity extends BaseActivity {
Circular_bar.setVisibility(View.GONE);
audioUtils.EndAudio();
String filePath = audioUtils.getFilePath();
postFile(filePath, 3, "");
uploadhandler.postDelayed(uploadRunnable, 1000);
ly_style.setText("点击录音");
handler.removeCallbacks(runnable);
endTime();
... ... @@ -906,165 +925,6 @@ public class ZytjActivity extends BaseActivity {
}
/*--------------------------------------------查看大图详情----------------------------------------------------------*/
float x1 = 0, x2 = 0; // 滑动坐标轴
int pageSze; // 页数
StandardGSYVideoPlayer player;
GSYVideoOptionBuilder gsyVideoOption;
private boolean isPlay;
private void imgPop(List<JxtImageEntity> imgList, int pageSze1) {
this.pageSze = pageSze1;
View view = LayoutInflater.from(ZytjActivity.this).inflate(R.layout.pop_zpgl_image, null);
ImageView pop_back = view.findViewById(R.id.pop_image_back);
ImageView pop_img = view.findViewById(R.id.pop_zpgl_image_img);
TextView pop_value = view.findViewById(R.id.pop_zpgl_image_value);
player = view.findViewById(R.id.videoplay);
View player_gs = view.findViewById(R.id.player_gs);
player.getBackButton().setVisibility(View.GONE);
gsyVideoOption = new GSYVideoOptionBuilder();
// 初始值
pop_value.setText((pageSze + 1) + "/" + imgList.size());
if (!TextUtils.isEmpty(imgList.get(pageSze1).getMinPath())) {
pop_img.setVisibility(View.GONE);
player.setVisibility(View.VISIBLE);
player_gs.setVisibility(View.VISIBLE);
setplay(gsyVideoOption, imgList.get(pageSze1).getPath());
} else {
M.Glide(imgList.get(pageSze).getPath(), pop_img, activity);
}
// 弹窗
final PopupWindow popupWindow = new PopupWindow(view, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
popupWindow.setOutsideTouchable(true);
popupWindow.setTouchable(true);
popupWindow.setFocusable(true);
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
popupWindow.showAsDropDown(view);
// back
pop_back.setOnClickListener(v -> {
if (player.isInPlayingState()) {
player.getCurrentPlayer().release();
}
popupWindow.dismiss();
});
popupWindow.setOnDismissListener(() -> {
if (popupWindow.isShowing() == false) {
if (player != null && player.isInPlayingState()) {
player.getCurrentPlayer().onVideoPause();
}
}
});
WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
Display defaultDisplay = windowManager.getDefaultDisplay();
int width = defaultDisplay.getWidth();
M.log("pageSze", pageSze + "");
view.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: // down
x1 = event.getX();
break;
case MotionEvent.ACTION_UP:
x2 = event.getX();
if ((x2 - x1) > (width / 3)) {
if ((pageSze - 1) >= 0) {
pageSze--;
if (!TextUtils.isEmpty(imgList.get(pageSze).getMinPath())) {
pop_img.setVisibility(View.GONE);
pop_img.setVisibility(View.GONE);
player.setVisibility(View.VISIBLE);
player_gs.setVisibility(View.VISIBLE);
if (gsyVideoOption == null) {
gsyVideoOption = new GSYVideoOptionBuilder();
}
setplay(gsyVideoOption, imgList.get(pageSze).getPath());
pop_value.setText((pageSze + 1) + "/" + imgList.size());
} else {
pop_img.setVisibility(View.VISIBLE);
player.setVisibility(View.GONE);
player_gs.setVisibility(View.GONE);
M.Glide(imgList.get(pageSze).getPath(), pop_img, activity);
pop_value.setText((pageSze + 1) + "/" + imgList.size());
}
M.log("video", imgList.get(pageSze));
} else {
M.toast(activity, "已是第一页");
}
} else if ((x1 - x2) > (width / 3)) {
if ((pageSze + 1) < imgList.size()) {
pageSze++;
if (!TextUtils.isEmpty(imgList.get(pageSze).getMinPath())) {
pop_img.setVisibility(View.GONE);
pop_img.setVisibility(View.GONE);
player.setVisibility(View.VISIBLE);
player_gs.setVisibility(View.VISIBLE);
if (gsyVideoOption == null) {
gsyVideoOption = new GSYVideoOptionBuilder();
}
setplay(gsyVideoOption, imgList.get(pageSze).getPath());
pop_value.setText((pageSze + 1) + "/" + imgList.size());
} else {
pop_img.setVisibility(View.VISIBLE);
player.setVisibility(View.GONE);
player_gs.setVisibility(View.GONE);
M.Glide(imgList.get(pageSze).getPath(), pop_img, activity);
pop_value.setText((pageSze + 1) + "/" + imgList.size());
}
} else {
M.toast(activity, "已是最后一页");
}
}
break;
}
return true;
}
});
}
private void setplay(GSYVideoOptionBuilder gsyVideoOption, String url) {
gsyVideoOption
.setIsTouchWiget(true)
.setRotateViewAuto(false)
.setLockLand(false)
.setAutoFullWithSize(true)
.setShowFullAnimation(false)
.setNeedLockFull(true)
.setUrl(url)
.setCacheWithPlay(false) // .setVideoTitle("测试视频")
.setVideoAllCallBack(new GSYSampleCallBack() {
@Override
public void onPrepared(String url, Object... objects) {
super.onPrepared(url, objects);
//开始播放了才能旋转和全屏
isPlay = true;
}
@Override
public void onQuitFullscreen(String url, Object... objects) {
super.onQuitFullscreen(url, objects);
}
}).setLockClickListener(new LockClickListener() {
@Override
public void onClick(View view, boolean lock) {
}
}).build(player);
player.startPlayLogic();
}
public void setBackgroundAlpha(float bgAlpha) {
WindowManager.LayoutParams lp = getWindow()
... ... @@ -1072,5 +932,18 @@ public class ZytjActivity extends BaseActivity {
lp.alpha = bgAlpha;
getWindow().setAttributes(lp);
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mediaPlayer != null) {
mediaPlayer.stop();
mediaPlayer.release();
mediaPlayer = null;
}
uploadhandler.removeCallbacksAndMessages(null);
handler.removeCallbacksAndMessages(null);
myHandler.removeCallbacksAndMessages(null);
}
}
... ...
... ... @@ -108,7 +108,8 @@ public class ZyxqPerActivity extends BaseActivity {
RecyclerView voiceRecycler;
@BindView(R.id.img_recycle)
RecyclerView imgRecycle;
@BindView(R.id.ll_xxzc_content)
LinearLayout ll_xxzc_content;
getStudentTaskInfoEntity myTzxqEntity;
MediaPlayer mediaPlayer;
@BindView(R.id.pj_zyTitle)
... ... @@ -199,6 +200,7 @@ public class ZyxqPerActivity extends BaseActivity {
if (getIntent().getStringExtra("type").equals("8")) {
tv_date.setText(tzxqEntity.getData().getName());
tv_date.setVisibility(View.VISIBLE);
ll_xxzc_content.setVisibility(View.VISIBLE);
}
if (tzxqEntity.getData().getTask_type() == 1) {
tv_type.setText("作业类型:线上提交");
... ...
... ... @@ -163,6 +163,8 @@ public class Zyxq_Activity extends BaseActivity {
TextView tv_xx_type;
@BindView(R.id.tv_stop_time)
TextView tv_stop_time;
@BindView(R.id.ll_xxzc_content)
LinearLayout ll_xxzc_content;
boolean isSet = false;
private List<Fragment> fragmentList = new ArrayList<Fragment>();
private List<String> tabNames = new ArrayList<>();
... ... @@ -172,7 +174,7 @@ public class Zyxq_Activity extends BaseActivity {
AudioAdapter myaudio;
Zy_Rv_Wck_Fragment zy_rv_wck_fragment;
Zy_Rv_ck_Fragment zy_rv_ck_fragment;
ItemAdapter itemAdapter,itemAdapter2;
ItemAdapter itemAdapter, itemAdapter2;
getTaskEvaluateOptionEntity taskEvaluate;
List<VideoEntity> frequencyUrl = new ArrayList<>();
private static final int REQUEST_CODE = 0x00000011; // 图片
... ... @@ -276,10 +278,10 @@ public class Zyxq_Activity extends BaseActivity {
public void onPageSelected(int i) {
if (tabNames.get(i).contains("未提交")
|| tabNames.get(i).contains("已点评")) {//全部
DebugLog.e("checkLayout===111"+tabNames.get(i));
DebugLog.e("checkLayout===111" + tabNames.get(i));
checkLayout.setVisibility(View.GONE);
}else {
DebugLog.e("checkLayout===222"+tabNames.get(i));
} else {
DebugLog.e("checkLayout===222" + tabNames.get(i));
checkLayout.setVisibility(View.VISIBLE);
}
... ... @@ -354,8 +356,10 @@ public class Zyxq_Activity extends BaseActivity {
myJxtEntity = jxtEntity;
if (getIntent().getStringExtra("type").equals("8")) {
tv_date.setText(jxtEntity.getData().getName());
ll_xxzc_content.setVisibility(View.VISIBLE);
}
if (!StringUtils.isEmptyString(jxtEntity.getData().getName())) {
ll_xxzc_content.setVisibility(View.GONE);
title.setText(jxtEntity.getData().getName());
}
class_id = jxtEntity.getData().getClass_id();
... ... @@ -703,7 +707,7 @@ public class Zyxq_Activity extends BaseActivity {
allCheckLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (zy_rv_ck_fragment.getDateSize() == 0&&myJxtEntity.getData().getIs_online()!= 0) {
if (zy_rv_ck_fragment.getDateSize() == 0 && myJxtEntity.getData().getIs_online() != 0) {
Toast.makeText(Zyxq_Activity.this, "暂无学生提交作业", Toast.LENGTH_SHORT).show();
return;
}
... ... @@ -756,7 +760,7 @@ public class Zyxq_Activity extends BaseActivity {
fbButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (zy_rv_ck_fragment.getDateSize() == 0&&myJxtEntity.getData().getIs_online()!= 0) {
if (zy_rv_ck_fragment.getDateSize() == 0 && myJxtEntity.getData().getIs_online() != 0) {
Toast.makeText(Zyxq_Activity.this, "暂无学生提交作业", Toast.LENGTH_SHORT).show();
return;
}
... ... @@ -783,6 +787,9 @@ public class Zyxq_Activity extends BaseActivity {
view.findViewById(R.id.tv_zhuanfa).setVisibility(View.GONE);
view.findViewById(R.id.tv_fuyong).setVisibility(View.GONE);
} else {
if (myJxtEntity.getData().getIs_can_forward() == 0) {
view.findViewById(R.id.tv_zhuanfa).setVisibility(View.GONE);
}
view.findViewById(R.id.tv_fuyong).setVisibility(View.VISIBLE);
}
... ... @@ -984,7 +991,7 @@ public class Zyxq_Activity extends BaseActivity {
EditText edit_content;
public void yjdpPop() {
for(getTaskEvaluateOptionEntity.DataBean bean:taskEvaluate.getData()){
for (getTaskEvaluateOptionEntity.DataBean bean : taskEvaluate.getData()) {
bean.setChecked(false);
}
View view = LayoutInflater.from(Zyxq_Activity.this).inflate(R.layout.pop_tydp_layout, null);
... ... @@ -1075,7 +1082,7 @@ public class Zyxq_Activity extends BaseActivity {
public void yjdpPops(String myStudentId) {
DebugLog.e("bunebab====");
for(getTaskEvaluateOptionEntity.DataBean bean:taskEvaluate.getData()){
for (getTaskEvaluateOptionEntity.DataBean bean : taskEvaluate.getData()) {
bean.setChecked(false);
}
if (tydpPopupwindowOnle == null) {
... ...
... ... @@ -60,8 +60,10 @@ public class JsjlActivity extends BaseActivity {
//转发要去除的学生 只存id
private ArrayList<getClassListEntity.DataBean.ParentBean> outStudent = new ArrayList<>();
private String class_id = "";
private int isShowTeacher = 0;//0-显示 1-不显示
@Override
protected void initData() {
isShowTeacher = getIntent().getIntExtra("isShowTeacher", 0);
includeBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
... ... @@ -87,7 +89,6 @@ public class JsjlActivity extends BaseActivity {
class_id = getIntent().getStringExtra("class_id");
if (getIntent().getSerializableExtra("screenPersion") != null) {
outStudent.addAll((ArrayList<getClassListEntity.DataBean.ParentBean>) getIntent().getSerializableExtra("screenPersion"));
DebugLog.e("7listlist==="+outStudent.toString());
}
if (getIntent().getSerializableExtra("AllDate") == null) {
... ... @@ -344,6 +345,7 @@ public class JsjlActivity extends BaseActivity {
}
student_num.setText("家长(" + x + "/" + item.getParent().size() + ")");
class_num.setText("成员" + x + "/" + item.getParent().size());
helper.addOnClickListener(R.id.show_re);
class_recycler.setLayoutManager(new LinearLayoutManager(mContext));
teacher_recycler.setLayoutManager(new LinearLayoutManager(mContext));
... ... @@ -351,7 +353,14 @@ public class JsjlActivity extends BaseActivity {
Jxt_Jl_TeacherAdapter jxt_teacherAdapter = new Jxt_Jl_TeacherAdapter(R.layout.item_class_select, item.getTeacher());
class_recycler.setAdapter(class_adapter);
teacher_recycler.setAdapter(jxt_teacherAdapter);
jxt_teacherAdapter.addHeaderView(header_teacher_and_student);
if (isShowTeacher == 1) {
teacher_recycler.setVisibility(View.GONE);
class_teacher.setText("");
} else {
teacher_recycler.setVisibility(View.VISIBLE);
class_teacher.setText("教师" + y + "/" + item.getTeacher().size());
jxt_teacherAdapter.addHeaderView(header_teacher_and_student);
}
jxt_teacherAdapter.addFooterView(footer_teacher_and_student);
class_adapter.addHeaderView(header_teacher);
class_adapter.addFooterView(footer_teacher);
... ...
... ... @@ -68,6 +68,7 @@ import com.yinhebairong.clasmanage.entity.getStudentTaskInfoEntity;
import com.yinhebairong.clasmanage.m.M;
import com.yinhebairong.clasmanage.network.ApiService;
import com.yinhebairong.clasmanage.ui.AudioAndVideoPlayActivity2;
import com.yinhebairong.clasmanage.ui.jxt.activity.Zy.ZytjActivity;
import com.yinhebairong.clasmanage.ui.jxt.fragment.All_Fragment;
import com.yinhebairong.clasmanage.ui.jxt.fragment.zy.ZY_Rv_Fragment;
import com.yinhebairong.clasmanage.utils.AudioUtils;
... ... @@ -296,7 +297,7 @@ public class AddGrowthRecordActivity extends BaseActivity {
WaitDialog.dismiss();
if (fbtzEntity.getCode() == M.success) {
Toast.makeText(AddGrowthRecordActivity.this, "发布成功", Toast.LENGTH_SHORT).show();
setResult(9527);
setResult(RESULT_OK);
AddGrowthRecordActivity.this.finish();
} else {
Toast.makeText(AddGrowthRecordActivity.this, fbtzEntity.getMsg(), Toast.LENGTH_SHORT).show();
... ... @@ -739,7 +740,6 @@ public class AddGrowthRecordActivity extends BaseActivity {
setBackgroundAlpha(0.5f);//设置屏幕透明度
popupWindow.showAtLocation(view, Gravity.BOTTOM, 0, M.getNavigationBarHeight(this));
Circular_bar.setVisibility(View.GONE);
AudioUtils audioUtils = new AudioUtils(AddGrowthRecordActivity.this);
luyi_rl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
... ... @@ -759,8 +759,7 @@ public class AddGrowthRecordActivity extends BaseActivity {
ly_but.setEnabled(true);
Circular_bar.setVisibility(View.GONE);
audioUtils.EndAudio();
String filePath = audioUtils.getFilePath();
postFile(filePath, 3, "");
uploadhandler.postDelayed(uploadRunnable, 1000);
ly_style.setText("点击录音");
handler.removeCallbacks(runnable);
endTime();
... ... @@ -918,5 +917,26 @@ public class AddGrowthRecordActivity extends BaseActivity {
public void hintKbTwo() {
KeyBoardUtils.closeKeybord(contentEd, this);
}
/**
* 上传录音前的准备工作
* 录音如果很长不会马上保存完成,需要等一会,用这个定时任务来处理,activity销毁一定要removeCallbacksAndMessages
*/
AudioUtils audioUtils = new AudioUtils(AddGrowthRecordActivity.this);
Handler uploadhandler = new Handler();
Runnable uploadRunnable = new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
//要做的事情
if (audioUtils.getFilePath() != null) {
DebugLog.e("哈哈");
postFile(audioUtils.getFilePath(), 3, "");
} else {
DebugLog.e("哈哈null");
uploadhandler.postDelayed(this, 1000);
}
}
};
}
... ...
... ... @@ -3,6 +3,8 @@ package com.yinhebairong.clasmanage.ui.main.activity.czjl;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
... ... @@ -48,6 +50,7 @@ import com.yinhebairong.clasmanage.entity.getClassPersonListEntity;
import com.yinhebairong.clasmanage.m.M;
import com.yinhebairong.clasmanage.network.ApiError;
import com.yinhebairong.clasmanage.ui.AudioAndVideoPlayActivity2;
import com.yinhebairong.clasmanage.ui.jxt.activity.HD.Hdxq_Activity;
import com.yinhebairong.clasmanage.ui.jxt.activity.Zy.Zyxq_Activity;
import com.yinhebairong.clasmanage.ui.jxt.fragment.All_Fragment;
import com.yinhebairong.clasmanage.ui.jxt.fragment.xxzy.XXZY_Rv_Fragment;
... ... @@ -60,10 +63,16 @@ import com.yinhebairong.clasmanage.view.image.ImagePagerActivity;
import com.yinhebairong.clasmanage.widget.CircleImageView;
import com.yinhebairong.clasmanage.widget.SupportPopupWindow;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import butterknife.BindView;
import butterknife.OnClick;
... ... @@ -292,7 +301,7 @@ public class GrowthRecordActivity extends BaseActivity {
@Override
protected void convert(BaseViewHolder helper, GrowUpEntity.DataBeanX.DataBean item) {
TextView text_time = helper.itemView.findViewById(R.id.tv_time);
TextView tv_time = helper.itemView.findViewById(R.id.tv_time);
TextView tv_name = helper.itemView.findViewById(R.id.tv_name);
TextView tv_zhankai = helper.itemView.findViewById(R.id.tv_zhankai);
TextView tv_content = helper.itemView.findViewById(R.id.tv_content);
... ... @@ -300,7 +309,7 @@ public class GrowthRecordActivity extends BaseActivity {
RecyclerView rv_audio = helper.itemView.findViewById(R.id.rv_audio);
RecyclerView rv_image = helper.itemView.findViewById(R.id.rv_image);
text_time.setText(item.getCreate_time());
tv_time.setText(item.getCreate_time());
tv_name.setText(item.getParents().getName());
tv_content.setText(item.getShortcontent());
... ... @@ -375,7 +384,41 @@ public class GrowthRecordActivity extends BaseActivity {
audioAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
play(audoEntityList.get(position).getVideoPath());
text_time = view.findViewById(R.id.text_time);
List<VideoEntity> data = audioAdapter.getData();
for (int i = 0; i < data.size(); i++) {
data.get(i).setChecked(false);
}
try {
if (mediaPlayer.isPlaying()) {
mediaPlayer.reset();
data.get(position).setChecked(true);
mediaPlayer.setDataSource(data.get(position).getVideoPath());
mediaPlayer.prepare();
updateDescTv();
} else {
mediaPlayer.reset();
mediaPlayer.setDataSource(data.get(position).getVideoPath());
mediaPlayer.prepare();
mediaPlayer.start();
updateDescTv();
}
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
int duration = mediaPlayer.getDuration();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
Date date = new Date(duration);
String format = simpleDateFormat.format(date);
text_time.setText(format);
}
});
} catch (IOException e) {
e.printStackTrace();
}
adapter.notifyDataSetChanged();
// play(audoEntityList.get(position).getVideoPath());
}
});
... ... @@ -384,6 +427,7 @@ public class GrowthRecordActivity extends BaseActivity {
}
}
public TextView text_time;
String playUrl = null;
... ... @@ -391,7 +435,7 @@ public class GrowthRecordActivity extends BaseActivity {
* 播放音频
*/
private void play(String url) {
DebugLog.e("audio==="+url);
DebugLog.e("audio===" + url);
if (playUrl == null) {
playUrl = url;
... ... @@ -451,5 +495,56 @@ public class GrowthRecordActivity extends BaseActivity {
mediaPlayer.release();
mediaPlayer = null;
}
myHandler.removeCallbacksAndMessages(null);
}
ExecutorService executorService;
// 开启线程,修改倒计时
private void updateDescTv() {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
while (mediaPlayer != null && mediaPlayer.isPlaying()) {// 判断音频是否正在播放
myHandler.sendEmptyMessage(100);
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
if (executorService == null || executorService.isShutdown())
executorService = Executors.newSingleThreadExecutor();
executorService.execute(thread);
}
MyHandler myHandler = new MyHandler(this);
private static class MyHandler extends Handler {
private WeakReference<Activity> mActivity;
MyHandler(Activity activity) {
mActivity = new WeakReference<>(activity);
}
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
GrowthRecordActivity currentActivity = (GrowthRecordActivity) mActivity.get();
switch (msg.what) {
case 100:
if (currentActivity.mediaPlayer != null) {
//更新 seekbar 长度
//设置文件时长,单位 "分:秒" 格式
long time = currentActivity.mediaPlayer.getDuration() - currentActivity.mediaPlayer.getCurrentPosition();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
Date date = new Date(time);
String format = simpleDateFormat.format(date);
currentActivity.text_time.setText(format);
//记得释放资源
break;
}
}
}
}
}
... ...
... ... @@ -37,7 +37,7 @@
android:text="账号"
android:textColor="@color/color_3d444d"
android:textSize="@dimen/sp_16" />
<!--18276570171,13888680699(戴茂义对应家长)-13888372529(双重身份) 13064230586
<!--18276570171,13888680699(戴茂义对应家长)-13078713577(双重身份) 13064230586
-18988090188(两个孩子)15925232030(老师) 18587195559 (陈圆圆) 刘艳茗 15987125081-->
<EditText
android:id="@+id/edit_zh"
... ...
... ... @@ -164,6 +164,8 @@
android:layout_height="wrap_content"
android:layout_below="@id/teacher_lin"
android:layout_marginTop="19dp"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginRight="@dimen/dp_16"
android:layout_marginBottom="@dimen/dp_16"
android:background="@drawable/shape_solid_8_fff"
android:orientation="vertical">
... ...
... ... @@ -122,6 +122,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/teacher_lin"
android:layout_margin="@dimen/dp_16"
android:visibility="gone"
android:background="@drawable/shape_solid_8_fff"
android:orientation="vertical">
... ...