Comments (11)
Hi @AruLNadhaN ,
Thanks for bring this to my notice. Can you please provide me the drawable (xml) for the ImageButton - which you're trying to accomplish (just for testing)??
from incdec.
I used the same like the sample code
<com.hariofspades.incdeclibrary.IncDecImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:textSizeB="24"
android:id="@+id/incdec"
android:layout_marginTop="20dp"
app:textColorB="@color/white"
app:leftButtonColorTintB="@color/colorPrimaryDark"
app:rightButtonColorTinitB="@color/colorPrimary"
app:leftDrawableTintB="@color/white"
app:rightDrawableTintB="@color/white"
app:leftDrawableB="@drawable/ic_remove_black_24dp"
app:rightDrawableB="@drawable/ic_add_black_24dp"/>
from incdec.
Hi @AruLNadhaN
I've fixed it. By default, the background will be transparent and if you add tintcolors, you can see the backgroud. You can also set left and right backgroud as drawable via xml and java
app:leftBackground="@drawable/round"
app:rightBackground="@drawable/round"
incdecImg2.setBackground(ContextCompat.getDrawable(this,R.drawable.round),
ContextCompat.getDrawable(this,R.drawable.round));
Please let me know if this is what you seek.
from incdec.
I cleaned & rebuild my project. But the latest changes are not reflected in my build folder code. Maybe you should change the version in gradle or something!
Error:(87) No resource identifier found for attribute 'leftBackground' in package
from incdec.
sorry, did not update the documentation. It's updated.
compile 'com.hariofspades.IncDec:incdeclibrary:0.0.2'
for xml
app:leftBackgroundB="@drawable/round"
app:rightBackgroudnB="@drawable/round"
for java
incdecImg2.setBackgroundforButton(ContextCompat.getDrawable(this,R.drawable.round),
ContextCompat.getDrawable(this,R.drawable.round));
from incdec.
Thanks!. But I have an Issue with the Initial value. I'm trying to set it as 1. But it starts only from 0.
`mPicker.setConfiguration(LinearLayout.HORIZONTAL,IncDecImageButton.TYPE_INTEGER,
IncDecImageButton.DECREMENT,IncDecImageButton.INCREMENT);
mPicker.setupValues(1,20,1,1);
mPicker.enableLongPress(true,true,200);`
from incdec.
Oops. That's not working only for integer types.
Have Fixed it. Please try
compile 'com.hariofspades.IncDec:incdeclibrary:0.0.3'
from incdec.
The values are being changed due to RV Recycling. Do u have a way to solve this ?
from incdec.
RecyclerView will always recycle and bring things back to initial stage. You need to maintain the new value (changed value) as flag and set the value back in onBind. That's the one way I know. I faced similar problem in keeping the checkBox component alive in RecyclerView. Flag is one solution
Also I've heard you can stop RecyclerView recycling (onbind - setrecycleable to false) if your list is small - not suggestible* but a workaround.
Not suggestible* - bcoz, if you're not recycling, then it is better to go with ListView itself rather than RecyclerView
from incdec.
Thanks! I have already used the Flag solution. Do we have any method like setvalue
So that i can set the value back in onBind!
from incdec.
Yes. You have function setValue. you can use it to set values for integer and float items.
Please try and let me know if that is working as expected.
incdec.setValue(3);
from incdec.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incdec.