Software engineer focused on front-end mobile with special care for UX/UI @blissapps.
Currently working with Koltin Multiplatform and Compose Multiplatform.
When Iβm not coding Iβm π§ or πββοΈ
A View capable of increasing or decreasing a unit value with a toggle animation
Home Page: https://guilhe.github.io/QuantityPickerView
License: Apache License 2.0
Software engineer focused on front-end mobile with special care for UX/UI @blissapps.
Currently working with Koltin Multiplatform and Compose Multiplatform.
When Iβm not coding Iβm π§ or πββοΈ
In recycle view, the Quantity Picker is set as a child item. The button is not identifying when clicking`
My click listener code:
mListAdapter.setOnItemChildClickListener { adapter, view, position ->
if(view.id == R.id.quantitypicker) {
showToast("hai")`
<com.github.guilhe.views.QuantityPickerView
android:id="@+id/quantitypicker"
android:onClick="click"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:textLabelFont="@font/poppins_medium"
app:textLabelFormatter="%s "
app:textLabelSize="14sp"
app:btnAdd="@drawable/ic_dot"
app:btnRemove="@drawable/ic_dot_remove"
app:backgroundColor="@color/line"
tools:isOpen="false" />
</FrameLayout>
Animation is getting slower while opening and closing
My XML :
`
<com.github.guilhe.views.QuantityPickerView
android:id="@+id/picker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:textLabelFont="@font/poppins_medium"
app:textLabelFormatter="%s "
app:textLabelSize="14sp"
app:rippleColor="@color/white"
app:btnAdd="@drawable/default_btn_add"
app:btnRemove="@drawable/default_btn_remove"
app:backgroundColor="@color/white"
tools:isOpen="true" />
</FrameLayout>`
Testing device : Vivo V3
Version : Android 5.1
API Level : 21
When QuantityPickerView
is child of a ConstraintLayout
and it's width is 0dp (to take into account constraints) it receives wrong measures specs and the layout_width will be randomly wrong calculated.
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<com.github.guilhe.views.QuantityPickerView
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
No problems with measure specs
To fix this problem - for now - we have 2 options:
FrameLayout
and give constraints restrictions to the FrameLayout
:<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<FrameLayout
android:id="@+id/quantityPickerView"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.github.guilhe.views.QuantityPickerView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:value="@{item.quantity}" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Thanks a lot for your job !
I have a question about isOpen. I would like to use this picker always open. But when isOpen attribute is true, the start view is closed (only + button).
This attribute is private, then I cannot change it in my soft.
Is there any solution ?
Thank you again.
Alain
First of all, thank you very much for your help in solving issues. I've just met with another issue.
How to open programmatically if there is any value
My XML :
holder.getView(R.id.picker) as QuantityPickerView).apply { if(it.picker_count!=null){ value=it.picker_count!! } }
//not working below line
this.isOpen
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.