Skip to content

Commit

Permalink
Convert fbandroid/libraries/fresco/drawee/src/m/j/c/f/drawee/drawable…
Browse files Browse the repository at this point in the history
…/DrawableParent to Kotlin

Reviewed By: kartavya-ramnani

Differential Revision: D62498402

fbshipit-source-id: 2e58ff29953cf52abda9e3182adc3e585963e905
  • Loading branch information
steelrooter authored and facebook-github-bot committed Sep 12, 2024
1 parent 9589fa4 commit 5b4b73c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,15 @@ public DrawableParent getDrawableParentForIndex(int index) {

private DrawableParent createDrawableParentForIndex(final int index) {
return new DrawableParent() {
@Nullable
@Override
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
public Drawable setDrawable(Drawable newDrawable) {
// NULLSAFE_FIXME[Return Not Nullable]
public Drawable setDrawable(@Nullable Drawable newDrawable) {
return ArrayDrawable.this.setDrawable(index, newDrawable);
}

@Nullable
@Override
public Drawable getDrawable() {
// NULLSAFE_FIXME[Return Not Nullable]
return ArrayDrawable.this.getDrawable(index);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,25 @@
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.drawee.drawable;
package com.facebook.drawee.drawable

import android.graphics.drawable.Drawable;
import com.facebook.infer.annotation.Nullsafe;
import javax.annotation.Nullable;
import android.graphics.drawable.Drawable

/** A drawable parent that has a single child. */
@Nullsafe(Nullsafe.Mode.LOCAL)
public interface DrawableParent {
interface DrawableParent {

/**
* Sets the new child drawable.
*
* @param newDrawable a new child drawable to set
* @return the old child drawable
*/
@Nullable
Drawable setDrawable(@Nullable Drawable newDrawable);
fun setDrawable(newDrawable: Drawable?): Drawable?

/**
* Gets the child drawable.
*
* @return the current child drawable
*/
@Nullable
Drawable getDrawable();
val drawable: Drawable?
}

0 comments on commit 5b4b73c

Please sign in to comment.