Search in sources :

Example 16 with Nullable

use of androidx.annotation.Nullable in project CloudReader by youlookwhat.

the class BaseFragment method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View inflate = inflater.inflate(R.layout.fragment_base, null);
    bindingView = DataBindingUtil.inflate(activity.getLayoutInflater(), setContent(), null, false);
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    bindingView.getRoot().setLayoutParams(params);
    RelativeLayout mContainer = inflate.findViewById(R.id.container);
    mContainer.addView(bindingView.getRoot());
    bindingView.getRoot().setVisibility(View.GONE);
    return inflate;
}
Also used : RelativeLayout(android.widget.RelativeLayout) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Nullable(androidx.annotation.Nullable)

Example 17 with Nullable

use of androidx.annotation.Nullable in project Parse-SDK-Android by ParsePlatform.

the class ParseObject method getList.

/**
 * Access a {@link List} value.
 *
 * @param key The key to access the value for
 * @return {@code null} if there is no such key or if the value can't be converted to a {@link
 *     List}.
 */
@Nullable
public <T> List<T> getList(String key) {
    synchronized (mutex) {
        Object value = estimatedData.get(key);
        if (!(value instanceof List)) {
            return null;
        }
        @SuppressWarnings("unchecked") List<T> returnValue = (List<T>) value;
        return returnValue;
    }
}
Also used : JSONObject(org.json.JSONObject) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(java.util.List) Nullable(androidx.annotation.Nullable)

Example 18 with Nullable

use of androidx.annotation.Nullable in project Parse-SDK-Android by ParsePlatform.

the class ParseObject method getParsePolygon.

/**
 * Access a {@link ParsePolygon} value.
 *
 * @param key The key to access the value for
 * @return {@code null} if there is no such key or if it is not a {@link ParsePolygon}.
 */
@Nullable
public ParsePolygon getParsePolygon(@NonNull String key) {
    synchronized (mutex) {
        checkGetAccess(key);
        Object value = estimatedData.get(key);
        if (!(value instanceof ParsePolygon)) {
            return null;
        }
        return (ParsePolygon) value;
    }
}
Also used : JSONObject(org.json.JSONObject) Nullable(androidx.annotation.Nullable)

Example 19 with Nullable

use of androidx.annotation.Nullable in project Parse-SDK-Android by ParsePlatform.

the class ParseObject method get.

/**
 * Access a value. In most cases it is more convenient to use a helper function such as {@link
 * #getString(String)} or {@link #getInt(String)}.
 *
 * @param key The key to access the value for.
 * @return {@code null} if there is no such key.
 */
@Nullable
public Object get(@NonNull String key) {
    synchronized (mutex) {
        if (key.equals(KEY_ACL)) {
            return getACL();
        }
        checkGetAccess(key);
        Object value = estimatedData.get(key);
        // Either way, make sure it's consistent.
        if (value instanceof ParseRelation) {
            ((ParseRelation<?>) value).ensureParentAndKey(this, key);
        }
        return value;
    }
}
Also used : JSONObject(org.json.JSONObject) Nullable(androidx.annotation.Nullable)

Example 20 with Nullable

use of androidx.annotation.Nullable in project CloudReader by youlookwhat.

the class BaseHeaderActivity method setImgHeaderBg.

/**
 * 加载titlebar背景
 */
private void setImgHeaderBg(String imgUrl) {
    if (!TextUtils.isEmpty(imgUrl)) {
        // 高斯模糊背景 原来 参数:12,5  23,4
        Glide.with(this).load(imgUrl).error(R.drawable.stackblur_default).transform(new BlurTransformation(40, 8)).listener(new RequestListener<Drawable>() {

            @Override
            public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                return false;
            }

            @Override
            public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                bindingTitleView.tbBaseTitle.setBackgroundColor(Color.TRANSPARENT);
                bindingTitleView.ivBaseTitlebarBg.setImageAlpha(0);
                bindingTitleView.ivBaseTitlebarBg.setVisibility(View.VISIBLE);
                return false;
            }
        }).into(bindingTitleView.ivBaseTitlebarBg);
    }
}
Also used : BlurTransformation(jp.wasabeef.glide.transformations.BlurTransformation) Target(com.bumptech.glide.request.target.Target) RequestListener(com.bumptech.glide.request.RequestListener) AnimationDrawable(android.graphics.drawable.AnimationDrawable) Drawable(android.graphics.drawable.Drawable) GlideException(com.bumptech.glide.load.engine.GlideException) Nullable(androidx.annotation.Nullable) DataSource(com.bumptech.glide.load.DataSource)

Aggregations

Nullable (androidx.annotation.Nullable)1206 View (android.view.View)207 Bundle (android.os.Bundle)118 IOException (java.io.IOException)106 ArrayList (java.util.ArrayList)104 TextView (android.widget.TextView)102 NonNull (androidx.annotation.NonNull)101 Context (android.content.Context)95 Cursor (android.database.Cursor)78 SuppressLint (android.annotation.SuppressLint)74 Uri (android.net.Uri)69 RecyclerView (androidx.recyclerview.widget.RecyclerView)64 List (java.util.List)63 ViewGroup (android.view.ViewGroup)60 Intent (android.content.Intent)58 Test (org.junit.Test)55 Recipient (org.thoughtcrime.securesms.recipients.Recipient)52 LayoutInflater (android.view.LayoutInflater)48 R (org.thoughtcrime.securesms.R)46 ImageView (android.widget.ImageView)45