1

I am using a custom UI component in my project which has it's own few attributes. I want to change a specific one using a function when it is clicked. I don't know how to access it though, I am fairly new in this department.

<com.chinodev.androidneomorphframelayout.NeomorphFrameLayout
                    android:id="@+id/btnsystem"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="5dp"
                    app:neomorph_background_color="@color/appBackground"
                    app:neomorph_corner_radius="10dp"
                    app:neomorph_elevation="4dp"
                    app:neomorph_highlight_color="#ffffff"
                    app:neomorph_shadow_color="#CDCDCD"
                    app:neomorph_view_type="rectangular">

here say I want to change the app:neomorph_elevation using onclick function how can I do that?

3 Answers 3

1

In NeomorphFrameLayout you can add a public function changeElevation ex

 fun changeElevation(elevation :Float){
      neomorph_elevation = elevation
    }

and can use in onClickListener like

btnsystem.changeElevation(5f)
Sign up to request clarification or add additional context in comments.

Comments

0

As they specified in library that,

Attributes: neomorph_clickable option set it to true and onClick trigger a function from xml or from setOnClickListener whichever you prefer...

https://github.com/4inodev/Neomorphic-FrameLayout-Android

Comments

0

android-repository-history

History of Android repository XML

repository2-$N.xml and addons_list-3.xml

Used by sdkmanager command.

repository-$N.xml and addons_list-2.xml

Used by android command, which is deprecated and unavailable in the latest Android SDK Tools (since r25.3.0)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.