Skip to content

Commit 5ed6f0b

Browse files
committed
Formatted source code using :google-java-format
1 parent 79ad2ef commit 5ed6f0b

File tree

90 files changed

+4314
-3002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4314
-3002
lines changed

app/build.gradle

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ dependencies {
3030
implementation rootProject.ext.libs.recyclerview
3131
implementation rootProject.ext.libs.design
3232
implementation 'com.github.dkzwm:ViewPagerTransforms:1.3.3'
33-
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
33+
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.44'
3434
implementation 'com.joooonho:selectableroundedimageview:1.0.1'
3535
implementation 'com.github.bumptech.glide:glide:4.8.0'
3636
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
37-
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
38-
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
37+
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
38+
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
39+
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
40+
3941
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package me.dkzwm.widget.srl.sample;
22

33
import android.app.Application;
4-
54
import com.squareup.leakcanary.LeakCanary;
6-
75
import me.dkzwm.widget.srl.IRefreshViewCreator;
86
import me.dkzwm.widget.srl.SmoothRefreshLayout;
97
import me.dkzwm.widget.srl.extra.IRefreshView;
@@ -16,26 +14,26 @@
1614
*
1715
* @author dkzwm
1816
*/
19-
2017
public class DemoApplication extends Application {
2118
@Override
2219
public void onCreate() {
2320
super.onCreate();
2421
LeakCanary.install(this);
25-
SmoothRefreshLayout.setDefaultCreator(new IRefreshViewCreator() {
26-
@Override
27-
public IRefreshView<IIndicator> createHeader(SmoothRefreshLayout layout) {
28-
ClassicHeader<IIndicator> header = new ClassicHeader<>(layout.getContext());
29-
header.setLastUpdateTimeKey("header_last_update_time");
30-
return header;
31-
}
22+
SmoothRefreshLayout.setDefaultCreator(
23+
new IRefreshViewCreator() {
24+
@Override
25+
public IRefreshView<IIndicator> createHeader(SmoothRefreshLayout layout) {
26+
ClassicHeader<IIndicator> header = new ClassicHeader<>(layout.getContext());
27+
header.setLastUpdateTimeKey("header_last_update_time");
28+
return header;
29+
}
3230

33-
@Override
34-
public IRefreshView<IIndicator> createFooter(SmoothRefreshLayout layout) {
35-
ClassicFooter<IIndicator> footer = new ClassicFooter<>(layout.getContext());
36-
footer.setLastUpdateTimeKey("footer_last_update_time");
37-
return footer;
38-
}
39-
});
31+
@Override
32+
public IRefreshView<IIndicator> createFooter(SmoothRefreshLayout layout) {
33+
ClassicFooter<IIndicator> footer = new ClassicFooter<>(layout.getContext());
34+
footer.setLastUpdateTimeKey("footer_last_update_time");
35+
return footer;
36+
}
37+
});
4038
}
4139
}

app/src/main/java/me/dkzwm/widget/srl/sample/adapter/HorizontalRecyclerViewAdapter.java

+25-19
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@
88
import android.widget.ImageView;
99
import android.widget.TextView;
1010
import android.widget.Toast;
11-
1211
import com.bumptech.glide.Glide;
13-
1412
import java.util.ArrayList;
1513
import java.util.List;
16-
1714
import me.dkzwm.widget.srl.sample.R;
1815

1916
/**
2017
* Created by dkzwm on 2017/10/24.
2118
*
2219
* @author dkzwm
2320
*/
24-
public class HorizontalRecyclerViewAdapter extends RecyclerView.Adapter<HorizontalRecyclerViewAdapter.RecyclerViewHolder> {
21+
public class HorizontalRecyclerViewAdapter
22+
extends RecyclerView.Adapter<HorizontalRecyclerViewAdapter.RecyclerViewHolder> {
2523
private LayoutInflater mInflater;
2624
private Context mContext;
2725
private List<String> mList = new ArrayList<>();
@@ -68,21 +66,29 @@ public RecyclerViewHolder(View itemView) {
6866
super(itemView);
6967
mImageView = (ImageView) itemView.findViewById(R.id.imageView_list_item);
7068
mTextView = (TextView) itemView.findViewById(R.id.textView_list_item);
71-
mTextView.setOnClickListener(new View.OnClickListener() {
72-
@Override
73-
public void onClick(View v) {
74-
Toast.makeText(v.getContext(), "Click:" + getAdapterPosition(), Toast.LENGTH_SHORT).show();
75-
}
76-
});
77-
mTextView.setOnLongClickListener(new View.OnLongClickListener() {
78-
@Override
79-
public boolean onLongClick(View v) {
80-
Toast.makeText(v.getContext(), "LongClick:" + getAdapterPosition(), Toast.LENGTH_SHORT).show();
81-
return true;
82-
}
83-
});
69+
mTextView.setOnClickListener(
70+
new View.OnClickListener() {
71+
@Override
72+
public void onClick(View v) {
73+
Toast.makeText(
74+
v.getContext(),
75+
"Click:" + getAdapterPosition(),
76+
Toast.LENGTH_SHORT)
77+
.show();
78+
}
79+
});
80+
mTextView.setOnLongClickListener(
81+
new View.OnLongClickListener() {
82+
@Override
83+
public boolean onLongClick(View v) {
84+
Toast.makeText(
85+
v.getContext(),
86+
"LongClick:" + getAdapterPosition(),
87+
Toast.LENGTH_SHORT)
88+
.show();
89+
return true;
90+
}
91+
});
8492
}
85-
8693
}
87-
8894
}

app/src/main/java/me/dkzwm/widget/srl/sample/adapter/ListViewAdapter.java

+27-25
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package me.dkzwm.widget.srl.sample.adapter;
22

3-
import android.app.Activity;
43
import android.content.Context;
54
import android.view.LayoutInflater;
65
import android.view.View;
@@ -9,12 +8,9 @@
98
import android.widget.ImageView;
109
import android.widget.TextView;
1110
import android.widget.Toast;
12-
1311
import com.bumptech.glide.Glide;
14-
1512
import java.util.ArrayList;
1613
import java.util.List;
17-
1814
import me.dkzwm.widget.srl.sample.R;
1915

2016
/**
@@ -28,7 +24,7 @@ public class ListViewAdapter extends BaseAdapter {
2824
private Context mContext;
2925

3026
public ListViewAdapter(Context context, LayoutInflater inflater) {
31-
mContext=context;
27+
mContext = context;
3228
mInflater = inflater;
3329
mList = new ArrayList<>();
3430
}
@@ -82,26 +78,32 @@ private class ListViewHolder {
8278
private ListViewHolder(View view) {
8379
mImageView = (ImageView) view.findViewById(R.id.imageView_list_item);
8480
mTextView = (TextView) view.findViewById(R.id.textView_list_item);
85-
mTextView.setOnClickListener(new View.OnClickListener() {
86-
@Override
87-
public void onClick(View v) {
88-
Object obj = v.getTag();
89-
if (obj instanceof Integer) {
90-
Toast.makeText(v.getContext(), "Click:" + obj, Toast.LENGTH_SHORT).show();
91-
}
92-
}
93-
});
94-
mTextView.setOnLongClickListener(new View.OnLongClickListener() {
95-
@Override
96-
public boolean onLongClick(View v) {
97-
Object obj = v.getTag();
98-
if (obj instanceof Integer) {
99-
Toast.makeText(v.getContext(), "LongClick:" + obj, Toast.LENGTH_SHORT).show();
100-
}
101-
return true;
102-
}
103-
});
81+
mTextView.setOnClickListener(
82+
new View.OnClickListener() {
83+
@Override
84+
public void onClick(View v) {
85+
Object obj = v.getTag();
86+
if (obj instanceof Integer) {
87+
Toast.makeText(v.getContext(), "Click:" + obj, Toast.LENGTH_SHORT)
88+
.show();
89+
}
90+
}
91+
});
92+
mTextView.setOnLongClickListener(
93+
new View.OnLongClickListener() {
94+
@Override
95+
public boolean onLongClick(View v) {
96+
Object obj = v.getTag();
97+
if (obj instanceof Integer) {
98+
Toast.makeText(
99+
v.getContext(),
100+
"LongClick:" + obj,
101+
Toast.LENGTH_SHORT)
102+
.show();
103+
}
104+
return true;
105+
}
106+
});
104107
}
105-
106108
}
107109
}

app/src/main/java/me/dkzwm/widget/srl/sample/adapter/LoadMoreRecyclerViewAdapter.java

-4
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@
22

33
import android.content.Context;
44
import android.widget.ImageView;
5-
65
import com.bumptech.glide.Glide;
76
import com.chad.library.adapter.base.BaseQuickAdapter;
87
import com.chad.library.adapter.base.BaseViewHolder;
9-
108
import me.dkzwm.widget.srl.sample.R;
119

12-
1310
/**
1411
* Created by dkzwm on 2017/8/8.
1512
*
1613
* @author dkzwm
1714
*/
18-
1915
public class LoadMoreRecyclerViewAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
2016
private Context mContext;
2117

app/src/main/java/me/dkzwm/widget/srl/sample/adapter/RecyclerViewAdapter.java

+25-19
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@
99
import android.widget.ImageView;
1010
import android.widget.TextView;
1111
import android.widget.Toast;
12-
1312
import com.bumptech.glide.Glide;
14-
1513
import java.util.ArrayList;
1614
import java.util.List;
17-
1815
import me.dkzwm.widget.srl.sample.R;
1916

2017
/**
2118
* Created by dkzwm on 2017/6/1.
2219
*
2320
* @author dkzwm
2421
*/
25-
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.RecyclerViewHolder> {
22+
public class RecyclerViewAdapter
23+
extends RecyclerView.Adapter<RecyclerViewAdapter.RecyclerViewHolder> {
2624
private LayoutInflater mInflater;
2725
private Context mContext;
2826
private ArrayList<String> mList = new ArrayList<>();
@@ -70,21 +68,29 @@ class RecyclerViewHolder extends RecyclerView.ViewHolder {
7068
super(itemView);
7169
mImageView = itemView.findViewById(R.id.imageView_list_item);
7270
mTextView = itemView.findViewById(R.id.textView_list_item);
73-
mTextView.setOnClickListener(new View.OnClickListener() {
74-
@Override
75-
public void onClick(View v) {
76-
Toast.makeText(v.getContext(), "Click:" + getAdapterPosition(), Toast.LENGTH_SHORT).show();
77-
}
78-
});
79-
mTextView.setOnLongClickListener(new View.OnLongClickListener() {
80-
@Override
81-
public boolean onLongClick(View v) {
82-
Toast.makeText(v.getContext(), "LongClick:" + getAdapterPosition(), Toast.LENGTH_SHORT).show();
83-
return true;
84-
}
85-
});
71+
mTextView.setOnClickListener(
72+
new View.OnClickListener() {
73+
@Override
74+
public void onClick(View v) {
75+
Toast.makeText(
76+
v.getContext(),
77+
"Click:" + getAdapterPosition(),
78+
Toast.LENGTH_SHORT)
79+
.show();
80+
}
81+
});
82+
mTextView.setOnLongClickListener(
83+
new View.OnLongClickListener() {
84+
@Override
85+
public boolean onLongClick(View v) {
86+
Toast.makeText(
87+
v.getContext(),
88+
"LongClick:" + getAdapterPosition(),
89+
Toast.LENGTH_SHORT)
90+
.show();
91+
return true;
92+
}
93+
});
8694
}
87-
8895
}
89-
9096
}

app/src/main/java/me/dkzwm/widget/srl/sample/adapter/ViewPagerAdapter.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
import android.support.v4.app.Fragment;
44
import android.support.v4.app.FragmentManager;
55
import android.support.v4.app.FragmentStatePagerAdapter;
6-
76
import java.util.List;
87

98
/**
109
* Created by dkzwm on 2017/6/2.
1110
*
1211
* @author dkzwm
1312
*/
14-
1513
public class ViewPagerAdapter extends FragmentStatePagerAdapter {
1614
private List<? extends Fragment> mViewPagerFragments;
1715

@@ -25,11 +23,8 @@ public Fragment getItem(int position) {
2523
return mViewPagerFragments.get(position);
2624
}
2725

28-
2926
@Override
3027
public int getCount() {
3128
return mViewPagerFragments.size();
3229
}
33-
34-
35-
}
30+
}

