Skip to content

Commit 5e25784

Browse files
committed
Updated Javadoc issues (Java 8 changes)
1 parent 1498909 commit 5e25784

14 files changed

+61
-62
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.2.3'
9-
classpath 'com.novoda:bintray-release:0.2.7'
8+
classpath 'com.android.tools.build:gradle:1.3.1'
9+
classpath 'com.novoda:bintray-release:0.3.4'
1010
}
1111
}
1212

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip

library/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ android {
2525
compileSdkVersion 23
2626
buildToolsVersion '23.0.1'
2727

28-
lintOptions {
29-
abortOnError false
30-
}
31-
3228
defaultConfig {
3329
minSdkVersion 7
3430
targetSdkVersion 23
@@ -42,6 +38,10 @@ android {
4238
targetCompatibility JavaVersion.VERSION_1_7
4339
}
4440

41+
lintOptions {
42+
abortOnError false
43+
}
44+
4545
packagingOptions {
4646
exclude 'META-INF/LICENSE'
4747
exclude 'META-INF/LICENSE.txt'

library/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest package="com.devbrackets.android.recyclerext">
3+
34
<uses-sdk/>
45
<application/>
56
</manifest>

library/src/main/java/com/devbrackets/android/recyclerext/adapter/RecyclerCursorAdapter.java

+5-10
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
/**
3333
* A base cursor adapter for the RecyclerView
3434
*/
35-
public abstract class RecyclerCursorAdapter<VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> implements Filterable,
36-
CursorFilter.CursorFilterClient {
35+
public abstract class RecyclerCursorAdapter<VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> implements Filterable, CursorFilter.CursorFilterClient {
3736
protected static final String DEFAULT_ID_COLUMN_NAME = "_id";
3837

3938
protected Cursor cursor;
@@ -206,24 +205,22 @@ public CharSequence convertToString(Cursor cursor) {
206205
/**
207206
* Runs a query with the specified constraint. This query is requested
208207
* by the filter attached to this adapter.
209-
*
208+
* <p>
210209
* The query is provided by a
211210
* {@link android.widget.FilterQueryProvider}.
212211
* If no provider is specified, the current cursor is not filtered and returned.
213-
*
212+
* <p>
214213
* After this method returns the resulting cursor is passed to {@link #changeCursor(Cursor)}
215214
* and the previous cursor is closed.
216-
*
215+
* <p>
217216
* This method is always executed on a background thread, not on the
218217
* application's main thread (or UI thread.)
219-
*
218+
* <p>
220219
* Contract: when constraint is null or empty, the original results,
221220
* prior to any filtering, must be returned.
222221
*
223222
* @param constraint the constraint with which the query must be filtered
224-
*
225223
* @return a Cursor representing the results of the new query
226-
*
227224
* @see #getFilter()
228225
* @see #getFilterQueryProvider()
229226
* @see #setFilterQueryProvider(android.widget.FilterQueryProvider)
@@ -250,7 +247,6 @@ public Filter getFilter() {
250247
* provider is null, no filtering occurs.
251248
*
252249
* @return the current filter query provider or null if it does not exist
253-
*
254250
* @see #setFilterQueryProvider(android.widget.FilterQueryProvider)
255251
* @see #runQueryOnBackgroundThread(CharSequence)
256252
*/
@@ -267,7 +263,6 @@ public FilterQueryProvider getFilterQueryProvider() {
267263
* this adapter.
268264
*
269265
* @param provider the filter query provider or null to remove it
270-
*
271266
* @see #getFilterQueryProvider()
272267
* @see #runQueryOnBackgroundThread(CharSequence)
273268
*/

library/src/main/java/com/devbrackets/android/recyclerext/adapter/RecyclerHeaderAdapter.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ public void onBindViewHolder(ViewHolder holder, int position) {
5858
int childPosition = determineChildPosition(position);
5959

6060
if (viewType == VIEW_TYPE_CHILD) {
61-
onBindChildViewHolder((C)holder, childPosition);
61+
onBindChildViewHolder((C) holder, childPosition);
6262
} else if (viewType == VIEW_TYPE_HEADER) {
63-
onBindHeaderViewHolder((H)holder, childPosition);
63+
onBindHeaderViewHolder((H) holder, childPosition);
6464
holder.itemView.setTag(R.id.sticky_view_header_id, getHeaderId(childPosition));
6565
}
6666

@@ -69,7 +69,7 @@ public void onBindViewHolder(ViewHolder holder, int position) {
6969

7070
@Override
7171
public int getItemViewType(int position) {
72-
for (HeaderItem item: headerItems) {
72+
for (HeaderItem item : headerItems) {
7373
if (item.getViewPosition() == position) {
7474
return VIEW_TYPE_HEADER;
7575
} else if (item.getViewPosition() > position) {
@@ -94,7 +94,7 @@ public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
9494

9595
/**
9696
* Returns the total number of items in the data set hold by the adapter.
97-
* <br />
97+
* <p>
9898
* <b>NOTE:</b> {@link #getChildCount()} should be overridden instead of this method
9999
*
100100
* @return The total number of items in this adapter.
@@ -135,7 +135,7 @@ public long getHeaderId(int childPosition) {
135135
* Called to display the header information with the <code>firstChildPosition</code> being the
136136
* position of the first child after this header.
137137
*
138-
* @param holder The ViewHolder which should be updated
138+
* @param holder The ViewHolder which should be updated
139139
* @param firstChildPosition The position of the child immediately after this header
140140
*/
141141
public abstract void onBindHeaderViewHolder(H holder, int firstChildPosition);
@@ -144,7 +144,7 @@ public long getHeaderId(int childPosition) {
144144
* Called to display the child information with the <code>childPosition</code> being the
145145
* position of the child, excluding headers.
146146
*
147-
* @param holder The ViewHolder which should be updated
147+
* @param holder The ViewHolder which should be updated
148148
* @param childPosition The position of the child
149149
*/
150150
public abstract void onBindChildViewHolder(C holder, int childPosition);
@@ -164,7 +164,7 @@ public long getHeaderId(int childPosition) {
164164
*/
165165
public int determineChildPosition(int viewPosition) {
166166
int headerCount = 0;
167-
for (HeaderItem item: headerItems) {
167+
for (HeaderItem item : headerItems) {
168168
if (item.getViewPosition() < viewPosition) {
169169
headerCount++;
170170
} else {

library/src/main/java/com/devbrackets/android/recyclerext/adapter/RecyclerHeaderCursorAdapter.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void onBindViewHolder(ViewHolder holder, Cursor cursor, int position) {
7676

7777
Cursor c = getCursor(childPosition);
7878
if (viewType == VIEW_TYPE_CHILD) {
79-
onBindChildViewHolder((C)holder, c, childPosition);
79+
onBindChildViewHolder((C) holder, c, childPosition);
8080
} else if (viewType == VIEW_TYPE_HEADER) {
8181
onBindHeaderViewHolder((H) holder, c, childPosition);
8282
holder.itemView.setTag(R.id.sticky_view_header_id, getHeaderId(childPosition));
@@ -87,7 +87,7 @@ public void onBindViewHolder(ViewHolder holder, Cursor cursor, int position) {
8787

8888
@Override
8989
public int getItemViewType(int position) {
90-
for (HeaderItem item: headerItems) {
90+
for (HeaderItem item : headerItems) {
9191
if (item.getViewPosition() == position) {
9292
return VIEW_TYPE_HEADER;
9393
} else if (item.getViewPosition() > position) {
@@ -112,7 +112,7 @@ public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
112112

113113
/**
114114
* Returns the total number of items in the data set hold by the adapter.
115-
* <br />
115+
* <p>
116116
* <b>NOTE:</b> {@link #getChildCount()} should be overridden instead of this method
117117
*
118118
* @return The total number of items in this adapter.
@@ -154,6 +154,7 @@ public long getHeaderId(int childPosition) {
154154
* position of the first child after this header.
155155
*
156156
* @param holder The ViewHolder which should be updated
157+
* @param cursor The cursor representing the first child for the header
157158
* @param firstChildPosition The position of the child immediately after this header
158159
*/
159160
public abstract void onBindHeaderViewHolder(H holder, Cursor cursor, int firstChildPosition);
@@ -163,6 +164,7 @@ public long getHeaderId(int childPosition) {
163164
* position of the child, excluding headers.
164165
*
165166
* @param holder The ViewHolder which should be updated
167+
* @param cursor The cursor representing child to bind
166168
* @param childPosition The position of the child
167169
*/
168170
public abstract void onBindChildViewHolder(C holder, Cursor cursor, int childPosition);
@@ -188,7 +190,7 @@ public int getChildCount() {
188190
*/
189191
public int determineChildPosition(int viewPosition) {
190192
int headerCount = 0;
191-
for (HeaderItem item: headerItems) {
193+
for (HeaderItem item : headerItems) {
192194
if (item.getViewPosition() < viewPosition) {
193195
headerCount++;
194196
} else {

library/src/main/java/com/devbrackets/android/recyclerext/adapter/RecyclerListAdapter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* A basic adapter with support for lists to simplify integrations.
1313
*
1414
* @param <VH> The ViewHolder to use
15-
* @param <T> The object type for the list
15+
* @param <T> The object type for the list
1616
*/
1717
public abstract class RecyclerListAdapter<VH extends RecyclerView.ViewHolder, T> extends RecyclerView.Adapter<VH> {
1818

@@ -105,7 +105,7 @@ public void add(T item) {
105105
* Adds the specified item to the list with the specified position
106106
*
107107
* @param position The position to insert the item at
108-
* @param item The item to add to the list
108+
* @param item The item to add to the list
109109
*/
110110
public void add(int position, T item) {
111111
synchronized (lock) {

library/src/main/java/com/devbrackets/android/recyclerext/adapter/ReorderableRecyclerCursorAdapter.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void changeCursor(Cursor newCursor) {
6868
* no ReorderItem will be added to the cache
6969
*
7070
* @param originalPosition The original position of the item
71-
* @param newPosition The new position for the item
71+
* @param newPosition The new position for the item
7272
*/
7373
public void reorderItem(int originalPosition, int newPosition) {
7474
//Make sure the positions aren't the same
@@ -86,11 +86,11 @@ public void reorderItem(int originalPosition, int newPosition) {
8686
//Iterates through the items that will be effected and changes their positions
8787
if (originalPosition > newPosition) {
8888
for (int i = originalPosition; i > newPosition; i--) {
89-
cursorPositionMap.put(i, cursorPositionMap.get(i -1, i -1));
89+
cursorPositionMap.put(i, cursorPositionMap.get(i - 1, i - 1));
9090
}
9191
} else {
9292
for (int i = originalPosition; i < newPosition; i++) {
93-
cursorPositionMap.put(i, cursorPositionMap.get(i +1, i +1));
93+
cursorPositionMap.put(i, cursorPositionMap.get(i + 1, i + 1));
9494
}
9595
}
9696

@@ -159,7 +159,7 @@ private void cleanMap() {
159159
}
160160

161161
//Actually removes the items
162-
for (int i: removeList) {
162+
for (int i : removeList) {
163163
cursorPositionMap.delete(i);
164164
}
165165
}

library/src/main/java/com/devbrackets/android/recyclerext/decoration/ReorderDecoration.java

+18-18
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public interface ReorderListener {
5858
* Called when the user drag event ends, informing the listener of the changed position
5959
*
6060
* @param originalPosition The position the dragged view started at
61-
* @param newPosition The position the dragged view should be saved as
61+
* @param newPosition The position the dragged view should be saved as
6262
*/
6363
void onItemReordered(int originalPosition, int newPosition);
6464

@@ -67,7 +67,7 @@ public interface ReorderListener {
6767
* actually updating the backing data structure (e.g. calling swap on a {@link com.devbrackets.android.recyclerext.adapter.RecyclerCursorAdapter})
6868
*
6969
* @param originalPosition The position the dragged view started at
70-
* @param newPosition The position the dragged view should be saved as
70+
* @param newPosition The position the dragged view should be saved as
7171
*/
7272
void onItemPostReordered(int originalPosition, int newPosition);
7373
}
@@ -138,8 +138,8 @@ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, Recycle
138138

139139
/**
140140
* This will determine two things.
141-
* 1. If we need to handle the touch event
142-
* 2. If reordering needs to start due to dragHandle being clicked
141+
* 1. If we need to handle the touch event
142+
* 2. If reordering needs to start due to dragHandle being clicked
143143
*/
144144
@Override
145145
public boolean onInterceptTouchEvent(RecyclerView recyclerView, MotionEvent event) {
@@ -335,7 +335,7 @@ public LayoutOrientation getOrientation() {
335335
* Manually starts the reorder process for the specified view. This should not be used if the {@link #setDragHandleId(int)} is
336336
* set and should control the reordering.
337337
*
338-
* @param view The View to start reordering
338+
* @param view The View to start reordering
339339
* @param startMotionEvent The MotionEvent that starts the reorder
340340
*/
341341
public void startReorder(View view, @Nullable MotionEvent startMotionEvent) {
@@ -453,7 +453,7 @@ public int calculateNewPosition() {
453453
* top when Vertical and left when Horizontal.
454454
*
455455
* @param childPosition The position of the view in the RecyclerView
456-
* @param draggedUp True if the view has been moved up or to the left
456+
* @param draggedUp True if the view has been moved up or to the left
457457
*/
458458
private void updateNewViewStart(int childPosition, boolean draggedUp) {
459459
View view = recyclerView.getLayoutManager().getChildAt(childPosition);
@@ -481,10 +481,10 @@ private void updateFloatingItemCenter() {
481481
* This happens when the dragging view starts above the <code>view</code> and has been dragged
482482
* below it, or vice versa.
483483
*
484-
* @param view The view to compare with the dragging items current and original positions
484+
* @param view The view to compare with the dragging items current and original positions
485485
* @param itemPosition The position for the <code>view</code>
486-
* @param middle The center of the floating item
487-
* @param outRect The {@link Rect} to update the position in
486+
* @param middle The center of the floating item
487+
* @param outRect The {@link Rect} to update the position in
488488
*/
489489
private void setVerticalOffsets(View view, int itemPosition, PointF middle, Rect outRect) {
490490
if (orientation == LayoutOrientation.HORIZONTAL) {
@@ -515,10 +515,10 @@ private void setVerticalOffsets(View view, int itemPosition, PointF middle, Rect
515515
* This happens when the dragging view starts before the <code>view</code> and has been dragged
516516
* after it, or vice versa.
517517
*
518-
* @param view The view to compare with the dragging items current and original positions
518+
* @param view The view to compare with the dragging items current and original positions
519519
* @param itemPosition The position for the <code>view</code>
520-
* @param middle The center of the floating item
521-
* @param outRect The {@link Rect} to update the position in
520+
* @param middle The center of the floating item
521+
* @param outRect The {@link Rect} to update the position in
522522
*/
523523
private void setHorizontalOffsets(View view, int itemPosition, PointF middle, Rect outRect) {
524524
if (orientation == LayoutOrientation.VERTICAL) {
@@ -597,20 +597,20 @@ private void performHorizontalEdgeScroll(PointF fingerPosition) {
597597
* view being dragged.
598598
*
599599
* @param fingerPosition The current position of the dragging finger
600-
* @param viewMiddle The center of the view being dragged
600+
* @param viewMiddle The center of the view being dragged
601601
*/
602602
private void updateVerticalBounds(PointF fingerPosition, PointF viewMiddle) {
603603
if (orientation == LayoutOrientation.HORIZONTAL) {
604604
return;
605605
}
606606

607-
floatingItemBounds.top = (int)fingerPosition.y;
607+
floatingItemBounds.top = (int) fingerPosition.y;
608608
if (fingerOffset != null) {
609609
floatingItemBounds.top += fingerOffset.y;
610610
}
611611

612612
if (floatingItemBounds.top < -viewMiddle.y) {
613-
floatingItemBounds.top = -(int)viewMiddle.y;
613+
floatingItemBounds.top = -(int) viewMiddle.y;
614614
}
615615

616616
floatingItemBounds.bottom = floatingItemBounds.top + floatingItemStartingBounds.height();
@@ -621,20 +621,20 @@ private void updateVerticalBounds(PointF fingerPosition, PointF viewMiddle) {
621621
* view being dragged.
622622
*
623623
* @param fingerPosition The current position of the dragging finger
624-
* @param viewMiddle The center of the view being dragged
624+
* @param viewMiddle The center of the view being dragged
625625
*/
626626
private void updateHorizontalBounds(PointF fingerPosition, PointF viewMiddle) {
627627
if (orientation == LayoutOrientation.VERTICAL) {
628628
return;
629629
}
630630

631-
floatingItemBounds.left = (int)fingerPosition.x;
631+
floatingItemBounds.left = (int) fingerPosition.x;
632632
if (fingerOffset != null) {
633633
floatingItemBounds.left += fingerOffset.x;
634634
}
635635

636636
if (floatingItemBounds.left < -viewMiddle.x) {
637-
floatingItemBounds.left = -(int)viewMiddle.x;
637+
floatingItemBounds.left = -(int) viewMiddle.x;
638638
}
639639

640640
floatingItemBounds.right = floatingItemBounds.left + floatingItemStartingBounds.width();

0 commit comments

Comments
 (0)