Search in sources :

Example 61 with Nullable

use of android.support.annotation.Nullable in project PermissionsDispatcher by hotchemi.

the class ContactsFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_contacts, container, false);
    mMessageText = (TextView) rootView.findViewById(R.id.contact_message);
    // Register a listener to add a dummy contact when a button is clicked.
    Button button = (Button) rootView.findViewById(R.id.contact_add);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            insertDummyContact();
        }
    });
    // Register a listener to display the first contact when a button is clicked.
    button = (Button) rootView.findViewById(R.id.contact_load);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            loadContact();
        }
    });
    return rootView;
}
Also used : Button(android.widget.Button) TextView(android.widget.TextView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 62 with Nullable

use of android.support.annotation.Nullable in project MaterialIntroView by iammert.

the class FocusFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_focus, container, false);
    button1 = (Button) view.findViewById(R.id.button_focus_1);
    button2 = (Button) view.findViewById(R.id.button_focus_2);
    button3 = (Button) view.findViewById(R.id.button_focus_3);
    showIntro(button1, INTRO_FOCUS_1, "This intro view focus on all target.", Focus.ALL);
    return view;
}
Also used : View(android.view.View) MaterialIntroView(co.mobiwise.materialintro.view.MaterialIntroView) Nullable(android.support.annotation.Nullable)

Example 63 with Nullable

use of android.support.annotation.Nullable in project nmid-headline by miao1007.

the class WebViewFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.activity_detailed, container, false);
    ButterKnife.inject(this, view);
    return view;
}
Also used : InjectView(butterknife.InjectView) View(android.view.View) WebView(android.webkit.WebView) Nullable(android.support.annotation.Nullable)

Example 64 with Nullable

use of android.support.annotation.Nullable in project FastAdapter by mikepenz.

the class FastAdapterDiffUtil method set.

public static <A extends ItemAdapter<Item>, Item extends IItem> A set(final A adapter, final List<Item> items, final DiffCallback<Item> callback, final boolean detectMoves) {
    if (adapter.isUseIdDistributor()) {
        IdDistributor.checkIds(items);
    }
    //first collapse all items
    adapter.getFastAdapter().collapse(false);
    //if we have a comparator then sort
    if (adapter.getComparator() != null) {
        Collections.sort(items, adapter.getComparator());
    }
    //map the types
    adapter.mapPossibleTypes(items);
    //remember the old items
    final List<Item> oldItems = adapter.getAdapterItems();
    DiffUtil.DiffResult result = DiffUtil.calculateDiff(new DiffUtil.Callback() {

        @Override
        public int getOldListSize() {
            return oldItems.size();
        }

        @Override
        public int getNewListSize() {
            return items.size();
        }

        @Override
        public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
            return callback.areItemsTheSame(oldItems.get(oldItemPosition), items.get(newItemPosition));
        }

        @Override
        public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
            return callback.areContentsTheSame(oldItems.get(oldItemPosition), items.get(newItemPosition));
        }

        @Nullable
        @Override
        public Object getChangePayload(int oldItemPosition, int newItemPosition) {
            Object result = callback.getChangePayload(oldItems.get(oldItemPosition), oldItemPosition, items.get(newItemPosition), newItemPosition);
            return result == null ? super.getChangePayload(oldItemPosition, newItemPosition) : result;
        }
    }, detectMoves);
    //make sure the new items list is not a reference of the already mItems list
    if (items != oldItems) {
        //remove all previous items
        if (!oldItems.isEmpty()) {
            oldItems.clear();
        }
        //add all new items to the list
        oldItems.addAll(items);
    }
    result.dispatchUpdatesTo(new ListUpdateCallback() {

        @Override
        public void onInserted(int position, int count) {
            adapter.getFastAdapter().notifyAdapterItemRangeInserted(adapter.getFastAdapter().getPreItemCountByOrder(adapter.getOrder()) + position, count);
        }

        @Override
        public void onRemoved(int position, int count) {
            adapter.getFastAdapter().notifyAdapterItemRangeRemoved(adapter.getFastAdapter().getPreItemCountByOrder(adapter.getOrder()) + position, count);
        }

        @Override
        public void onMoved(int fromPosition, int toPosition) {
            adapter.getFastAdapter().notifyAdapterItemMoved(adapter.getFastAdapter().getPreItemCountByOrder(adapter.getOrder()) + fromPosition, toPosition);
        }

        @Override
        public void onChanged(int position, int count, Object payload) {
            adapter.getFastAdapter().notifyAdapterItemRangeChanged(adapter.getFastAdapter().getPreItemCountByOrder(adapter.getOrder()) + position, count, payload);
        }
    });
    return adapter;
}
Also used : IItem(com.mikepenz.fastadapter.IItem) ListUpdateCallback(android.support.v7.util.ListUpdateCallback) DiffUtil(android.support.v7.util.DiffUtil) Nullable(android.support.annotation.Nullable)

Example 65 with Nullable

use of android.support.annotation.Nullable in project k-9 by k9mail.

the class AttachmentInfoExtractor method getDecryptedFileProviderUri.

@Nullable
@VisibleForTesting
protected Uri getDecryptedFileProviderUri(DeferredFileBody decryptedTempFileBody, String mimeType) {
    Uri uri;
    try {
        File file = decryptedTempFileBody.getFile();
        uri = DecryptedFileProvider.getUriForProvidedFile(context, file, decryptedTempFileBody.getEncoding(), mimeType);
    } catch (IOException e) {
        Timber.e(e, "Decrypted temp file (no longer?) exists!");
        uri = null;
    }
    return uri;
}
Also used : IOException(java.io.IOException) Uri(android.net.Uri) File(java.io.File) VisibleForTesting(android.support.annotation.VisibleForTesting) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)582 View (android.view.View)315 TextView (android.widget.TextView)163 RecyclerView (android.support.v7.widget.RecyclerView)85 BindView (butterknife.BindView)57 ImageView (android.widget.ImageView)52 ArrayList (java.util.ArrayList)43 IOException (java.io.IOException)36 Bundle (android.os.Bundle)35 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)35 Intent (android.content.Intent)32 ViewGroup (android.view.ViewGroup)32 Cursor (android.database.Cursor)29 Uri (android.net.Uri)27 File (java.io.File)24 AdapterView (android.widget.AdapterView)22 List (java.util.List)20 NonNull (android.support.annotation.NonNull)19 Context (android.content.Context)15 Bitmap (android.graphics.Bitmap)15