Skip to content

piyush-malaviya/SlideToOpen

Repository files navigation

SlideToOpen

Slide to open custom android view library

Images

alt tag alt tag

##Setup

###1. Add Library ####Gradle

dependencies {
    compile 'com.pcm:slidetoopen:1.0.0'
}

###2. Add view in xml layout

<com.pcm.slidetoopen.SlideToOpen
    android:id="@+id/slideToOpen"
    android:layout_width="match_parent"
    android:layout_height="80dp"
    android:layout_alignParentBottom="true"
    android:layout_margin="12dp"
    app:margin="10"
    app:sliderColor="@color/colorPrimary"
    app:sliderText="Slide to open >"
    app:sliderTextSize="20"
    app:textOff="Close"
    app:textOn="Open"
    app:textSize="12"
    app:thumbColor="@color/colorAccent" />

###3. Setup SlideToOpen in Class file

SlideToOpen slideToOpen = (SlideToOpen) findViewById(R.id.slideToOpen);
slideToOpen.setOnSliderStatusChange(new OnSliderStatusChange() {
    @Override
    public void onSliderStatusChange(boolean isOpen) {
        if (isOpen) {
            Toast.makeText(MainActivity.this, "Open", Toast.LENGTH_SHORT).show();
        }
    }
});

License

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages