/** * Constructor that defaults {@code waitForLayout} to {@code false}. */ public ViewTarget(@NonNull T view) { this.view = Preconditions.checkNotNull(view); sizeDeterminer = new SizeDeterminer(view); }
public ViewTarget(T view) { if (view == null) { throw new NullPointerException("View must not be null!"); } this.view = view; sizeDeterminer = new SizeDeterminer(view); }
/** * @param waitForLayout If set to {@code true}, Glide will always wait for any pending layout pass * before checking for the size a View. If set to {@code false} Glide will only wait for a pending * layout pass if it's unable to resolve the size from layout parameters or an existing View size. * Because setting this parameter to {@code true} forces Glide to wait for the layout pass to * occur before starting the load, setting this parameter to {@code true} can cause flashing in * some cases and should be used sparingly. If layout parameters are set to fixed sizes, they will * still be used instead of the View's dimensions even if this parameter is set to {@code true}. * This parameter is a fallback only. */ public ViewTarget(T view, boolean waitForLayout) { this.view = Preconditions.checkNotNull(view); sizeDeterminer = new SizeDeterminer(view, waitForLayout); }