Android Open Source - Android-ExtendedViewPager Main Activity






From Project

Back to project page Android-ExtendedViewPager.

License

The source code is released under:

MIT License

If you think the Android project Android-ExtendedViewPager 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.onatm.sample.extendedviewpager;
/*from w  ww.j  a  v a 2 s. c om*/
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.onatm.library.extendedviewpager.ParallaxImageViewPager;
import com.onatm.sample.extendedviewpager.adapter.DescriptionPagerAdapter;


public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ParallaxImageViewPager parallaxViewPager = ((ParallaxImageViewPager) findViewById(R.id.parallax_image_viewpager_login));
        parallaxViewPager.setOverlapPercentage(0.50f).setAdapter(new DescriptionPagerAdapter(getSupportFragmentManager()));
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();

        return super.onOptionsItemSelected(item);
    }
}




Java Source Code List

com.onatm.library.extendedviewpager.ParallaxImageViewPager.java
com.onatm.sample.extendedviewpager.DescriptionFragment.java
com.onatm.sample.extendedviewpager.MainActivity.java
com.onatm.sample.extendedviewpager.adapter.DescriptionPagerAdapter.java