Code Monkey home page Code Monkey logo

neumorphism's People

Contributors

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

neumorphism's Issues

Collection sample

Describe the request you'd like:
I create new sample of collection which has NeumorphCardView in viewHolder

Additional context:
This is issue, because when use NeumorphCardView in viewHolder collection lagging a lot.

neumorphic TextView style does not work when text is set/changed by java class

Version used: 0.2.1
Devices/Android versions reproduced on: Android 10

When i try to set different text from java class, only previously set text(in xml) shadow & elevation shows in layout with new text.
for examaple,
suppose, in xml, "Hello World" text has been set in a soup.neumorphism.NeumorphTextView -> at this stage everything looks good.
then when i change this text to a new one from java class, suppose "Hello There!" -> shadow and elevation style remains the same of "Hello World" but text changes to new one "Hello There!". This means neumorphic effect of text "Hello World" remains there even if i changed the text and new neumorphic effect of text "Hello There!" does not drawn. it looks like visible text is different from neumorphic text in background.

There are number of issues in soup.neumorphism.NeumorphTextView:

  1. explained above
  2. Inherited from above issue: if text is multiline, then whole neumorphic effect is drawn in single line even if text is wrapped in new lines if there is no space left in first line.
  3. neumorphic effect of ellipses does not draw when ellipses enabled whether it is at the end or start if text is more than available space. it looks very ugly because instead of ellipses, it draws usual text in place of ellipses.
  4. When width is set to match parant in soup.neumorphism.NeumorphTextView, and text alignment is set to center, text is drawn at center as expected but neumorphic effect of that text is drawn at start that make it impossible to use in some cases when alignment is needed.
  5. when padding is set in soup.neumorphism.NeumorphTextView, neumorphic effect of text is draw at start as in case 4.

All the above issues makes it ugly when text is more than available screen space, if text is not set in xml then it does not draw neumorphic effect even if text is set from java class.

Adding background feature to NeumorphCardView

Hey! Can you please suggest me or integrate in this project a way to add background xmls to NeumorphCardView? I want to show a gradient in a view but currently I can only fill a single color into it.

Thanks

How to use Textview i have tried your methode but no result

Here is textview code i am using can you please correct it if there is any problem in code

<soup.neumorphism.NeumorphTextView
        style="@style/Widget.Neumorph.TextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World"
        android:textSize="30sp" />

and result it here

image

NeumorphTextView setText Problem

Hi, is it normal that setText on NeumorphTextView during runtime, the shadow will not be redraw?
I'm not sure is it I'm doing it wrong or not.

<soup.neumorphism.NeumorphTextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:neumorph_shadowColorLight="?colorPrimary"
app:neumorph_shadowColorDark="?colorPrimaryDark"
app:neumorph_backgroundColor="?android:colorBackground"
android:textColor="?android:colorBackground"
android:text="10\n30"
app:layout_constraintTop_toTopOf="@id/some_view1"
app:layout_constraintBottom_toTopOf="@id/some_view2"
app:layout_constraintVertical_bias="0.25"
android:textSize="80sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

Using custom font on NeumorphButton

What if i want to use custom font using NeumorphButton ?
Right now i can't do that, or is there any support of doing this that i am missing?

Kindly reply.

Cut corner

Describe the request you'd like:
Supports two styles to the corner shapes like MDC.

Additional context:
스크란샷 2020-05-21 α„‹α…©α„Œα…₯ᆫ 1 21 13

After adding backgroundDrawable feature. App crashes while trying to initialize ImageView

StackTrace:

