Skip to content
Crossfader is a small library to provide an easy to use and fast helper class for the great CrossFadeSlidingPaneLayout
Branch: develop
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DEV * change README Jul 16, 2015
app * update libs to final release Sep 22, 2018
gradle/wrapper
library * [release] v1.6.0-rc01 Aug 18, 2018
.gitignore * improve gitignore file Aug 21, 2015
LICENSE * initial commit Jul 16, 2015
README.md * [release] v1.6.0 Sep 22, 2018
build.gradle * [release] v1.6.0 Sep 22, 2018
gradle-release.gradle upgrade to androidX Aug 18, 2018
gradle.properties upgrade to androidX Aug 18, 2018
gradlew
gradlew.bat
settings.gradle * initial commit Jul 16, 2015

README.md

Crossfader Maven Central

Join the chat at https://gitter.im/mikepenz/crossfader

Crossfader is a small library to provide an easy to use and fast helper class for the great CrossFadeSlidingPaneLayout by @chiuki.

It comes with following features:

  • Easy to use API
  • Lightweight
  • No additional dependencies
  • No need to modify your layouts

Preview

Screenshots

Image Image

Image

#Include in your project ##Using Maven The Crossfader Library is pushed to Maven Central, so you just need to add the following dependency to your build.gradle.

implementation "com.mikepenz:crossfader:1.6.0"
implementation "androidx.appcompat:appcompat:${androidX}"

To use appcompat please use a version smaller than 1.6.0. (See the releases on GitHub)

How to use

Initialize and create the Crossfader

crossFader = new Crossfader()
	    //provide the view which should be the main content
        .withContent(findViewById(R.id.crossfade_content))
        //provide the view and it's width (in pixels) which should be displayed first
        .withFirst(result.getSlider(), firstWidth)
        //provide the view and it's width (in pixels) which should be displayed after fading
        .withSecond(miniResult.build(this), secondWidth)
        //provde the saved instance state to store the previous state of the crossfade view
        .withSavedInstance(savedInstanceState)
        //build and inflate everything
        .build();
        //Awesome everything is set and working

Programmatically crossFade the view

//check if the view is crossFaded
if (crossFader.isCrossFaded()) {
	//crossFade the view
	crossFader.crossFade();
}

Save the instance state

@Override
protected void onSaveInstanceState(Bundle outState) {
	//add the values which need to be saved from the crossFader to the bundle
	outState = crossFader.saveInstanceState(outState);
	super.onSaveInstanceState(outState);
}

Developed By

License

Copyright 2018 Mike Penz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.