Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/3llomi/hidely

Custom Views that can hide/show a View with some Animations (inspired by the Android FAB)
https://github.com/3llomi/hidely

animation fab hide-view-with-animation ui view

Last synced: 8 days ago
JSON representation

Custom Views that can hide/show a View with some Animations (inspired by the Android FAB)

Awesome Lists containing this project

README

        

# Hidely
Custom Views that can hide/show a View with some Animations (inspired by the Android FAB)

## Demo





## Install
Add this to your project build.gradle

```
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```

Add this to your module build.gradle

```gradle
dependencies {
implementation 'com.github.3llomi:hidely:1.0'
}
```

## Usage

## Basic Usage
use one of the following `Hidely` Views

* `HidelyButton`
* `HidelyImageButton`
* `HidelyImageView`
* `HidelyView`

* `HidelyFrameLayout`
* `HidelyRelativeLayout`
* `HidelyLinearLayout`

## OR

if you want to make your own custom view then :

1. make your own custom view and make it **implements** `HidelyInterface` this will give you the 4 methods `show()` , `hide()` ,`isShowing()` and `setAnimationCallbacks()`
2. make an Object from `HidelyCore` and pass the view as a Parameter:
`hidelyCore = new HidelyCore(this);`
3. fill the 4 methods with hidely core like this

```java

@Override
public void show() {
if (hidelyCore != null)
hidelyCore.show();
}

@Override
public void hide() {
if (hidelyCore != null)
hidelyCore.hide();
}

@Override
public boolean isShowing() {
return hidelyCore == null ? false : hidelyCore.isShowing();
}

@Override
public void setAnimationCallbacks(HidelyAnimationCallbacks animationCallbacks) {
hidelyCore.setAnimationListener(animationCallbacks);
}

```

### XML

```xml

```

### Java

```java

HidelyImageButton hidelyImageButton = findViewById(R.id.simple_example_hidely);
Button changeButtonState = findViewById(R.id.change_button_state);

changeButtonState.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//check if button is Showing
if (hidelyImageButton.isShowing())
//hide button
hidelyImageButton.hide();
else
//show button
hidelyImageButton.show();
}
});

```

### Listen for Animation Callbacks

```java

hidelyImageButton.setAnimationCallbacks(new HidelyAnimationCallbacks() {
@Override
public void onAnimationStart() {

}

@Override
public void onAnimationEnd() {

}
});

```