2020-08-28 15:36:26.484 2550-2550/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: soup.neumorphism.sample, PID: 2550
    java.lang.RuntimeException: Unable to start activity ComponentInfo{soup.neumorphism.sample/soup.neumorphism.sample.MainActivity}: android.view.InflateException: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Error inflating class soup.neumorphism.NeumorphImageView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3555)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3707)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2220)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8016)
        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:1076)
     Caused by: android.view.InflateException: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Error inflating class soup.neumorphism.NeumorphImageView
     Caused by: android.view.InflateException: Binary XML file line #169 in soup.neumorphism.sample:layout/activity_main: Error inflating class soup.neumorphism.NeumorphImageView
     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:854)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
        at soup.neumorphism.sample.MainActivity.onCreate(MainActivity.kt:12)
        at android.app.Activity.performCreate(Activity.java:7957)
        at android.app.Activity.performCreate(Activity.java:7946)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3530)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3707)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2220)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8016)
        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:1076)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void soup.neumorphism.NeumorphShapeDrawable.setBackgroundDrawable(android.graphics.drawable.Drawable)' on a null object reference
2020-08-28 15:36:26.484 2550-2550/? E/AndroidRuntime:     at soup.neumorphism.NeumorphImageView.setBackgroundDrawable(NeumorphImageView.kt:93)
        at soup.neumorphism.NeumorphImageView.setBackground(NeumorphImageView.kt:89)
        at android.view.View.<init>(View.java:6198)
        at android.widget.ImageView.<init>(ImageView.java:193)
        at android.widget.ImageView.<init>(ImageView.java:188)
        at androidx.appcompat.widget.AppCompatImageView.<init>(AppCompatImageView.java:72)
        at soup.neumorphism.NeumorphImageView.<init>(NeumorphImageView.kt:17)
        at soup.neumorphism.NeumorphImageView.<init>(NeumorphImageView.kt:16)
        at soup.neumorphism.NeumorphImageView.<init>(Unknown Source:8)

Problem: NeumorphImageView is based on AppCompatImageView and inside AppCompatImageView's constructor, setBackgroundDrawable is called before shapeDrawable is initialized.

Inset Attribute

Describe the request you'd like:
If you add padding to increase neumorphism shadow and spacing,
it does not work on 'wrap_content'.
So it is better not to use padding for both neumorphism shadow and padding,
but add a separate property.
Maybe it would be nice if gap + padding works as actual padding.

<soup.neumorphism.NeumorphButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="8dp" />

Additional context:
Add any other context or screenshots about the feature request here.

Allow to change corner radius for all 3 types of shape

Just like in title, i would like to be able to change corner radius on every type of shape :). I think your library is closest to being best one on Android. It misses some configuration additions. Maybe onTouch effects for buttons might be also a good idea (i didn't find on click effect while trying your lib out).

Problem with tablets

Version used: 0.1.11
Devices/Android versions reproduced on: Lenovo Tab/ Some Custom made tables (Version: 8.1.0)
screenshot-1596001983448

  • A screenshots showing the issue. As you can see its showing border for both white and grey shadow in tablet, but ran the same code in pixel 3a its working like a charm

Flat drawables

The flat widget is not working. The drawable is actually clipping to look like this
Screenshot_1587276300

Support for icons in NeumorphButton

Describe the request you'd like:
Request to add support for icons in NeumorphButton on either left or right and it would be amazing if we could add tint over them.

Additional context: NA

Button light shadow color and elevation is not accurate on a background of different color.

Version used:
Pixel 3 API29 & android 11

When adding a button with a different background color, we lose the light neumorphic shadow in the view. The dark one might be missing as well since when clicked the button does not seem to depress.

Added elevation to the widget which seems to somewhat fix the problem but now if you look closely the background of the view behind the neumorphic background does not respect the style set forth in the widget instance, and so we see unwanted edges behind the colored neumorphic background.

Screen Shot 2020-10-05 at 12 42 38 AM

                <soup.neumorphism.NeumorphButton
                    android:id="@+id/write_publish_button"
                    style="@style/Widget.Neumorph.Button"
                    android:layout_width="140dp"
                    android:layout_height="64dp"
                    android:layout_marginStart="12dp"
                    android:layout_marginTop="-12dp"
                    android:layout_marginEnd="12dp"
                    android:layout_marginBottom="12dp"
                    android:padding="12dp"
                    android:elevation="4dp"
                    android:background="@drawable/background_rounded_theme"
                    app:neumorph_shadowElevation="4dp"
                    android:text="Publish"
                    android:textColor="@color/default_text"
                    android:textStyle="bold"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/write_entry_container"
                    app:layout_constraintVertical_bias=".6"
                    app:neumorph_backgroundColor="?attr/colorThemeWritingScreenMainDark"
                    app:neumorph_shadowColorDark="?attr/primaryColorDark"
                    app:neumorph_shadowColorLight="?attr/primaryColorLight"
                    app:neumorph_shapeAppearance="@style/NeuShapeCornerRound"
                    app:neumorph_shapeType="flat"
                    />

                <soup.neumorphism.NeumorphButton
                    android:id="@+id/write_save_button"
                    style="@style/Widget.Neumorph.Button"
                    android:layout_width="140dp"
                    android:layout_height="64dp"
                    android:layout_gravity="end"
                    android:layout_marginStart="12dp"
                    android:layout_marginTop="-12dp"
                    android:layout_marginEnd="12dp"
                    android:layout_marginBottom="12dp"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:padding="12dp"
                    android:text="save"
                    android:textColor="?attr/TextColorMain"
                    android:textStyle="bold"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/write_publish_button"
                    app:layout_constraintVertical_bias=".0"
                    app:neumorph_backgroundColor="?attr/primaryColor"
                    app:neumorph_shadowColorDark="?attr/primaryColorDark"
                    app:neumorph_shadowColorLight="?attr/primaryColorLight"
                    app:neumorph_shapeAppearance="@style/NeuShapeCornerRound"
                    app:neumorph_shapeType="flat"
                    />

Create Round neumorphism cardview

Hi, thanks for this great library.

Describe the request:
How can create a rounded neumorphism cardview with this lib? is need some hack for creating circular NeumorphCardView?

Additional context:
i need rounded cardview for shapes like this image:

rounded cardview

once again thanks for creating this lib.

option to disable dark them

Thanks for such a great library, i am working on app that does not need to support dark mood. There is no such option in this library

Corner size not applied

Version used: 0.2.0
Devices/Android versions reproduced on: Galaxy note 4

  • Sample codes to trigger the issue.
  <soup.neumorphism.NeumorphCardView
            android:layout_width="150dp"
            android:layout_height="150dp"
            app:neumorph_backgroundColor="@color/backColor"
            app:neumorph_inset="12dp"
            app:neumorph_shadowColorDark="@color/neu_card_dark"
            app:neumorph_shadowColorLight="@color/neu_card_lighter"
            app:neumorph_shadowElevation="4dp"
            app:neumorph_shapeAppearance="@style/RectangleNeuCardViewForHomePage">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="4dp"
                app:srcCompat="@drawable/ic_stage" />

        </soup.neumorphism.NeumorphCardView>

style:

 <style name="RectangleNeuCardViewForHomePage">
        <item name="cornerSizeBottomLeft">12dp</item>
        <item name="cornerSizeBottomRight">12dp</item>
        <item name="cornerSizeTopLeft">360dp</item>
        <item name="cornerSizeTopRight">360dp</item>
    </style>
  • A screenrecord or screenshots showing the issue.

i want to create this shape type (top corner different from bottom)
topRounded

but corner size not applied.
result

Light Source Direction Option/Attribute

Light Source Direction Feature
Is there any feature, to specify the light source direction ?
For example: I want to change the direction of shadow, beneath my neumorphic widgets.
How do I do that in this library?

We can have some enum like:
LightSource.topLeft, LightSource.topRight, LightSource.top, bottom, right, left , etc. in order to specify the direction of light, and hence change the direction of shadow significantly.

μΉ΄λ“œλ·°μ™€ λ²„νŠΌμ„ 같이 μ“°κ³  싢은데 μ–΄λ–»κ²Œ 해야할지..

image
μœ„ 사진과 같이 ν•˜κ³ μ‹Άμ€λ° 라이브러리둜 ν•˜λ©΄ μ œκ°€ ν•˜κ³ μžν•˜λŠ” λ°©ν–₯λŒ€λ‘œ μž˜μ•ˆλ˜λ„€μš”,,

image
μœ„ 사진 처럼 λ²„νŠΌμ΄ λœ¬λ‹€(?)라고 ν‘œν˜„μ„ ν•΄μ•Όν•˜λŠ” 건지,, ν˜Ήμ‹œ μ΄λŸ¬ν•œ 문제λ₯Ό μ•„μ‹ λ‹€λ©΄ 해결방법쒀 μ•Œλ €μ£Όμ‹€ 수 μžˆμ„κΉŒμš”??
ꡬ체적이지 λͺ»ν•œ 질문 μ£„μ†‘ν•©λ‹ˆλ‹€..

Error in import library

Version used:

Error in iport library in my project
version: 0.1.11.

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.github.fornewid:neumorphism:0.1.11
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.fornewid:neumorphism:0.1.11
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.github.fornewid:neumorphism:0.1.11

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.github.fornewid:neumorphism:0.1.11.
Show Details
Affected Modules: app

I would like to use a library, but I am using this error when importing, makes many updates to the tools and android studio, nothing seems to solve

app will crash

Version used:
com.github.fornewid:neumorphism:0.2.1
android api 23

XML:
<soup.neumorphism.NeumorphCardView android:id="@+id/neumorphCardView" style="@style/smallRoundedButton" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/constraintLayout"/>

Style:
<style name="smallRoundedButton" parent="android:Widget"> <item name="android:padding">6dp</item> <item name="android:stateListAnimator">@animator/button_state_list_anim_neumorph</item> <item name="android:focusable">true</item> <item name="android:clickable">true</item> <item name="android:scaleType">center</item> <item name="neumorph_shadowElevation">4dp</item> <item name="neumorph_shadowColorLight">@color/lightShadow</item> <item name="neumorph_shadowColorDark">@color/darkShadow</item> <item name="neumorph_shapeType">flat</item> <item name="neumorph_shapeAppearance">@style/CustomShapeAppearance16</item> </style>

Logcat Error:
java.lang.OutOfMemoryError: Failed to allocate a 4759564 byte allocation with 634240 free bytes and 619KB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:831) at android.graphics.Bitmap.createBitmap(Bitmap.java:808) at android.graphics.Bitmap.createBitmap(Bitmap.java:775) at soup.neumorphism.internal.blur.BlurProvider.blur(BlurProvider.kt:51) at soup.neumorphism.internal.blur.BlurProvider.blur(BlurProvider.kt:42) at soup.neumorphism.internal.blur.BlurProvider.blur$default(BlurProvider.kt:34) at soup.neumorphism.internal.shape.FlatShape$toBlurredBitmap$1.invoke(FlatShape.kt:92) at soup.neumorphism.internal.shape.FlatShape.toBlurredBitmap(FlatShape.kt:104) at soup.neumorphism.internal.shape.FlatShape.updateShadowBitmap(FlatShape.kt:84) at soup.neumorphism.NeumorphShapeDrawable.draw(NeumorphShapeDrawable.kt:283) at android.view.View.drawBackground(View.java:16370) at android.view.View.draw(View.java:16169) at android.view.View.draw(View.java:16090) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.draw(View.java:16181) at android.view.View.draw(View.java:16090) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at androidx.drawerlayout.widget.DrawerLayout.drawChild(DrawerLayout.java:1478) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16088) at android.view.ViewGroup.drawChild(ViewGroup.java:3609) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399) at android.view.View.draw(View.java:16181) at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690) at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2728) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2642) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

its works fine in some newer android phone but when running on phone with android api 23 it will crash!!
how can i solve that?

i try to use normal card view and its works fine.

It's Working on MinSdk21

Describe the request you'd like:
A clear and concise description of what you want.

Additional context:
Add any other context or screenshots about the feature request here.
Sir It's working on MinSdk version 21
Can i have for MinSdk16??

radiogroup

개인적인 ν¬λ§μ΄μ§€λ§Œ λΌλ””μ˜€ κ·Έλ£Ή λ²„νŠΌλ„ μžˆμ—ˆμœΌλ©΄ ν•©λ‹ˆλ‹€ γ… γ… 

μ•ˆλ“œλ‘œμ΄λ“œ μŠ€νŠœλ””μ˜€ μ΄ˆλ³΄μ΄μ§€λ§Œ λ ˆμ΄μ•„μ›ƒμ— μΆ”κ°€ν•˜λ©΄ μ•ˆλ“œλ‘œμ΄λ“œ μŠ€νŠœλ””μ˜€μ—μ„œ
예λ₯Όλ“€μ–΄ NeumorphImageButton λ₯Ό μΆ”κ°€ν•˜λ©΄ 였λ₯Έμͺ½μ— λ””μžμΈμ΄ 보여지지 μ•Šκ³  κ°€μƒλ¨Έμ‹ μ—μ„œ
맀일 ν™•μΈν•˜κ²Œ λ˜λ„€μš”..

I'm getting Failed to Resolve Error !

Version used:
Devices/Android versions reproduced on:

I would appreciate if you could attach:

  • Sample codes to trigger the issue.
  • A screenrecord or screenshots showing the issue.
    Failed to resolve: com.github.fornewid:neumorphism:0.1.10

Multiline text does not work if it doesn't fits in single line

Version used: 0.3.0
Devices/Android versions reproduced on:
Android 10

Issues in Neumorph TextView
When there are more words than available width space in textview, shadows are not created in next lines except first line, only simple text is being shown in next lines.

When width is set to match_parent, stting gravity to centre or anything else does not align shadows as per gravity, it only aligns simple text, shadows remain at start.

Same is the case with setting padding, it doesn't move shadows.

Wrong shadow corner if shapeType pressed and added backgroundColor

photo_2020-09-13_14-11-03
<soup.neumorphism.NeumorphButton
android:id="@+id/btnNext"
android:layout_width="260dp"
android:layout_height="68dp"
android:layout_marginBottom="24dp"
android:text="test"
style="@style/TestButtonText"
android:gravity="center"
android:textAllCaps="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/startLine"
app:layout_constraintEnd_toStartOf="@id/endLine"
app:neumorph_shadowColorDark="@color/black"
app:neumorph_shadowColorLight="@color/transparent"
app:neumorph_backgroundColor="@color/red"
app:neumorph_shapeAppearance="@style/CustomTestShape"
app:neumorph_shapeType="pressed"
app:neumorph_shadowElevation="4dp"
/>

<style name="CustomTestShape">
    <item name="neumorph_cornerFamily">rounded</item>
    <item name="neumorph_cornerSize">34dp</item>
</style>

When using view inside ViewGroup hierarchy margin inside view is not enough

<EditText
    android:id="@+id/searchBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:autofillHints=""
    android:drawableEnd="@android:drawable/ic_menu_search"
    android:hint="@string/search"
    android:inputType="textShortMessage"
    android:theme="@style/ThemeOverlay.AppCompat.Dark"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />


<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">


<soup.neumorphism.NeumorphCardView
    android:id="@+id/searchBySong"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="8dp"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:background="?selectableItemBackground"
    android:clickable="true"
    android:focusable="true"
    android:paddingStart="16dp"
    android:paddingTop="12dp"
    android:paddingEnd="16dp"
    android:paddingBottom="12dp"
    app:layout_constraintEnd_toStartOf="@+id/searchByPoster"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/searchBar">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawableTint="@color/yellowTextColor"
        android:text="Option1"
        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="@color/yellowTextColor" />
</soup.neumorphism.NeumorphCardView>


<soup.neumorphism.NeumorphCardView
    android:id="@+id/searchByPoster"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginTop="8dp"
    android:layout_marginEnd="16dp"
    android:background="?selectableItemBackground"
    android:clickable="true"
    android:focusable="true"
    android:paddingStart="16dp"
    android:paddingTop="12dp"
    android:paddingEnd="16dp"
    android:paddingBottom="12dp"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toEndOf="@+id/searchBySong"
    app:layout_constraintTop_toBottomOf="@+id/searchBar">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawableTint="@color/redTextColor"
        android:text="Option2"
        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="@color/redTextColor" />
</soup.neumorphism.NeumorphCardView>

</LinearLayout>

viber_image_2020-04-04_01-12-02

Background color

Hi

Thanks for this package.
May I ask you if there is any way to apply a background color locally to each one of your objects?
Thanks for your feedback.

Screenshot 2020-12-24 at 07 57 56

Make layout classes open

I want to use <merge> tag so I want to inherit from layout classes but they are final. NeumorphCardView in particular.

How to change color of button

I am trying to color of button with this but it is not working

<soup.neumorphism.NeumorphButton
        android:id="@+id/button"
        style="@style/Widget.Neumorph.Button"
        android:layout_width="0dp"
        android:layout_height="60dp"
        android:layout_marginBottom="100dp"
        android:text="Start Meditation"
        android:background="#ff000"
        app:layout_constraintBottom_toTopOf="@+id/button2"
        app:layout_constraintEnd_toEndOf="@+id/button2"
        app:layout_constraintStart_toStartOf="@+id/button2"
        app:neumorph_shadowColorDark="#CCD1D9E6"
        app:neumorph_shadowColorLight="#CCFFFFFF"
        app:neumorph_shapeType="flat" />

Flat and pressed state

Do you want to add flat && pressed state at the same time? it should be great, bacause it can help to add these effects (there are internal and external shadows at the same time)

image

Expose corner radius for widgets

Can we get an option to change radius of a widget? For example, I am using NeumorphImageButton and I would like to have a square button, but because this button has to be small, it becomes a circle when I make it below a certain size, and I can't seem to lower the radius to make it a rounded square.

Something like this:
Screen Shot 2020-06-13 at 12 15 17 AM

When you use the NeumorphShapeDrawable in a RecyclerView item, scroll becomes laggy

RecyclerView is configured correctly: only a few ViewHolders are created, therefore views shouldn't be recreated.
My item view consists of TextView within NeumorphCardView.

<?xml version="1.0" encoding="utf-8"?>
<soup.neumorphism.NeumorphCardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="4dp"
    android:layout_marginTop="-3.1dp"
    android:layout_marginEnd="4dp"
    android:layout_marginBottom="-3.1dp"
    app:neumorph_shadowColorDark="?attr/neumorphDarkColor"
    app:neumorph_shadowColorLight="?attr/neumorphLightColor"
    app:neumorph_shadowElevation="4dp"
    app:neumorph_shapeAppearance="@style/NeumorphRounded5dp"
    app:neumorph_shapeType="flat">

    <TextView
        android:id="@+id/itemGroupText"
        style="@style/Button.Cancel"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="start"
        android:padding="16dp"
        android:textSize="16sp"
        tools:text="Group 1" />

</soup.neumorphism.NeumorphCardView>

Maybe issue is due to dirty: Boolean variable in NeumorphShapeDrawable. It could become true for some reason when it is used in RecyclerView. I think so because profiler says that Shape.updateShadowBitmap() takes a lot of time.
image

CardView Issue

I would appreciate if you could resolve:

  • When i used neumorphism cardView in RecyclerView after recyclerView scrolling is not smooth as before its working smoothly please verify this and give me a solution

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.