SCViewPager

Overview

Android Arsenal

SCViewPager

Jazz for android

A simple ViewPager extends that provide scroll based animation like Jazz Hands for iOS. Jazz Hands library provided by IFTTT : https://github.com/IFTTT/JazzHands

alt tag

Install

With Gradle (JCenter):

compile "com.dev.sacot41:scviewpager:0.0.4"

Start

First, add SCViewPager to your project. Create an activity with the viewPage and the views you want to animate.

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
	android:layout_height="match_parent"
	tools:context=".MainActivity">

	<com.dev.sacot41.scviewpager.SCViewPager
        android:id="@+id/viewpager_main_activity"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
	</com.dev.sacot41.scviewpager.SCViewPager>

	<TextView
        android:id="@+id/textview_to_animate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:text="@string/textview_bonjour"/>

Retrieve view and add animation after you have set viewPager and his adapter.

Point size = SCViewAnimationUtil.getDisplaySize(this);

View view = findViewById(R.id.textview_to_animate);
SCViewAnimation viewAnimation = new SCViewAnimation(view);
viewAnimation.startToPosition((int)(size.x*1.5), null);
viewAnimation.addPageAnimation(new SCPositionAnimation(this, 0, -(int)(size.x*1.5), 0));
mViewPager.addAnimation(viewAnimation);

Disclaimer

This project is not yet implemented in a real app and it's hasn't the pretension to implement all feature provided by JazzHand on IOS; this projects is a pretext to me to better understand animation based on scrollview (viewpager) and publish my first library on Jcenter.

If you want a more complete library, heck Nightonke library, he add more animation and correct some bug : https://github.com/Nightonke/WoWoViewPager.

You might also like...
Comments
  • run this just once!?

    run this just once!?

    thanks for the library I use it as my main activity! and start another activity in the last page of pager! would you please tell me how to run this just once when app is recently installed?! and hide it next runs!?

    opened by MohsenShafiee 2
  • Spell wrong in README.md

    Spell wrong in README.md

    I find a wrong code in README.md.

    Start


    First, add SCViewPager to your project. Create an activity with the viewPage and the views you want to animate.

    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
    

    Here is wrong package name

    - <com.dev.sacot41.myresume.SCViewPager
    + <com.dev.sacot41.scviewpager.SCViewPager
    
    <com.dev.sacot41.myresume.SCViewPager
        android:id="@+id/viewpager_main_activity"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </com.dev.sacot41.myresume.SCViewPager>
    
    <TextView
        android:id="@+id/textview_to_animate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:text="@string/textview_bonjour"/>
    
    opened by tuesleep 0
  • Unit Tests for improved test coverage

    Unit Tests for improved test coverage

    Hi, My name is Farid. I'm a developer with great interest in making open source contributions to popular projects.

    My company - DevFactory - is sponsoring me to improve unit test coverage in open source projects.

    I have analyzed SCViewPager and observed that there is room for improvement of coverage. The results indicate that the project has:

    Coverage: 0%, Total Lines: 557

    If you are interested in having us work towards improving the project’s coverage to 80%, please let me know and we will add it to our pipeline. Our first step will be to create a pull request with a sample. Once you approve it, we'll follow up with one or two more pull requests. Our target is to increase code coverage to above 80 percent.

    For an example of our work, please see these Pull Requests accepted by the community:

    • https://github.com/oblac/jodd/pull/264
    • https://github.com/iluwatar/java-design-patterns/pull/294

    I'm looking forward to your confirmation.

    Thank you, Mohd Farid Open Source Code Coverage Team DevFactory

    opened by mfarid 0
Owner
Samuel Côté
Samuel Côté