Giter Site home page Giter Site logo

kishan2612 / material-backdrop-android Goto Github PK

View Code? Open in Web Editor NEW
107.0 7.0 13.0 314 KB

Material Backdrop

License: MIT License

Java 100.00%
android backdrop material-design layout navigation-drawer material-design-2 android-development android-ui android-architecture navigation-menus

material-backdrop-android's Introduction

Material-Backdrop-Android

This library is created based on Backdrop component from material design.Backdrop

alt text alt text

Usage

  1. Include repository
allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
  1. Include project as local library
dependencies {
	        implementation 'com.github.kishan2612:Material-Backdrop-Android:v1.1.0'
	}
  1. Include the widget in your layout

 <com.evolve.backdroplibrary.BackdropContainer
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:id="@+id/backdropcontainer"
       app:menuIcon="@drawable/ic_menu_24px"
       app:closeIcon="@drawable/ic_close_24px"
       app:duration="500">

       <include layout="@layout/backlayer"/>
       <include layout="@layout/frontlayer"/>


   </com.evolve.backdroplibrary.BackdropContainer>

The container must contain only two child or it may throw an Exception.

The developer can customize the backlayer and frontlayer of their choice. Use public methods to show and hide the backlayer.

  1. In onCreate method
 
 backdropContainer =(BackdropContainer)findViewById(R.id.backdropcontainer);

        backdropContainer.attachToolbar(toolbar)
                .dropInterpolator(new LinearInterpolator())
                .dropHeight(height)
                .build();

Customization

app:menuIcon="@drawable/ic_menu_24px" - You can use your own icon or app logo

app:closeIcon="@drawable/ic_close_24px" - You can use your own icon or app logo

app:duration="500" - default duration is 1000ms if duration is not specified

dropInterpolator(new LinearInterpolator()) - You can use own interpolator

dropHeight(height) - The height is sneek height of front layer.(Dp) eg :

int height= this.getResources().getDimensionPixelSize(R.dimen.sneek_height);

Public Methods

backdropContainer.showBackview();
backdropContainer.closeBackview();

Compatabiliy

Api 16+

ChangeLog

V1.1 :

  crash fixed.

License

MIT License

Copyright (c) 2018 kishan V

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.

material-backdrop-android's People

Contributors

kishan2612 avatar mergimkrasniqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

material-backdrop-android's Issues

Can't access outside package

Hey man, how are you?

I'm testing your lib here, and

backdropContainer.showBackview();
backdropContainer.closeBackview();

can't be accessed outside from package :/ can you help me?

*obs: you need to share this lib to community (android arsenal, uplabs...)

Thanks

State and Listener

Hi,
Please provide a listener to know where the back layer is shown, also add the state of backDrop if is opened or closed.
Thanks.

java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity

I received this error in my project:

2019-07-17 16:45:52.667 14358-14358/com.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app, PID: 14358
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app/com.app.MainActivity}: android.view.InflateException: Binary XML file line #52: Binary XML file line #52: Error inflating class com.evolve.backdroplibrary.BackdropContainer

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3121)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3260)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1976)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6912)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Caused by: android.view.InflateException: Binary XML file line #52: Binary XML file line #52: Error inflating class com.evolve.backdroplibrary.BackdropContainer
Caused by: android.view.InflateException: Binary XML file line #52: Error inflating class com.evolve.backdroplibrary.BackdropContainer
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.app.MainActivity.onCreate(MainActivity.kt:42)
at android.app.Activity.performCreate(Activity.java:7144)
at android.app.Activity.performCreate(Activity.java:7135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1293)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3101)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3260)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1976)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6912)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Caused by: java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity
at com.evolve.backdroplibrary.BackdropContainer.(BackdropContainer.java:45)
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 
at android.view.LayoutInflater.createView(LayoutInflater.java:647) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
at com.app.MainActivity.onCreate(MainActivity.kt:42) 
at android.app.Activity.performCreate(Activity.java:7144) 
at android.app.Activity.performCreate(Activity.java:7135) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1293) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3101) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3260) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1976) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6912) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860) 

My configuration project:

compileSdkVersion 29
defaultConfig {
applicationId "com.app"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

implementation 'com.github.kishan2612:Material-Backdrop-Android:v1.1.0'

Failed to resolve

Failed to resolve: com.github.kishan2612:Material-Backdrop-Android:v1.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.