Aug 18, 2014 Replies: 21 This library was made based on UISegmentedControl for IOS Installation instructions: - Copy the .xml and .jar files to your custom libraries folder - Select in your REFERENCED LIBRARIES Version history: V1.0 (Not published): - Initial version V1.1 (Not published): - Bugs Corrections and add some features, like size of fonts, shadow (on/off), color of split, size of split, etc V1.2 (First public release) UISegmented Author: Alberto Iglesias Version: 1.2 UISegmented Fields: _shadow As Boolean _splitcolor As Int _splitwidth As Int Methods: IsInitialized As Boolean Tests whether the object has been initialized. _addbutton (pID As String, pText As String, pColor As Int, pSize As Int) As String Add a button like Segment. pID = Identifier to your Segment Button pText = Text to your Segment Button pColor = Color of the Text pSize = Size of the Text Examples: objUI1.addButton("y","num 2",Colors.Red,18) objUI2.addButton("4","4",Colors.White,18) objUI3.addButton("5","E",Colors.Black,14) _asview As PanelWrapper Return Panel Object from UISegment _author As String Return the author of this library _build (Width As Int, height As Int) As String Need build "AFTER" put all of segment buttons and Split to calculate sizes Example: objUI3.Build(250dip,50dip) _getpressed As String Return the Pressed Segment _initialize (vCallback As Object, ev As String, colorA As Int, colorB As Int) As String Initializes the object. You can add parameters to this method if needed. Examples: Dim objUI1 As UISegmented objUI1.Initialize(Me,"objUI2",Colors.ARGB(255,196,83,82),Colors.ARGB(255,216,29,8)) Dim objUI3 As UISegmented objUI3.Initialize(Me,"objUI3",Colors.White,Colors.White) _setpressedbytag (pTag As String) As String Force to pressed a segment button, identifing by TAG value _setpressedbytext (pText As String) As String Force to pressed a segment button, identifing by TEXT value _unpressall As String Unpress all of segment buttons _version As String Return the version of this library Version: 1.3 * Add a flag to invert colors when the button is push or not V1.3 (First public release) New flag added..... InvertedColors = True/False 2 UISegmented Samples with InvertedColors True and False: With InvertedColors = TRUE With InvertedColors = FALSE (DEFAULT) Attachments UISegmentTest1.zip UISegmentTest1.zip 6.5 KB · Views: 715 UISegmentTest2.zip UISegmentTest2.zip 10.3 KB · Views: 768 Library1.3.zip Library1.3.zip 7.6 KB · Views: 736 Library1.2.zip Library1.2.zip 7.5 KB · Views: 679 Last edited: Sep 1, 2014 Click to expand...
This library was made based on UISegmentedControl for IOS Installation instructions: - Copy the .xml and .jar files to your custom libraries folder - Select in your REFERENCED LIBRARIES Version history: V1.0 (Not published): - Initial version V1.1 (Not published): - Bugs Corrections and add some features, like size of fonts, shadow (on/off), color of split, size of split, etc V1.2 (First public release) UISegmented Author: Alberto Iglesias Version: 1.2 UISegmented Fields: _shadow As Boolean _splitcolor As Int _splitwidth As Int Methods: IsInitialized As Boolean Tests whether the object has been initialized. _addbutton (pID As String, pText As String, pColor As Int, pSize As Int) As String Add a button like Segment. pID = Identifier to your Segment Button pText = Text to your Segment Button pColor = Color of the Text pSize = Size of the Text Examples: objUI1.addButton("y","num 2",Colors.Red,18) objUI2.addButton("4","4",Colors.White,18) objUI3.addButton("5","E",Colors.Black,14) _asview As PanelWrapper Return Panel Object from UISegment _author As String Return the author of this library _build (Width As Int, height As Int) As String Need build "AFTER" put all of segment buttons and Split to calculate sizes Example: objUI3.Build(250dip,50dip) _getpressed As String Return the Pressed Segment _initialize (vCallback As Object, ev As String, colorA As Int, colorB As Int) As String Initializes the object. You can add parameters to this method if needed. Examples: Dim objUI1 As UISegmented objUI1.Initialize(Me,"objUI2",Colors.ARGB(255,196,83,82),Colors.ARGB(255,216,29,8)) Dim objUI3 As UISegmented objUI3.Initialize(Me,"objUI3",Colors.White,Colors.White) _setpressedbytag (pTag As String) As String Force to pressed a segment button, identifing by TAG value _setpressedbytext (pText As String) As String Force to pressed a segment button, identifing by TEXT value _unpressall As String Unpress all of segment buttons _version As String Return the version of this library Version: 1.3 * Add a flag to invert colors when the button is push or not V1.3 (First public release) New flag added..... InvertedColors = True/False 2 UISegmented Samples with InvertedColors True and False: With InvertedColors = TRUE With InvertedColors = FALSE (DEFAULT)
C CidTek Active Member Licensed User Longtime User Aug 18, 2014 #2 Any chance you can make a UISwitch?
NJDude Expert Licensed User Longtime User Aug 18, 2014 #3 Nice. Would it be possible you translated the following to keep it kosher? Code: Copy CorFonte As Int TamFonte As Int Texto As String
Nice. Would it be possible you translated the following to keep it kosher? Code: Copy CorFonte As Int TamFonte As Int Texto As String
Alberto Iglesias Well-Known Member Licensed User Longtime User Aug 19, 2014 #4 Ok NJDude, I will translate today and I post them
Alberto Iglesias Well-Known Member Licensed User Longtime User Aug 19, 2014 #5 The "UISwitch" is already exist, look in this EREL class: http://www.b4x.com/android/forum/threads/switch-view-android-4.38971/#content
The "UISwitch" is already exist, look in this EREL class: http://www.b4x.com/android/forum/threads/switch-view-android-4.38971/#content
Alberto Iglesias Well-Known Member Licensed User Longtime User Aug 19, 2014 #6 NJDude, this translate is not necessary, this type in only for internal use. I take off from documentation
NJDude, this translate is not necessary, this type in only for internal use. I take off from documentation
C CidTek Active Member Licensed User Longtime User Aug 19, 2014 #7 Alberto Iglesias said: The "UISwitch" is already exist, look in this EREL class: http://www.b4x.com/android/forum/threads/switch-view-android-4.38971/#content Click to expand... It doesn't look as good as the iOS one however, and since you were basing your SegmentedControl on the iOS version I thought I would put it out there. I like the look of the iOS 7 one even better as good design usually requires no text labels to explain On/Off. Last edited: Aug 19, 2014
Alberto Iglesias said: The "UISwitch" is already exist, look in this EREL class: http://www.b4x.com/android/forum/threads/switch-view-android-4.38971/#content Click to expand... It doesn't look as good as the iOS one however, and since you were basing your SegmentedControl on the iOS version I thought I would put it out there. I like the look of the iOS 7 one even better as good design usually requires no text labels to explain On/Off.
Alberto Iglesias Well-Known Member Licensed User Longtime User Aug 19, 2014 #9 OK CidTek, I do this library with this design based. In some days I put in the forum... I think it will help you and others users.
OK CidTek, I do this library with this design based. In some days I put in the forum... I think it will help you and others users.
C CidTek Active Member Licensed User Longtime User Aug 19, 2014 #10 Alberto Iglesias said: OK CidTek, I do this library with this design based. In some days I put in the forum... I think it will help you and others users. Click to expand... Thank you! And for those of us that port our apps to Blackberrys it will even have a native look on those platforms.
Alberto Iglesias said: OK CidTek, I do this library with this design based. In some days I put in the forum... I think it will help you and others users. Click to expand... Thank you! And for those of us that port our apps to Blackberrys it will even have a native look on those platforms.
Alberto Iglesias Well-Known Member Licensed User Longtime User Aug 20, 2014 #11 CidTek, It´s already done, look in: http://www.b4x.com/android/forum/threads/uiswitch-switch-control-ios-like.44020 Enjoy!
CidTek, It´s already done, look in: http://www.b4x.com/android/forum/threads/uiswitch-switch-control-ios-like.44020 Enjoy!
avacondios Active Member Licensed User Longtime User Aug 23, 2014 #12 Hi, can you share the source code ?
Douglas Farias Expert Licensed User Longtime User Aug 23, 2014 #13 have os limitation? android 2.3+ etc?
billyrudi Active Member Licensed User Longtime User Sep 1, 2014 #14 Hi Alberto, i have need to change the logic of the colors in your control. then selected one must be on e the other grayed. can you develop a flag to invert the selection? regards Paolo Lops
Hi Alberto, i have need to change the logic of the colors in your control. then selected one must be on e the other grayed. can you develop a flag to invert the selection? regards Paolo Lops
Alberto Iglesias Well-Known Member Licensed User Longtime User Sep 2, 2014 #15 Hey Paolo, Check the version 1.3, I do this for your request... Enjoy!
billyrudi Active Member Licensed User Longtime User Sep 2, 2014 #16 Hi Alberto you are great!. Are you sure that the library1.3.zip is correct? i don't see your flag...
Alberto Iglesias Well-Known Member Licensed User Longtime User Sep 2, 2014 #17 Yes, it is. Look: Version: 1.3 * Add a flag to invert colors when the button is push or not V1.3 (First public release) New flag added..... InvertedColors = True/False Just download this version.
Yes, it is. Look: Version: 1.3 * Add a flag to invert colors when the button is push or not V1.3 (First public release) New flag added..... InvertedColors = True/False Just download this version.
Mashiane Expert Licensed User Longtime User Jul 6, 2016 #19 Nice work, would be nice though of instead of text one can add images to each item. Any considerations?
Nice work, would be nice though of instead of text one can add images to each item. Any considerations?
Dave O Well-Known Member Licensed User Longtime User Dec 22, 2016 #20 Is there a way to set the selection color? (It currently seems fixed as a dark gray.) Basically, I'd like to create a control like the red/white one in the lower left of the graphic in the first post (unselected = white, selected = color).
Is there a way to set the selection color? (It currently seems fixed as a dark gray.) Basically, I'd like to create a control like the red/white one in the lower left of the graphic in the first post (unselected = white, selected = color).