Search in sources :

Example 1 with Nullable

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);
}
Also used : ImageView(android.widget.ImageView) View(android.view.View) WebView(android.webkit.WebView) Nullable(android.support.annotation.Nullable)

Example 2 with Nullable

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;
}
Also used : View(android.view.View) ViewTreeObserver(android.view.ViewTreeObserver) ViewPager(android.support.v4.view.ViewPager) Nullable(android.support.annotation.Nullable)

Example 3 with Nullable

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;
}
Also used : SimpleMainThreadMediaPlayerListener(com.volokh.danylo.video_player_manager.ui.SimpleMainThreadMediaPlayerListener) IOException(java.io.IOException) ImageView(android.widget.ImageView) VideoPlayerView(com.volokh.danylo.video_player_manager.ui.VideoPlayerView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 4 with Nullable

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;
}
Also used : PowerManager(android.os.PowerManager) Nullable(android.support.annotation.Nullable)

Example 5 with Nullable

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;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) SearchView(android.support.v7.widget.SearchView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)477 View (android.view.View)266 TextView (android.widget.TextView)131 RecyclerView (android.support.v7.widget.RecyclerView)70 ImageView (android.widget.ImageView)41 IOException (java.io.IOException)32 Intent (android.content.Intent)30 Bundle (android.os.Bundle)30 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)28 ViewGroup (android.view.ViewGroup)27 Uri (android.net.Uri)25 BindView (butterknife.BindView)25 ArrayList (java.util.ArrayList)25 Cursor (android.database.Cursor)23 File (java.io.File)22 AdapterView (android.widget.AdapterView)16 Bitmap (android.graphics.Bitmap)15 Context (android.content.Context)14 Drawable (android.graphics.drawable.Drawable)13 EditText (android.widget.EditText)13