...
|
...
|
@@ -2,21 +2,26 @@ package com.yinhebairong.clasmanage.ui.jxt.activity; |
|
|
|
|
|
import android.graphics.Color;
|
|
|
import android.os.Bundle;
|
|
|
import android.util.DisplayMetrics;
|
|
|
import android.view.Gravity;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.view.Window;
|
|
|
import android.view.WindowManager;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.PopupWindow;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
import androidx.annotation.Nullable;
|
|
|
import androidx.recyclerview.widget.GridLayoutManager;
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
import com.bumptech.glide.Glide;
|
...
|
...
|
@@ -90,27 +95,25 @@ public class JlxqActivity extends BaseActivity { |
|
|
RecyclerView jlxqRv2;
|
|
|
int stuid = -1;
|
|
|
String jlId;
|
|
|
@BindView(R.id.jlxq_tv1)
|
|
|
TextView jlxqTv1;
|
|
|
@BindView(R.id.jlxq_photo)
|
|
|
ImageView jlxqPhoto;
|
|
|
@BindView(R.id.jlxq_name)
|
|
|
TextView jlxqName;
|
|
|
@BindView(R.id.jlgl_data)
|
|
|
TextView jlglData;
|
|
|
@BindView(R.id.jlxq_item)
|
|
|
LinearLayout jlxqItem;
|
|
|
@BindView(R.id.jlxq_content)
|
|
|
TextView jlxqContent;
|
|
|
@BindView(R.id.show_but)
|
|
|
LinearLayout showBut;
|
|
|
@BindView(R.id.massage_sc)
|
|
|
TextView massageSc;
|
|
|
// @BindView(R.id.jlxq_tv1)
|
|
|
// TextView jlxqTv1;
|
|
|
// @BindView(R.id.jlxq_photo)
|
|
|
// ImageView jlxqPhoto;
|
|
|
// @BindView(R.id.jlxq_name)
|
|
|
// TextView jlxqName;
|
|
|
// @BindView(R.id.jlgl_data)
|
|
|
// TextView jlglData;
|
|
|
// @BindView(R.id.jlxq_item)
|
|
|
// LinearLayout jlxqItem;
|
|
|
// @BindView(R.id.jlxq_content)
|
|
|
// TextView jlxqContent;
|
|
|
// @BindView(R.id.show_but)
|
|
|
// LinearLayout showBut;
|
|
|
// @BindView(R.id.massage_sc)
|
|
|
// TextView massageSc;
|
|
|
@BindView(R.id.rl_tj2)
|
|
|
RelativeLayout rlTj;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
protected void initData() {
|
|
|
includeName.setText("接龙详情");
|
...
|
...
|
@@ -168,75 +171,115 @@ public class JlxqActivity extends BaseActivity { |
|
|
tvJlxqCz.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
shopPopup();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
private void shopPopup() {
|
|
|
View view = LayoutInflater.from(activity).inflate(R.layout.popup_jl, null);
|
|
|
|
|
|
final PopupWindow popupWindow = new PopupWindow(view, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT - tvJlxqCz.getBottom());
|
|
|
TextView jl_zf = view.findViewById(R.id.jl_zf);
|
|
|
TextView jl_ch = view.findViewById(R.id.jl_ch);
|
|
|
TextView jl_qx = view.findViewById(R.id.jl_qx);
|
|
|
popupWindow.setOutsideTouchable(true);
|
|
|
popupWindow.setTouchable(true);
|
|
|
popupWindow.setFocusable(true);
|
|
|
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
|
|
|
popupWindow.showAsDropDown(tvJlxqCz);
|
|
|
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
|
|
|
@Override
|
|
|
public void onDismiss() {
|
|
|
setBackgroundAlpha(1f);
|
|
|
}
|
|
|
});
|
|
|
popupWindow.showAtLocation(view, Gravity.BOTTOM,0,M.getNavigationBarHeight(this));
|
|
|
jl_zf.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
jl_ch.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
getDelete(jlId);
|
|
|
}
|
|
|
});
|
|
|
jl_qx.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
// jlxqAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
|
|
// @Override
|
|
|
// public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
// Toast.makeText(ctx, "123", Toast.LENGTH_SHORT).show();
|
|
|
// }
|
|
|
// });
|
|
|
}
|
|
|
|
|
|
private void setBackgroundAlpha(float v) {
|
|
|
WindowManager.LayoutParams lp = getWindow()
|
|
|
.getAttributes();
|
|
|
lp.alpha = v;
|
|
|
getWindow().setAttributes(lp);
|
|
|
}
|
|
|
|
|
|
|
|
|
//删除
|
|
|
// private void getDelete(String jlId) {
|
|
|
// View inflate = LayoutInflater.from(activity).inflate(R.layout.pop_jl_del, null);
|
|
|
// TextView cancle = inflate.findViewById(R.id.pop_del_jl_cancle);
|
|
|
// TextView sure = inflate.findViewById(R.id.pop_del_jl_sure);
|
|
|
// SupportPopupWindow popupWindow = new SupportPopupWindow(inflate, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
|
|
// popupWindow.setOutsideTouchable(true);
|
|
|
// popupWindow.setTouchable(true);
|
|
|
// popupWindow.setFocusable(true);
|
|
|
// popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
|
|
|
// popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
|
|
|
// popupWindow.showAsDropDown(inflate);
|
|
|
// //取消
|
|
|
// cancle.setOnClickListener(new View.OnClickListener() {
|
|
|
// @Override
|
|
|
// public void onClick(View view) {
|
|
|
// popupWindow.dismiss();
|
|
|
// }
|
|
|
// });
|
|
|
//
|
|
|
// //确定
|
|
|
// sure.setOnClickListener(new View.OnClickListener() {
|
|
|
// @Override
|
|
|
// public void onClick(View view) {
|
|
|
// Api().chxq(Config.Token, jlId)
|
|
|
// .subscribeOn(Schedulers.io())
|
|
|
// .observeOn(AndroidSchedulers.mainThread())
|
|
|
// .subscribe(new Observer<ChxqEntity>() {
|
|
|
// @Override
|
|
|
// public void onSubscribe(Disposable d) {
|
|
|
//
|
|
|
// }
|
|
|
//
|
|
|
// @Override
|
|
|
// public void onNext(ChxqEntity chxqEntity) {
|
|
|
// if (chxqEntity.getCode() == M.success) {
|
|
|
// M.toast(activity, "删除成功");
|
|
|
// initData();
|
|
|
// } else {
|
|
|
// M.toast(activity, "删除失败");
|
|
|
// }
|
|
|
// }
|
|
|
//
|
|
|
// @Override
|
|
|
// public void onError(Throwable e) {
|
|
|
//
|
|
|
// }
|
|
|
//
|
|
|
// @Override
|
|
|
// public void onComplete() {
|
|
|
//
|
|
|
// }
|
|
|
// });
|
|
|
// popupWindow.dismiss();
|
|
|
// }
|
|
|
// });
|
|
|
// }
|
|
|
private void getDelete(String jlId) {
|
|
|
View inflate = LayoutInflater.from(activity).inflate(R.layout.pop_jl_del, null);
|
|
|
TextView cancle = inflate.findViewById(R.id.pop_del_jl_cancle);
|
|
|
TextView sure = inflate.findViewById(R.id.pop_del_jl_sure);
|
|
|
SupportPopupWindow popupWindow = new SupportPopupWindow(inflate, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
|
|
popupWindow.setOutsideTouchable(true);
|
|
|
popupWindow.setTouchable(true);
|
|
|
popupWindow.setFocusable(true);
|
|
|
popupWindow.setAnimationStyle(R.style.AnimTopMiddle);
|
|
|
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.color.color_tm));
|
|
|
popupWindow.showAsDropDown(inflate);
|
|
|
//取消
|
|
|
cancle.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
popupWindow.dismiss();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//确定
|
|
|
sure.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
Api().chxq(Config.Token, jlId)
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
.subscribe(new Observer<ChxqEntity>() {
|
|
|
@Override
|
|
|
public void onSubscribe(Disposable d) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onNext(ChxqEntity chxqEntity) {
|
|
|
if (chxqEntity.getCode() == M.success) {
|
|
|
M.toast(activity, "删除成功");
|
|
|
initData();
|
|
|
} else {
|
|
|
M.toast(activity, "删除失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onError(Throwable e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onComplete() {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
popupWindow.dismiss();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
...
|
...
|
@@ -245,7 +288,7 @@ public class JlxqActivity extends BaseActivity { |
|
|
}
|
|
|
|
|
|
|
|
|
@OnClick({R.id.fbxq_but, R.id.include_back, R.id.tj_but, R.id.massage_sc})
|
|
|
@OnClick({R.id.fbxq_but, R.id.include_back, R.id.tj_but})
|
|
|
public void onViewClicked(View view) {
|
|
|
switch (view.getId()) {
|
|
|
case R.id.include_back:
|
...
|
...
|
@@ -259,7 +302,7 @@ public class JlxqActivity extends BaseActivity { |
|
|
getDataTJ();
|
|
|
break;
|
|
|
// case R.id.massage_sc:
|
|
|
//// getDelete(jlId);
|
|
|
// getDelete(jlId);
|
|
|
// break;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -278,9 +321,7 @@ public class JlxqActivity extends BaseActivity { |
|
|
@Override
|
|
|
public void onNext(TjjlEntity tjjlEntity) {
|
|
|
if (tjjlEntity.getCode() == M.success) {
|
|
|
rlTj.setVisibility(View.VISIBLE);
|
|
|
M.toast(activity, "提交成功");
|
|
|
getDataTJ();
|
|
|
} else {
|
|
|
rlTj.setVisibility(View.GONE);
|
|
|
Toast.makeText(ctx, "" + tjjlEntity.getMsg(), Toast.LENGTH_SHORT).show();
|
...
|
...
|
@@ -300,9 +341,7 @@ public class JlxqActivity extends BaseActivity { |
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
class JlxqAdapter extends BaseQuickAdapter<JlxpEntity.DataBean.ListBean, BaseViewHolder> {
|
|
|
|
|
|
public JlxqAdapter(int layoutResId, @Nullable List<JlxpEntity.DataBean.ListBean> data) {
|
|
|
super(layoutResId, data);
|
|
|
}
|
...
|
...
|
@@ -312,9 +351,8 @@ public class JlxqActivity extends BaseActivity { |
|
|
ImageView jlxq_photo = helper.itemView.findViewById(R.id.jlxq_photo);
|
|
|
helper.setText(R.id.jlxq_name, item.getUsername())
|
|
|
.setText(R.id.jlgl_data, item.getCreate_time())
|
|
|
.setText(R.id.jlxq_content, item.getContent())
|
|
|
.addOnClickListener(R.id.massage_sc);
|
|
|
// Glide.with(mContext).load(item.getPhoto()).into(jlxq_photo);
|
|
|
.setText(R.id.jlxq_content, item.getContent());
|
|
|
Glide.with(mContext).load(item.getPhoto()).into(jlxq_photo);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|