Comments (16)
Sounds good!
from kformmaster.
Stroke size: https://thejuki.github.io/KFormMaster/element/segmented/#margin-stroke
Stroke color: https://thejuki.github.io/KFormMaster/element/segmented/#tint-color
from kformmaster.
So I close this issue now. You did a great job on this feature.
from kformmaster.
I could try implementing this library:
https://github.com/Kaopiz/android-segmented-control
or this one:
https://github.com/RobertApikyan/SegmentedControl
from kformmaster.
@TheJuki
I think this one could do the trick: https://github.com/Kaopiz/android-segmented-control
Or maybe an even better source without an library -> https://medium.com/@staceypyee/revealing-the-magic-of-creating-ios-segmented-control-with-image-in-android-kotlin-part-1-7d817f9d5c7
from kformmaster.
I just released 4.6.1. Please update your dependency and let me know if the Segmented element works for you. Check out the docs: https://thejuki.github.io/KFormMaster/element/segmented/
from kformmaster.
Hi @TheJuki
looks really great! One question left:
I want to customize colors, spacings and sizes. So my idea was to create a custom layout as you explained here : StarkSoftware/SSForms#3
I copied the form_element_segment.xml into my project and changed some values - but unfortunately nothing changes in the app. Do you have any idea why that does not work?
Thanks for your great support.
from kformmaster.
And one more idea:
if no title is provided, the view of the label should be removed - otherwise we'll have some unnecessary space above the button group.
from kformmaster.
I copied and converted the main class from https://github.com/Kaopiz/android-segmented-control
It controls most of styling. I can add new properties to the FormSegmentedElement class which can talk to and update the SegmentedGroup class.
Also, the RadioButtons are added programmatically, so, adding RadioButtons to the XML would not work. The ones in form_element_segment.xml should probably just be removed.
As for the title, I can check if the title is null or empty and make the View be View.GONE.
from kformmaster.
As for the title, I can check if the title is null or empty and make the View be View.GONE.
That would be perfect.
It controls most of styling. I can add new properties to the FormSegmentedElement class which can talk to and update the SegmentedGroup class.
Ah I see. So I can set colors and corner with that class. But what I'm missing is to set the layout to fill horizontal. Perhaps you have an idea to implement this.
Thats now:
So it should look like:
from kformmaster.
Oh. Hmm. I'll play around with it but it should be possible. Again, I'll make this a property in FormSegmentedElement.
from kformmaster.
Setting android:layout_weight="1" in the XML for the RadioButton seems to work. So, I'll add "fillSpace" as a property.
from kformmaster.
So, I'll add "fillSpace" as a property.
Sound perfect. Thank you.
Maybe you could add some properties for colors, corner and margin/padding as well.
I may be able to change color by adding "colorFormMasterElementRadioSelected" in my colors, but changing the corner radius by adding R.dimen.elementRadioCornerRadius to my dimens.xml is not working. Maybe a property could handle that.
And some properties to change text size and button padding would add more flexibility, too. What do you think?
from kformmaster.
Making progress...
from kformmaster.
I just released 4.6.2. Please update your dependency and let me know if the new properties work for you. The title for segmented will also be View.GONE if null or empty.
from kformmaster.
works great and looks fantastic! 🥇
Some further ideas for later:
- change stroke size with params
- change stroke color with params
from kformmaster.
Related Issues (20)
- ucrop sub-dependency 2.2.4 no longer exists HOT 1
- Header & Label background color HOT 3
- How to update height of segmented Button HOT 9
- upgrade RendererRecyclerViewAdapter dependency HOT 1
- Crash HOT 2
- Request: Allow to set the focus on an element HOT 2
- Use ListAdapter/notifyItem*Changed instead of notifyDataSetChanged HOT 2
- Recommendation for usage
- Build failed: Duplicate key: (row=string, column=action_cancel) HOT 4
- Segment appears on new line and does not return proper values HOT 3
- Not firing onValueChanged on FormSegmentedElement HOT 2
- displayValueFor in FormPickerMultiCheckBoxElement HOT 3
- Migrate to Maven Central HOT 13
- Multiline Editext Scroll
- Can't able to access that FormBuilderHelper's listener variable. HOT 2
- Not working with latest version of Dhaval2404/ImagePicker HOT 1
- Setting FormButtonElement margin in FormBuilder init has no effect HOT 2
- Error in jitpack HOT 2
- findViewById(R.id.chatRecyclerView) must not be null
- MultiLineEditTextElement PickerDropDownElement doesn't work correctly with multi line
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 kformmaster.