Skip to content

Commit

Permalink
Gradle Error Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
syaikhanagil committed Apr 27, 2019
1 parent 330c034 commit 3c8797f
Show file tree
Hide file tree
Showing 38 changed files with 712 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 syaikhanagil

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
139 changes: 138 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,138 @@
# revBackDrop
## revBackDrop
Easy Material Backdrop Library
###### Based of Material Design Backdrop.[Backdrop](https://material.io/design/components/backdrop.html)
-----
### Preview
<img src="preview/before.png" width="250"> ** ** <img src="preview/after.png" width="250"> ** ** <img src="preview/prev1.gif" width="250">



## Install

##### Include the `revBackDrop` dependency in app's **build.gradle** and you are good to go.

```groovy
implementation 'com.github.syaikhanagil.revBackDrop:1.1'
```
or
```groovy
compile 'com.github.syaikhanagil.revBackDrop:1.1'
```

### Usage
1. Include in your layout
```java
<android.support.v7.widget.Toolbar
android:theme="@style/AppTheme.AppBarOverlay"
android:id="@+id/ToolbarID"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
android:background="@color/colorPrimary"/>

<net.syaikhanagil.androidlabs.backdrop.dropContainer
android:id="@+id/DropContainerID"
android:layout_below="@id/ToolbarID"
android:layout_height="match_parent"
android:layout_width="match_parent"
app:dropMenuIcon="@drawable/ic_drop_menu"
app:dropCloseIcon="@drawable/ic_drop_close"
app:duration="100">

<!-- Is Front Layout -->
<include layout="@layout/layout_main"/>

<!-- Is Back Layout -->
<include layout="@layout/layout_menu"/>

</net.syaikhanagil.androidlabs.backdrop.dropContainer>
```

* Notice : The container can only be used for two child layout

#### If you own cosumize icon, you can change this attribute at the layout usage.
```java
app:dropMenuIcon="@drawable/ic_drop_menu" // Before clicked

app:dropCloseIcon="@drawable/ic_drop_close" // After child dropped or Icon clicked
```

##### Vector for Close and Menu Icon (Optional)

**ic_drop_menu.xml**
```java
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#ffffff"
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>
```

**ic_drop_close.xml**
```java
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#ffffff"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
```

4. Add this in **values/dimens.xml**
```java
<dimen name="drop_height">120dp</dimen>
```

5. in your Activity onCreate Method
```java
Toolbar mToolbar = (Toolbar) findViewById(R.id.ToolbarID);
dropContainer = (dropContainer) findViewById(R.id.DropContainerID);
int droppedHeight = this.getResources().getDimensionPixelSize(R.dimen.drop_height);
dropContainer.attachToolbar(mToolbar).dropInterpolator(new LinearInterpolator()).dropHeight(droppedHeight).createDrop();
```


### ChangeLog

#### v1.2
* Gradle Error Fixed
* Added Api 16+ Support

#### v1.1
* Crash Fixed
* Added Api 17+ Support

#### v1.0
* Initial Release

## License
```
MIT License
Copyright (c) 2019 Syaikhan Agil
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
29 changes: 29 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion "27.0.2"

defaultConfig {
applicationId "net.syaikhanagil.androidlabs.backdrop.demo"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFile 'proguard-rules.pro'
}
}
}

dependencies {
compile project(':library')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.0.2'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\tools\adt-bundle-windows-x86_64-20131030\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
22 changes: 22 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.syaikhanagil.androidlabs.backdrop.demo" >

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:resizeableActivity = "true">
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package net.syaikhanagil.androidlabs.backdrop.demo;

import android.os.*;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import net.syaikhanagil.androidlabs.backdrop.dropContainer;
import android.view.animation.*;

public class MainActivity extends AppCompatActivity
{
Toolbar mToolbar;
dropContainer dropContainer;

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mToolbar = (Toolbar) findViewById(R.id.ToolbarID);
dropContainer = (dropContainer) findViewById(R.id.DropContainerID);
int droppedHeight = this.getResources().getDimensionPixelSize(R.dimen.drop_height);
dropContainer.attachToolbar(mToolbar).dropInterpolator(new LinearInterpolator()).dropHeight(droppedHeight).createDrop();
}
}
18 changes: 18 additions & 0 deletions app/src/main/res/drawable/background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<selector>
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="0"
android:endColor="#ffffff"
android:startColor="#ffffff"
android:type="linear" />
<corners xmlns:android="http://schemas.android.com/apk/res/android"
android:topLeftRadius="17.0dip"
android:topRightRadius="17.0dip"/>
</shape>
</item>
</selector>


10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_drop_close.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#ffffff"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>

10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_drop_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#ffffff"
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>

34 changes: 34 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent">

<android.support.v7.widget.Toolbar
android:theme="@style/AppTheme.AppBarOverlay"
android:id="@+id/ToolbarID"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
android:background="@color/colorPrimary"/>

<net.syaikhanagil.androidlabs.backdrop.dropContainer
android:layout_below="@id/ToolbarID"
android:id="@+id/DropContainerID"
android:layout_height="match_parent"
android:layout_width="match_parent"
app:dropMenuIcon="@drawable/ic_drop_menu"
app:dropCloseIcon="@drawable/ic_drop_close"
app:duration="100">

<!-- Is Front Layout -->
<include layout="@layout/layout_main"/>

<!-- Is Back Layout -->
<include layout="@layout/layout_menu"/>

</net.syaikhanagil.androidlabs.backdrop.dropContainer>

</RelativeLayout>

25 changes: 25 additions & 0 deletions app/src/main/res/layout/layout_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@color/colorPrimary">

<Button
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="Button"/>

<Button
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="Button"/>

<Button
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="Button"/>

</LinearLayout>

10 changes: 10 additions & 0 deletions app/src/main/res/layout/layout_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/background">

</LinearLayout>

Binary file added app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions app/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>

6 changes: 6 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#00838f</color>
<color name="colorPrimaryDark">#00838f</color>
<color name="colorAccent">#009688</color>
</resources>
Loading

0 comments on commit 3c8797f

Please sign in to comment.