Android Open Source - androidify-yourself Androidify View Pager Item Fragment






From Project

Back to project page androidify-yourself.

License

The source code is released under:

MIT License

If you think the Android project androidify-yourself listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.github.androidify;
//from  ww w.ja v a 2s.co  m
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class AndroidifyViewPagerItemFragment extends Fragment {

    public static final String IMG_ID = "IMG_ID";

    private int imgId;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (savedInstanceState != null) {
            imgId = savedInstanceState.getInt(IMG_ID);
        }

        View rootView = inflater.inflate(R.layout.androidify_part, container, false);
        ImageView imageView = (ImageView) rootView.findViewById(R.id.android_part);
        imageView.setImageResource(imgId);
        return rootView;
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        outState.putInt(IMG_ID, imgId);
    }

    public void setImgId(int imgId) {
        this.imgId = imgId;
    }
}




Java Source Code List

com.github.androidify.AndroidDrawables.java
com.github.androidify.AndroidSoundPlayer.java
com.github.androidify.AndroidSoundRecorder.java
com.github.androidify.AndroidifyViewPagerAdapter.java
com.github.androidify.AndroidifyViewPagerItemFragment.java
com.github.androidify.BitmapUtils.java
com.github.androidify.MainActivity.java
com.github.androidify.PlaceholderFragment.java