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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations