作者 qin

Merge branch 'zhangtao'

正在显示 38 个修改的文件 包含 722 行增加182 行删除
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="12">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="10" class="java.lang.String" itemvalue="android.annotation.Nullable" />
<item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="11">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="9" class="java.lang.String" itemvalue="android.annotation.NonNull" />
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
... ...
... ... @@ -52,12 +52,16 @@ public class MainActivity extends BaseMvpActivity<CommonPresenter, MainModel> im
getWindow().setNavigationBarColor(Color.parseColor("#fcfcfc"));
//状态栏颜色
getWindow().setStatusBarColor(Color.parseColor("#fcfcfc"));*/
homeFragment = new HomeFragment();
wrongFragment = new PraticeWrongFragment();
wrongFragment = new PraticeWrongFragment();
transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.frame, homeFragment);
// transaction.show(homeFragment);
if(homeFragment==null){
homeFragment=new HomeFragment();
transaction.add(R.id.frame, homeFragment);
}else{
transaction.show(homeFragment);
}
transaction.commit();
rlHome.setChecked(true);
... ...
... ... @@ -440,7 +440,7 @@ public interface MyServer {
* @return
*/
@GET("GetProvinceList")
Observable<AddressBean> GetProvinceList(@Query("IsAll") boolean IsAll);
Observable<AddressBean> GetProvinceList(@Query("IsAll") boolean IsAll, @Query("RegionType") String RegionType);
/**
* 获取城市列表接口
... ... @@ -450,7 +450,7 @@ public interface MyServer {
* @return
*/
@GET("GetCityListByProvince")
Observable<AddressBean> GetCityListByProvince(@Query("ProvinceId") String ProvinceId, @Query("IsAll") boolean IsAll);
Observable<AddressBean> GetCityListByProvince(@Query("ProvinceId") String ProvinceId, @Query("IsAll") boolean IsAll, @Query("RegionType") String RegionType);
/**
* 获取职位查询属性列表接口
... ... @@ -556,4 +556,23 @@ public interface MyServer {
@GET("DeleteExamRecordInfo")
Observable<UserBean> DeleteExamRecordInfo(@Query("oid") String oid);
/**
* 保存答题结果接口
*
* @param accountOid 用户ID
* @param catalogOid 题库分类ID
* @param examScore 考试最终得分
* @param answerNum 答题的最终数量
* @param useSecond 用时多少秒
* @return
*/
@GET("InsertSimExamRecord")
Observable<UserBean> InsertSimExamRecord(
@Query("accountOid") String accountOid,
@Query("catalogOid") String catalogOid,
@Query("examScore") Double examScore,
@Query("answerNum") int answerNum,
@Query("useSecond") int useSecond
);
}
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@ import android.graphics.Path;
import android.graphics.Point;
import android.graphics.Rect;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
... ... @@ -111,7 +112,12 @@ public class WaveView extends View {
int baseline = (targetRect.bottom + targetRect.top - fontMetrics.bottom - fontMetrics.top) / 2;
// 下面这行是实现水平居中,drawText对应改为传入targetRect.centerX()
textPaint.setTextAlign(Paint.Align.CENTER);
canvas.drawText(progress + "分", targetRect.centerX(), baseline, textPaint);
if(!TextUtils.isEmpty(text)){
canvas.drawText(progress + text, targetRect.centerX(), baseline, textPaint);
}else{
canvas.drawText(progress + "分", targetRect.centerX(), baseline, textPaint);
}
}
/**
... ... @@ -235,6 +241,15 @@ public class WaveView extends View {
invalidate();
}
private String text;
public void setText(String text) {
if (!TextUtils.isEmpty(text)) {
this.text = text;
}
invalidate();
}
/**
* 通过动画设置当前进度
*
... ...
... ... @@ -81,6 +81,10 @@ public class AnswerMarkActivity extends BaseMvpActivity<CommonPresenter, Exercis
TranscriptBean bean = (TranscriptBean) o;
List<TranscriptBean.RecordLstBean> beanRecordLst = bean.getRecordLst();
countTest.setText(String.valueOf(bean.getExamTotalNum()));
countPass.setText(String.valueOf(bean.getExamPassNum()));
countAnswer.setText(String.valueOf(bean.getExamAnswerNum()));
if (beanRecordLst != null)
recordLst.addAll(beanRecordLst);
markAdapter.notifyDataSetChanged();
... ...
... ... @@ -51,7 +51,10 @@ public class AnswerResultActivity extends BaseMvpActivity<CommonPresenter, MainM
public void initView() {
int rightCount = getIntent().getIntExtra("rightCount", 0);
int wrongCount = getIntent().getIntExtra("wrongCount", 0);
int allCount = getIntent().getIntExtra("allCount", 0);
String cataloglst = getIntent().getStringExtra("cataloglst");
int trueWrong=allCount-rightCount;
cataLogLst = SharedPrefrenceUtils.getStringList(this, "CataLogLst");
accountOid = SharedPrefrenceUtils.getString(this, "AccountOid");
for (int i = 0; i < cataLogLst.size(); i++) {
... ... @@ -62,13 +65,14 @@ public class AnswerResultActivity extends BaseMvpActivity<CommonPresenter, MainM
tvRight.setText(String.valueOf(rightCount));
tvWrong.setText(String.valueOf(wrongCount));
tvWrong.setText(String.valueOf(trueWrong));
tvNext.setOnClickListener(this);
ZomCount = rightCount + wrongCount;
zql = (rightCount / ZomCount) * 100;
waveview.setProgress(zql);
double i = rightCount / (double) allCount;
double b = i * 100;
waveview.setProgress((int) b);
waveview.setText("%");
}
... ...
... ... @@ -398,7 +398,7 @@ public class AnswerSheetActivity extends BaseMvpActivity<CommonPresenter, Exerci
doRefresh();
selectAnswer = "";
} else if (currentIndex == maxTopic - 1) {
Toast.makeText(this,"当前已是最后一题",Toast.LENGTH_SHORT).show();
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
tvShowCard.setVisibility(View.GONE);
commit.setVisibility(View.VISIBLE);
}
... ... @@ -464,7 +464,7 @@ public class AnswerSheetActivity extends BaseMvpActivity<CommonPresenter, Exerci
rlAnswer.setVisibility(View.INVISIBLE);
if(!answerSelect.get(currentIndex).equals("0")){
if (!answerSelect.get(currentIndex).equals("0")) {
optionsAdapter.setSelect(answerSelect.get(currentIndex));
optionsAdapter.notifyDataSetChanged();
listAnswer.setItemsCanFocus(false);
... ...
... ... @@ -2,17 +2,19 @@ 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.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
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.UserBean;
import com.hh.xuetubao.model.ExerciseModel;
import com.hh.xuetubao.model.PersonalModel;
import com.hh.xuetubao.mvp.BaseMvpActivity;
import com.hh.xuetubao.mvp.CommonPresenter;
import com.hh.xuetubao.mvp.ICommonView;
... ... @@ -52,9 +54,17 @@ public class MockExamActivity extends BaseMvpActivity<CommonPresenter, ExerciseM
@Override
public void initView() {
resumeOid = SharedPrefrenceUtils.getString(this, "AccountOid");
catalogOid = getIntent().getStringExtra("catalogOid") + "";
catalogOid = getIntent().getStringExtra("catalogOid");
String reallHeader = SharedPrefrenceUtils.getString(this, "ReallHeader");
String headPic = SharedPrefrenceUtils.getString(this, "HeadPic");
if (!TextUtils.isEmpty(headPic)) {
Glide.with(this).load(headPic).into(image);
} else if (!TextUtils.isEmpty(reallHeader)) {
Glide.with(this).load(reallHeader).into(image);
}
Log.e("catalogOid", catalogOid);
linTrain.setOnClickListener(this);
}
... ... @@ -67,6 +77,9 @@ public class MockExamActivity extends BaseMvpActivity<CommonPresenter, ExerciseM
@Override
public void initData() {
mPresenter.getPresenter(3, 1, catalogOid, resumeOid);
PersonalModel model = new PersonalModel();
model.getModel(this, 2, 1, resumeOid);
}
@Override
... ... @@ -94,7 +107,20 @@ public class MockExamActivity extends BaseMvpActivity<CommonPresenter, ExerciseM
}
if (api == 2 && intent == 1) {
UserBean bean = (UserBean) o;
if (bean.getUserName() != null) {
SharedPrefrenceUtils.saveString(this, "UserName", bean.getUserName());
}
if (bean.getLoginName() != null) {
SharedPrefrenceUtils.saveString(this, "LoginName", bean.getLoginName());
}
if (!TextUtils.isEmpty(bean.getUserName())) {
name.setText(bean.getUserName());
} else if (!TextUtils.isEmpty(bean.getLoginName())) {
name.setText(bean.getLoginName());
}
}
}
@Override
... ...
... ... @@ -6,6 +6,7 @@ import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.RadioButton;
import com.hh.xuetubao.MainActivity;
import com.hh.xuetubao.R;
import com.hh.xuetubao.activity.work.JobHuntActivity;
import com.hh.xuetubao.fragment.HomeFragment;
... ... @@ -115,7 +116,7 @@ public class PracticeActivity extends BaseMvpActivity<CommonPresenter, MainModel
homeFragment = new HomeFragment();
switch (v.getId()) {
case R.id.rl_home:
startActivity(new Intent(PracticeActivity.this, JobHuntActivity.class));
startActivity(new Intent(PracticeActivity.this, MainActivity.class));
this.finish();
break;
case R.id.rl_pratice:
... ...
... ... @@ -7,7 +7,6 @@ import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
... ... @@ -37,8 +36,6 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
TextView tvTitle;
@BindView(R.id.lin_tab)
RelativeLayout linTab;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.tv3)
TextView tv3;
@BindView(R.id.tv5)
... ... @@ -65,6 +62,8 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
RelativeLayout rlReStart;
@BindView(R.id.tv_delete)
TextView tvDelete;
@BindView(R.id.tv_time)
TextView tvTime;
private String catalogOid;
private Intent intent;
private String thisCatalogOid;
... ... @@ -81,6 +80,8 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
Integer danxuanWrong = getIntent().getIntExtra("danxuanWrong", 0);
Integer duoxuanWrongt = getIntent().getIntExtra("duoxuanWrong", 0);
Integer panduanWrong = getIntent().getIntExtra("panduanWrong", 0);
Integer time = getIntent().getIntExtra("time", 0);
Log.e("zhangtao", String.valueOf(duoxuanWrongt) + "-------------");
... ... @@ -99,6 +100,8 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
tv13.setText(getFormat(duoxuanCount, duoxuanWrongt) + "%");
tv19.setText(getFormat(panduanCount, panduanWrong) + "%");
tvTime.setText(String.valueOf(time));
int i = danxuanWrong + duoxuanWrongt + panduanWrong;
tv22.setText(String.valueOf(i));
... ... @@ -193,7 +196,7 @@ public class TestScoreActivity extends BaseMvpActivity<CommonPresenter, Exercise
startActivity(intent);
break;
case R.id.tv_delete:
Toast.makeText(this,"1",Toast.LENGTH_SHORT).show();
Toast.makeText(this, "1", Toast.LENGTH_SHORT).show();
mPresenter.getPresenter(9, 1, thisCatalogOid);
break;
... ...
... ... @@ -99,6 +99,10 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
private List<String> stringList = new ArrayList<>();//用来存放多选题选择的答案
private List<String> historyAnswer = new ArrayList<>();//存放历史选择的答案
private boolean isRight;
private double totalScore;
private double danxuan;
private double duoxuan;
private double panduan;
@Override
... ... @@ -142,6 +146,7 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
} catch (Exception e) {
Log.e("xuetubao:", e.toString());
}
historyAnswer.set(listIndex, selectAnswer);
//判断 单选题 是否答对
if (rightAnswer.contains(selectAnswer)) {
... ... @@ -171,10 +176,15 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
try {
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
}catch (Exception e){
optionsAdapter.setRight(rightAnswer);
}
optionsAdapter.setRight(rightAnswer,selectAnswer);
optionsAdapter.notifyDataSetChanged();
}
... ... @@ -203,6 +213,8 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
Log.e("xuetubao:", e.toString());
}
historyAnswer.set(listIndex, selectAnswer);
for (int i = 0; i < stringList.size(); i++) {
if (rightAnswer.contains(stringList.get(i))) {
integerList.add(1);
... ... @@ -238,10 +250,14 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
try{
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
}catch (Exception e){
optionsAdapter.setRight(rightAnswer);
}
optionsAdapter.setRight(rightAnswer,selectAnswer);
optionsAdapter.notifyDataSetChanged();
} else if (isRight && rightAnswer.length() == selectAnswer.length()) {
... ... @@ -264,6 +280,7 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
}
}
historyAnswer.set(listIndex, selectAnswer);
}
});
... ... @@ -317,15 +334,20 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
for (AnswerBean.QuestionLstBean a : questionLst) {
statusList.add(0);
historyAnswer.add("0");
}
sheetGridAdapter = new AnswerSheetGridAdapter(statusList, this);
danxuan = bean.getRadioScore();
duoxuan = bean.getMultipleScore();
panduan = bean.getJudgeScore();
}
}
private void doRefresh(boolean isNext) {
historyAnswer.add(selectAnswer);
// historyAnswer.add(selectAnswer);
integerList.clear();
selectAnswer = "";
... ... @@ -347,17 +369,19 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
listAnswer.setAdapter(optionsAdapter);
optionsAdapter.notifyDataSetChanged();
if (listIndex == questionLst.size() - 1) {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
tvShowCard.setVisibility(View.GONE);
commit.setVisibility(View.VISIBLE);
}
if (historyAnswer.size() > listIndex) {
if (!historyAnswer.get(listIndex).equals("0")) {
optionsAdapter.setSelect(historyAnswer.get(listIndex));
optionsAdapter.notifyDataSetInvalidated();
if (TextUtils.isEmpty(historyAnswer.get(listIndex))) {
rlAnswer.setVisibility(View.GONE);
} else {
rlAnswer.setVisibility(View.VISIBLE);
}
rlAnswer.setVisibility(View.VISIBLE);
} else {
rlAnswer.setVisibility(View.GONE);
}
}
... ... @@ -428,7 +452,7 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
if (listIndex < questionLst.size() - 1) {
if (type.contains("多选")) {
if (!TextUtils.isEmpty(selectAnswer)&&type.contains("多选")) {
if (selectAnswer.length() != rightAnswer.length()) {
statusList.set(listIndex, 2);
}
... ... @@ -442,7 +466,9 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
}
listIndex++;
doRefresh(true);
doRefresh(true);
// doRefresh(true);
} else if (listIndex == questionLst.size() - 1) {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
... ... @@ -470,6 +496,7 @@ public class a extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
intent.putExtra("rightCount", rightCount);
intent.putExtra("wrongCount", wrongCount);
intent.putExtra("cataloglst", catalogOid);
intent.putExtra("allCount",questionLst.size());
startActivity(intent);
break;
case R.id.tv_show_card:
... ...
... ... @@ -74,7 +74,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
LinearLayout linTab;
@BindView(R.id.rl_card)
RelativeLayout rlCard;
// @BindView(R.id.right_select)
// @BindView(R.id.right_select)
// TextView rightSelect;
// @BindView(R.id.right_answer)
// TextView rightAnswerText;
... ... @@ -82,7 +82,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
// RelativeLayout rlAnswer;
@BindView(R.id.commit)
LinearLayout commit;
// @BindView(R.id.tv2)
// @BindView(R.id.tv2)
// TextView tv2;
@BindView(R.id.tv_show_card)
TextView tvShowCard;
... ... @@ -108,7 +108,6 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
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;
... ... @@ -121,6 +120,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
private double panduan;
private int longTime;
private int thisTime;
private int unDone;
private CountDownTimer timer;
... ... @@ -185,23 +185,29 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
} else if (!rightAnswer.contains(selectAnswer)) {
if (type.equals("单选")) {
danxuanWrong++;
} else if (type.equals("判断")) {
panduanWrong++;
}
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);
try {
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
} catch (Exception e) {
}
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++;
}
}
... ... @@ -262,8 +268,11 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
statusList.set(listIndex, 2);
sheetGridAdapter.notifyDataSetChanged();
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
try {
String questionOid = questionLst.get(listIndex).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
} catch (Exception e) {
}
/* optionsAdapter.setRight(rightAnswer);
optionsAdapter.notifyDataSetChanged();*/
... ... @@ -289,6 +298,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
}
}
historyAnswer.set(listIndex, selectAnswer);
}
});
... ... @@ -360,6 +370,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
for (AnswerBean.QuestionLstBean a : questionLst) {
statusList.add(0);
historyAnswer.add("0");
}
sheetGridAdapter = new AnswerSheetGridAdapter(statusList, this);
... ... @@ -388,6 +399,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
intent.putExtra("panduanWrong", panduanCount);
intent.putExtra("duoxuanWrong", duoxuanCount);
intent.putExtra("totalScore", totalScore);
intent.putExtra("time", thisTime);
startActivity(intent);
b.this.finish();
} else {
... ... @@ -411,6 +423,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
intent.putExtra("panduanWrong", panduanWrong);
intent.putExtra("duoxuanWrong", duoxuanWrong);
intent.putExtra("totalScore", totalScore);
intent.putExtra("time", thisTime);
startActivity(intent);
b.this.finish();
}
... ... @@ -422,7 +435,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
private void doRefresh(boolean isNext) {
historyAnswer.add(selectAnswer);
// historyAnswer.add(selectAnswer);
listRightAnswer.add(rightAnswer);
integerList.clear();
... ... @@ -441,12 +454,19 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
// rightAnswerText.setText(questionLst.get(listIndex).getWrongAnaly());
// rlAnswer.setVisibility(View.GONE);
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
optionsAdapter = new ListAnswerAdapter(questionLst.get(listIndex).getOptionsLst(), this);
listAnswer.setAdapter(optionsAdapter);
optionsAdapter.notifyDataSetChanged();
if (historyAnswer.size() > listIndex) {
if (listIndex == questionLst.size() - 1) {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
tvShowCard.setVisibility(View.GONE);
commit.setVisibility(View.VISIBLE);
}
if (!historyAnswer.get(listIndex).equals("0")) {
optionsAdapter.setSelect(historyAnswer.get(listIndex));
optionsAdapter.notifyDataSetInvalidated();
... ... @@ -502,7 +522,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
circular.setBackWidth(20);
circular.setProgWidth(20);
circular.setMaxProgress(questionLst.size());
circular.setProgress(questionLst.size()-laveCount);
circular.setProgress(questionLst.size() - laveCount);
count.setText(String.valueOf(laveCount));
... ... @@ -531,9 +551,21 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
intent.putExtra("panduanWrong", panduanWrong);
intent.putExtra("duoxuanWrong", duoxuanWrong);
intent.putExtra("totalScore", totalScore);
intent.putExtra("time", thisTime);
Log.e("zhangtao", totalScore + "分");
Log.e("zhangtao:catalogOid", catalogOid + "");
Log.e("zhangtao:danxuanCount", danxuanCount + "分");
Log.e("zhangtao:duoxuanCount", duoxuanCount + "分");
Log.e("zhangtao:panduanCount", panduanCount + "分");
Log.e("zhangtao;danxuanWrong", danxuanWrong + "分");
Log.e("zhangtao;danxuanWrong", duoxuanWrong + "分");
startActivity(intent);
startActivity(intent);
startActivity(intent);
b.this.finish();
mPresenter.getPresenter(10, 1, accountOid, catalogOid, String.valueOf(totalScore), String.valueOf(unDone), String.valueOf(thisTime));
}
});
... ... @@ -582,7 +614,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
case R.id.rl_next:
if (listIndex < questionLst.size() - 1) {
if (type.contains("多选")) {
if (!TextUtils.isEmpty(selectAnswer) && type.contains("多选")) {
if (selectAnswer.length() != rightAnswer.length()) {
statusList.set(listIndex, 2);
}
... ... @@ -593,10 +625,20 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
unDone++;
wrongCount++;
statusList.set(listIndex, 0);
} else if (listIndex <= questionLst.size() - 1) {
if (type.contains("单选")) {
danxuanWrong++;
} else if (type.contains("判断")) {
panduanWrong++;
} else if (type.contains("多选")) {
duoxuanWrong++;
}
}
}
listIndex++;
doRefresh(true);
} else if (listIndex == questionLst.size() - 1) {
... ... @@ -625,7 +667,6 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
}
} else if (listIndex == questionLst.size() - 1) {
if (TextUtils.isEmpty(selectAnswer)) {
unDone++;
if (type.contains("单选")) {
danxuanWrong++;
} else if (type.contains("判断")) {
... ... @@ -635,7 +676,7 @@ public class b extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
}
}
}
showCommitCard(this, unDone);
showCommitCard(this, questionLst.size() - rightCount - wrongCount);
chageAlpha(0.5f);
break;
case R.id.tv_show_card:
... ...
... ... @@ -135,6 +135,7 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
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);
... ... @@ -178,19 +179,32 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
totalScore += panduan;
}
String questionOid = questionLst.get(position).getQuestionOid();
mPresenter.getPresenter(7, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
try {
String questionOid = questionLst.get(position).getQuestionOid();
mPresenter.getPresenter(7, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
} catch (Exception e) {
}
rlAnswer.setVisibility(View.GONE);
} else if (!rightAnswer.contains(selectAnswer)) {
rlAnswer.setVisibility(View.VISIBLE);
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);
try {
String questionOid = questionLst.get(position).getQuestionOid();
mPresenter.getPresenter(4, 2, accountOid, questionOid, String.valueOf(1), catalogOid);
} catch (Exception e) {
}
text.setTextColor(getResources().getColor(R.color.color_ff5400));
option.setTextColor(getResources().getColor(R.color.color_ff5400));
... ... @@ -271,7 +285,12 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
duoxuanWrong++;
rlAnswer.setVisibility(View.VISIBLE);
} else if (isRight && rightAnswer.length() == selectAnswer.length()) {
rlAnswer.setVisibility(View.GONE);
isClickAble = false;
rightCount++;
tvRightNum.setText(String.valueOf(rightCount));
... ... @@ -287,6 +306,7 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
}
}
historyAnswer.set(listIndex, selectAnswer);
}
});
... ... @@ -322,7 +342,9 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
AnswerBean bean = (AnswerBean) o;
List<AnswerBean.QuestionLstBean> questionLstBeans = bean.getQuestionLst();
questionLst.addAll(questionLstBeans);
if (questionLstBeans.size() != 0)
questionLst.addAll(questionLstBeans);
danxuanCount = bean.getRadioCount();
duoxuanCount = bean.getMultipleCount();
... ... @@ -350,6 +372,7 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
for (AnswerBean.QuestionLstBean a : questionLst) {
statusList.add(0);
historyAnswer.add("0");
}
sheetGridAdapter = new AnswerSheetGridAdapter(statusList, this);
... ... @@ -358,7 +381,7 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
private void doRefresh(boolean isNext) {
historyAnswer.add(selectAnswer);
// historyAnswer.add(selectAnswer);
integerList.clear();
selectAnswer = "";
... ... @@ -381,7 +404,11 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
optionsAdapter.notifyDataSetChanged();
if (historyAnswer.size() > listIndex) {
if (listIndex == questionLst.size() - 1) {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
}
if (!historyAnswer.get(listIndex).equals("0")) {
optionsAdapter.setSelect(historyAnswer.get(listIndex));
optionsAdapter.notifyDataSetInvalidated();
... ... @@ -505,6 +532,7 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
listIndex--;
doRefresh(false);
}
break;
case R.id.rl_next:
if (listIndex < questionLst.size() - 1) {
... ... @@ -524,8 +552,8 @@ public class c extends BaseMvpActivity<CommonPresenter, ExerciseModel> implement
}
listIndex++;
doRefresh(true);
doRefresh(true);
} else if (listIndex == questionLst.size() - 1) {
Toast.makeText(this, "当前已是最后一题", Toast.LENGTH_SHORT).show();
}
... ...
... ... @@ -5,12 +5,15 @@ import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.GridView;
... ... @@ -116,24 +119,21 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
linCompany.setOnClickListener(this);
linRequire.setOnClickListener(this);
edSearch.addTextChangedListener(new TextWatcher() {
edSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
requsetBody = new CompanySearchBody();
requsetBody.setPage(1);
requsetBody.setPageSize(10);
requsetBody.setSearchName(edSearch.getText().toString());
doRequset(requsetBody);
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH){
String input=edSearch.getText().toString();
if(!TextUtils.isEmpty(input)){
requsetBody = new CompanySearchBody();
requsetBody.setPage(1);
requsetBody.setPageSize(10);
requsetBody.setSearchName(edSearch.getText().toString());
doRequset(requsetBody);
}
return true;
}
return false;
}
});
}
... ... @@ -150,7 +150,7 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
requsetBody.setPageSize(10);
doRequset(requsetBody);
mPresenter.getPresenter(7, 1, String.valueOf(true));
mPresenter.getPresenter(7, 1, String.valueOf(true),"Company");
mPresenter.getPresenter(8, 1, String.valueOf(0), String.valueOf(true));
mPresenter.getPresenter(8, 2, String.valueOf(1), String.valueOf(true));
mPresenter.getPresenter(8, 3, String.valueOf(3), String.valueOf(true));
... ... @@ -178,7 +178,7 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
List<AddressBean.ProvListBean> provList = bean.getProvList();
provinceList.addAll(provList);
proviceId = provinceList.get(1).getProvOid();
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true),"Company");
}
if (api == 7 && intent == 2) {
AddressBean bean = (AddressBean) o;
... ... @@ -326,7 +326,7 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
requsetBody.setProvinceId(provinceList.get(position).getProvOid());
}
// model.getModel(activity, 7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true),"Company");
popListAdapter.change(position);
cityBean.setSelectA(position);
... ... @@ -368,7 +368,7 @@ public class CompanyActivity extends BaseMvpActivity<CommonPresenter, ZhaopinMod
requsetBody.setProvinceId(provinceList.get(0).getProvOid());
proviceId = provinceList.get(1).getProvOid();
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true),"Company");
popListAdapter.change(0);
popCityListAdapter.change(0);
... ...
... ... @@ -64,6 +64,8 @@ public class HomeCompanyAdapter extends BaseAdapter {
List<CompanyBean.CompanyListBean.IndustryListBean> industryList = list.get(position).getIndustryList();
ListLabelAdapter adapter = new ListLabelAdapter(industryList, context);
rec.setAdapter(adapter);
rec.setFocusable(false);
rec.setFocusableInTouchMode(false);
count.setText(String.valueOf(list.get(position).getJobCount()));
... ...
... ... @@ -59,7 +59,11 @@ public class JobHuntWorkAdapter extends RecyclerView.Adapter<JobHuntWorkAdapter.
@Override
public int getItemCount() {
return list.size();
if (list.size() > 3) {
return 3;
} else {
return list.size();
}
}
public class ViewHolder extends RecyclerView.ViewHolder {
... ...
... ... @@ -49,15 +49,19 @@ public class ListAnswerAdapter extends BaseAdapter {
option.setText(list.get(position).getOptionName());
text.setText(list.get(position).getOptionDesc());
if (!TextUtils.isEmpty(rightAnswer)) {
if (!TextUtils.isEmpty(rightAnswer) && !TextUtils.isEmpty(selectAnswer)) {
if (rightAnswer.contains(list.get(position).getOptionName())) {
right.setVisibility(View.VISIBLE);
wrong.setVisibility(View.GONE);
option.setVisibility(View.GONE);
} else {
} else if (!rightAnswer.contains(list.get(position).getOptionName()) && selectAnswer.contains(list.get(position).getOptionName())) {
right.setVisibility(View.GONE);
wrong.setVisibility(View.VISIBLE);
option.setVisibility(View.GONE);
} else {
right.setVisibility(View.GONE);
wrong.setVisibility(View.GONE);
option.setVisibility(View.VISIBLE);
}
}
... ... @@ -71,29 +75,30 @@ public class ListAnswerAdapter extends BaseAdapter {
}
private String selectString;
private String rightAnswer;
private String selectAnswer;
private Boolean isEnable = true;
public void setSelect(String answer) {
this.selectString = answer;
}
private String rightAnswer;
public void setRight(String answer) {
this.rightAnswer = answer;
public void setRight(String right, String select) {
this.rightAnswer = right;
this.selectAnswer = select;
}
private String listRight;
public void setEnable(Integer integer) {
public void setListRight(String answer) {
this.listRight = answer;
}
@Override
public boolean isEnabled(int position) {
if (!TextUtils.isEmpty(selectString)) {
return false;
} else {
if (isEnable) {
return true;
} else {
return false;
}
}
}
... ...
package com.hh.xuetubao.adapter;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.hh.xuetubao.R;
import com.hh.xuetubao.bean.HotJobBean;
import java.util.List;
public class OfficeJobAdapter extends RecyclerView.Adapter<OfficeJobAdapter.ViewHolder> {
private Context context;
private List<HotJobBean.JobListBean> list;
public OfficeJobAdapter(Context context, List<HotJobBean.JobListBean> list) {
this.context = context;
this.list = list;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.rv_office_job, null);
ViewHolder holder = new ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
if (list.get(position).getJobName() != null)
holder.job.setText(list.get(position).getJobName());
if (list.get(position).getCompanyName() != null)
holder.company.setText(list.get(position).getCompanyName());
if (list.get(position).getSalary() != null)
holder.money.setText(list.get(position).getSalary());
if (list.get(position).getExprience() != null)
holder.jingyan.setText(list.get(position).getExprience());
if (list.get(position).getEducation() != null)
holder.xueli.setText(list.get(position).getEducation());
if (list.get(position).getAddress() != null)
holder.address.setText(list.get(position).getAddress());
if (list.size() > 3) {
if (position == 2) {
holder.line.setVisibility(View.GONE);
} else {
holder.line.setVisibility(View.VISIBLE);
}
} else {
if (position == list.size() - 1) {
holder.line.setVisibility(View.GONE);
} else {
holder.line.setVisibility(View.VISIBLE);
}
}
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (jumpToDetail != null) {
jumpToDetail.turnToDetail(list.get(position).getJobOid());
}
}
});
}
@Override
public int getItemCount() {
if (list.size() > 3) {
return 3;
} else {
return list.size();
}
}
public class ViewHolder extends RecyclerView.ViewHolder {
private final TextView job;
private final TextView money;
private final TextView company;
private final TextView jingyan;
private final TextView xueli;
private final TextView address;
private final View line;
public ViewHolder(View itemView) {
super(itemView);
job = (TextView) itemView.findViewById(R.id.tv_job);
money = (TextView) itemView.findViewById(R.id.tv_money);
company = (TextView) itemView.findViewById(R.id.tv_company);
jingyan = (TextView) itemView.findViewById(R.id.jingyan);
xueli = (TextView) itemView.findViewById(R.id.xueli);
address = (TextView) itemView.findViewById(R.id.address);
line = itemView.findViewById(R.id.line2);
}
}
private JumpToDetail jumpToDetail;
public void setJumpToDetail(JumpToDetail jumpToDetail) {
this.jumpToDetail = jumpToDetail;
}
public interface JumpToDetail {
void turnToDetail(String JobOid);
}
}
... ...
... ... @@ -29,33 +29,28 @@ public class StudyTimeXrcAdapter extends RecyclerView.Adapter<StudyTimeXrcAdapte
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.rc_read_time, null);
View viewById = view.findViewById(R.id.view_long);
ViewGroup.LayoutParams params = viewById.getLayoutParams();
int height = params.height;
params.height = 1200;
viewById.setLayoutParams(params);
ViewHolder holder = new ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
if (day.get(position) != null)
if (day.get(position) != null) {
holder.tvDay.setText(time.get(position));
if (time.get(position) != null)
}
if (time.get(position) != null) {
holder.tvTime.setText(day.get(position));
}
ViewGroup.LayoutParams params = holder.longView.getLayoutParams();
Log.e("SSsss",day.get(position)+"");
int a= Integer.valueOf(day.get(position).substring(day.get(position).length()-1,day.get(position).length()));
Log.e("a_Position",a+"");
params.height = a * 50;
if(a == 0){
holder.longView.setVisibility(View.GONE);
}else {
holder.longView.setLayoutParams(params);
int a = Integer.valueOf(day.get(position).substring(day.get(position).length() - 1, day.get(position).length()));
if (a == 0) {
params.height = 0;
} else {
params.height = a * 30;
}
// params.height = 100;
holder.longView.setLayoutParams(params);
}
... ...
... ... @@ -36,8 +36,10 @@ import com.hh.xuetubao.bean.AnswerBean;
import com.hh.xuetubao.bean.CompanyBean;
import com.hh.xuetubao.bean.FreeCourseBean;
import com.hh.xuetubao.bean.QuestionBankLstBean;
import com.hh.xuetubao.bean.UserBean;
import com.hh.xuetubao.model.ExerciseModel;
import com.hh.xuetubao.model.LearnModel;
import com.hh.xuetubao.model.PersonalModel;
import com.hh.xuetubao.model.ZhaopinModel;
import com.hh.xuetubao.mvp.BaseMvpFragment;
import com.hh.xuetubao.mvp.CommonPresenter;
... ... @@ -217,6 +219,11 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
ZhaopinModel zhaopinModel = new ZhaopinModel();
zhaopinModel.getModel(this, 3, 1, "4");
PersonalModel personalModel = new PersonalModel();
personalModel.getModel(this, 1, 1, "HeadPic");
personalModel.getModel(this, 1, 2, "CoverPic");
}
@Override
... ... @@ -269,6 +276,16 @@ public class HomeFragment extends BaseMvpFragment<CommonPresenter, LearnModel> i
tvMoreQiye.setVisibility(View.GONE);
}
}
if (api == 1 && intent == 1) {
UserBean bean = (UserBean) o;
String imgUrl = bean.getImgUrl();
SharedPrefrenceUtils.saveString(getActivity(), "HeadPic", imgUrl);
}
if (api == 1 && intent == 2) {
UserBean bean = (UserBean) o;
String imgUrl = bean.getImgUrl();
SharedPrefrenceUtils.saveString(getActivity(), "CoverPic", imgUrl);
}
}
@Override
... ...
... ... @@ -138,6 +138,12 @@ public class JobHuntFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMod
jobList.addAll(beanJobList);
workAdapter.notifyDataSetChanged();
if (jobList.size() > 3) {
zhiweiMore.setVisibility(View.VISIBLE);
} else {
zhiweiMore.setVisibility(View.GONE);
}
}
}
... ...
... ... @@ -136,7 +136,11 @@ public class MineFragment extends BaseMvpFragment<CommonPresenter, PersonalModel
if (api == 1 && intent == 3) {
UserBean bean = (UserBean) o;
int count = bean.getUnReadCount();
messageNum.setText(String.valueOf(count));
if(count==0){
messageNum.setVisibility(View.GONE);
}else {
messageNum.setText(String.valueOf(count));
}
}
if (api == 2 && intent == 1) {
... ...
... ... @@ -7,21 +7,20 @@ import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import com.hh.xuetubao.MyServer;
import com.hh.xuetubao.R;
... ... @@ -29,8 +28,8 @@ import com.hh.xuetubao.Utils.BaseObsever;
import com.hh.xuetubao.Utils.HttpUtils;
import com.hh.xuetubao.Utils.NetConfig;
import com.hh.xuetubao.activity.work.OfficeDetailActivity;
import com.hh.xuetubao.adapter.GridViewAdapter;
import com.hh.xuetubao.adapter.JobHuntWorkAdapter;
import com.hh.xuetubao.adapter.OfficeJobAdapter;
import com.hh.xuetubao.adapter.PopCityListAdapter;
import com.hh.xuetubao.adapter.PopProvinceListAdapter;
import com.hh.xuetubao.bean.AddressBean;
... ... @@ -56,7 +55,7 @@ import io.reactivex.schedulers.Schedulers;
/**
* 职位Fragment
*/
public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinModel> implements ICommonView, JobHuntWorkAdapter.JumpToDetail, View.OnClickListener {
public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinModel> implements ICommonView, OfficeJobAdapter.JumpToDetail, View.OnClickListener {
@BindView(R.id.recyclerview)
... ... @@ -78,7 +77,7 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
@BindView(R.id.rl_tab)
LinearLayout rlTab;
private JobHuntWorkAdapter jobHuntWorkAdapter;
private OfficeJobAdapter jobHuntWorkAdapter;
private List<HotJobBean.JobListBean> jobList = new ArrayList<>();
private List<AddressBean.ProvListBean> provinceList = new ArrayList<>();
private List<AddressBean.CityListBean> cityList = new ArrayList<>();
... ... @@ -132,7 +131,7 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
LinearLayoutManager manager = new LinearLayoutManager(getActivity());
recyclerview.setLayoutManager(manager);
jobHuntWorkAdapter = new JobHuntWorkAdapter(getActivity(), jobList);
jobHuntWorkAdapter = new OfficeJobAdapter(getActivity(), jobList);
recyclerview.setAdapter(jobHuntWorkAdapter);
jobHuntWorkAdapter.setJumpToDetail(this);
... ... @@ -141,27 +140,22 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
linCompany.setOnClickListener(this);
linRequire.setOnClickListener(this);
edSearch.addTextChangedListener(new TextWatcher() {
edSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
requestBody = new JobSearchBody();
requestBody.setPage(1);
requestBody.setPageSize(10);
requestBody.setSearchName(edSearch.getText().toString());
doRequset(requestBody);
Log.e("zhangtao:Jobreqeust",requestBody.toString());
Log.e("zhangtao:A","=========================");
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
String input = edSearch.getText().toString();
if (!TextUtils.isEmpty(input)) {
requestBody = new JobSearchBody();
requestBody.setPage(1);
requestBody.setPageSize(10);
requestBody.setSearchName(edSearch.getText().toString());
doRequset(requestBody);
}
return true;
}
return false;
}
});
}
... ... @@ -175,7 +169,7 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
model = new ZhaopinModel();
model.getModel(this, 7, 1, String.valueOf(true));
model.getModel(this, 7, 1, String.valueOf(true), "Job");
model.getModel(this, 8, 1, String.valueOf(0), String.valueOf(true));
model.getModel(this, 8, 2, String.valueOf(1), String.valueOf(true));
model.getModel(this, 8, 3, String.valueOf(3), String.valueOf(true));
... ... @@ -202,8 +196,7 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
List<AddressBean.ProvListBean> provList = bean.getProvList();
provinceList.addAll(provList);
proviceId = provinceList.get(1).getProvOid();
model.getModel(this, 7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true), "Job");
}
if (api == 7 && intent == 2) {
AddressBean bean = (AddressBean) o;
... ... @@ -720,7 +713,7 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
}
// model.getModel(activity, 7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true),"Job");
popListAdapter.change(position);
cityBean.setSelectA(position);
... ... @@ -731,9 +724,9 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
listTwo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if(position == 0){
if (position == 0) {
requestBody.setCityIdId(null);
}else {
} else {
requestBody.setCityIdId(cityList.get(position).getCityId());
}
popCityListAdapter.change(position); // 改
... ... @@ -761,7 +754,7 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
requestBody.setProvinceId(provinceList.get(0).getProvOid());
proviceId = provinceList.get(1).getProvOid();
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true));
mPresenter.getPresenter(7, 2, proviceId, String.valueOf(true),"Job");
popListAdapter.change(0);
popCityListAdapter.change(0);
... ... @@ -773,7 +766,7 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
@Override
public void onClick(View v) {
popupWindow.dismiss();
Log.e("requestBody",requestBody.toString());
Log.e("requestBody", requestBody.toString());
doRequset(requestBody);
}
});
... ... @@ -1096,7 +1089,6 @@ public class OfficeFragment extends BaseMvpFragment<CommonPresenter, ZhaopinMode
// }
//职位->要求弹窗
// private void showRequirePop(final List<AddressBean.PropListBean> xueLiList, final List<AddressBean.PropListBean> jingYanList, final List<AddressBean.PropListBean> zhiYeList) {
//
... ...
... ... @@ -51,6 +51,24 @@ public class ExerciseModel implements ICommonModel {
if (api == 9 && intent == 1)
DeleteExamRecordInfo(commonView, api, intent, params);
if (api == 10 && intent == 1)
InsertSimExamRecord(commonView, api, intent, params);
}
private void InsertSimExamRecord(final ICommonView commonView, final int api, final int intent, String... params) {
if (api == 10 && intent == 1)
mServers.InsertSimExamRecord(params[0], params[1], Double.valueOf(params[2]), Integer.valueOf(params[3]), Integer.valueOf(params[4]))
.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 DeleteExamRecordInfo(final ICommonView commonView, final int api, final int intent, String... params) {
... ...
... ... @@ -77,7 +77,7 @@ public class ZhaopinModel implements ICommonModel {
private void GetCityListByProvince(final ICommonView commonView, final int api, final int intent, String... params) {
if (api == 7 && intent == 2)
mServers.GetCityListByProvince(params[0], Boolean.valueOf(params[1]))
mServers.GetCityListByProvince(params[0], Boolean.valueOf(params[1]),params[2])
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
... ... @@ -103,7 +103,7 @@ public class ZhaopinModel implements ICommonModel {
private void GetProvinceList(final ICommonView commonView, final int api, final int intent, String... params) {
if (api == 7 && intent == 1)
mServers.GetProvinceList(Boolean.valueOf(params[0]))
mServers.GetProvinceList(Boolean.valueOf(params[0]),params[1])
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObsever() {
... ...
... ... @@ -8,7 +8,7 @@
<RelativeLayout
android:id="@+id/rl_top"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_68"
android:layout_height="@dimen/dp_48"
android:background="#F2F2F2">
<LinearLayout
... ... @@ -82,7 +82,7 @@
android:layout_alignBottom="@id/tv_kaoshi"
android:layout_marginRight="@dimen/dp_5"
android:layout_toLeftOf="@+id/tv_time1"
android:text="6"
android:text="0"
android:textColor="@color/color_ff5400"
android:textSize="12sp" />
... ... @@ -123,7 +123,7 @@
android:layout_alignBottom="@id/tv_jige"
android:layout_marginRight="@dimen/dp_5"
android:layout_toLeftOf="@+id/tv_time1"
android:text="6"
android:text="0"
android:textColor="@color/color_ff5400"
android:textSize="12sp" />
... ... @@ -164,7 +164,7 @@
android:layout_alignBottom="@id/tv_dati"
android:layout_marginRight="@dimen/dp_5"
android:layout_toLeftOf="@+id/tv_time1"
android:text="6"
android:text="0"
android:textColor="@color/color_ff5400"
android:textSize="12sp" />
... ...
... ... @@ -36,6 +36,8 @@
android:layout_marginLeft="@dimen/dp_5"
android:background="@null"
android:hint="请输入职位名称"
android:imeOptions="actionSearch"
android:inputType="text"
android:maxEms="20"
android:textSize="12sp" />
</LinearLayout>
... ... @@ -68,12 +70,14 @@
android:layout_marginLeft="@dimen/dp_5"
android:src="@mipmap/down" />
</LinearLayout>
<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="#D7D7D7" />
<LinearLayout
android:id="@+id/lin_city"
android:layout_width="0dp"
... ...
... ... @@ -8,7 +8,7 @@
<RelativeLayout
android:id="@+id/rl_top"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_68"
android:layout_height="@dimen/dp_48"
android:background="#F2F2F2">
<LinearLayout
... ...
... ... @@ -343,6 +343,8 @@
android:id="@+id/rec_work"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:layout_below="@+id/zhiwei" />
... ...
... ... @@ -44,10 +44,10 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="删除"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/dp_20"
android:text="删除"
android:textColor="#666666"
android:textSize="12sp" />
</RelativeLayout>
... ... @@ -71,22 +71,37 @@
android:textColor="#000000"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_time"
<LinearLayout
android:id="@+id/line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_15"
android:text="用时37分12秒"
android:textColor="#FF5400"
android:textSize="12sp" />
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="用时"
android:textColor="#FF5400"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="37分12秒"
android:textColor="#FF5400"
android:textSize="12sp" />
</LinearLayout>
<View
android:id="@+id/line1"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_below="@+id/tv_time"
android:layout_below="@+id/line"
android:layout_marginTop="@dimen/dp_30"
android:background="#E5E5E5" />
... ...
... ... @@ -28,7 +28,7 @@
android:layout_width="@dimen/dp_154"
android:layout_height="@dimen/dp_145"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_25"
android:scaleType="fitXY"
android:src="@mipmap/aaa" />
... ...
... ... @@ -363,12 +363,14 @@
<RelativeLayout
android:id="@+id/rl_end"
android:layout_width="@dimen/dp_335"
android:layout_height="@dimen/dp_50"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_30"
android:layout_below="@+id/rl_toudi"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_60"
android:layout_marginRight="@dimen/dp_20"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/circle_bigconners_orange">
<TextView
... ...
... ... @@ -10,7 +10,7 @@
<RelativeLayout
android:id="@+id/rl_top"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_68"
android:layout_height="@dimen/dp_48"
android:background="#F2F2F2">
<LinearLayout
... ...
... ... @@ -36,6 +36,8 @@
android:layout_marginLeft="@dimen/dp_5"
android:background="@null"
android:hint="请输入职位名称"
android:imeOptions="actionSearch"
android:inputType="text"
android:maxEms="20"
android:textSize="12sp" />
</LinearLayout>
... ... @@ -170,15 +172,14 @@
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible" />
android:divider="@null" />
<LinearLayout
android:id="@+id/office_zwsj"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="gone"
android:id="@+id/office_zwsj"
>
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
... ...
... ... @@ -9,7 +9,7 @@
<RelativeLayout
android:id="@+id/rl_top"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_68"
android:layout_height="@dimen/dp_48"
android:background="#F2F2F2">
<LinearLayout
... ...
... ... @@ -120,8 +120,8 @@
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_7"
android:background="#f5f5f5"
android:layout_height="@dimen/dp_1"
android:background="#EEEEEE"
android:layout_below="@+id/linnn"
/>
... ...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tv_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"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:text="6K-8K"
android:textColor="#FF5400"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_company"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_job"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:text="上海鉴泉自动化科技有限公司"
android:textColor="#232323"
android:textSize="14sp" />
<LinearLayout
android:id="@+id/lin_tab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_company"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#F8F8F8">
<TextView
android:id="@+id/jingyan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/circle_f8f8f8_3"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:text="无经验"
android:textColor="#A9A9A9"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8">
<TextView
android:id="@+id/xueli"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/circle_f8f8f8_3"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:text="不限学历"
android:textColor="#A9A9A9"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:background="#F8F8F8">
<TextView
android:id="@+id/address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/circle_f8f8f8_3"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_5"
android:text="上海市金山区"
android:textColor="#A9A9A9"
android:textSize="11sp" />
</LinearLayout>
</LinearLayout>
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20"
android:layout_below="@+id/lin_tab" />
<View
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_7"
android:layout_below="@+id/line"
android:background="#f5f5f5" />
</RelativeLayout>
... ...