作者 liming

Merge branch 'zhangtao' of http://114.215.101.231:8099/zhangtao/huahang_project

# Conflicts:
#	.idea/gradle.xml
#	.idea/misc.xml
#	app/src/main/java/com/hh/xuetubao/adapter/JobHuntCompanyAdapter.java
正在显示 72 个修改的文件 包含 2335 行增加589 行删除
... ... @@ -2,14 +2,14 @@ apply plugin: 'com.android.application'
android {
/* signingConfigs {
release {
keyAlias 'FireControl'
keyPassword '11111111'
storeFile file('./FireControl.jks')
storePassword '11111111'
}
}*/
/* signingConfigs {
release {
keyAlias 'FireControl'
keyPassword '11111111'
storeFile file('./FireControl.jks')
storePassword '11111111'
}
}*/
compileSdkVersion 28
defaultConfig {
... ...
... ... @@ -32,10 +32,6 @@
android:name=".activity.study.StudyActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait" />
<activity
android:name=".activity.study.CourseDetailActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name=".activity.study.CourseDetailActivity_Video"
... ... @@ -141,6 +137,15 @@
<activity
android:name=".activity.pratice.AnswerWrongActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.pratice.a"
android:screenOrientation="portrait" />
<activity
android:name=".activity.pratice.b"
android:screenOrientation="portrait" />
<activity
android:name=".activity.pratice.c"
android:screenOrientation="portrait" />
<!-- 微信 -->
<activity
... ... @@ -150,4 +155,5 @@
</application>
</manifest>
\ No newline at end of file
... ...
... ... @@ -6,7 +6,6 @@ import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.RadioButton;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.activity.pratice.PracticeActivity;
import com.hh.xuetubao.activity.study.StudyActivity;
import com.hh.xuetubao.activity.work.JobHuntActivity;
... ... @@ -53,8 +52,6 @@ public class MainActivity extends BaseMvpActivity<CommonPresenter, MainModel> im
getWindow().setNavigationBarColor(Color.parseColor("#fcfcfc"));
//状态栏颜色
getWindow().setStatusBarColor(Color.parseColor("#fcfcfc"));*/
homeFragment = new HomeFragment();
wrongFragment = new PraticeWrongFragment();
... ... @@ -145,7 +142,7 @@ public class MainActivity extends BaseMvpActivity<CommonPresenter, MainModel> im
MainActivity.this.finish();
break;
case R.id.rl_mine:
transaction.replace(R.id.frame, mineFragment);
transaction.replace(R.id.frame, mineFragment, "1");
transaction.commit();
rlMine.setChecked(true);
selectTag = 4;
... ...
... ... @@ -547,4 +547,13 @@ public interface MyServer {
@GET("GetRandomQuestions")
Observable<AnswerBean> GetRandomQuestions(@Query("catalogOid") String catalogOid, @Query("randomNum") int randomNum, @Query("accountOid") String accountOid);
/**
* 删除成绩接口
*
* @param oid 当前目录ID
* @return
*/
@GET("DeleteExamRecordInfo")
Observable<UserBean> DeleteExamRecordInfo(@Query("oid") String oid);
}
\ No newline at end of file
... ...
package com.hh.xuetubao.Utils;
import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.widget.GridView;
/**
* Time: 11/22/2019 9:28
* Author: 秦小飞
* Description:
*/
public class GridViewNesting extends GridView {
public GridViewNesting(Context context) {
super(context);
}
public GridViewNesting(Context context, AttributeSet attrs) {
super(context, attrs);
}
public GridViewNesting(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public GridViewNesting(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
... ...
... ... @@ -2,6 +2,8 @@ package com.hh.xuetubao.activity.personal;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.hh.xuetubao.R;
... ... @@ -14,10 +16,12 @@ import com.hh.xuetubao.mvp.ICommonView;
import butterknife.BindView;
import butterknife.ButterKnife;
public class MessageDetailActivity extends BaseMvpActivity<CommonPresenter, PersonalModel> implements ICommonView {
public class MessageDetailActivity extends BaseMvpActivity<CommonPresenter, PersonalModel> implements ICommonView, View.OnClickListener {
@BindView(R.id.tv_content)
TextView tvContent;
@BindView(R.id.lin_back)
LinearLayout linBack;
private String msgOid;
private int status;
... ... @@ -27,6 +31,8 @@ public class MessageDetailActivity extends BaseMvpActivity<CommonPresenter, Pers
msgOid = intent.getStringExtra("MsgOid");
status = intent.getIntExtra("Status", 0);
linBack.setOnClickListener(this);
}
@Override
... ... @@ -78,4 +84,13 @@ public class MessageDetailActivity extends BaseMvpActivity<CommonPresenter, Pers
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.lin_back:
this.finish();
break;
}
}
}
... ...
package com.hh.xuetubao.activity.personal;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.hh.xuetubao.R;
... ... @@ -35,6 +35,8 @@ public class MoneyHistoryActivity extends BaseMvpActivity<CommonPresenter, Perso
TextView tvOut;
@BindView(R.id.xrecyclerview)
XRecyclerView xrecyclerview;
@BindView(R.id.lin_back)
LinearLayout linBack;
private String searchType = null;
private int pageIndex = 1;
private int pageSize = 10;
... ... @@ -55,6 +57,7 @@ public class MoneyHistoryActivity extends BaseMvpActivity<CommonPresenter, Perso
tvAll.setOnClickListener(this);
tvIn.setOnClickListener(this);
tvOut.setOnClickListener(this);
linBack.setOnClickListener(this);
}
@Override
... ... @@ -133,6 +136,9 @@ public class MoneyHistoryActivity extends BaseMvpActivity<CommonPresenter, Perso
isRefresh = true;
mPresenter.getPresenter(9, 1, resumeOid, searchType, String.valueOf(1), String.valueOf(pageSize));
break;
case R.id.lin_back:
this.finish();
break;
}
}
... ...
... ... @@ -374,6 +374,9 @@ public class AnswerWrongActivity extends BaseMvpActivity<CommonPresenter, Exerci
case R.id.tv_look:
rlAnswer.setVisibility(View.VISIBLE);
break;
case R.id.tv_show_card:
break;
}
}
... ...
... ... @@ -121,7 +121,8 @@ public class MockExamActivity extends BaseMvpActivity<CommonPresenter, ExerciseM
this.finish();
break;
case R.id.mock_exam_btn: // this - > 答题界面
Intent intent = new Intent(this, AnswerActivity.class);
// Intent intent = new Intent(this, AnswerActivity.class);
Intent intent = new Intent(this, b.class);
intent.putExtra("catalogOid", catalogOid);
SharedPrefrenceUtils.saveString(this, "thisCatalogOid", catalogOid);
startActivity(intent);
... ...
... ... @@ -6,15 +6,16 @@ import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.Utils.WaveView;
import com.hh.xuetubao.bean.UserBean;
import com.hh.xuetubao.model.ExerciseModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
... ... @@ -35,7 +36,7 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
@BindView(R.id.tv_title)
TextView tvTitle;
@BindView(R.id.lin_tab)
LinearLayout linTab;
RelativeLayout linTab;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.tv3)
... ... @@ -62,6 +63,8 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
RelativeLayout rlAllWrong;
@BindView(R.id.rl_reStart)
RelativeLayout rlReStart;
@BindView(R.id.tv_delete)
TextView tvDelete;
private String catalogOid;
private Intent intent;
private String thisCatalogOid;
... ... @@ -92,7 +95,6 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
tv11.setText(String.valueOf(duoxuanWrongt));
tv17.setText(String.valueOf(panduanWrong));
tv7.setText(getFormat(danxuanCount, danxuanWrong) + "%");
tv13.setText(getFormat(duoxuanCount, duoxuanWrongt) + "%");
tv19.setText(getFormat(panduanCount, panduanWrong) + "%");
... ... @@ -108,7 +110,7 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
linTab.setOnClickListener(this);
rlAllWrong.setOnClickListener(this);
rlReStart.setOnClickListener(this);
tvDelete.setOnClickListener(this);
thisCatalogOid = SharedPrefrenceUtils.getString(this, "thisCatalogOid");
}
... ... @@ -135,7 +137,9 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
@Override
public void getData(Object o, int api, int intent) {
if (api == 9 && intent == 1) {
UserBean bean = (UserBean) o;
}
}
@Override
... ... @@ -179,15 +183,19 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
finish();
break;
case R.id.rl_allWrong:
intent = new Intent(this, AnswerWrongActivity.class);
intent = new Intent(this, c.class);
intent.putExtra("catalogOid", catalogOid);
startActivity(intent);
break;
case R.id.rl_reStart:
intent = new Intent(this, AnswerActivity.class);
intent = new Intent(this, b.class);
intent.putExtra("catalogOid", catalogOid);
startActivity(intent);
break;
case R.id.tv_delete:
Toast.makeText(this,"1",Toast.LENGTH_SHORT).show();
mPresenter.getPresenter(9, 1, thisCatalogOid);
break;
}
}
... ...
package com.hh.xuetubao.activity.pratice;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.adapter.AnswerSheetGridAdapter;
import com.hh.xuetubao.adapter.ListAnswerAdapter;
import com.hh.xuetubao.bean.AnswerBean;
import com.hh.xuetubao.model.ExerciseModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 随机练习页面
*/
public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implements ICommonView, View.OnClickListener {
@BindView(R.id.list_answer)
ListView listAnswer;
@BindView(R.id.tv_radio)
TextView tvRadio;
@BindView(R.id.tv_max)
TextView tvMax;
@BindView(R.id.tv_current)
TextView tvCurrent;
@BindView(R.id.tv_title)
TextView tvTitle;
@BindView(R.id.tv_topic)
TextView tvTopic;
@BindView(R.id.rl_last)
RelativeLayout rlLast;
@BindView(R.id.rl_next)
RelativeLayout rlNext;
@BindView(R.id.index)
TextView index;
@BindView(R.id.all)
TextView all;
@BindView(R.id.tv_right_num)
TextView tvRightNum;
@BindView(R.id.tv_wrong_num)
TextView tvWrongNum;
@BindView(R.id.lin_tab)
LinearLayout linTab;
@BindView(R.id.rl_card)
RelativeLayout rlCard;
@BindView(R.id.right_select)
TextView rightSelect;
@BindView(R.id.right_answer)
TextView rightAnswerText;
@BindView(R.id.rl_answer)
RelativeLayout rlAnswer;
@BindView(R.id.commit)
LinearLayout commit;
@BindView(R.id.tv2)
TextView tv2;
@BindView(R.id.tv_show_card)
TextView tvShowCard;
private String catalogOid;
private String accountOid;
private int listIndex = 0; //数据下标
private String type;//题目类型
private boolean isClickAble = true;//是否能选择多条目
private String rightAnswer;//当前题目正确答案
private int rightCount;//答对题的数量
private int wrongCount;//答错题的数量
private List<AnswerBean.QuestionLstBean> questionLst = new ArrayList<>();//创建集合存储这一套题
private ListAnswerAdapter optionsAdapter;
private String selectAnswer = "";
private AnswerSheetGridAdapter sheetGridAdapter;
private PopupWindow popupWindow;
private List<Integer> statusList = new ArrayList<>();//保存答题结果 0:未答题 1:答对 2:答错
private List<Integer> integerList = new ArrayList<>();// 存放 1或者2 用来判断多选题 是否答对
private List<String> stringList = new ArrayList<>();//用来存放多选题选择的答案
private List<String> historyAnswer = new ArrayList<>();//存放历史选择的答案
private boolean isRight;
@Override
public void initView() {
accountOid = SharedPrefrenceUtils.getString(this, "AccountOid");
catalogOid = getIntent().getStringExtra("catalogOid");
rlLast.setOnClickListener(this);
rlNext.setOnClickListener(this);
linTab.setOnClickListener(this);
rlCard.setOnClickListener(this);
commit.setOnClickListener(this);
tvShowCard.setOnClickListener(this);
listAnswer.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ImageView wrong = (ImageView) view.findViewById(R.id.img_wrong);
ImageView right = (ImageView) view.findViewById(R.id.img_right);
TextView option = (TextView) view.findViewById(R.id.option);
Log.e("zhangtao:trueType", type);
if (type.contains("单选") || type.contains("判断")) {
//单选· 多选 选择答案 设置为单选
if (isClickAble) {
isClickAble = false;
try {
if (position == 0) {
selectAnswer = "A";
} else if (position == 1) {
selectAnswer = "B";
} else if (position == 2) {
selectAnswer = "C";
} else if (position == 3) {
selectAnswer = "D";
} else if (position == 4) {
selectAnswer = "E";
}
} catch (Exception e) {
Log.e("xuetubao:", e.toString());
}
//判断 单选题 是否答对
if (rightAnswer.contains(selectAnswer)) {
right.setVisibility(View.VISIBLE);
wrong.setVisibility(View.GONE);
option.setVisibility(View.GONE);
rightCount++;
tvRightNum.setText(String.valueOf(rightCount));
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
if (listIndex < questionLst.size() - 1) {
listIndex++;//答对 自动下一题
doRefresh(true);
} else {
Toast.makeText(a.this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
tvShowCard.setVisibility(View.GONE);
commit.setVisibility(View.VISIBLE);
}
} else if (!rightAnswer.contains(selectAnswer)) {
wrongCount++;
tvWrongNum.setText(String.valueOf(wrongCount));
rlAnswer.setVisibility(View.VISIBLE);//展示错题解析
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
optionsAdapter.setRight(rightAnswer);
optionsAdapter.notifyDataSetChanged();
}
}
} else if (type.contains("多选")) {
//多选题 选择答案 不用设置为单选
if (isClickAble) {
try {
if (position == 0) {
selectAnswer += "A";
stringList.add("A");
} else if (position == 1) {
selectAnswer += "B";
stringList.add("B");
} else if (position == 2) {
selectAnswer += "C";
stringList.add("C");
} else if (position == 3) {
selectAnswer += "D";
stringList.add("D");
} else if (position == 4) {
selectAnswer += "E";
stringList.add("E");
}
} catch (Exception e) {
Log.e("xuetubao:", e.toString());
}
for (int i = 0; i < stringList.size(); i++) {
if (rightAnswer.contains(stringList.get(i))) {
integerList.add(1);
} else {
integerList.add(2);
}
}
//判断多选题是否答对
for (int i = 0; i < integerList.size(); i++) {
if (integerList.get(i) == 2) {
right.setVisibility(View.GONE);
wrong.setVisibility(View.VISIBLE);
option.setVisibility(View.GONE);
isRight = false;
} else {
right.setVisibility(View.VISIBLE);
wrong.setVisibility(View.GONE);
option.setVisibility(View.GONE);
isRight = true;
}
}
if (!isRight) {
isClickAble = false;
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
wrongCount++;
tvWrongNum.setText(String.valueOf(wrongCount));
rlAnswer.setVisibility(View.VISIBLE);//展示错题解析
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
optionsAdapter.setRight(rightAnswer);
optionsAdapter.notifyDataSetChanged();
} else if (isRight && rightAnswer.length() == selectAnswer.length()) {
rightCount++;
tvRightNum.setText(String.valueOf(rightCount));
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
if (listIndex < questionLst.size() - 1) {
listIndex++;//答对 自动下一题
doRefresh(true);
} else {
Toast.makeText(a.this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
tvShowCard.setVisibility(View.GONE);
commit.setVisibility(View.VISIBLE);
}
}
}
}
}
});
}
@Override
public int initLayout() {
return R.layout.activity_answer_sheet;
}
@Override
public void initData() {
mPresenter.getPresenter(8, 1, catalogOid, String.valueOf(10), accountOid);
}
@Override
public CommonPresenter getPresenter() {
return new CommonPresenter();
}
@Override
public ExerciseModel getModel() {
return new ExerciseModel();
}
@Override
public void getData(Object o, int api, int intent) {
if (api == 8 && intent == 1) {
AnswerBean bean = (AnswerBean) o;
List<AnswerBean.QuestionLstBean> questionLstBeans = bean.getQuestionLst();
questionLst.addAll(questionLstBeans);
tvMax.setText(String.valueOf(questionLst.size()));
all.setText(String.valueOf(questionLst.size()));
tvTopic.setText(questionLstBeans.get(listIndex).getQuestionTitle());
tvCurrent.setText(String.valueOf(listIndex + 1));
index.setText(String.valueOf(listIndex + 1));
type = questionLstBeans.get(listIndex).getQuestionTypeName();
tvRadio.setText(type);
rightAnswer = questionLstBeans.get(listIndex).getAnswer();
rightSelect.setText(questionLstBeans.get(listIndex).getAnswer());
if(!TextUtils.isEmpty(questionLstBeans.get(listIndex).getAnswer())){
rightAnswerText.setText(questionLstBeans.get(listIndex).getWrongAnaly());
}
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
listAnswer.setAdapter(optionsAdapter);
optionsAdapter.notifyDataSetChanged();
for (AnswerBean.QuestionLstBean a : questionLst) {
statusList.add(0);
}
sheetGridAdapter = new AnswerSheetGridAdapter(statusList, this);
}
}
private void doRefresh(boolean isNext) {
historyAnswer.add(selectAnswer);
integerList.clear();
selectAnswer = "";
stringList.clear();
isClickAble = true;
tvTopic.setText(questionLst.get(listIndex).getQuestionTitle());
tvCurrent.setText(String.valueOf(listIndex + 1));
type = questionLst.get(listIndex).getQuestionTypeName();
tvRadio.setText(type);
index.setText(String.valueOf(listIndex + 1));
rightAnswer = questionLst.get(listIndex).getAnswer();
rightSelect.setText(questionLst.get(listIndex).getAnswer());
if(!TextUtils.isEmpty(questionLst.get(listIndex).getWrongAnaly()))
rightAnswerText.setText(questionLst.get(listIndex).getWrongAnaly());
rlAnswer.setVisibility(View.GONE);
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
listAnswer.setAdapter(optionsAdapter);
optionsAdapter.notifyDataSetChanged();
if (historyAnswer.size() > listIndex) {
optionsAdapter.setSelect(historyAnswer.get(listIndex));
optionsAdapter.notifyDataSetInvalidated();
if (TextUtils.isEmpty(historyAnswer.get(listIndex))) {
rlAnswer.setVisibility(View.GONE);
} else {
rlAnswer.setVisibility(View.VISIBLE);
}
}
}
private void showAnswerCard(List<Integer> sheetCard, int rightCount, int wrongCount, int currentIndex, int maxTopic) {
View contentView = LayoutInflater.from(this).inflate(R.layout.pop_answer_sheet, null);
View view = LayoutInflater.from(this).inflate(R.layout.activity_answer, null);
TextView tv_card = (TextView) contentView.findViewById(R.id.tv_card);
GridView gridView = (GridView) contentView.findViewById(R.id.grid_dati);
TextView index = (TextView) contentView.findViewById(R.id.index);
TextView total = (TextView) contentView.findViewById(R.id.total);
TextView right = (TextView) contentView.findViewById(R.id.tv_right_num);
TextView wrong = (TextView) contentView.findViewById(R.id.tv_wrong_num);
right.setText(String.valueOf(rightCount));
wrong.setText(String.valueOf(wrongCount));
index.setText(String.valueOf(currentIndex + 1));
total.setText(String.valueOf(maxTopic));
gridView.setAdapter(sheetGridAdapter);
popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
popupWindow.setOutsideTouchable(false);
popupWindow.setTouchable(true);
popupWindow.showAtLocation(view, Gravity.BOTTOM, 0, 0);
tv_card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (popupWindow != null) {
popupWindow.dismiss();
}
}
});
}
@Override
public void onComplete(int api) {
}
@Override
public void onError(Throwable e, int api) {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.rl_last:
if (listIndex == 0) {
Toast.makeText(this, "当前已是第一题", Toast.LENGTH_SHORT).show();
} else {
listIndex--;
doRefresh(false);
}
break;
case R.id.rl_next:
Log.e("zhangtao:right", rightCount + "");
Log.e("zhangtao:wrong", wrongCount + "");
if (listIndex < questionLst.size() - 1) {
if (type.contains("多选")) {
if (selectAnswer.length() != rightAnswer.length()) {
statusList.set(listIndex, 2);
}
}
if (TextUtils.isEmpty(selectAnswer)) {
if (listIndex > historyAnswer.size() - 1) {
wrongCount++;
statusList.set(listIndex, 0);
}
}
listIndex++;
doRefresh(true);
} else if (listIndex == questionLst.size() - 1) {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
tvShowCard.setVisibility(View.GONE);
commit.setVisibility(View.VISIBLE);
}
break;
case R.id.lin_tab:
this.finish();
break;
case R.id.tv_look:
rlAnswer.setVisibility(View.VISIBLE);
break;
case R.id.commit:
if (listIndex > historyAnswer.size()) {
if (TextUtils.isEmpty(selectAnswer)) {
wrongCount++;
}
}else if(listIndex==questionLst.size()-1){
if(TextUtils.isEmpty(selectAnswer)){
wrongCount++;
}
}
Intent intent = new Intent(this, AnswerResultActivity.class);
intent.putExtra("rightCount", rightCount);
intent.putExtra("wrongCount", wrongCount);
startActivity(intent);
break;
case R.id.tv_show_card:
showAnswerCard(statusList, rightCount, wrongCount, listIndex, questionLst.size());
break;
case R.id.rl_card:
showAnswerCard(statusList, rightCount, wrongCount, listIndex, questionLst.size());
break;
}
}
}
... ...
package com.hh.xuetubao.activity.pratice;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.annotation.RequiresApi;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.adapter.AnswerSheetGridAdapter;
import com.hh.xuetubao.adapter.ListAnswerAdapter;
import com.hh.xuetubao.bean.AnswerBean;
import com.hh.xuetubao.model.ExerciseModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 模拟练习页面
*/
public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implements ICommonView, View.OnClickListener {
@BindView(R.id.list_answer)
ListView listAnswer;
@BindView(R.id.tv_radio)
TextView tvRadio;
@BindView(R.id.tv_max)
TextView tvMax;
@BindView(R.id.tv_current)
TextView tvCurrent;
@BindView(R.id.tv_title)
TextView tvTitle;
@BindView(R.id.tv_topic)
TextView tvTopic;
@BindView(R.id.rl_last)
RelativeLayout rlLast;
@BindView(R.id.rl_next)
RelativeLayout rlNext;
@BindView(R.id.index)
TextView index;
@BindView(R.id.all)
TextView all;
@BindView(R.id.tv_right_num)
TextView tvRightNum;
@BindView(R.id.tv_wrong_num)
TextView tvWrongNum;
@BindView(R.id.lin_tab)
LinearLayout linTab;
@BindView(R.id.rl_card)
RelativeLayout rlCard;
// @BindView(R.id.right_select)
// TextView rightSelect;
// @BindView(R.id.right_answer)
// TextView rightAnswerText;
// @BindView(R.id.rl_answer)
// RelativeLayout rlAnswer;
@BindView(R.id.commit)
LinearLayout commit;
// @BindView(R.id.tv2)
// TextView tv2;
@BindView(R.id.tv_show_card)
TextView tvShowCard;
@BindView(R.id.tv_second)
TextView tvSecond;
private String catalogOid;
private String accountOid;
private int listIndex = 0; //数据下标
private String type;//题目类型
private boolean isClickAble = true;//是否能选择多条目
private String rightAnswer;//当前题目正确答案
private int rightCount;//答对题的数量
private int wrongCount;//答错题的数量
private List<AnswerBean.QuestionLstBean> questionLst = new ArrayList<>();//创建集合存储这一套题
private ListAnswerAdapter optionsAdapter;
private String selectAnswer = "";
private AnswerSheetGridAdapter sheetGridAdapter;
private PopupWindow popupWindow;
private List<Integer> statusList = new ArrayList<>();//保存答题结果 0:未答题 1:答对 2:答错
private List<Integer> integerList = new ArrayList<>();// 存放 1或者2 用来判断多选题 是否答对
private List<String> stringList = new ArrayList<>();//用来存放多选题选择的答案
private List<String> historyAnswer = new ArrayList<>();//存放历史选择的答案
private List<String> listRightAnswer = new ArrayList<>();
private boolean isRight;
private int unDone;//未完成的题
private int danxuanCount;
private int duoxuanCount;
private int panduanCount;
private int danxuanWrong;
private int panduanWrong;
private int duoxuanWrong;
private double totalScore;
private double danxuan;
private double duoxuan;
private double panduan;
private int longTime;
private int thisTime;
private CountDownTimer timer;
@Override
public void initView() {
accountOid = SharedPrefrenceUtils.getString(this, "AccountOid");
catalogOid = getIntent().getStringExtra("catalogOid");
rlLast.setOnClickListener(this);
rlNext.setOnClickListener(this);
linTab.setOnClickListener(this);
rlCard.setOnClickListener(this);
commit.setOnClickListener(this);
tvShowCard.setOnClickListener(this);
listAnswer.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ImageView wrong = (ImageView) view.findViewById(R.id.img_wrong);
ImageView right = (ImageView) view.findViewById(R.id.img_right);
TextView option = (TextView) view.findViewById(R.id.option);
TextView text = (TextView) view.findViewById(R.id.text);
Log.e("zhangtao:trueType", type);
if (type.contains("单选") || type.contains("判断")) {
//单选· 多选 选择答案 设置为单选
if (isClickAble) {
isClickAble = false;
try {
if (position == 0) {
selectAnswer = "A";
} else if (position == 1) {
selectAnswer = "B";
} else if (position == 2) {
selectAnswer = "C";
} else if (position == 3) {
selectAnswer = "D";
} else if (position == 4) {
selectAnswer = "E";
}
} catch (Exception e) {
Log.e("xuetubao:", e.toString());
}
//判断 单选题 是否答对
if (rightAnswer.contains(selectAnswer)) {
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
rightCount++;
tvRightNum.setText(String.valueOf(rightCount));
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
if (type.contains("单选")) {
totalScore += danxuan;
} else if (type.contains("判断")) {
totalScore += panduan;
}
} else if (!rightAnswer.contains(selectAnswer)) {
wrongCount++;
tvWrongNum.setText(String.valueOf(wrongCount));
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
if (type.contains("单选")) {
danxuanWrong++;
} else if (type.contains("判断")) {
panduanWrong++;
}
}
}
} else if (type.contains("多选")) {
//多选题 选择答案 不用设置为单选
if (isClickAble) {
try {
if (position == 0) {
selectAnswer += "A";
stringList.add("A");
} else if (position == 1) {
selectAnswer += "B";
stringList.add("B");
} else if (position == 2) {
selectAnswer += "C";
stringList.add("C");
} else if (position == 3) {
selectAnswer += "D";
stringList.add("D");
} else if (position == 4) {
selectAnswer += "E";
stringList.add("E");
}
} catch (Exception e) {
Log.e("xuetubao:", e.toString());
}
for (int i = 0; i < stringList.size(); i++) {
if (rightAnswer.contains(stringList.get(i))) {
integerList.add(1);
} else {
integerList.add(2);
}
}
//判断多选题是否答对
for (int i = 0; i < integerList.size(); i++) {
if (integerList.get(i) == 2) {
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
isRight = false;
} else {
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
isRight = true;
}
}
if (!isRight) {
isClickAble = false;
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
wrongCount++;
tvWrongNum.setText(String.valueOf(wrongCount));
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
/* optionsAdapter.setRight(rightAnswer);
optionsAdapter.notifyDataSetChanged();*/
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
duoxuanWrong++;
} else if (isRight && rightAnswer.length() == selectAnswer.length()) {
isClickAble = false;
rightCount++;
tvRightNum.setText(String.valueOf(rightCount));
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
totalScore += duoxuan;
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
}
}
}
}
});
}
@Override
public int initLayout() {
// return R.layout.activity_answer;
// return R.layout.activity_answer_sheet;
return R.layout.activity_answer;
}
@Override
public void initData() {
// mPresenter.getPresenter(8, 1, catalogOid, String.valueOf(10), accountOid);
mPresenter.getPresenter(4, 1, catalogOid, accountOid);
}
@Override
public CommonPresenter getPresenter() {
return new CommonPresenter();
}
@Override
public ExerciseModel getModel() {
return new ExerciseModel();
}
@Override
protected void onDestroy() {
super.onDestroy();
timer.cancel();
}
@Override
public void getData(Object o, int api, int intent) {
if (api == 4 && intent == 1) {
AnswerBean bean = (AnswerBean) o;
List<AnswerBean.QuestionLstBean> questionLstBeans = bean.getQuestionLst();
questionLst.addAll(questionLstBeans);
danxuanCount = bean.getRadioCount();
duoxuanCount = bean.getMultipleCount();
panduanCount = bean.getJudgeCount();
danxuan = bean.getRadioScore();
duoxuan = bean.getMultipleScore();
panduan = bean.getJudgeScore();
tvMax.setText(String.valueOf(questionLst.size()));
all.setText(String.valueOf(questionLst.size()));
tvTopic.setText(questionLstBeans.get(listIndex).getQuestionTitle());
tvCurrent.setText(String.valueOf(listIndex + 1));
index.setText(String.valueOf(listIndex + 1));
type = questionLstBeans.get(listIndex).getQuestionTypeName();
tvRadio.setText(type);
rightAnswer = questionLstBeans.get(listIndex).getAnswer();
// rightSelect.setText(questionLstBeans.get(listIndex).getAnswer());
if (!TextUtils.isEmpty(questionLstBeans.get(listIndex).getAnswer())) {
// rightAnswerText.setText(questionLstBeans.get(listIndex).getWrongAnaly());
}
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
listAnswer.setAdapter(optionsAdapter);
optionsAdapter.notifyDataSetChanged();
for (AnswerBean.QuestionLstBean a : questionLst) {
statusList.add(0);
}
sheetGridAdapter = new AnswerSheetGridAdapter(statusList, this);
longTime = bean.getExamMinute() * 60;
thisTime = longTime;
timer = new CountDownTimer(thisTime * 1000, 1000) {
private Intent intent;
@Override
public void onTick(long millisUntilFinished) {
thisTime--;
tvSecond.setText(String.valueOf(thisTime));
}
@Override
public void onFinish() {
if (listIndex == 0) {
intent = new Intent(b.this, TestScoreActivity.class);
intent.putExtra("catalogOid", catalogOid);
intent.putExtra("danxuanCount", danxuanCount);
intent.putExtra("duoxuanCount", duoxuanCount);
intent.putExtra("panduanCount", panduanCount);
intent.putExtra("danxuanWrong", danxuanCount);
intent.putExtra("panduanWrong", panduanCount);
intent.putExtra("duoxuanWrong", duoxuanCount);
intent.putExtra("totalScore", totalScore);
startActivity(intent);
b.this.finish();
} else {
for (int i = listIndex + 1; i < questionLst.size(); i++) {
if (questionLst.get(i).getQuestionTypeName().contains("单选")) {
danxuanWrong++;
} else if (questionLst.get(i).getQuestionTypeName().contains("多选")) {
duoxuanWrong++;
} else if (questionLst.get(i).getQuestionTypeName().contains("判断")) {
panduanWrong++;
}
}
intent = new Intent(b.this, TestScoreActivity.class);
intent.putExtra("catalogOid", catalogOid);
intent.putExtra("danxuanCount", danxuanCount);
intent.putExtra("duoxuanCount", duoxuanCount);
intent.putExtra("panduanCount", panduanCount);
intent.putExtra("danxuanWrong", danxuanWrong);
intent.putExtra("panduanWrong", panduanWrong);
intent.putExtra("duoxuanWrong", duoxuanWrong);
intent.putExtra("totalScore", totalScore);
startActivity(intent);
b.this.finish();
}
}
}.start();
}
}
private void doRefresh(boolean isNext) {
historyAnswer.add(selectAnswer);
listRightAnswer.add(rightAnswer);
integerList.clear();
selectAnswer = "";
stringList.clear();
isClickAble = true;
tvTopic.setText(questionLst.get(listIndex).getQuestionTitle());
tvCurrent.setText(String.valueOf(listIndex + 1));
type = questionLst.get(listIndex).getQuestionTypeName();
tvRadio.setText(type);
index.setText(String.valueOf(listIndex + 1));
rightAnswer = questionLst.get(listIndex).getAnswer();
// rightSelect.setText(questionLst.get(listIndex).getAnswer());
if (!TextUtils.isEmpty(questionLst.get(listIndex).getWrongAnaly()))
// rightAnswerText.setText(questionLst.get(listIndex).getWrongAnaly());
// rlAnswer.setVisibility(View.GONE);
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
listAnswer.setAdapter(optionsAdapter);
optionsAdapter.notifyDataSetChanged();
if (historyAnswer.size() > listIndex) {
optionsAdapter.setSelect(historyAnswer.get(listIndex));
optionsAdapter.notifyDataSetInvalidated();
}
}
private void showAnswerCard(List<Integer> sheetCard, int rightCount, int wrongCount, int currentIndex, int maxTopic) {
View contentView = LayoutInflater.from(this).inflate(R.layout.pop_answer_sheet, null);
View view = LayoutInflater.from(this).inflate(R.layout.activity_answer, null);
TextView tv_card = (TextView) contentView.findViewById(R.id.tv_card);
GridView gridView = (GridView) contentView.findViewById(R.id.grid_dati);
TextView index = (TextView) contentView.findViewById(R.id.index);
TextView total = (TextView) contentView.findViewById(R.id.total);
TextView right = (TextView) contentView.findViewById(R.id.tv_right_num);
TextView wrong = (TextView) contentView.findViewById(R.id.tv_wrong_num);
right.setText(String.valueOf(rightCount));
wrong.setText(String.valueOf(wrongCount));
index.setText(String.valueOf(currentIndex + 1));
total.setText(String.valueOf(maxTopic));
// sheetGridAdapter = new AnswerSheetGridAdapter(sheetCard, this);
gridView.setAdapter(sheetGridAdapter);
popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
popupWindow.setOutsideTouchable(false);
popupWindow.setTouchable(true);
popupWindow.showAtLocation(view, Gravity.BOTTOM, 0, 0);
tv_card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (popupWindow != null) {
popupWindow.dismiss();
}
}
});
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private void showCommitCard(final Context context, int laveCount) {
View contentView = LayoutInflater.from(this).inflate(R.layout.pop_answer_commit, null);
View view = LayoutInflater.from(this).inflate(R.layout.activity_answer, null);
TextView count = (TextView) contentView.findViewById(R.id.tv_count);
TextView goOn = (TextView) contentView.findViewById(R.id.tv_continue);
TextView commit = (TextView) contentView.findViewById(R.id.tv_commit);
count.setText(String.valueOf(laveCount));
popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
popupWindow.setOutsideTouchable(false);
popupWindow.setTouchable(true);
popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
goOn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
}
});
commit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
Intent intent = new Intent(context, TestScoreActivity.class);
intent.putExtra("catalogOid", catalogOid);
intent.putExtra("danxuanCount", danxuanCount);
intent.putExtra("duoxuanCount", duoxuanCount);
intent.putExtra("panduanCount", panduanCount);
intent.putExtra("danxuanWrong", danxuanWrong);
intent.putExtra("panduanWrong", panduanWrong);
intent.putExtra("duoxuanWrong", duoxuanWrong);
intent.putExtra("totalScore", totalScore);
Log.e("zhangtao", totalScore + "分");
startActivity(intent);
b.this.finish();
}
});
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
chageAlpha(1f);
}
});
}
private void chageAlpha(float color) {
WindowManager.LayoutParams lp = this.getWindow().getAttributes();
lp.alpha = color;
this.getWindow().setAttributes(lp);
}
@Override
public void onComplete(int api) {
}
@Override
public void onError(Throwable e, int api) {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.rl_last:
if (listIndex == 0) {
Toast.makeText(this, "当前已是第一题", Toast.LENGTH_SHORT).show();
} else {
listIndex--;
doRefresh(false);
}
break;
case R.id.rl_next:
if (listIndex < questionLst.size() - 1) {
if (type.contains("多选")) {
if (selectAnswer.length() != rightAnswer.length()) {
statusList.set(listIndex, 2);
}
}
if (TextUtils.isEmpty(selectAnswer)) {
if (listIndex > historyAnswer.size() - 1) {
unDone++;
wrongCount++;
statusList.set(listIndex, 0);
}
}
listIndex++;
doRefresh(true);
} else if (listIndex == questionLst.size() - 1) {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
tvShowCard.setVisibility(View.GONE);
commit.setVisibility(View.VISIBLE);
}
break;
case R.id.lin_tab:
this.finish();
break;
case R.id.tv_look:
// rlAnswer.setVisibility(View.VISIBLE);
break;
case R.id.commit:
if (listIndex > historyAnswer.size()) {
if (TextUtils.isEmpty(selectAnswer)) {
wrongCount++;
if (type.contains("单选")) {
danxuanWrong++;
} else if (type.contains("判断")) {
panduanWrong++;
} else if (type.contains("多选")) {
duoxuanWrong++;
}
}
} else if (listIndex == questionLst.size() - 1) {
if (TextUtils.isEmpty(selectAnswer)) {
unDone++;
if (type.contains("单选")) {
danxuanWrong++;
} else if (type.contains("判断")) {
panduanWrong++;
} else if (type.contains("多选")) {
duoxuanWrong++;
}
}
}
showCommitCard(this, unDone);
chageAlpha(0.5f);
break;
case R.id.tv_show_card:
showAnswerCard(statusList, rightCount, wrongCount, listIndex, questionLst.size());
break;
case R.id.rl_card:
showAnswerCard(statusList, rightCount, wrongCount, listIndex, questionLst.size());
break;
}
}
}
... ...
package com.hh.xuetubao.activity.pratice;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.adapter.AnswerSheetGridAdapter;
import com.hh.xuetubao.adapter.ListAnswerAdapter;
import com.hh.xuetubao.bean.AnswerBean;
import com.hh.xuetubao.model.ExerciseModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 错题练习页面
*/
public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implements ICommonView, View.OnClickListener {
@BindView(R.id.list_answer)
ListView listAnswer;
@BindView(R.id.tv_radio)
TextView tvRadio;
@BindView(R.id.tv_max)
TextView tvMax;
@BindView(R.id.tv_current)
TextView tvCurrent;
@BindView(R.id.tv_title)
TextView tvTitle;
@BindView(R.id.tv_topic)
TextView tvTopic;
@BindView(R.id.rl_last)
RelativeLayout rlLast;
@BindView(R.id.rl_next)
RelativeLayout rlNext;
@BindView(R.id.index)
TextView index;
@BindView(R.id.all)
TextView all;
@BindView(R.id.tv_right_num)
TextView tvRightNum;
@BindView(R.id.tv_wrong_num)
TextView tvWrongNum;
@BindView(R.id.lin_tab)
LinearLayout linTab;
@BindView(R.id.rl_card)
RelativeLayout rlCard;
@BindView(R.id.right_select)
TextView rightSelect;
@BindView(R.id.right_answer)
TextView rightAnswerText;
@BindView(R.id.rl_answer)
RelativeLayout rlAnswer;
@BindView(R.id.commit)
LinearLayout commit;
@BindView(R.id.tv2)
TextView tv2;
@BindView(R.id.tv_show_card)
TextView tvShowCard;
private String catalogOid;
private String accountOid;
private int listIndex = 0; //数据下标
private String type;//题目类型
private boolean isClickAble = true;//是否能选择多条目
private String rightAnswer;//当前题目正确答案
private int rightCount;//答对题的数量
private int wrongCount;//答错题的数量
private List<AnswerBean.QuestionLstBean> questionLst = new ArrayList<>();//创建集合存储这一套题
private ListAnswerAdapter optionsAdapter;
private String selectAnswer = "";
private AnswerSheetGridAdapter sheetGridAdapter;
private PopupWindow popupWindow;
private List<Integer> statusList = new ArrayList<>();//保存答题结果 0:未答题 1:答对 2:答错
private List<Integer> integerList = new ArrayList<>();// 存放 1或者2 用来判断多选题 是否答对
private List<String> stringList = new ArrayList<>();//用来存放多选题选择的答案
private List<String> historyAnswer = new ArrayList<>();//存放历史选择的答案
private boolean isRight;
private int unDone;//未完成的题
private int danxuanCount;
private int duoxuanCount;
private int panduanCount;
private int danxuanWrong;
private int panduanWrong;
private int duoxuanWrong;
private double totalScore;
private double danxuan;
private double duoxuan;
private double panduan;
@Override
public void initView() {
accountOid = SharedPrefrenceUtils.getString(this, "AccountOid");
catalogOid = getIntent().getStringExtra("catalogOid");
rlLast.setOnClickListener(this);
rlNext.setOnClickListener(this);
linTab.setOnClickListener(this);
rlCard.setOnClickListener(this);
commit.setOnClickListener(this);
tvShowCard.setOnClickListener(this);
tvShowCard.setText("查看答案");
listAnswer.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ImageView wrong = (ImageView) view.findViewById(R.id.img_wrong);
ImageView right = (ImageView) view.findViewById(R.id.img_right);
TextView option = (TextView) view.findViewById(R.id.option);
TextView text = (TextView) view.findViewById(R.id.text);
Log.e("zhangtao:trueType", type);
if (type.contains("单选") || type.contains("判断")) {
//单选· 多选 选择答案 设置为单选
if (isClickAble) {
isClickAble = false;
try {
if (position == 0) {
selectAnswer = "A";
} else if (position == 1) {
selectAnswer = "B";
} else if (position == 2) {
selectAnswer = "C";
} else if (position == 3) {
selectAnswer = "D";
} else if (position == 4) {
selectAnswer = "E";
}
} catch (Exception e) {
Log.e("xuetubao:", e.toString());
}
//判断 单选题 是否答对
if (rightAnswer.contains(selectAnswer)) {
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
rightCount++;
tvRightNum.setText(String.valueOf(rightCount));
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
if (type.contains("单选")) {
totalScore += danxuan;
} else if (type.contains("判断")) {
totalScore += panduan;
}
String questionOid = questionLst.get(position).getQuestionOid();
mPresenter.getPresenter(7, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
} else if (!rightAnswer.contains(selectAnswer)) {
wrongCount++;
tvWrongNum.setText(String.valueOf(wrongCount));
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(position).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
if (type.contains("单选")) {
danxuanWrong++;
} else if (type.contains("判断")) {
panduanWrong++;
}
}
}
} else if (type.contains("多选")) {
//多选题 选择答案 不用设置为单选
if (isClickAble) {
try {
if (position == 0) {
selectAnswer += "A";
stringList.add("A");
} else if (position == 1) {
selectAnswer += "B";
stringList.add("B");
} else if (position == 2) {
selectAnswer += "C";
stringList.add("C");
} else if (position == 3) {
selectAnswer += "D";
stringList.add("D");
} else if (position == 4) {
selectAnswer += "E";
stringList.add("E");
}
} catch (Exception e) {
Log.e("xuetubao:", e.toString());
}
for (int i = 0; i < stringList.size(); i++) {
if (rightAnswer.contains(stringList.get(i))) {
integerList.add(1);
} else {
integerList.add(2);
}
}
//判断多选题是否答对
for (int i = 0; i < integerList.size(); i++) {
if (integerList.get(i) == 2) {
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
isRight = false;
} else {
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
isRight = true;
}
}
if (!isRight) {
isClickAble = false;
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
wrongCount++;
tvWrongNum.setText(String.valueOf(wrongCount));
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(position).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
/* optionsAdapter.setRight(rightAnswer);
optionsAdapter.notifyDataSetChanged();*/
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
duoxuanWrong++;
} else if (isRight && rightAnswer.length() == selectAnswer.length()) {
isClickAble = false;
rightCount++;
tvRightNum.setText(String.valueOf(rightCount));
statusList.set(listIndex, 1);
sheetGridAdapter.notifyDataSetChanged();
totalScore += duoxuan;
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
}
}
}
}
});
}
@Override
public int initLayout() {
// return R.layout.activity_answer;
return R.layout.activity_answer_sheet;
}
@Override
public void initData() {
// mPresenter.getPresenter(8, 1, catalogOid, String.valueOf(10), accountOid);
mPresenter.getPresenter(7, 1, accountOid, catalogOid, String.valueOf(1));
}
@Override
public CommonPresenter getPresenter() {
return new CommonPresenter();
}
@Override
public ExerciseModel getModel() {
return new ExerciseModel();
}
@Override
public void getData(Object o, int api, int intent) {
if (api == 7 && intent == 1) {
AnswerBean bean = (AnswerBean) o;
List<AnswerBean.QuestionLstBean> questionLstBeans = bean.getQuestionLst();
questionLst.addAll(questionLstBeans);
danxuanCount = bean.getRadioCount();
duoxuanCount = bean.getMultipleCount();
panduanCount = bean.getJudgeCount();
danxuan = bean.getRadioScore();
duoxuan = bean.getMultipleScore();
panduan = bean.getJudgeScore();
tvMax.setText(String.valueOf(questionLst.size()));
all.setText(String.valueOf(questionLst.size()));
tvTopic.setText(questionLstBeans.get(listIndex).getQuestionTitle());
tvCurrent.setText(String.valueOf(listIndex + 1));
index.setText(String.valueOf(listIndex + 1));
type = questionLstBeans.get(listIndex).getQuestionTypeName();
tvRadio.setText(type);
rightAnswer = questionLstBeans.get(listIndex).getAnswer();
rightSelect.setText(questionLstBeans.get(listIndex).getAnswer());
if (!TextUtils.isEmpty(questionLstBeans.get(listIndex).getAnswer())) {
rightAnswerText.setText(questionLstBeans.get(listIndex).getWrongAnaly());
}
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
listAnswer.setAdapter(optionsAdapter);
optionsAdapter.notifyDataSetChanged();
for (AnswerBean.QuestionLstBean a : questionLst) {
statusList.add(0);
}
sheetGridAdapter = new AnswerSheetGridAdapter(statusList, this);
}
}
private void doRefresh(boolean isNext) {
historyAnswer.add(selectAnswer);
integerList.clear();
selectAnswer = "";
stringList.clear();
isClickAble = true;
tvTopic.setText(questionLst.get(listIndex).getQuestionTitle());
tvCurrent.setText(String.valueOf(listIndex + 1));
type = questionLst.get(listIndex).getQuestionTypeName();
tvRadio.setText(type);
index.setText(String.valueOf(listIndex + 1));
rightAnswer = questionLst.get(listIndex).getAnswer();
rightSelect.setText(questionLst.get(listIndex).getAnswer());
if (!TextUtils.isEmpty(questionLst.get(listIndex).getWrongAnaly()))
rightAnswerText.setText(questionLst.get(listIndex).getWrongAnaly());
rlAnswer.setVisibility(View.GONE);
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
listAnswer.setAdapter(optionsAdapter);
optionsAdapter.notifyDataSetChanged();
if (historyAnswer.size() > listIndex) {
optionsAdapter.setSelect(historyAnswer.get(listIndex));
optionsAdapter.notifyDataSetInvalidated();
}
}
private void showAnswerCard(List<Integer> sheetCard, int rightCount, int wrongCount, int currentIndex, int maxTopic) {
View contentView = LayoutInflater.from(this).inflate(R.layout.pop_answer_sheet, null);
View view = LayoutInflater.from(this).inflate(R.layout.activity_answer, null);
TextView tv_card = (TextView) contentView.findViewById(R.id.tv_card);
GridView gridView = (GridView) contentView.findViewById(R.id.grid_dati);
TextView index = (TextView) contentView.findViewById(R.id.index);
TextView total = (TextView) contentView.findViewById(R.id.total);
TextView right = (TextView) contentView.findViewById(R.id.tv_right_num);
TextView wrong = (TextView) contentView.findViewById(R.id.tv_wrong_num);
right.setText(String.valueOf(rightCount));
wrong.setText(String.valueOf(wrongCount));
index.setText(String.valueOf(currentIndex + 1));
total.setText(String.valueOf(maxTopic));
// sheetGridAdapter = new AnswerSheetGridAdapter(sheetCard, this);
gridView.setAdapter(sheetGridAdapter);
popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
popupWindow.setOutsideTouchable(false);
popupWindow.setTouchable(true);
popupWindow.showAtLocation(view, Gravity.BOTTOM, 0, 0);
tv_card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (popupWindow != null) {
popupWindow.dismiss();
}
}
});
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private void showCommitCard(final Context context, int laveCount) {
View contentView = LayoutInflater.from(this).inflate(R.layout.pop_answer_commit, null);
View view = LayoutInflater.from(this).inflate(R.layout.activity_answer, null);
TextView count = (TextView) contentView.findViewById(R.id.tv_count);
TextView goOn = (TextView) contentView.findViewById(R.id.tv_continue);
TextView commit = (TextView) contentView.findViewById(R.id.tv_commit);
count.setText(String.valueOf(laveCount));
popupWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
popupWindow.setOutsideTouchable(false);
popupWindow.setTouchable(true);
popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
goOn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
}
});
commit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow.dismiss();
Intent intent = new Intent(context, TestScoreActivity.class);
intent.putExtra("catalogOid", catalogOid);
intent.putExtra("danxuanCount", danxuanCount);
intent.putExtra("duoxuanCount", duoxuanCount);
intent.putExtra("panduanCount", panduanCount);
intent.putExtra("danxuanWrong", danxuanWrong);
intent.putExtra("panduanWrong", panduanWrong);
intent.putExtra("duoxuanWrong", duoxuanWrong);
intent.putExtra("totalScore", totalScore);
Log.e("zhangtao", totalScore + "分");
startActivity(intent);
c.this.finish();
}
});
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
chageAlpha(1f);
}
});
}
private void chageAlpha(float color) {
WindowManager.LayoutParams lp = this.getWindow().getAttributes();
lp.alpha = color;
this.getWindow().setAttributes(lp);
}
@Override
public void onComplete(int api) {
}
@Override
public void onError(Throwable e, int api) {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.rl_last:
if (listIndex == 0) {
Toast.makeText(this, "当前已是第一题", Toast.LENGTH_SHORT).show();
} else {
listIndex--;
doRefresh(false);
}
break;
case R.id.rl_next:
if (listIndex < questionLst.size() - 1) {
if (type.contains("多选")) {
if (selectAnswer.length() != rightAnswer.length()) {
statusList.set(listIndex, 2);
}
}
if (TextUtils.isEmpty(selectAnswer)) {
if (listIndex > historyAnswer.size() - 1) {
unDone++;
wrongCount++;
statusList.set(listIndex, 0);
}
}
listIndex++;
doRefresh(true);
} else if (listIndex == questionLst.size() - 1) {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
}
break;
case R.id.lin_tab:
this.finish();
break;
case R.id.tv_look:
rlAnswer.setVisibility(View.VISIBLE);
break;
case R.id.commit:
if (listIndex > historyAnswer.size()) {
if (TextUtils.isEmpty(selectAnswer)) {
wrongCount++;
if (type.contains("单选")) {
danxuanWrong++;
} else if (type.contains("判断")) {
panduanWrong++;
} else if (type.contains("多选")) {
duoxuanWrong++;
}
}
} else if (listIndex == questionLst.size() - 1) {
if (TextUtils.isEmpty(selectAnswer)) {
unDone++;
if (type.contains("单选")) {
danxuanWrong++;
} else if (type.contains("判断")) {
panduanWrong++;
} else if (type.contains("多选")) {
duoxuanWrong++;
}
}
} else {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
}
break;
case R.id.tv_show_card:
rlAnswer.setVisibility(View.VISIBLE);
break;
case R.id.rl_card:
showAnswerCard(statusList, rightCount, wrongCount, listIndex, questionLst.size());
break;
}
}
}
... ...
package com.hh.xuetubao.activity.study;
import android.graphics.Bitmap;
import android.media.MediaMetadataRetriever;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.bean.ChapterLstBean;
import com.hh.xuetubao.bean.Event;
import com.hh.xuetubao.fragment.IntroduceFragment;
import com.hh.xuetubao.fragment.ListFragment;
import com.hh.xuetubao.model.LearnModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.HashMap;
import butterknife.BindView;
import butterknife.ButterKnife;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;
/**
* 课程详情
*/
public class CourseDetailActivity extends BaseMvpActivity<CommonPresenter, LearnModel> implements ICommonView, View.OnClickListener {
@BindView(R.id.viewPager)
FrameLayout viewPager;
@BindView(R.id.tv_introduce)
TextView linIntroduce;
@BindView(R.id.tv_list)
TextView linList;
@BindView(R.id.jiecao_Player)
JCVideoPlayerStandard jiecaoPlayer;
private IntroduceFragment introduceFragment;
private ListFragment listFragment;
private String lessonOid;
private int playing;
private String accountOid;
@Override
public void initView() {
EventBus.getDefault().register(this);
accountOid = SharedPrefrenceUtils.getString(this, "AccountOid");
lessonOid = getIntent().getExtras().getString("lessonOid");
introduceFragment = new IntroduceFragment();
listFragment = new ListFragment(lessonOid);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.viewPager, introduceFragment, lessonOid);
transaction.show(introduceFragment);
transaction.commit();
linIntroduce.setOnClickListener(this);
linList.setOnClickListener(this);
}
public void onResumeJC(final Event event) {
new Thread(new Runnable() {
private int duration;
@Override
public void run() {
try {
playing = jiecaoPlayer.getCurrentPositionWhenPlaying();
duration = jiecaoPlayer.getDuration();
mPresenter.getPresenter(6,
1,
accountOid,
event.getLessonOid(),
event.getChapterOid(),
event.getSectionOid(),
event.getResourceOid(),
String.valueOf(playing/1000),
String.valueOf(playing/1000),
String.valueOf(duration/1000)
);
Thread.sleep(500);
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
mPresenter.getPresenter(6, 1, accountOid);
}
@Override
protected void onResume() {
super.onResume();
// onResumeJC();
}
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void handleEvent(Event event) {
// 接收来自ListRecSecondChildAdapter的URL视频路径
if (event.getCode() == 1) {
Bitmap bitmap = getNetVideoBitmap(event.getPlayUrl());
jiecaoPlayer.setUp(event.getPlayUrl(), JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL);
Glide.with(this).load(bitmap).into(jiecaoPlayer.thumbImageView);
jiecaoPlayer.startVideo();
onResumeJC(event);
}
if (event.getCode() == 2) {
Glide.with(this).load(event.getPlayUrl()).into(jiecaoPlayer.thumbImageView);
}
}
@Override
public void onBackPressed() {
if (JCVideoPlayerStandard.backPress()) {
return;
}
super.onBackPressed();
}
@Override
public int initLayout() {
return R.layout.activity_course_detail;
}
@Override
public void initData() {
mPresenter.getPresenter(3, 1, "", lessonOid);
}
@Override
public CommonPresenter getPresenter() {
return new CommonPresenter();
}
@Override
public LearnModel getModel() {
return new LearnModel();
}
@Override
public void getData(Object o, int api, int intent) {
if (api == 3 && intent == 1) {
ChapterLstBean bean = (ChapterLstBean) o;
String playUrl = bean.getChapterLst().get(0).getSectionLst().get(0).getResourceLst().get(0).getPlayUrl();
jiecaoPlayer.setUp(playUrl, JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL);
// onSendPlayUrl(bean.getChapterLst().get(0).getSectionLst().get(0).getResourceLst().get(0).getPlayUrl());
// Bitmap videoBitmap = getNetVideoBitmap(playUrl);
// Glide.with(this).load(videoBitmap).into(jiecaoPlayer.thumbImageView);
}
}
@Override
public void onComplete(int api) {
}
@Override
public void onError(Throwable e, int api) {
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
@Override
public void onClick(View v) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
introduceFragment = new IntroduceFragment();
listFragment = new ListFragment(lessonOid);
switch (v.getId()) {
case R.id.tv_introduce:
linIntroduce.setTextColor(getResources().getColor(R.color.color_ff5400));
linList.setTextColor(getResources().getColor(R.color.color_616161));
transaction.replace(R.id.viewPager, introduceFragment, lessonOid);
transaction.commit();
break;
case R.id.tv_list:
linList.setTextColor(getResources().getColor(R.color.color_ff5400));
linIntroduce.setTextColor(getResources().getColor(R.color.color_616161));
transaction.replace(R.id.viewPager, listFragment, lessonOid);
transaction.commit();
break;
}
}
@Override
protected void onPause() {
super.onPause();
jiecaoPlayer.releaseAllVideos();
jiecaoPlayer.release();
}
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
introduceFragment.onDestroy();
listFragment.onDestroy();
}
public static Bitmap getNetVideoBitmap(String videoUrl) {
Bitmap bitmap = null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
//根据url获取缩略图
retriever.setDataSource(videoUrl, new HashMap());
//获得第一帧图片
bitmap = retriever.getFrameAtTime();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} finally {
retriever.release();
}
return bitmap;
}
}
... ... @@ -15,10 +15,10 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.dou361.ijkplayer.listener.OnShowThumbnailListener;
import com.dou361.ijkplayer.widget.IjkVideoView;
import com.dou361.ijkplayer.widget.PlayStateParams;
... ... @@ -44,8 +44,9 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
/**
... ... @@ -67,12 +68,20 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
MyViewPagerAdapter pagerAdapter;
TextView introduce, tv_list;
TextView titleValue;
String title;
boolean canStudy = false;
TextView time_video;
@Override
public void initView() {
EventBus.getDefault().register(this);
accountOid = SharedPrefrenceUtils.getString(this, "AccountOid");
lessonOid = getIntent().getExtras().getString("lessonOid");
title = getIntent().getExtras().getString("title");
Log.e("AccountOid", "AccountOid " + accountOid + "," + "lessonOid" + lessonOid);
course_A = this.findViewById(R.id.course_A); // 视频
... ... @@ -82,6 +91,12 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
pager = this.findViewById(R.id.pager);
introduce = this.findViewById(R.id.tv_introduce); // 介绍
tv_list = this.findViewById(R.id.tv_list); // 目录
titleValue = this.findViewById(R.id.titleValue);
time_video = this.findViewById(R.id.app_video_endTime);
titleValue.setText(title);
start.setOnClickListener(this);
back.setOnClickListener(this);
... ... @@ -167,6 +182,7 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
Log.e("bean", bean.toString());
playUrl = bean.getChapterLst().get(0).getSectionLst().get(0).getResourceLst().get(0).getPlayUrl(); // html
Log.e("player", playUrl);
canStudy = true;
}
/* 发送消息 */
... ... @@ -205,6 +221,10 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
this.finish();
break;
case R.id.course_detail_start: // 开始学习
if (canStudy == false) {
Toast.makeText(CourseDetailActivity_Video.this, "还未加载完毕...请稍等", Toast.LENGTH_SHORT).show();
return;
}
playVideo(playUrl);
break;
case R.id.tv_introduce: // 介绍
... ... @@ -271,12 +291,16 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
}
})
.setPlaySource((urlA.substring(urlA.length() - 3, urlA.length())).trim().equals("tml") ? "" : urlA)
.setAutoReConnect(true,0)
.startPlay();
time_video.setText(play.getDuration() + "");
course_A.setVisibility(View.VISIBLE);
course_B.setVisibility(View.GONE);
}
}
// 播放视频
... ... @@ -375,6 +399,7 @@ public class CourseDetailActivity_Video extends BaseMvpActivity<CommonPresenter,
return ti;
}
//第一帧
public static Bitmap getNetVideoBitmap(String videoUrl) {
Bitmap bitmap = null;
... ...
... ... @@ -86,6 +86,8 @@ public class OfficeDetailActivity extends BaseMvpActivity<CommonPresenter, Zhaop
ImageView itemGsxq;
@BindView(R.id.yjtd)
TextView yjtd;
@BindView(R.id.rl_company)
RelativeLayout rlCompany;
private String jobOid;
private List<OfficeDetailBean.LabelListBean> labelList = new ArrayList<>();
... ... @@ -98,6 +100,7 @@ public class OfficeDetailActivity extends BaseMvpActivity<CommonPresenter, Zhaop
private Float precision;
private Float latitude;
private String accountOid;
private Intent intent;
@Override
... ... @@ -122,6 +125,7 @@ public class OfficeDetailActivity extends BaseMvpActivity<CommonPresenter, Zhaop
imgBack.setOnClickListener(this);
tvLookAll.setOnClickListener(this);
itemGsxq.setOnClickListener(this);
rlCompany.setOnClickListener(this);
}
... ... @@ -278,10 +282,15 @@ public class OfficeDetailActivity extends BaseMvpActivity<CommonPresenter, Zhaop
tvLookAll.setVisibility(View.GONE);
break;
case R.id.item_gsxq: // 公司详情
Intent intent = new Intent(OfficeDetailActivity.this, CompanyDetailActivity.class);
intent = new Intent(OfficeDetailActivity.this, CompanyDetailActivity.class);
intent.putExtra("CompanyOid", CompanyId);
startActivity(intent);
break;
case R.id.rl_company:
intent = new Intent(this, CompanyDetailActivity.class);
intent.putExtra("CompanyOid",CompanyId);
startActivity(intent);
break;
}
}
... ...
... ... @@ -42,12 +42,13 @@ public class CertificationCourseContentAdapter extends BaseAdapter {
TextView title = (TextView) view.findViewById(R.id.title);
View line = view.findViewById(R.id.line);
if (list.get(position).getCatalogName() != null)
if (list.get(position).getCatalogName() != null) {
title.setText(list.get(position).getCatalogName());
}
if (position == list.size() - 1) {
line.setVisibility(View.VISIBLE);
line.setVisibility(View.GONE);
} else {
line.setVisibility(View.INVISIBLE);
line.setVisibility(View.VISIBLE);
}
return view;
}
... ...
... ... @@ -66,7 +66,7 @@ public class CourseXrecAdapter extends RecyclerView.Adapter<CourseXrecAdapter.Vi
@Override
public void onClick(View v) {
if (turn != null) {
turn.turnTo(mlist.get(position).getLessonOid());
turn.turnTo(mlist.get(position).getLessonOid(),mlist.get(position).getLessonName().trim());
}
}
});
... ... @@ -103,6 +103,6 @@ public class CourseXrecAdapter extends RecyclerView.Adapter<CourseXrecAdapter.Vi
}
public interface Turn {
void turnTo(String lessonOid);
void turnTo(String lessonOid,String title);
}
}
... ...
... ... @@ -29,7 +29,11 @@ public class GridHomeHotAdapter extends BaseAdapter {
@Override
public int getCount() {
return list.size();
if (list.size() > 4) {
return 4;
} else {
return list.size();
}
}
@Override
... ...
package com.hh.xuetubao.adapter;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
... ... @@ -25,7 +27,11 @@ public class HomeCompanyAdapter extends BaseAdapter {
@Override
public int getCount() {
return list.size();
if (list.size() > 3) {
return 3;
} else {
return list.size();
}
}
@Override
... ... @@ -48,6 +54,17 @@ public class HomeCompanyAdapter extends BaseAdapter {
TextView address = (TextView) view.findViewById(R.id.address);
TextView job = (TextView) view.findViewById(R.id.job);
TextView count = (TextView) view.findViewById(R.id.job_count);
RecyclerView rec = (RecyclerView) view.findViewById(R.id.list_label);
View line = (View) view.findViewById(R.id.line);
LinearLayoutManager manager = new LinearLayoutManager(context);
manager.setOrientation(LinearLayoutManager.HORIZONTAL);
rec.setLayoutManager(manager);
List<CompanyBean.CompanyListBean.IndustryListBean> industryList = list.get(position).getIndustryList();
ListLabelAdapter adapter = new ListLabelAdapter(industryList, context);
rec.setAdapter(adapter);
count.setText(String.valueOf(list.get(position).getJobCount()));
if (list.get(position).getCompanyLogo() != null)
... ... @@ -59,6 +76,30 @@ public class HomeCompanyAdapter extends BaseAdapter {
if (list.get(position).getPopularJobName() != null)
job.setText(list.get(position).getPopularJobName());
if (list.size() > 3) {
if (position == 2) {
line.setVisibility(View.GONE);
} else {
line.setVisibility(View.VISIBLE);
}
} else {
if (position == list.size() - 1) {
line.setVisibility(View.GONE);
} else {
line.setVisibility(View.VISIBLE);
}
}
/*job.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
*/
return view;
}
}
... ...
... ... @@ -29,7 +29,11 @@ public class HomeQuestionAdapter extends BaseAdapter {
@Override
public int getCount() {
return list.size();
if (list.size() > 3) {
return 3;
} else {
return list.size();
}
}
@Override
... ... @@ -55,12 +59,27 @@ public class HomeQuestionAdapter extends BaseAdapter {
ImageView img = (ImageView) view.findViewById(R.id.img);
TextView title = (TextView) view.findViewById(R.id.title);
TextView time = (TextView) view.findViewById(R.id.time);
View line = view.findViewById(R.id.line);
if (list.get(position).getCatalogName() != null)
title.setText(list.get(position).getCatalogName());
if (list.get(position).getConverUrl() != null)
Glide.with(context).load(list.get(position).getConverUrl()).apply(coverRequestOptions).into(img);
if (list.size() > 3) {
if (position == 2) {
line.setVisibility(View.GONE);
} else {
line.setVisibility(View.VISIBLE);
}
} else {
if (position == list.size() - 1) {
line.setVisibility(View.GONE);
} else {
line.setVisibility(View.VISIBLE);
}
}
return view;
}
... ...
... ... @@ -70,7 +70,7 @@ public class JobHuntCompanyAdapter extends RecyclerView.Adapter<JobHuntCompanyAd
holder.hotJob.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(turn != null){
if (turn != null) {
turn.turnToZw(list.get(position).getPopularJobOid());
}
}
... ... @@ -80,7 +80,11 @@ public class JobHuntCompanyAdapter extends RecyclerView.Adapter<JobHuntCompanyAd
@Override
public int getItemCount() {
return list.size();
if (list.size() > 3) {
return 3;
} else {
return list.size();
}
}
public class ViewHolder extends RecyclerView.ViewHolder {
... ... @@ -114,6 +118,7 @@ public class JobHuntCompanyAdapter extends RecyclerView.Adapter<JobHuntCompanyAd
public interface Turn {
void turnTo(String CompanyOid);
void turnToZw(String id);
}
... ...
... ... @@ -49,6 +49,18 @@ public class ListAnswerAdapter extends BaseAdapter {
option.setText(list.get(position).getOptionName());
text.setText(list.get(position).getOptionDesc());
if (!TextUtils.isEmpty(rightAnswer)) {
if (rightAnswer.contains(list.get(position).getOptionName())) {
right.setVisibility(View.VISIBLE);
wrong.setVisibility(View.GONE);
option.setVisibility(View.GONE);
} else {
right.setVisibility(View.GONE);
wrong.setVisibility(View.VISIBLE);
option.setVisibility(View.GONE);
}
}
if (!TextUtils.isEmpty(selectString)) {
if (selectString.contains(list.get(position).getOptionName())) {
option.setTextColor(context.getResources().getColor(R.color.color_ff5400));
... ... @@ -64,6 +76,18 @@ public class ListAnswerAdapter extends BaseAdapter {
this.selectString = answer;
}
private String rightAnswer;
public void setRight(String answer) {
this.rightAnswer = answer;
}
private String listRight;
public void setListRight(String answer) {
this.listRight = answer;
}
@Override
public boolean isEnabled(int position) {
if (!TextUtils.isEmpty(selectString)) {
... ...
... ... @@ -4,6 +4,7 @@ import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
... ... @@ -46,12 +47,8 @@ public class RecruitmentRecAdapter extends RecyclerView.Adapter<RecruitmentRecAd
holder.year.setText(list.get(position).getExprience());
if (list.get(position).getEducation() != null)
holder.education.setText(list.get(position).getEducation());
if (list.get(position).getAddress() != null && !list.get(position).getAddress().equals("")) {
holder.address.setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(list.get(position).getAddress())) {
holder.address.setText(list.get(position).getAddress());
Log.e("address111", list.get(position).getAddress().toString().trim());
}else {
holder.address.setVisibility(View.GONE);
}
LinearLayoutManager manager = new LinearLayoutManager(context);
... ...
... ... @@ -4,10 +4,10 @@ package com.hh.xuetubao.fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.amap.api.maps.AMap;
... ... @@ -17,7 +17,6 @@ import com.amap.api.maps.MapView;
import com.amap.api.maps.model.CameraPosition;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.MyLocationStyle;
import com.bumptech.glide.Glide;
import com.hh.xuetubao.MyServer;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.BaseObsever;
... ... @@ -46,7 +45,7 @@ public class CompanyMainFragment extends Fragment {
TextView address;
@BindView(R.id.web)
TextView web;
// @BindView(R.id.img_hotel)
// @BindView(R.id.img_hotel)
// ImageView imgHotel;
@BindView(R.id.tv_content)
TextView tvContent;
... ... @@ -125,11 +124,10 @@ public class CompanyMainFragment extends Fragment {
web.setText(bean.getWebSite());
if (bean.getCompanyLogoPic() != null)
// Glide.with(getActivity()).load(bean.getCompanyLogoPic()).into(imgHotel);
if (bean.getIntroduction() != null)
tvContent.setText(bean.getIntroduction());
if (bean.getIntroduction() != null)
tvContent.setText(Html.fromHtml(bean.getIntroduction()));
if (bean.getFullAddress() != null)
tvDingwei.setText(bean.getFullAddress());
}
});
... ...
... ... @@ -15,7 +15,6 @@ import android.widget.ImageView;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.CustomScrollView;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity_Video;
import com.hh.xuetubao.adapter.CourseXrecAdapter;
import com.hh.xuetubao.bean.FreeCourseBean;
... ... @@ -182,9 +181,10 @@ public class CourseFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
}
@Override
public void turnTo(String lessonOid) {
public void turnTo(String lessonOid,String title) {
Intent intent = new Intent(getActivity(), CourseDetailActivity_Video.class); //CourseDetailActivity
intent.putExtra("lessonOid", lessonOid);
intent.putExtra("title",title);
startActivity(intent);
}
}
... ...
... ... @@ -14,7 +14,6 @@ import android.widget.RelativeLayout;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity_Video;
import com.hh.xuetubao.adapter.CurriculumScheduleRecAdapter;
import com.hh.xuetubao.bean.FreeCourseBean;
... ...
... ... @@ -10,16 +10,21 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.MyServer;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.BaseObsever;
import com.hh.xuetubao.Utils.GridViewNesting;
import com.hh.xuetubao.Utils.HttpUtils;
import com.hh.xuetubao.Utils.ListViewNesting;
import com.hh.xuetubao.Utils.NetConfig;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.activity.pratice.PracticeActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.pratice.PriacticeDistActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity_Video;
import com.hh.xuetubao.activity.study.StudyActivity;
import com.hh.xuetubao.activity.work.CompanyActivity;
... ... @@ -27,6 +32,7 @@ import com.hh.xuetubao.activity.work.CompanyDetailActivity;
import com.hh.xuetubao.adapter.GridHomeHotAdapter;
import com.hh.xuetubao.adapter.HomeCompanyAdapter;
import com.hh.xuetubao.adapter.HomeQuestionAdapter;
import com.hh.xuetubao.bean.AnswerBean;
import com.hh.xuetubao.bean.CompanyBean;
import com.hh.xuetubao.bean.FreeCourseBean;
import com.hh.xuetubao.bean.QuestionBankLstBean;
... ... @@ -47,6 +53,8 @@ import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* 首页
... ... @@ -56,11 +64,10 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
@BindView(R.id.grid_hotLesson)
GridView gridHotLesson;
GridViewNesting gridHotLesson;
@BindView(R.id.list_question)
ListViewNesting listQuestion;
@BindView(R.id.list_company)
ListView listCompany;
@BindView(R.id.img_top)
Banner banner;
@BindView(R.id.tv_more_ke)
... ... @@ -71,6 +78,8 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
TextView tvMoreTi;
@BindView(R.id.lin_title)
LinearLayout linTitle;
@BindView(R.id.list_company)
ListViewNesting listCompany;
private Unbinder unbinder;
private List<FreeCourseBean.bean> hotList = new ArrayList<>();
private List<QuestionBankLstBean.QuestionBankbean> questionList = new ArrayList<>();
... ... @@ -80,6 +89,7 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
private HomeCompanyAdapter companyAdapter;
private Intent intent;
private List<Drawable> imageList = new ArrayList<>();
private String accountOid;
@Override
public int getLayoutId() {
... ... @@ -95,6 +105,8 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
linTitle.setFocusableInTouchMode(true);
linTitle.requestFocus();
accountOid = SharedPrefrenceUtils.getString(getActivity(), "AccountOid");
hotAdapter = new GridHomeHotAdapter(hotList, getActivity());
gridHotLesson.setAdapter(hotAdapter);
gridHotLesson.setOnItemClickListener(new AdapterView.OnItemClickListener() {
... ... @@ -111,9 +123,11 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
listQuestion.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
intent = new Intent(getActivity(), PracticeActivity.class);
/*intent = new Intent(getActivity(), PracticeActivity.class);
intent.putExtra("catalogOid", questionList.get(position).getCatalogOid());
startActivity(intent);
startActivity(intent);*/
doRequestTwo(questionList.get(position).getCatalogOid(),accountOid,questionList.get(position).getCatalogName());
}
});
... ... @@ -144,13 +158,13 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
@Override
public void OnBannerClick(int position) {
switch (position) {
case 0: // 题库
Intent intent = new Intent(getActivity(),PracticeActivity.class);
intent.putExtra("tag","1");
case 0: // 题库
Intent intent = new Intent(getActivity(), PracticeActivity.class);
intent.putExtra("tag", "1");
startActivity(intent);
break;
case 1:
Intent intent1 = new Intent(getActivity(),StudyActivity.class);
Intent intent1 = new Intent(getActivity(), StudyActivity.class);
startActivity(intent1);
break;
}
... ... @@ -169,6 +183,30 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
}
private void doRequestTwo(final String catalogOid, String accountOid, final String title) {
MyServer mServers = HttpUtils.getInstance().getServer(NetConfig.shuaTiUrl);
mServers.GetRandomQuestions(catalogOid, Integer.valueOf(10), accountOid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
@Override
public void onNext(Object value) {
super.onNext(value);
AnswerBean bean = (AnswerBean) value;
if (bean.isIsSuccess()) {
Intent intent = new Intent(getActivity(), PriacticeDistActivity.class);
intent.putExtra("CatalogOid", catalogOid);
SharedPrefrenceUtils.saveString(getActivity(), "PraticeTitle", title);
getActivity().startActivity(intent);
} else {
Toast.makeText(getActivity(), "当前账号无权限,请拨打电话xxxxxxxxxx", Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
public void initData() {
LearnModel model = new LearnModel();
... ... @@ -199,6 +237,12 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
List<FreeCourseBean.bean> beanLessonLst = bean.getLessonLst();
hotList.addAll(beanLessonLst);
hotAdapter.notifyDataSetChanged();
if(beanLessonLst.size()>4){
tvMoreKe.setVisibility(View.VISIBLE);
}else{
tvMoreKe.setVisibility(View.GONE);
}
}
if (api == 2 && intent == 1) {
QuestionBankLstBean bean = (QuestionBankLstBean) o;
... ... @@ -207,7 +251,7 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
questionList.addAll(bankLst);
questionAdapter.notifyDataSetChanged();
if (bankLst.size() > 4) {
if (bankLst.size() > 3) {
tvMoreTi.setVisibility(View.VISIBLE);
} else {
tvMoreTi.setVisibility(View.GONE);
... ... @@ -219,7 +263,7 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
companyList.addAll(companyListBeans);
companyAdapter.notifyDataSetChanged();
if (companyListBeans.size() > 4) {
if (companyListBeans.size() > 3) {
tvMoreQiye.setVisibility(View.VISIBLE);
} else {
tvMoreQiye.setVisibility(View.GONE);
... ... @@ -262,6 +306,7 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
public void onResume() {
super.onResume();
banner.startAutoPlay();
}
@Override
... ...
... ... @@ -3,7 +3,6 @@ package com.hh.xuetubao.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
... ... @@ -12,7 +11,6 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.hh.xuetubao.MainActivity;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.RecyclerViewSpacesItemDecoration;
import com.hh.xuetubao.activity.personal.DeliveryActivity;
... ... @@ -35,7 +33,6 @@ import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
/**
... ... @@ -63,7 +60,7 @@ public class JobHuntFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMod
private JobHuntWorkAdapter workAdapter;
private List<CompanyBean.CompanyListBean> companyList = new ArrayList<>();
private List<HotJobBean.JobListBean> jobList = new ArrayList<>();
// private OfficeFragment officeFragment;
// private OfficeFragment officeFragment;
// private FragmentTransaction transaction;
private Intent intent;
... ... @@ -128,6 +125,12 @@ public class JobHuntFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMod
companyList.addAll(companyListBeans);
adapter.notifyDataSetChanged();
if (companyList.size() > 3) {
linMoreCompany.setVisibility(View.VISIBLE);
} else {
linMoreCompany.setVisibility(View.GONE);
}
}
if (api == 3 && intent == 2) {
HotJobBean bean = (HotJobBean) o;
... ... @@ -174,7 +177,7 @@ public class JobHuntFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMod
case R.id.img_zhiwei:
Intent intent1 = new Intent(getActivity(), JobHuntActivity.class);
intent1.putExtra("jobTag","1");
intent1.putExtra("jobTag", "1");
startActivity(intent1);
getActivity().finish();
... ...
... ... @@ -8,9 +8,13 @@ import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.hh.xuetubao.R;
import com.hh.xuetubao.adapter.ListRecChildAdapter;
import com.hh.xuetubao.adapter.ListRecGroupAdapter;
import com.hh.xuetubao.bean.ChapterLstBean;
import com.hh.xuetubao.model.LearnModel;
... ... @@ -18,8 +22,6 @@ import com.hh.xuetubao.mvp.BaseMvpFragment;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.List;
... ... @@ -37,10 +39,18 @@ public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
Unbinder unbinder;
@BindView(R.id.rec_group)
RecyclerView recGroup;
@BindView(R.id.image)
ImageView image;
@BindView(R.id.list_linear)
LinearLayout listLinear;
private String lessonOid;
private List<ChapterLstBean.ChapterLstObject> title = new ArrayList<>();
private ListRecGroupAdapter groupAdapter;
RotateAnimation rotateAnimation;
@SuppressLint("ValidFragment")
public ListFragment(String lessonOid) {
this.lessonOid = lessonOid;
... ... @@ -59,6 +69,16 @@ public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
groupAdapter.setLessonOid(lessonOid);
recGroup.setAdapter(groupAdapter);
rotateAnimation = new RotateAnimation(0,360, Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
rotateAnimation.setDuration(2000);
rotateAnimation.setFillAfter(true);
rotateAnimation.setRepeatMode(Animation.RESTART);
//让旋转动画一直转,不停顿的重点
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setRepeatCount(-1);
image.setAnimation(rotateAnimation);
}
@Override
... ... @@ -85,6 +105,9 @@ public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
title.addAll(chapterLst);
groupAdapter.notifyDataSetChanged();
recGroup.setVisibility(View.VISIBLE);
listLinear.setVisibility(View.GONE);
image.clearAnimation();
// onSendPlayUrl(bean.getChapterLst().get(0).getSectionLst().get(0).getResourceLst().get(0).getPlayUrl());
}
}
... ... @@ -118,5 +141,4 @@ public class ListFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
}
}
... ...
... ... @@ -11,6 +11,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
... ... @@ -24,7 +25,6 @@ import com.hh.xuetubao.activity.personal.MessageActivity;
import com.hh.xuetubao.activity.personal.MoneyActivity;
import com.hh.xuetubao.activity.personal.ResumeActivity;
import com.hh.xuetubao.activity.pratice.PracticeActivity;
import com.hh.xuetubao.activity.study.StudyActivity;
import com.hh.xuetubao.activity.study.StudyNoteActivity;
import com.hh.xuetubao.bean.UserBean;
import com.hh.xuetubao.model.PersonalModel;
... ... @@ -64,10 +64,15 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
RelativeLayout rlCuoti;
@BindView(R.id.rl_end)
RelativeLayout rlEnd;
@BindView(R.id.lin_back)
LinearLayout linBack;
@BindView(R.id.rl_top)
RelativeLayout rlTop;
private Intent intent;
private FragmentTransaction transaction;
// private PraticeWrongFragment wrongFragment;
private String accountOid;
private HomeFragment homeFragment;
@Override
public int getLayoutId() {
... ... @@ -78,6 +83,13 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
public void initView(@Nullable Bundle savedInstanceState) {
accountOid = SharedPrefrenceUtils.getString(getActivity(), "AccountOid");
String tag = getTag();
if (tag.equals("1")) {
rlTop.setVisibility(View.GONE);
} else {
rlTop.setVisibility(View.VISIBLE);
}
rlXinxi.setOnClickListener(this);
rlJianli.setOnClickListener(this);
rlMessage.setOnClickListener(this);
... ... @@ -86,6 +98,7 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
rlStudy.setOnClickListener(this);
rlCuoti.setOnClickListener(this);
rlEnd.setOnClickListener(this);
linBack.setOnClickListener(this);
}
... ... @@ -142,7 +155,7 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
Glide.with(this).load(headPic).into(imgUser);
} else if (!TextUtils.isEmpty(reallHeader)) {
Glide.with(this).load(reallHeader).into(imgUser);
}else if(bean.getHeadPic() != null && !bean.getHeadPic().equals("")){
} else if (bean.getHeadPic() != null && !bean.getHeadPic().equals("")) {
Glide.with(getActivity()).load(bean.getHeadPic()).into(imgUser);
}
... ... @@ -186,6 +199,7 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
transaction = getActivity().getSupportFragmentManager().beginTransaction();
// wrongFragment = new PraticeWrongFragment();
homeFragment = new HomeFragment();
switch (v.getId()) {
case R.id.rl_xinxi:
... ... @@ -227,6 +241,10 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
startActivity(new Intent(getActivity(), LoginActivity.class));
getActivity().finish();
break;
case R.id.lin_back:
/* transaction.replace(R.id.frame,homeFragment);
transaction.commit();*/
break;
}
}
... ...
... ... @@ -160,6 +160,8 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
requestBody.setSearchName(edSearch.getText().toString());
doRequset(requestBody);
Log.e("zhangtao:Jobreqeust",requestBody.toString());
Log.e("zhangtao:A","=========================");
}
});
}
... ...
... ... @@ -14,7 +14,7 @@ import android.widget.TextView;
import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.activity.pratice.AnswerWrongActivity;
import com.hh.xuetubao.activity.pratice.c;
import com.hh.xuetubao.adapter.PractiveWrongAdapter;
import com.hh.xuetubao.bean.AnswerBean;
import com.hh.xuetubao.model.ExerciseModel;
... ... @@ -30,7 +30,7 @@ import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* 错题Fragment
* 我的错题
*/
public class PraticeWrongFragment extends BaseMvpFragment<CommonPresenter, ExerciseModel> implements ICommonView {
... ... @@ -43,6 +43,7 @@ public class PraticeWrongFragment extends BaseMvpFragment<CommonPresenter, Exerc
private List<AnswerBean.CatalogLstBean> catalogLst = new ArrayList<>();
private PraticeWrongFragment fragment;
private String accountOid;
private int count;
@Override
public int getLayoutId() {
... ... @@ -58,7 +59,8 @@ public class PraticeWrongFragment extends BaseMvpFragment<CommonPresenter, Exerc
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(getActivity(), AnswerWrongActivity.class);
// Intent intent = new Intent(getActivity(), AnswerWrongActivity.class);
Intent intent = new Intent(getActivity(), c.class);
intent.putExtra("catalogOid", catalogLst.get(position).getCatalogOid());
startActivity(intent);
}
... ... @@ -90,15 +92,21 @@ public class PraticeWrongFragment extends BaseMvpFragment<CommonPresenter, Exerc
@Override
public void getData(Object o, int api, int intent) {
catalogLst.clear();
AnswerBean bean = (AnswerBean) o;
List<AnswerBean.CatalogLstBean> catalogLstBeans = bean.getCatalogLst();
tvNum.setText(String.valueOf(catalogLstBeans.size()));
catalogLst.addAll(catalogLstBeans);
practiveWrongAdapter.notifyDataSetChanged();
if (api == 6 && intent == 1) {
count=0;
catalogLst.clear();
AnswerBean bean = (AnswerBean) o;
List<AnswerBean.CatalogLstBean> catalogLstBeans = bean.getCatalogLst();
for (int i = 0; i < catalogLstBeans.size(); i++) {
count += catalogLstBeans.get(i).getWrongNum();
Log.e("xuetubao", String.valueOf(count));
}
tvNum.setText(String.valueOf(count));
catalogLst.addAll(catalogLstBeans);
practiveWrongAdapter.notifyDataSetChanged();
}
}
... ...
... ... @@ -12,6 +12,7 @@ import android.widget.RelativeLayout;
import com.hh.xuetubao.R;
import com.hh.xuetubao.activity.pratice.AnswerSheetActivity;
import com.hh.xuetubao.activity.pratice.MockExamActivity;
import com.hh.xuetubao.activity.pratice.a;
import com.hh.xuetubao.model.MainModel;
import com.hh.xuetubao.mvp.BaseMvpFragment;
import com.hh.xuetubao.mvp.CommonPresenter;
... ... @@ -102,7 +103,8 @@ public class PriacticeDistFragment extends BaseMvpFragment<CommonPresenter, Main
getActivity().finish();
break;
case R.id.frag_pricatice_dist_sjlx: // - > 随机练习
intent = new Intent(getActivity(), AnswerSheetActivity.class);
// intent = new Intent(getActivity(), AnswerSheetActivity.class);
intent = new Intent(getActivity(), a.class);
intent.putExtra("catalogOid", catalogOid);
startActivity(intent);
break;
... ...
... ... @@ -18,8 +18,6 @@ import com.hh.xuetubao.R;
import com.hh.xuetubao.Utils.CustomScrollView;
import com.hh.xuetubao.Utils.RecyclerViewSpacesItemDecoration;
import com.hh.xuetubao.Utils.SharedPrefrenceUtils;
import com.hh.xuetubao.activity.personal.InfromationActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity;
import com.hh.xuetubao.activity.study.CourseDetailActivity_Video;
import com.hh.xuetubao.adapter.StudyTimeXrcAdapter;
import com.hh.xuetubao.adapter.StudyXrecAdapter;
... ... @@ -38,9 +36,8 @@ import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel> implements ICommonView , CustomScrollView.OnScrollChangeListener, XRecyclerView.LoadingListener, View.OnClickListener, StudyXrecAdapter.TurnTo{
public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel> implements ICommonView, CustomScrollView.OnScrollChangeListener, XRecyclerView.LoadingListener, View.OnClickListener, StudyXrecAdapter.TurnTo {
@BindView(R.id.xrecyclerview)
XRecyclerView xrecyclerview;
... ... @@ -84,7 +81,7 @@ public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
public void initView(@Nullable Bundle savedInstanceState) {
ButterKnife.bind(getActivity());
resumeOid = SharedPrefrenceUtils.getString(getActivity(), "AccountOid");
xrecyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));
adapter = new StudyXrecAdapter(getActivity(), mlist);
... ... @@ -194,7 +191,11 @@ public class StudyFragment extends BaseMvpFragment<CommonPresenter, LearnModel>
case R.id.img_user:
case R.id.rl_user:
case R.id.rl_body:
startActivity(new Intent(getActivity(), InfromationActivity.class));
// startActivity(new Intent(getActivity(), InfromationActivity.class));
MineFragment mineFragment = new MineFragment();
FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.frame, mineFragment);
transaction.commit();
break;
}
}
... ...
... ... @@ -48,6 +48,24 @@ public class ExerciseModel implements ICommonModel {
if (api == 8 && intent == 1)
GetRandomQuestions(commonView, api, intent, params);
if (api == 9 && intent == 1)
DeleteExamRecordInfo(commonView, api, intent, params);
}
private void DeleteExamRecordInfo(final ICommonView commonView, final int api, final int intent, String... params) {
if (api == 9 && intent == 1)
mServers.DeleteExamRecordInfo(params[0])
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
@Override
public void onNext(Object value) {
super.onNext(value);
commonView.getData(value, api, intent);
}
});
}
private void RemoveWrongQuestion(final ICommonView commonView, final int api, final int intent, String... params) {
... ...
... ... @@ -15,9 +15,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:layout_centerVertical="true"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -138,4 +138,5 @@
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
... ...
... ... @@ -64,7 +64,7 @@
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_25"
android:background="#333333" />
android:background="#D5D5D5" />
<ImageView
android:id="@+id/img_message"
... ...
... ... @@ -18,7 +18,7 @@
android:layout_width="@dimen/dp_30"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_35">
android:layout_marginTop="@dimen/dp_20">
<ImageView
android:layout_width="@dimen/dp_15"
... ... @@ -28,26 +28,6 @@
<TextView
android:id="@+id/tv_more"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_20"
android:layout_alignTop="@id/img_back"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/dp_15"
android:text="···"
android:textColor="#333333"
android:textSize="20sp" />
<ImageView
android:id="@+id/img_more"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_alignTop="@id/img_back"
android:layout_marginRight="@dimen/dp_15"
android:layout_toLeftOf="@id/tv_more"
android:src="@mipmap/link" />
<TextView
android:id="@+id/tv_name"
android:layout_width="@dimen/dp_207"
android:layout_height="wrap_content"
... ... @@ -100,6 +80,7 @@
android:text="招聘职位("
android:textColor="#b0b0b0"
android:textSize="15sp" />
<TextView
android:id="@+id/job_count"
android:layout_width="wrap_content"
... ... @@ -110,6 +91,7 @@
android:text="36"
android:textColor="#b0b0b0"
android:textSize="15sp" />
<TextView
android:id="@+id/aaa"
android:layout_width="wrap_content"
... ... @@ -125,24 +107,22 @@
android:id="@+id/xhx1"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_3"
android:background="@color/color_ff5400"
android:layout_below="@+id/tv_page"
android:layout_alignLeft="@+id/tv_page"
android:layout_alignRight="@+id/tv_page"
android:layout_below="@+id/tv_page"
android:layout_marginTop="@dimen/dp_7"
/>
android:background="@color/color_ff5400" />
<View
android:id="@+id/xhx2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_3"
android:background="@color/color_ff5400"
android:layout_below="@+id/tv_page"
android:layout_alignLeft="@+id/tv_require"
android:layout_alignRight="@+id/aaa"
android:layout_below="@+id/tv_page"
android:layout_marginTop="@dimen/dp_7"
android:visibility="gone"
/>
android:background="@color/color_ff5400"
android:visibility="gone" />
<View
android:id="@+id/line"
... ... @@ -150,10 +130,9 @@
android:layout_height="@dimen/dp_1"
android:layout_below="@id/tv_page"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:background="#EDEDED"
android:layout_marginTop="@dimen/dp_10"
/>
android:layout_marginRight="@dimen/dp_20"
android:background="#EDEDED" />
<FrameLayout
android:id="@+id/frame"
... ...
... ... @@ -15,6 +15,12 @@
android:layout_height="wrap_content"
android:visibility="gone">
<com.dou361.ijkplayer.widget.IjkVideoView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_100"
android:id="@+id/ss"
></com.dou361.ijkplayer.widget.IjkVideoView>
<!---->
<include
layout="@layout/simple_player_view_player"
android:layout_width="match_parent"
... ... @@ -63,6 +69,7 @@
</FrameLayout>
<TextView
android:id="@+id/titleValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
... ...
... ... @@ -15,9 +15,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:layout_centerVertical="true"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -48,7 +48,7 @@
android:layout_height="@dimen/dp_1"
android:layout_marginLeft="@dimen/dp_29"
android:layout_marginRight="@dimen/dp_29"
android:background="@color/color_333333" />
android:background="@color/color_d5d5d5" />
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
... ...
... ... @@ -15,9 +15,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -54,7 +54,7 @@
android:layout_marginLeft="@dimen/dp_29"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_29"
android:background="#333333" />
android:background="#D5D5D5" />
<ImageView
android:id="@+id/img_message"
... ...
... ... @@ -56,7 +56,7 @@
android:layout_marginLeft="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_25"
android:background="#333333" />
android:background="#D5D5D5" />
<ImageView
android:id="@+id/img_message"
... ...
... ... @@ -15,9 +15,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -14,11 +14,11 @@
android:background="#F2F2F2">
<LinearLayout
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ... @@ -34,47 +34,6 @@
android:textSize="17sp" />
</LinearLayout>
<LinearLayout
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_30"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/circle_concers"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="···"
android:textColor="#232323" />
<View
android:layout_width="@dimen/dp_1"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:background="#DCDCDC" />
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent">
<ImageView
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/yuanhuan" />
<ImageView
android:layout_width="wrap_content"
android:background="@drawable/yuandian"
android:layout_centerInParent="true"
android:layout_height="wrap_content" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
... ...
... ... @@ -15,6 +15,7 @@
<TextView
android:id="@+id/tv_time"
android:layout_marginLeft="@dimen/dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
... ...
... ... @@ -15,8 +15,7 @@
<LinearLayout
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:gravity="center_vertical"
android:orientation="horizontal">
... ...
... ... @@ -15,9 +15,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -12,11 +12,11 @@
android:background="#F2F2F2">
<LinearLayout
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -32,7 +32,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/img_back"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_20"
android:text="机器人工程师"
android:textColor="#4C4C4C"
android:textSize="23sp" />
... ... @@ -119,76 +119,82 @@
android:layout_marginRight="@dimen/dp_20"
android:background="#C4C4C4" />
<ImageView
android:id="@+id/img_logo"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
<RelativeLayout
android:id="@+id/rl_company"
android:layout_below="@id/line"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:src="@mipmap/bird_logo" />
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_logo"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
<TextView
android:id="@+id/company_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/line"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_20"
android:layout_toRightOf="@id/img_logo"
android:text="中企崛起"
android:textColor="#232323"
android:textSize="16sp" />
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:src="@mipmap/bird_logo" />
<TextView
android:id="@+id/tv_nature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/company_name"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_15"
android:layout_toRightOf="@id/img_logo"
android:text="民营"
android:textColor="#232323"
android:textSize="14sp" />
<TextView
android:id="@+id/company_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_20"
android:layout_toRightOf="@id/img_logo"
android:text="中企崛起"
android:textColor="#232323"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/tv_nature"
android:layout_marginLeft="@dimen/dp_15"
android:layout_toRightOf="@id/tv_nature"
android:text="1-50人"
android:textColor="#232323"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_nature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/company_name"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_15"
android:layout_toRightOf="@id/img_logo"
android:text="民营"
android:textColor="#232323"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_industry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_nature"
android:layout_alignStart="@id/tv_nature"
android:layout_marginTop="@dimen/dp_10"
android:text="移动互联网"
android:textColor="#232323"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/tv_nature"
android:layout_marginLeft="@dimen/dp_15"
android:layout_toRightOf="@id/tv_nature"
android:text="1-50人"
android:textColor="#232323"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_industry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_nature"
android:layout_alignStart="@id/tv_nature"
android:layout_marginTop="@dimen/dp_10"
android:text="移动互联网"
android:textColor="#232323"
android:textSize="14sp" />
<ImageView
android:id="@+id/item_gsxq"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_30"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginRight="@dimen/dp_15"
android:src="@mipmap/into" />
</RelativeLayout>
<ImageView
android:id="@+id/item_gsxq"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_30"
android:layout_below="@id/line"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginRight="@dimen/dp_15"
android:src="@mipmap/into" />
<View
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_below="@+id/tv_industry"
android:layout_below="@+id/rl_company"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20"
... ...
... ... @@ -15,9 +15,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_13"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -15,7 +15,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
<RelativeLayout
android:id="@+id/lin_tab"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_68"
... ... @@ -23,21 +23,34 @@
android:orientation="horizontal">
<ImageView
android:id="@+id/img1"
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_30"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:src="@mipmap/back" />
<TextView
android:id="@+id/tv_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@id/img1"
android:text="考试成绩"
android:textColor="#232323"
android:textSize="17sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="删除"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/dp_20"
android:textColor="#666666"
android:textSize="12sp" />
</RelativeLayout>
<com.hh.xuetubao.Utils.WaveView
android:id="@+id/waveview"
... ...
... ... @@ -14,9 +14,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:layout_centerVertical="true"
android:orientation="horizontal">
<ImageView
... ... @@ -27,7 +26,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="工业机器人操作..."
android:text="工业机器人操作"
android:textColor="#232323"
android:textSize="17sp"
android:maxLines="1"
... ...
... ... @@ -16,9 +16,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -9,7 +9,6 @@
android:id="@+id/tv_xinxi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="基本信息"
android:textColor="#000000"
... ... @@ -20,7 +19,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_xinxi"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="公司性质:"
android:textColor="#4C4C4C"
... ... @@ -42,7 +40,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_xingzhi"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_5"
android:text="公司规模:"
android:textColor="#4C4C4C"
... ... @@ -65,7 +62,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_guimo"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_5"
android:text="公司地址:"
android:textColor="#4C4C4C"
... ... @@ -88,7 +84,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_dizhi"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_5"
android:text="公司网址:"
android:textColor="#4C4C4C"
... ... @@ -120,7 +115,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/line"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="公司介绍"
android:textColor="#000000"
... ... @@ -141,7 +135,6 @@
android:id="@+id/tv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_below="@id/tv_jieshao"
... ... @@ -162,7 +155,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/line2"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="公司地址"
android:textColor="#000000"
... ... @@ -173,7 +165,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_map"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="北京市昌平区北七家镇创意空间211"
android:textColor="#4C4C4C"
... ... @@ -192,7 +183,6 @@
<com.amap.api.maps.MapView
android:id="@+id/map"
android:layout_below="@id/tv_dingwei"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_50"
... ...
... ... @@ -22,7 +22,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_200"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:src="@drawable/course_logo" />
... ...
... ... @@ -15,9 +15,8 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -52,10 +52,10 @@
android:background="#333333" />
</LinearLayout>
<GridView
<com.hh.xuetubao.Utils.GridViewNesting
android:id="@+id/grid_hotLesson"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_400"
android:layout_height="wrap_content"
android:layout_below="@+id/lin_title"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
... ... @@ -73,6 +73,8 @@
android:background="@drawable/stroke_gray"
android:gravity="center"
android:text="查看更多"
android:layout_marginTop="@dimen/dp_30"
android:textColor="#AAAAAA"
android:textSize="12sp"
/>
... ... @@ -83,7 +85,7 @@
android:layout_height="@dimen/dp_10"
android:layout_below="@id/tv_more_ke"
android:layout_marginTop="@dimen/dp_30"
android:background="#f1f1f1" />
android:background="#F5F5F5" />
<LinearLayout
android:id="@+id/lin_title1"
... ... @@ -132,7 +134,7 @@
android:layout_height="@dimen/dp_30"
android:layout_below="@+id/list_question"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/stroke_gray"
android:gravity="center"
... ... @@ -146,7 +148,7 @@
android:layout_height="@dimen/dp_10"
android:layout_below="@id/tv_more_ti"
android:layout_marginTop="@dimen/dp_30"
android:background="#f1f1f1" />
android:background="#F5F5F5" />
<LinearLayout
android:id="@+id/lin_title2"
... ... @@ -179,10 +181,10 @@
android:background="#333333" />
</LinearLayout>
<ListView
<com.hh.xuetubao.Utils.ListViewNesting
android:id="@+id/list_company"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_500"
android:layout_height="wrap_content"
android:layout_below="@+id/lin_title2"
android:layout_marginTop="@dimen/dp_10"
android:scrollbars="none"
... ... @@ -196,7 +198,7 @@
android:layout_height="30dp"
android:layout_below="@+id/list_company"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_30"
android:background="@drawable/stroke_gray"
... ...
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.ListFragment">
<LinearLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.hh.xuetubao.Utils.RecyclerViewNesting
android:id="@+id/rec_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
</LinearLayout>
<com.hh.xuetubao.Utils.RecyclerViewNesting
android:id="@+id/rec_group"
</ScrollView>
<LinearLayout
android:id="@+id/list_linear"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<ImageView
android:id="@+id/image"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40"
android:layout_gravity="center"
android:src="@mipmap/welcome_load" />
</LinearLayout>
</ScrollView>
\ No newline at end of file
</FrameLayout>
\ No newline at end of file
... ...
... ... @@ -4,12 +4,41 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.MineFragment">
<RelativeLayout
android:id="@+id/rl_top"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_68"
android:background="#F2F2F2">
<LinearLayout
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_20"
android:src="@mipmap/back" />
<TextView
android:layout_width="@dimen/dp_68"
android:layout_height="wrap_content"
android:text="个人中心"
android:textColor="#232323"
android:textSize="17sp" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/line"
android:layout_width="@dimen/dp_75"
android:layout_height="@dimen/dp_75"
android:layout_marginLeft="@dimen/dp_20"
android:layout_below="@id/rl_top"
android:layout_marginTop="@dimen/dp_45">
<com.hh.xuetubao.Utils.CircleImageView
... ...
... ... @@ -17,9 +17,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -16,9 +16,8 @@
android:id="@+id/lin_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_18"
android:orientation="horizontal">
<ImageView
... ...
... ... @@ -8,25 +8,23 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_tab"
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20" />
android:layout_marginTop="@dimen/dp_10" />
<View
android:layout_marginTop="@dimen/dp_10"
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_below="@+id/rv_tab"
android:layout_marginTop="@dimen/dp_10"
android:background="#EDEDED" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rec_job"
android:layout_below="@id/line"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rec_job"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/line" />
</RelativeLayout>
\ No newline at end of file
... ...
... ... @@ -33,6 +33,7 @@
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:divider="@null"
android:nestedScrollingEnabled="false"
android:scrollbars="none" />
... ...
... ... @@ -192,19 +192,11 @@
android:src="@mipmap/into" />
<View
android:id="@+id/line4"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_below="@+id/job"
android:layout_marginTop="@dimen/dp_20"
android:background="#D7D7D7"
android:visibility="gone" />
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="#d7d7d7"
android:layout_below="@+id/line4"
android:layout_below="@+id/tv1"
android:layout_marginTop="@dimen/dp_15"
/>
... ...
... ... @@ -24,23 +24,14 @@
android:textColor="#363636"
android:textSize="15sp" />
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:text="更新时间:2019-10-20 16:00"
android:textColor="#AAAAAA"
android:textSize="12sp" />
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:background="#e4e8f0"
android:layout_marginTop="@dimen/dp_14"
android:layout_below="@+id/time"
android:layout_below="@+id/title"
/>
</RelativeLayout>
... ...
... ... @@ -82,9 +82,9 @@
android:layout_below="@id/list_label"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginLeft="@dimen/dp_50"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_10"
android:orientation="horizontal">
... ...
... ... @@ -8,7 +8,6 @@
android:id="@+id/job"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="销售工程师"
android:textColor="#232323"
... ... @@ -31,7 +30,6 @@
android:layout_height="wrap_content"
android:layout_below="@id/job"
android:orientation="horizontal"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
>
... ... @@ -39,14 +37,13 @@
android:id="@+id/year"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/circle_f8f8f8_3"
android:paddingLeft="@dimen/dp_5"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_5"
android:paddingBottom="@dimen/dp_3"
android:text="1-3年"
android:textColor="#a9a9a9"
android:textSize="@dimen/sp_11" />
android:textColor="#232323"
android:textSize="14sp" />
<TextView
android:id="@+id/education"
... ... @@ -55,14 +52,13 @@
android:layout_below="@id/job"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@+id/year"
android:background="@drawable/circle_f8f8f8_3"
android:paddingLeft="@dimen/dp_5"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_5"
android:paddingBottom="@dimen/dp_3"
android:text="本科"
android:textColor="#a9a9a9"
android:textSize="@dimen/sp_11" />
android:textColor="#232323"
android:textSize="14sp" />
<TextView
android:id="@+id/address"
... ... @@ -70,17 +66,14 @@
android:layout_height="wrap_content"
android:layout_below="@id/job"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@+id/education"
android:background="@drawable/circle_f8f8f8_3"
android:layout_toRightOf="@+id/year"
android:paddingLeft="@dimen/dp_5"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_5"
android:paddingBottom="@dimen/dp_3"
android:text="北京"
android:textColor="#a9a9a9"
android:textSize="@dimen/sp_11"
android:visibility="gone"
/>
android:textColor="#232323"
android:textSize="14sp" />
</LinearLayout>
... ... @@ -102,8 +95,6 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_below="@+id/view"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:background="#EEEEEE" />
</RelativeLayout>
... ...