Git Product home page Git Product logo

android-materialshadowninepatch's Introduction

Stats Top Languages

android-materialshadowninepatch's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-materialshadowninepatch's Issues

Resources$NotFoundException : res/drawable-tvdpi-v4/ms9_spot_shadow_z1.xml

Help me fix this error please

Caused by: android.content.res.Resources$NotFoundException: File res/drawable-tvdpi-v4/ms9_spot_shadow_z1.xml from drawable resource ID #0x7f0200e0 at android.content.res.Resources.loadDrawable(Resources.java:1953) at android.content.res.Resources.getDrawable(Resources.java:660) at com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView.getNinePatchDrawableFromResource(MaterialShadowContainerView.java:311) at com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView.updateShadowLevelCompat(MaterialShadowContainerView.java:346) at com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView.updateShadowLevel(MaterialShadowContainerView.java:401) at com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView.<init>(MaterialShadowCon

Is it possible to have transparent shadows?

From what I'm reading I think the answer is no, but I want to be sure. I have a SlidingPaneLayout where the left pane has multiple colors in it, but the shadow uses the background color of the parent view and it looks terrible.

Reduce overdraws

Can reduce overdraws when inner view has solid filled content.

related issue: #3

Broken repo?

Hello

I tried to add library repo

In gradle build I added:

repositories {
    mavenCentral()
    maven {
        url "https://jitpack.io"
    }
}

android {
    . . . 
    dependencies {
        . . . . 
        compile 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:0.6.2'
    }
}

After gradle update got following error:

Error:A problem occurred configuring project ':Android'.
> Artifact 'materialshadowninepatch.jar (com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:0.6.2)' not found.
  Searched in the following locations:
      https://jitpack.io/com/h6ah4i/android/materialshadowninepatch/materialshadowninepatch/0.6.2/materialshadowninepatch-0.6.2.jar

Also tried versions 0.6.1, 0.6.0 but I've experienced same issue

Question - difference between shadowElevation and shadowTranslationZ?

I've been playing around with the values in my app, and also looked at your source code, but I can't quite figure out what the difference is. I'm assuming shadowElevation is how "high" the shadow should be, e.g., what the elevation is of the material it's cast upon? While shadowTranslationZ is how "high" the item in the container is? I'm not sure – shadowElevation is not used in your sample!
Likewise for how much margin is required - you put 16dp for everything in the examples, but how can we calculate the minimum margin required for each shadow size?

Thank you so much for this library, I hope a short guide in the README would as helpful to others!

Can't add to project

I add below line to dependencies and sync. It show's error.

compile 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:1.0.0'

error :
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
/Users/mehdi08/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/a5e461f3cfccca112f65fb535223bc71/res/values/values.xml
Error:(252, 5) error: resource android:attr/fontVariationSettings not found.
Error:(252, 5) error: resource android:attr/ttcIndex not found.
/Users/mehdi08/08_Corp./Tapesh/Tapesh-Android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml
Error:(524) resource android:attr/fontVariationSettings not found.
Error:(524) resource android:attr/ttcIndex not found.
Error:failed linking references.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.

Failed to execute aapt
Information:BUILD FAILED in 4s
Information:9 errors
Information:0 warnings
Information:See complete output in console

Shadow only draws if root child view has a background

Is this by design?

I have something like this:

<MaterialShadowContainerView>
   <LinearLayout>
    <View android:background="#ff0000">
    <View android:background="#00ff00">
  </LinearLayout>
</MaterialShadowContainerView>

The shadow does not seem to draw if the LinearLayout does not have a background. If I set one, it works, but also means there's unnecessary overdraw.

Thanks for the very useful library, by the way!

Material Shadows not showing up when created dynamically

I have a vertical linear layout with a couple other vertical linear layouts hosted inside of it. I'm trying to use this code to create a little bit of space between each inner item as well as add a shadow to them, but no matter what I try I can't get shadows to appear when I create an object dynamically

My code is as follows

container.removeAllViews();

for (LinearLayout aLayout : itemsToAdd) {

    MaterialShadowContainerView msv = new MaterialShadowContainerView(getApplicationContext());
    msv.setShadowElevation(dp(6));
    msv.setShadowTranslationZ(dp(2));
    msv.setForceUseCompatShadow(true);

    ViewGroup.MarginLayoutParams p = new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    p.setMargins(dp(6), dp(6), dp(6), dp(45));

    msv.setLayoutParams(p);
    msv.addView(aLayout);
    container.addView(msv);

}

where container is a larger vertical linear layout that all of my smaller items are added to, and aLayout is each individual LinearLayout of an ArrayList collection. Right now I'm assuming there is something I've done wrong with the margins as no matter what I do I can't get them to show up at all. All I ever seem to get is one continuous block of white without a single shadow as shown below

Nothing but White

Is there something wrong with the way I'm doing this, or is there an actual bug with this library?

Question - Supported Shapes

Hi,
This is great lib bro. is this lib support circle shapes and custom shapes? or just rectangle shapes?

ThnQ 👍

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.