Skip to content

Commit

Permalink
Merge pull request #3 from DevFactory/release/multiple-code-improveme…
Browse files Browse the repository at this point in the history
…nts-fix-1

Multiple code improvements - squid:S1301, squid:S1213, squid:SwitchLastCaseIsDefaultCheck, squid:S2131, squid:S1118
  • Loading branch information
CymChad committed Apr 21, 2016
2 parents 7c823e1 + 8bb71f1 commit 4206f2e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void initAdapter() {
mQuickAdapter.setOnRecyclerViewItemClickListener(new BaseQuickAdapter.OnRecyclerViewItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Toast.makeText(AnimationUseActivity.this, "" + position, Toast.LENGTH_LONG).show();
Toast.makeText(AnimationUseActivity.this, Integer.toString(position), Toast.LENGTH_LONG).show();
}
});
mRecyclerView.setAdapter(mQuickAdapter);
Expand Down Expand Up @@ -68,7 +68,8 @@ public void onItemSelected(MaterialSpinner view, int position, long id, String i
case 5:
mQuickAdapter.openLoadAnimation(new CustomAnimation());
break;

default:
break;
}
mRecyclerView.setAdapter(mQuickAdapter);
}
Expand All @@ -86,6 +87,8 @@ public void onItemSelected(MaterialSpinner view, int position, long id, String i
case 1:
mQuickAdapter.isFirstOnly(false);
break;
default:
break;
}
mQuickAdapter.notifyDataSetChanged();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void initAdapter() {
mQuickAdapter.setOnRecyclerViewItemClickListener(new BaseQuickAdapter.OnRecyclerViewItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Toast.makeText(HeaderAndFooterUseActivity.this, "" + position, Toast.LENGTH_LONG).show();
Toast.makeText(HeaderAndFooterUseActivity.this, "" + Integer.toString(position), Toast.LENGTH_LONG).show();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class PullToRefreshUseActivity extends Activity implements BaseQuickAdapt

private static final int PAGE_SIZE = 6;

private int delayMillis = 1000;

private int mCurrentCounter = 0;

@Override
Expand All @@ -54,7 +56,7 @@ public void onClick(View v) {
});
mQuickAdapter.addHeaderView(headView);
}
private int delayMillis = 1000;

@Override
public void onLoadMoreRequested() {
if (mCurrentCounter >= TOTAL_COUNTER) {
Expand Down Expand Up @@ -100,7 +102,7 @@ private void initAdapter() {
mQuickAdapter.setOnRecyclerViewItemClickListener(new BaseQuickAdapter.OnRecyclerViewItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Toast.makeText(PullToRefreshUseActivity.this, "" + position, Toast.LENGTH_LONG).show();
Toast.makeText(PullToRefreshUseActivity.this, Integer.toString(position), Toast.LENGTH_LONG).show();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* https://github.com/CymChad/BaseRecyclerViewAdapterHelper
*/
public class DataServer {

private DataServer() {}

public static List<Status> getSampleData(int lenth) {
List<Status> list = new ArrayList<>();
for (int i = 0; i < lenth; i++) {
Expand Down

0 comments on commit 4206f2e

Please sign in to comment.