# Slidr **Repository Path**: Ematrix/Slidr ## Basic Information - **Project Name**: Slidr - **Description**: Easily add slide to dismiss functionality to an Activity - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-03-05 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Slidr ================ [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.r0adkll/slidableactivity/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.r0adkll/slidableactivity) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Slidr-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1364) Easily add slide-to-dismiss functionality to your Activity by calling `Slidr.attach(this)` in your `onCreate(..)` method. ![Slidr Example](images/slidr_gif.gif "Gif Example") ## Usage An example usage: ```java public class ExampleActivity extends { @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_example); int primary = getResources().getColor(R.color.primaryDark); int secondary = getResources().getColor(R.color.secondaryDark); Slidr.attach(this, primary, secondary); } } ``` or ```java public class ExampleActivity extends { @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_example); Slidr.attach(this); } } ``` `Slidr.attach(...)` will return a `SlidrInterface` which gives you access to two methods: ```java SlidrInterface.lock(); SlidrInterface.unlock(); ``` These methods lock or unlock the slidable touch interface. The theme that you use for your sliding activity must have these attributes set: ```xml true @android:color/transparent ``` Then in the layout of your activity you must give it a background like this; ```xml ... ``` ## Including in your project Include this line in your gradle build file: ```groovy compile 'com.r0adkll:slidableactivity:{latest_version}' ``` ## Author - Drew Heavner, **[r0adkll](http://r0adkll.com)** ## License Copyright (c) 2014 Drew Heavner 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.