245 lines
7.8 KiB
Java
245 lines
7.8 KiB
Java
package cn.shangyu.gdxzExpert.activity;
|
|
|
|
import android.content.Intent;
|
|
import android.view.View;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
|
|
import com.gyf.immersionbar.ImmersionBar;
|
|
|
|
import cn.shangyu.gdxzExpert.R;
|
|
import cn.shangyu.gdxzExpert.base.BaseActivity;
|
|
import cn.shangyu.gdxzExpert.utils.CommonUtil;
|
|
import cn.shangyu.gdxzExpert.utils.Constant;
|
|
import cn.shangyu.gdxzExpert.utils.MyUserIconUtil;
|
|
import cn.shangyu.gdxzExpert.utils.SharePrefUtil;
|
|
import cn.shangyu.gdxzExpert.utils.UIUtils;
|
|
import cn.shangyu.gdxzExpert.widget.LoadingPage.ResultState;
|
|
|
|
public class MyDownLoadsActivity extends BaseActivity{
|
|
private View view;
|
|
private RelativeLayout mRl_1, mRl_2, mRl_3, mRl_4,mRl_5,mRl_6,mRl_7;
|
|
private View mV_line1, mV_line2, mV_line3, mV_line4,mV_line5,mV_line6;
|
|
private TextView mTv_title1, mTv_title2, mTv_title3, mTv_title4, mTv_title5,mTv_title6,mTv_title7;
|
|
private boolean isDownLoad = true;
|
|
private Intent getIntent;
|
|
private MyDownLoadsActivity mActivity;
|
|
|
|
@Override
|
|
public void setTitle() {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
@Override
|
|
public View onCreateSuccessedView() {
|
|
// TODO Auto-generated method stub
|
|
ImmersionBar.with(this).keyboardEnable(true).statusBarDarkFont(true).titleBar(mToolbar).init();
|
|
if(CommonUtil.BigModule())
|
|
{
|
|
view = UIUtils.inflate(R.layout.activity_my_down_loads_big);
|
|
}
|
|
else
|
|
{
|
|
view = UIUtils.inflate(R.layout.activity_my_down_loads);
|
|
}
|
|
mActivity = this;
|
|
initIntent();
|
|
initView();
|
|
initListener();
|
|
return view;
|
|
}
|
|
|
|
@Override
|
|
protected void onResume() {
|
|
super.onResume();
|
|
if (getIntent().getType() != null
|
|
&& getIntent().getType().equals("download")) {
|
|
needreportPage("我的下载");
|
|
} else {
|
|
needreportPage("我的收藏");
|
|
}
|
|
|
|
}
|
|
|
|
public void initIntent() {
|
|
getIntent = getIntent();
|
|
if (getIntent.getType() != null
|
|
&& getIntent.getType().equals("download")) {
|
|
top_title.setText("我的下载");
|
|
isDownLoad = true;
|
|
} else {
|
|
top_title.setText("我的收藏");
|
|
isDownLoad = false;
|
|
}
|
|
if(CommonUtil.BigModule())
|
|
{
|
|
top_title.setTextSize(23);
|
|
}
|
|
}
|
|
|
|
public void initListener() {
|
|
mRl_1.setOnClickListener(this);
|
|
mRl_2.setOnClickListener(this);
|
|
mRl_3.setOnClickListener(this);
|
|
mRl_4.setOnClickListener(this);
|
|
mRl_5.setOnClickListener(this);
|
|
mRl_6.setOnClickListener(this);
|
|
mRl_7.setOnClickListener(this);
|
|
}
|
|
|
|
public void initView() {
|
|
mRl_1 = (RelativeLayout) view.findViewById(R.id.rl_1);
|
|
mRl_2 = (RelativeLayout) view.findViewById(R.id.rl_2);
|
|
mRl_3 = (RelativeLayout) view.findViewById(R.id.rl_3);
|
|
mRl_4 = (RelativeLayout) view.findViewById(R.id.rl_4);
|
|
mRl_5=(RelativeLayout) view.findViewById(R.id.rl_5);
|
|
mRl_6=(RelativeLayout) view.findViewById(R.id.rl_6);
|
|
mRl_7=(RelativeLayout) view.findViewById(R.id.rl_7);
|
|
mV_line1 = view.findViewById(R.id.v_line1);
|
|
mV_line2 = view.findViewById(R.id.v_line2);
|
|
mV_line3 = view.findViewById(R.id.v_line3);
|
|
mV_line4 = view.findViewById(R.id.v_line4);
|
|
mV_line5 = view.findViewById(R.id.v_line5);
|
|
mV_line6 = view.findViewById(R.id.v_line6);
|
|
mTv_title1 = (TextView) view.findViewById(R.id.tv_title1);
|
|
mTv_title2 = (TextView) view.findViewById(R.id.tv_title2);
|
|
mTv_title3 = (TextView) view.findViewById(R.id.tv_title3);
|
|
mTv_title4 = (TextView) view.findViewById(R.id.tv_title4);
|
|
mTv_title5= (TextView) view.findViewById(R.id.tv_title5);
|
|
mTv_title6= (TextView) view.findViewById(R.id.tv_title6);
|
|
mTv_title7= (TextView) view.findViewById(R.id.tv_title7);
|
|
if (isDownLoad) {
|
|
mRl_1.setVisibility(View.VISIBLE);
|
|
mRl_2.setVisibility(View.VISIBLE);
|
|
mRl_3.setVisibility(View.VISIBLE);
|
|
mRl_4.setVisibility(View.VISIBLE);
|
|
mRl_5.setVisibility(View.VISIBLE);
|
|
mV_line1.setVisibility(View.VISIBLE);
|
|
mV_line2.setVisibility(View.VISIBLE);
|
|
mV_line3.setVisibility(View.VISIBLE);
|
|
mV_line4.setVisibility(View.VISIBLE);
|
|
mV_line5.setVisibility(View.VISIBLE);
|
|
|
|
mTv_title1.setText("诊疗指南");
|
|
mTv_title2.setText("期刊杂志");
|
|
mTv_title3.setText("课件文档");
|
|
mTv_title4.setText("诊疗指南(新)");
|
|
mTv_title5.setText("课件文档(新)");
|
|
if(SharePrefUtil.getBoolean(this, Constant.ShowMagazine,true))
|
|
{
|
|
}
|
|
else
|
|
{
|
|
mRl_2.setVisibility(View.GONE);
|
|
mV_line2.setVisibility(View.GONE);
|
|
}
|
|
} else {
|
|
mRl_1.setVisibility(View.VISIBLE);
|
|
mRl_2.setVisibility(View.VISIBLE);
|
|
mRl_3.setVisibility(View.VISIBLE);
|
|
mRl_4.setVisibility(View.VISIBLE);
|
|
mRl_5.setVisibility(View.VISIBLE);
|
|
mRl_6.setVisibility(View.VISIBLE);
|
|
mRl_7.setVisibility(View.VISIBLE);
|
|
mV_line1.setVisibility(View.VISIBLE);
|
|
mV_line2.setVisibility(View.VISIBLE);
|
|
mV_line3.setVisibility(View.VISIBLE);
|
|
mV_line4.setVisibility(View.VISIBLE);
|
|
mV_line5.setVisibility(View.VISIBLE);
|
|
mV_line6.setVisibility(View.VISIBLE);
|
|
// mTv_title1.setText("期刊杂志");
|
|
mTv_title1.setText("英文期刊");
|
|
mTv_title2.setText("病例荟萃");
|
|
mTv_title3.setText("病例讨论");
|
|
mTv_title4.setText("肝胆视频");
|
|
mTv_title5.setText("课件文档");
|
|
mTv_title6.setText("肝胆新闻");
|
|
mTv_title7.setText("患教学堂");
|
|
if(SharePrefUtil.getBoolean(this, Constant.ShowMagazine,true))
|
|
{
|
|
}
|
|
else
|
|
{
|
|
mRl_1.setVisibility(View.GONE);
|
|
mV_line1.setVisibility(View.GONE);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
@Override
|
|
public ResultState onLoad() {
|
|
// TODO Auto-generated method stub
|
|
return ResultState.STATE_SUCCESSED;
|
|
}
|
|
|
|
@Override
|
|
protected void processClick(View v) {
|
|
// TODO Auto-generated method stub
|
|
// AGP 8.0+ R.id 不再是 final 常量,不能用于 switch,改用 if-else
|
|
int id = v.getId();
|
|
if (id == R.id.rl_1) {
|
|
if (isDownLoad) {
|
|
Intent i = new Intent(mActivity, MyDownloadActivity.class);
|
|
i.putExtra("name",mTv_title1.getText().toString());
|
|
i.setType("0");
|
|
startActivity(i);
|
|
} else {
|
|
Intent intent = new Intent(mActivity, MyWFArticleActivity.class);
|
|
intent.putExtra("name",mTv_title1.getText().toString());
|
|
intent.setType("收藏");
|
|
startActivity(intent);
|
|
}
|
|
} else if (id == R.id.rl_2) {
|
|
if (isDownLoad) {
|
|
Intent intent = new Intent(mActivity, MyWFArticleActivity.class);
|
|
intent.putExtra("name",mTv_title2.getText().toString());
|
|
intent.setType("下载");
|
|
startActivity(intent);
|
|
} else {
|
|
Intent intent = new Intent(mActivity,
|
|
MyCollectBIngliActivity.class);
|
|
intent.putExtra("name",mTv_title2.getText().toString());
|
|
startActivity(intent);
|
|
}
|
|
} else if (id == R.id.rl_3) {
|
|
if (isDownLoad) {
|
|
startActivity(new Intent(mActivity,
|
|
MyDownLoadCourseActivity.class));
|
|
} else {
|
|
startActivity(new Intent(mActivity,
|
|
CasediscussioncollentActivity.class).putExtra("name",mTv_title3.getText().toString()));
|
|
}
|
|
} else if (id == R.id.rl_4) {
|
|
if (isDownLoad) {
|
|
//跳到uniapp 的缓存页面
|
|
MyUserIconUtil.showUniMp(MyDownLoadsActivity.this, "/pages_app/zhinanDownload/zhinanDownload", null);
|
|
} else {
|
|
startActivity(new Intent(mActivity, CoollectVideoActivity.class).putExtra("name",mTv_title4.getText().toString()));
|
|
}
|
|
} else if (id == R.id.rl_5) {
|
|
if (isDownLoad) {
|
|
//跳到uniapp 的缓存页面
|
|
MyUserIconUtil.showUniMp(MyDownLoadsActivity.this, "/pages_app/pptDownload/pptDownload", null);
|
|
} else {
|
|
startActivity(new Intent(mActivity, CoollectCourseActivity.class));
|
|
}
|
|
} else if (id == R.id.rl_6) {
|
|
if (isDownLoad) {
|
|
|
|
} else {
|
|
startActivity(new Intent(mActivity, CoollectNewsActivity.class).putExtra("name",mTv_title6.getText().toString()));
|
|
}
|
|
} else if (id == R.id.rl_7) {
|
|
if (isDownLoad) {
|
|
|
|
} else {
|
|
startActivity(new Intent(mActivity, CoollectTeachActivity.class).putExtra("name",mTv_title7.getText().toString()));
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|