Android Open Source - piwik_android_sdk Screen Slide Page Fragment






From Project

Back to project page piwik_android_sdk.

License

The source code is released under:

MIT License

If you think the Android project piwik_android_sdk 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.anupcowkur.piwiksample;
/*from   w w  w .j ava2s  . c o  m*/
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class ScreenSlidePageFragment extends Fragment {
    /**
     * The argument key for the page number this fragment represents.
     */
    public static final String ARG_PAGE = "page";
    /**
     * The fragment's page number, which is set to the argument value for {@link #ARG_PAGE}.
     */
    private int mPageNumber;

    public ScreenSlidePageFragment() {
    }

    /**
     * Factory method for this fragment class. Constructs a new fragment for the given page number.
     */
    public static ScreenSlidePageFragment create(int pageNumber) {
        ScreenSlidePageFragment fragment = new ScreenSlidePageFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_PAGE, pageNumber);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPageNumber = getArguments().getInt(ARG_PAGE);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout containing a title and body text.
        ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_screen_slide_page, container, false);

        // Set the title view to show the page number.
        ((TextView) rootView.findViewById(android.R.id.text1)).setText(getString(R.string.title_template_step, mPageNumber + 1));

        return rootView;
    }

    /**
     * Returns the page number represented by this fragment object.
     */
    public int getPageNumber() {
        return mPageNumber;
    }
}




Java Source Code List

com.anupcowkur.piwiksample.CardFlipActivity.java
com.anupcowkur.piwiksample.LayoutChangesActivity.java
com.anupcowkur.piwiksample.MainActivity.java
com.anupcowkur.piwiksample.ScreenSlideActivity.java
com.anupcowkur.piwiksample.ScreenSlidePageFragment.java
com.anupcowkur.piwiksample.TouchHighlightImageButton.java
com.anupcowkur.piwiksample.ZoomActivity.java
com.anupcowkur.piwiksdk.AuthenticatorService.java
com.anupcowkur.piwiksdk.Authenticator.java
com.anupcowkur.piwiksdk.PiwikCallback.java
com.anupcowkur.piwiksdk.PiwikClient.java
com.anupcowkur.piwiksdk.PiwikContentProvider.java
com.anupcowkur.piwiksdk.PiwikDBItems.java
com.anupcowkur.piwiksdk.PiwikDatabaseHelper.java
com.anupcowkur.piwiksdk.PiwikSyncAdapter.java
com.anupcowkur.piwiksdk.PiwikSyncService.java
com.anupcowkur.piwiksdk.SharedPreferenceKeys.java
com.anupcowkur.piwiksdk.StoreDataTask.java