本文整理了Java中androidx.annotation.NonNull.<init>()
方法的一些代码示例,展示了NonNull.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NonNull.<init>()
方法的具体详情如下:
包路径:androidx.annotation.NonNull
类名称:NonNull
方法名:<init>
暂无
代码示例来源:origin: airbnb/lottie-android
@Override
public void setTextLocales(@NonNull LocaleList locales) {
// Do nothing.
}
}
代码示例来源:origin: JakeWharton/butterknife
/**
* BindView annotated fields and methods in the specified {@code target} using the {@code source}
* {@link Activity} as the view root.
*
* @param target Target class for view binding.
* @param source Activity on which IDs will be looked up.
*/
@NonNull @UiThread
public static Unbinder bind(@NonNull Object target, @NonNull Activity source) {
View sourceView = source.getWindow().getDecorView();
return bind(target, sourceView);
}
代码示例来源:origin: JakeWharton/butterknife
/**
* BindView annotated fields and methods in the specified {@link View}. The view and its children
* are used as the view root.
*
* @param target Target view for view binding.
*/
@NonNull @UiThread
public static Unbinder bind(@NonNull View target) {
return bind(target, target);
}
代码示例来源:origin: JakeWharton/butterknife
/**
* BindView annotated fields and methods in the specified {@link View}. The view and its children
* are used as the view root.
*
* @param target Target view for view binding.
*/
@NonNull @UiThread
public static Unbinder bind(@NonNull View target) {
return bind(target, target);
}
代码示例来源:origin: JakeWharton/butterknife
/**
* BindView annotated fields and methods in the specified {@link Activity}. The current content
* view is used as the view root.
*
* @param target Target activity for view binding.
*/
@NonNull @UiThread
public static Unbinder bind(@NonNull Activity target) {
View sourceView = target.getWindow().getDecorView();
return bind(target, sourceView);
}
代码示例来源:origin: JakeWharton/butterknife
/**
* BindView annotated fields and methods in the specified {@link Dialog}. The current content
* view is used as the view root.
*
* @param target Target dialog for view binding.
*/
@NonNull @UiThread
public static Unbinder bind(@NonNull Dialog target) {
View sourceView = target.getWindow().getDecorView();
return bind(target, sourceView);
}
代码示例来源:origin: PhilJay/MPAndroidChart
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == PERMISSION_STORAGE) {
if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
saveToGallery();
} else {
Toast.makeText(getApplicationContext(), "Saving FAILED!", Toast.LENGTH_SHORT)
.show();
}
}
}
代码示例来源:origin: PhilJay/MPAndroidChart
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
tf = Typeface.createFromAsset(context.getAssets(), "OpenSans-Regular.ttf");
return super.onCreateView(inflater, container, savedInstanceState);
}
代码示例来源:origin: JakeWharton/butterknife
/** Set the {@code value} using the specified {@code setter} across the {@code list} of views. */
@UiThread
public static <T extends View, V> void set(@NonNull List<T> list,
@NonNull Setter<? super T, V> setter, @Nullable V value) {
for (int i = 0, count = list.size(); i < count; i++) {
setter.set(list.get(i), value, i);
}
}
代码示例来源:origin: JakeWharton/butterknife
/**
* Apply the specified {@code value} across the {@code array} of views using the {@code property}.
*/
@UiThread
public static <T extends View, V> void set(@NonNull T[] array,
@NonNull Property<? super T, V> setter, @Nullable V value) {
//noinspection ForLoopReplaceableByForEach
for (int i = 0, count = array.length; i < count; i++) {
setter.set(array[i], value);
}
}
代码示例来源:origin: JakeWharton/butterknife
/** Apply the specified {@code actions} across the {@code list} of views. */
@UiThread
@SafeVarargs public static <T extends View> void run(@NonNull List<T> list,
@NonNull Action<? super T>... actions) {
for (int i = 0, count = list.size(); i < count; i++) {
for (Action<? super T> action : actions) {
action.apply(list.get(i), i);
}
}
}
代码示例来源:origin: JakeWharton/butterknife
/** Apply the specified {@code actions} across the {@code array} of views. */
@UiThread
@SafeVarargs public static <T extends View> void run(@NonNull T[] array,
@NonNull Action<? super T>... actions) {
for (int i = 0, count = array.length; i < count; i++) {
for (Action<? super T> action : actions) {
action.apply(array[i], i);
}
}
}
代码示例来源:origin: JakeWharton/butterknife
/** Apply the specified {@code action} across the {@code list} of views. */
@UiThread
public static <T extends View> void run(@NonNull List<T> list,
@NonNull Action<? super T> action) {
for (int i = 0, count = list.size(); i < count; i++) {
action.apply(list.get(i), i);
}
}
代码示例来源:origin: JakeWharton/butterknife
/** Apply {@code action} to {@code view}. */
@UiThread
public static <T extends View> void run(@NonNull T view, @NonNull Action<? super T> action) {
action.apply(view, 0);
}
代码示例来源:origin: JakeWharton/butterknife
/** Apply {@code value} to {@code view} using {@code property}. */
@UiThread
public static <T extends View, V> void set(@NonNull T view,
@NonNull Property<? super T, V> setter, @Nullable V value) {
setter.set(view, value);
}
代码示例来源:origin: airbnb/lottie-android
@Override public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
Callback callback = getCallback();
if (callback == null) {
return;
}
callback.scheduleDrawable(this, what, when);
}
代码示例来源:origin: airbnb/lottie-android
@Override public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
Callback callback = getCallback();
if (callback == null) {
return;
}
callback.unscheduleDrawable(this, what);
}
代码示例来源:origin: airbnb/lottie-android
/**
* If the composition is larger than the canvas, we have to use a different method to scale it up.
* See the comments in {@link #draw(Canvas)} for more info.
*/
private float getMaxScale(@NonNull Canvas canvas) {
float maxScaleX = canvas.getWidth() / (float) composition.getBounds().width();
float maxScaleY = canvas.getHeight() / (float) composition.getBounds().height();
return Math.min(maxScaleX, maxScaleY);
}
代码示例来源:origin: PhilJay/MPAndroidChart
@NonNull
@Override
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
//noinspection ConstantConditions
return getItem(position).getView(position, convertView, getContext());
}
代码示例来源:origin: airbnb/lottie-android
@Override public void invalidateDrawable(@NonNull Drawable dr) {
if (getDrawable() == lottieDrawable) {
// We always want to invalidate the root drawable so it redraws the whole drawable.
// Eventually it would be great to be able to invalidate just the changed region.
super.invalidateDrawable(lottieDrawable);
} else {
// Otherwise work as regular ImageView
super.invalidateDrawable(dr);
}
}
内容来源于网络,如有侵权,请联系作者删除!