use of android.support.annotation.Nullable in project cw-omnibus by commonsguy.
the class DetailsFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View result = inflater.inflate(R.layout.details, container, false);
webView = (WebView) result.findViewById(R.id.webview);
flag = (ImageView) result.findViewById(R.id.flag);
toolbar = (Toolbar) result.findViewById(R.id.toolbar);
if (toolbar == null) {
setHasOptionsMenu(true);
} else {
toolbar.inflateMenu(R.menu.webview);
getNavItems(toolbar.getMenu());
toolbar.setOnMenuItemClickListener(this);
}
return (result);
}
use of android.support.annotation.Nullable in project PhotoPicker by donglua.
the class ImagePagerFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.__picker_picker_fragment_image_pager, container, false);
mViewPager = (ViewPager) rootView.findViewById(R.id.vp_photos);
mViewPager.setAdapter(mPagerAdapter);
mViewPager.setCurrentItem(currentItem);
mViewPager.setOffscreenPageLimit(5);
// we're recreated automatically by the window manager (e.g., device rotation)
if (savedInstanceState == null && hasAnim) {
ViewTreeObserver observer = mViewPager.getViewTreeObserver();
observer.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
mViewPager.getViewTreeObserver().removeOnPreDrawListener(this);
// Figure out where the thumbnail and full size versions are, relative
// to the screen and each other
int[] screenLocation = new int[2];
mViewPager.getLocationOnScreen(screenLocation);
thumbnailLeft = thumbnailLeft - screenLocation[0];
thumbnailTop = thumbnailTop - screenLocation[1];
runEnterAnimation();
return true;
}
});
}
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
hasAnim = currentItem == position;
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
return rootView;
}
use of android.support.annotation.Nullable in project VideoPlayerManager by danylovolokh.
the class VideoPlayerManagerFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.video_player_manager_fragment, container, false);
try {
mVideoFileDecriptor_sample_1 = getActivity().getAssets().openFd("video_sample_1.mp4");
mVideoFileDecriptor_sample_2 = getActivity().getAssets().openFd("video_sample_2.mp4");
} catch (IOException e) {
e.printStackTrace();
}
mVideoPlayer_1 = (VideoPlayerView) root.findViewById(R.id.video_player_1);
mVideoPlayer_1.addMediaPlayerListener(new SimpleMainThreadMediaPlayerListener() {
@Override
public void onVideoPreparedMainThread() {
// We hide the cover when video is prepared. Playback is about to start
mVideoCover.setVisibility(View.INVISIBLE);
}
@Override
public void onVideoStoppedMainThread() {
// We show the cover when video is stopped
mVideoCover.setVisibility(View.VISIBLE);
}
@Override
public void onVideoCompletionMainThread() {
// We show the cover when video is completed
mVideoCover.setVisibility(View.VISIBLE);
}
});
mVideoCover = (ImageView) root.findViewById(R.id.video_cover_1);
mVideoCover.setOnClickListener(this);
mVideoPlayer_2 = (VideoPlayerView) root.findViewById(R.id.video_player_2);
mVideoPlayer_2.addMediaPlayerListener(new SimpleMainThreadMediaPlayerListener() {
@Override
public void onVideoPreparedMainThread() {
// We hide the cover when video is prepared. Playback is about to start
mVideoCover2.setVisibility(View.INVISIBLE);
}
@Override
public void onVideoStoppedMainThread() {
// We show the cover when video is stopped
mVideoCover2.setVisibility(View.VISIBLE);
}
@Override
public void onVideoCompletionMainThread() {
// We show the cover when video is completed
mVideoCover2.setVisibility(View.VISIBLE);
}
});
mVideoCover2 = (ImageView) root.findViewById(R.id.video_cover_2);
mVideoCover2.setOnClickListener(this);
Picasso.with(getActivity()).load(R.drawable.video_sample_1_pic).into(mVideoCover);
Picasso.with(getActivity()).load(R.drawable.video_sample_2_pic).into(mVideoCover2);
return root;
}
use of android.support.annotation.Nullable in project android-job by evernote.
the class WakeLockUtil method acquireWakeLock.
@Nullable
public static PowerManager.WakeLock acquireWakeLock(@NonNull Context context, @NonNull String tag, long timeoutMillis) {
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, tag);
wakeLock.setReferenceCounted(false);
return acquireWakeLock(context, wakeLock, timeoutMillis) ? wakeLock : null;
}
use of android.support.annotation.Nullable in project Rajawali by Rajawali.
the class ExamplesFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_examples, container, false);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(adapter);
return view;
}
Aggregations