@@ -42,7 +42,6 @@ public abstract class CustomViewTarget<T extends View, Z> implements Target<Z> {
42
42
@ Nullable private OnAttachStateChangeListener attachStateListener ;
43
43
private boolean isClearedByUs ;
44
44
private boolean isAttachStateListenerAdded ;
45
- @ IdRes private int overrideTag ;
46
45
47
46
/** Constructor that defaults {@code waitForLayout} to {@code false}. */
48
47
public CustomViewTarget (@ NonNull T view ) {
@@ -162,14 +161,14 @@ public void onViewDetachedFromWindow(View v) {
162
161
* the same view, for example one foreground and one background view.
163
162
*
164
163
* @param tagId The android resource id to use.
164
+ * @deprecated Using this method prevents clearing the target from working properly. Glide uses
165
+ * its own internal tag id so this method should not be necessary. This method is currently a
166
+ * no-op.
165
167
*/
166
168
// Public API.
167
169
@ SuppressWarnings ({"UnusedReturnValue" , "WeakerAccess" })
170
+ @ Deprecated
168
171
public final CustomViewTarget <T , Z > useTagId (@ IdRes int tagId ) {
169
- if (this .overrideTag != 0 ) {
170
- throw new IllegalArgumentException ("You cannot change the tag id once it has been set." );
171
- }
172
- this .overrideTag = tagId ;
173
172
return this ;
174
173
}
175
174
@@ -265,12 +264,12 @@ final void pauseMyRequest() {
265
264
}
266
265
267
266
private void setTag (@ Nullable Object tag ) {
268
- view .setTag (overrideTag == 0 ? VIEW_TAG_ID : overrideTag , tag );
267
+ view .setTag (VIEW_TAG_ID , tag );
269
268
}
270
269
271
270
@ Nullable
272
271
private Object getTag () {
273
- return view .getTag (overrideTag == 0 ? VIEW_TAG_ID : overrideTag );
272
+ return view .getTag (VIEW_TAG_ID );
274
273
}
275
274
276
275
private void maybeAddAttachStateListener () {
0 commit comments