光环助手V3.6.3 DEV(20190328-1830)测试问题汇总(前端)(1.6.7.13.14.15) https://gitlab.ghzhushou.com/pm/halo-app-issues/issues/479
This commit is contained in:
@ -4,10 +4,14 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -15,9 +19,12 @@ import com.gc.materialdesign.views.ProgressBarCircularIndeterminate;
|
||||
import com.gh.base.BaseActivity;
|
||||
import com.gh.base.OnRequestCallBackListener;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.common.util.TextHelper;
|
||||
import com.gh.common.view.VerticalItemDecoration;
|
||||
import com.gh.gamecenter.adapter.ToolBoxRvAdapter;
|
||||
import com.gh.gamecenter.suggest.SuggestType;
|
||||
import com.lightgame.utils.Util_System_Keyboard;
|
||||
import com.lightgame.utils.Utils;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
@ -27,8 +34,16 @@ import butterknife.OnClick;
|
||||
*/
|
||||
|
||||
public class ToolBoxActivity extends BaseActivity implements SwipeRefreshLayout.OnRefreshListener,
|
||||
ToolBoxRvAdapter.OnSearchCallBackListener, OnRequestCallBackListener {
|
||||
OnRequestCallBackListener {
|
||||
|
||||
@BindView(R.id.et_search)
|
||||
public EditText searchEt;
|
||||
@BindView(R.id.tv_search)
|
||||
public TextView searchTv;
|
||||
@BindView(R.id.tv_back)
|
||||
public TextView backTv;
|
||||
@BindView(R.id.toolbox_appbar)
|
||||
AppBarLayout mAppBar;
|
||||
@BindView(R.id.toolbox_rv)
|
||||
RecyclerView mToolboxRv;
|
||||
@BindView(R.id.reuse_none_data)
|
||||
@ -74,7 +89,7 @@ public class ToolBoxActivity extends BaseActivity implements SwipeRefreshLayout.
|
||||
|
||||
mLayoutManager = new LinearLayoutManager(this);
|
||||
mToolboxRv.setLayoutManager(mLayoutManager);
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, ToolBoxActivity.this, mIsSearch, mSearchKey);
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, mIsSearch, mSearchKey);
|
||||
mToolboxRv.addItemDecoration(new VerticalItemDecoration(this, 8, false));
|
||||
mToolboxRv.setAdapter(mRvAdapter);
|
||||
|
||||
@ -92,8 +107,52 @@ public class ToolBoxActivity extends BaseActivity implements SwipeRefreshLayout.
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mAppBar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
|
||||
if (verticalOffset == 0) {
|
||||
mRefresh.setEnabled(true);
|
||||
} else {
|
||||
mRefresh.setEnabled(false);
|
||||
}
|
||||
int totalScrollRange = appBarLayout.getTotalScrollRange();
|
||||
if (totalScrollRange == -verticalOffset) {
|
||||
Util_System_Keyboard.hideSoftKeyboard(this);
|
||||
}
|
||||
});
|
||||
|
||||
initSearch();
|
||||
}
|
||||
|
||||
private void initSearch() {
|
||||
backTv.setOnClickListener(v -> search(false, searchEt.getText().toString()));
|
||||
|
||||
TextHelper.limitTheLengthOfEditText(searchEt, 20, () -> {
|
||||
Utils.toast(this, "最多输入20字");
|
||||
});
|
||||
|
||||
searchTv.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(searchEt.getText().toString())) {
|
||||
Utils.toast(this, R.string.search_hint);
|
||||
return;
|
||||
}
|
||||
search(true, searchEt.getText().toString());
|
||||
});
|
||||
|
||||
searchEt.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (!hasFocus) {
|
||||
Util_System_Keyboard.hideSoftKeyboard(this, searchEt);
|
||||
}
|
||||
});
|
||||
|
||||
searchEt.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||
searchTv.performClick();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@OnClick({R.id.reuse_no_connection, R.id.reuse_none_data})
|
||||
public void onClick(View view) {
|
||||
if (view.getId() == R.id.reuse_no_connection) {
|
||||
@ -147,7 +206,6 @@ public class ToolBoxActivity extends BaseActivity implements SwipeRefreshLayout.
|
||||
mRefresh.postDelayed(runnable, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void search(boolean isSearch, String searchKey) {
|
||||
if (mNoneData.getVisibility() == View.VISIBLE) {
|
||||
mNoneData.setVisibility(View.GONE);
|
||||
@ -162,15 +220,26 @@ public class ToolBoxActivity extends BaseActivity implements SwipeRefreshLayout.
|
||||
|
||||
private void changeAdapter(boolean isRefresh) {
|
||||
if (mIsSearch) {
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, this, mIsSearch, mSearchKey);
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, mIsSearch, mSearchKey);
|
||||
} else {
|
||||
if (mNormalRvAdapter != null && !isRefresh) {
|
||||
mRvAdapter = mNormalRvAdapter;
|
||||
} else {
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, this, mIsSearch, null);
|
||||
mRvAdapter = new ToolBoxRvAdapter(this, this, mIsSearch, null);
|
||||
mNormalRvAdapter = mRvAdapter;
|
||||
}
|
||||
}
|
||||
mToolboxRv.setAdapter(mRvAdapter);
|
||||
|
||||
if (mSearchKey != null) {
|
||||
searchEt.setText(mSearchKey);
|
||||
searchEt.setSelection(searchEt.getText().length());
|
||||
}
|
||||
|
||||
if (mIsSearch) {
|
||||
backTv.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
backTv.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user