app/src/main/java/me/dkzwm/widget/srl/sample/animation/StoreHouseBarItemAnimation.java

+4-10
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
import android.graphics.Paint;
55
import android.view.animation.Animation;
66
import android.view.animation.Transformation;
7-
87
import java.util.Random;
98

109
/**
11-
* Created by srain on 11/6/14.
12-
* Modify by dkzwm on 6/6/17
10+
* Created by srain on 11/6/14. Modify by dkzwm on 6/6/17
1311
*
1412
* @author srain;dkzwm
1513
*/
@@ -23,12 +21,8 @@ public class StoreHouseBarItemAnimation extends Animation {
2321
protected float mToAlpha = 0.4f;
2422
protected float mTranslationX;
2523

26-
27-
public StoreHouseBarItemAnimation(int index,
28-
float[] start,
29-
float[] end,
30-
int color,
31-
int lineWidth) {
24+
public StoreHouseBarItemAnimation(
25+
int index, float[] start, float[] end, int color, int lineWidth) {
3226
mIndex = index;
3327

3428
mMiddlePoint[0] = (start[0] + end[0]) / 2;
@@ -85,4 +79,4 @@ public void setAlpha(float alpha) {
8579
public void onDraw(Canvas canvas) {
8680
canvas.drawLine(mStartPoint[0], mStartPoint[1], mEndPoint[0], mEndPoint[1], mPaint);
8781
}
88-
}
82+
}

0 commit comments

Comments
 (0)