|
|
@@ -1,14 +1,17 @@
|
|
|
package com.webrain.dailypay.ui.fragment;
|
|
|
|
|
|
+import android.content.Context;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.v7.widget.CardView;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.LayoutInflater;
|
|
|
+import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
+import android.view.inputmethod.InputMethodManager;
|
|
|
import android.widget.AbsListView;
|
|
|
import android.widget.EditText;
|
|
|
import android.widget.LinearLayout;
|
|
|
@@ -94,62 +97,48 @@ public class ResumeFragment extends BaseFragment<ResumeFragmentPresenter> implem
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- @Subscribe
|
|
|
- public void onEvent(StringEvent event) {
|
|
|
- if (event.getData().equals(EventConstant.EVENT_USER_AUTHENTICATION_STATUS_CHANGE)) {
|
|
|
- mvpPresenter.init();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @OnClick(R.id.sav_search)
|
|
|
- public void onClick(View view) {
|
|
|
- if (savSearch.isAnimEnd()) {
|
|
|
- if (savSearch.isShow())
|
|
|
- savSearch.hideMenu();
|
|
|
- else
|
|
|
- savSearch.showMenu();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void onDestroyView() {
|
|
|
super.onDestroyView();
|
|
|
EventBus.getDefault().unregister(this);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- * 搜索按钮触发回调
|
|
|
- *
|
|
|
- * @param v
|
|
|
- * @param actionId
|
|
|
- * @param event
|
|
|
- * @return
|
|
|
+ * 当尚未成功认证
|
|
|
*/
|
|
|
- @OnEditorAction(R.id.et_search)
|
|
|
- public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
- if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
|
|
- mvpPresenter.setSearchKey(etSearch.getText().toString());
|
|
|
- mvpPresenter.getHttpPositionList(true, true, true);
|
|
|
+ @Override
|
|
|
+ public void onNoRealAuthentication(int state) {
|
|
|
+ if (state == AppConstant.APPROVE_SUCCESS) {
|
|
|
+ llAuthentication.setVisibility(View.GONE);
|
|
|
+ } else {
|
|
|
+ setLoadingVisible(false);
|
|
|
+ if (mHolder == null) {
|
|
|
+ mHolder = new RealAuthenticationHolder(mContext);
|
|
|
+ llAuthentication.addView(mHolder.getView());
|
|
|
+ llAuthentication.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+ if (state == AppConstant.APPROVE_NONE || state == AppConstant.APPROVE_FAIL) {
|
|
|
+ mHolder.initAuthenticationState();
|
|
|
+ } else {
|
|
|
+ mHolder.initGoingAuthenticationState();
|
|
|
+ }
|
|
|
}
|
|
|
- return false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 监听ListView 滑动 实现搜索栏状态改变
|
|
|
+ * 清理焦点
|
|
|
*/
|
|
|
- ScrollListView.OnScrollMoveListener onScrollMoveListener = new ScrollListView.OnScrollMoveListener() {
|
|
|
- @Override
|
|
|
- public void onScrollMove(int scrollY) {
|
|
|
- if (scrollY <= 0) { //设置标题的背景颜色
|
|
|
- savSearch.showMenu();
|
|
|
- } else if (scrollY >= PxUtils.dip2px(57)) { //滑动距离小于banner图的高度时,设置背景和字体颜色颜色透明度渐变
|
|
|
- savSearch.hideMenu();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
+ @Override
|
|
|
+ public void clearFocus() {
|
|
|
+ etSearch.clearFocus();
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 获得简历列表数据
|
|
|
+ *
|
|
|
+ * @param mData
|
|
|
+ * @param isLastPage
|
|
|
+ */
|
|
|
@Override
|
|
|
public void onPositionList(List<ResumeBean> mData, boolean isLastPage) {
|
|
|
setLoadingVisible(false);
|
|
|
@@ -181,29 +170,58 @@ public class ResumeFragment extends BaseFragment<ResumeFragmentPresenter> implem
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Subscribe
|
|
|
+ public void onEvent(StringEvent event) {
|
|
|
+ if (event.getData().equals(EventConstant.EVENT_USER_AUTHENTICATION_STATUS_CHANGE)) {
|
|
|
+ mvpPresenter.init();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @OnClick(R.id.sav_search)
|
|
|
+ public void onClick(View view) {
|
|
|
+ if (savSearch.isAnimEnd()) {
|
|
|
+ if (savSearch.isShow())
|
|
|
+ savSearch.hideMenu();
|
|
|
+ else
|
|
|
+ savSearch.showMenu();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
- * 当尚未成功认证
|
|
|
+ * 搜索按钮触发回调
|
|
|
+ *
|
|
|
+ * @param v
|
|
|
+ * @param actionId
|
|
|
+ * @param event
|
|
|
+ * @return
|
|
|
*/
|
|
|
- @Override
|
|
|
- public void onNoRealAuthentication(int state) {
|
|
|
- if (state == AppConstant.APPROVE_SUCCESS) {
|
|
|
- llAuthentication.setVisibility(View.GONE);
|
|
|
- } else {
|
|
|
- setLoadingVisible(false);
|
|
|
- if (mHolder == null) {
|
|
|
- mHolder = new RealAuthenticationHolder(mContext);
|
|
|
- llAuthentication.addView(mHolder.getView());
|
|
|
- llAuthentication.setVisibility(View.VISIBLE);
|
|
|
- }
|
|
|
- if (state == AppConstant.APPROVE_NONE || state == AppConstant.APPROVE_FAIL) {
|
|
|
- mHolder.initAuthenticationState();
|
|
|
- } else {
|
|
|
- mHolder.initGoingAuthenticationState();
|
|
|
- }
|
|
|
+ @OnEditorAction(R.id.et_search)
|
|
|
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
+ if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
|
|
+ mvpPresenter.setSearchKey(etSearch.getText().toString());
|
|
|
+ mvpPresenter.getHttpPositionList(true, true, true);
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 监听ListView 滑动 实现搜索栏状态改变
|
|
|
+ */
|
|
|
+ ScrollListView.OnScrollMoveListener onScrollMoveListener = new ScrollListView.OnScrollMoveListener() {
|
|
|
+ @Override
|
|
|
+ public void onScrollMove(int scrollY) {
|
|
|
+ if (scrollY <= 0) { //设置标题的背景颜色
|
|
|
+ if (!etSearch.isFocused())
|
|
|
+ savSearch.showMenu();
|
|
|
+ } else if (scrollY >= PxUtils.dip2px(57)) { //滑动距离小于banner图的高度时,设置背景和字体颜色颜色透明度渐变
|
|
|
+ if (!etSearch.isFocused())
|
|
|
+ savSearch.hideMenu();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
* 监听下拉刷新触发
|
|
|
*/
|
|
|
OnRefreshListener onRefreshListener = new OnRefreshListener() {
|
|
|
@@ -232,4 +250,5 @@ public class ResumeFragment extends BaseFragment<ResumeFragmentPresenter> implem
|
|
|
&& (firstVisibleItem + visibleItemCount >= totalItemCount - 1);
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
}
|