Oct 10, 2015 Replies: 30 This is a wrapper for this Github-Project. MaterialFavoriteButton Version: 1 MaterialFavoriteButton Fields: ba As BA Methods: AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int) BringToFront DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map) Initialize (EventName As String) Invalidate Invalidate2 (arg0 As Rect) Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int) IsInitialized As Boolean RemoveView RequestFocus As Boolean SendToBack SetBackgroundImage (arg0 As Bitmap) SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int) SetFavorite (favorite As Boolean) Changes the favorite state of this button. favorite: true to favorite the button, false to uncheck it SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int) SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int) SetVisibleAnimated (arg0 As Int, arg1 As Boolean) isFavorite As Boolean Returns favorite state. Return type: @return:true if button is in favorite state, false if not Properties: AnimateFavorite As Boolean [write only] AnimateUnfavorite As Boolean [write only] Background As Drawable BounceDuration As Int [write only] Color As Int [write only] Enabled As Boolean FavoriteResource As String [write only] Height As Int Left As Int NotFavoriteResource As String [write only] Padding As Int [write only] RotationAngle As Int [write only] RotationDuration As Int [write only] Tag As Object Top As Int Type As Int [write only] Visible As Boolean Width As Int There are four "build-in" favorites: Heart and Star. Each in White and Black They can be set using the "Color" and the "Type" of the FavoriteButton Color = 0 (Black) or 1 (White) Type = 0 (Star) or 1 () But you can set your own Favorite Buttons using Code: Copy fav3.FavoriteResource = "ic_event_available_black_24dp" fav3.NotFavoriteResource = "ic_event_busy_black_24dp" If you want to donate for my work building the wrapper you can do it here: Attachments MaterialFavoriteButtonEx.zip MaterialFavoriteButtonEx.zip 44.2 KB · Views: 1,001 libFavoriteButtonV1.0.0.zip libFavoriteButtonV1.0.0.zip 15.1 KB · Views: 985 Last edited: Oct 13, 2015 Click to expand...
This is a wrapper for this Github-Project. MaterialFavoriteButton Version: 1 MaterialFavoriteButton Fields: ba As BA Methods: AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int) BringToFront DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map) Initialize (EventName As String) Invalidate Invalidate2 (arg0 As Rect) Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int) IsInitialized As Boolean RemoveView RequestFocus As Boolean SendToBack SetBackgroundImage (arg0 As Bitmap) SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int) SetFavorite (favorite As Boolean) Changes the favorite state of this button. favorite: true to favorite the button, false to uncheck it SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int) SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int) SetVisibleAnimated (arg0 As Int, arg1 As Boolean) isFavorite As Boolean Returns favorite state. Return type: @return:true if button is in favorite state, false if not Properties: AnimateFavorite As Boolean [write only] AnimateUnfavorite As Boolean [write only] Background As Drawable BounceDuration As Int [write only] Color As Int [write only] Enabled As Boolean FavoriteResource As String [write only] Height As Int Left As Int NotFavoriteResource As String [write only] Padding As Int [write only] RotationAngle As Int [write only] RotationDuration As Int [write only] Tag As Object Top As Int Type As Int [write only] Visible As Boolean Width As Int There are four "build-in" favorites: Heart and Star. Each in White and Black They can be set using the "Color" and the "Type" of the FavoriteButton Color = 0 (Black) or 1 (White) Type = 0 (Star) or 1 () But you can set your own Favorite Buttons using Code: Copy fav3.FavoriteResource = "ic_event_available_black_24dp" fav3.NotFavoriteResource = "ic_event_busy_black_24dp" If you want to donate for my work building the wrapper you can do it here:
Daniel-White Active Member Licensed User Longtime User Oct 10, 2015 #3 Well done, Very nice feature. Thanks for share it.
X xor83 Member Licensed User Longtime User Dec 16, 2015 #4 Hello, How can I create listing shown in screenshot? What are those panels?
DonManfred Expert Licensed User Longtime User Dec 16, 2015 #5 xor83 said: What are those panels? Click to expand... i dont know, sorry it is a screenshot from the github project. maybe from an java app You can create a panel and use a 9patch drawable for it...
xor83 said: What are those panels? Click to expand... i dont know, sorry it is a screenshot from the github project. maybe from an java app You can create a panel and use a 9patch drawable for it...
I inakigarm Well-Known Member Licensed User Longtime User Dec 16, 2015 #7 xor83 said: Hello, How can I create listing shown in screenshot? What are those panels? Click to expand... I think they are Cardview view (in a scrollview). See @thedesolatesoul MSCardview library (https://www.b4x.com/android/forum/threads/mscardview.47710/#content)
xor83 said: Hello, How can I create listing shown in screenshot? What are those panels? Click to expand... I think they are Cardview view (in a scrollview). See @thedesolatesoul MSCardview library (https://www.b4x.com/android/forum/threads/mscardview.47710/#content)
Prosg Active Member Licensed User Longtime User Dec 20, 2015 #8 Hello, I want to add a Favorite Icon without Designer CustomView so i did this Code: Copy fav1.Initialize("") fav1.AnimateFavorite = True fav1.AnimateUnfavorite = True fav1.Color = 0 fav1.Type = 1 Activity.AddView(fav1,0,0,50dip,50dip) All works but in log i have this : lib: NOTFOUND '_onfavoritechanged lib: NOTFOUND 'favorite_onfavoritechanged Any idea ? regards
Hello, I want to add a Favorite Icon without Designer CustomView so i did this Code: Copy fav1.Initialize("") fav1.AnimateFavorite = True fav1.AnimateUnfavorite = True fav1.Color = 0 fav1.Type = 1 Activity.AddView(fav1,0,0,50dip,50dip) All works but in log i have this : lib: NOTFOUND '_onfavoritechanged lib: NOTFOUND 'favorite_onfavoritechanged Any idea ? regards
DonManfred Expert Licensed User Longtime User Dec 20, 2015 #9 Prosg said: Any idea ? Click to expand... Yes. This are just debug-output from the lib telling you that the eventsubs are not found. Normally these events were raised... But as you dont have them in your code they are ignored. You can ignore these log-output.
Prosg said: Any idea ? Click to expand... Yes. This are just debug-output from the lib telling you that the eventsubs are not found. Normally these events were raised... But as you dont have them in your code they are ignored. You can ignore these log-output.
A Alisson Active Member Licensed User Jan 5, 2016 #10 I have the error: DonManfred, what is need to do to run the example? Thanks very much Attachments upload_2016-1-5_16-20-43.png 138.7 KB · Views: 720
DonManfred Expert Licensed User Longtime User Jan 5, 2016 #11 You have an error in your manifest it seems. This has nothing to do with this library. Maybe it is the b4 a version you are using? Last edited: Jan 5, 2016
You have an error in your manifest it seems. This has nothing to do with this library. Maybe it is the b4 a version you are using?
A Alisson Active Member Licensed User Jan 5, 2016 #12 I use the B4A 5.50 and mobile device Android 4.4.2
DonManfred Expert Licensed User Longtime User Jan 5, 2016 #13 Alisson said: I use the B4A 5.50 and mobile device Android 4.4.2 Click to expand... Ok, this should work... You are trying to compile the example code from Post #1?
Alisson said: I use the B4A 5.50 and mobile device Android 4.4.2 Click to expand... Ok, this should work... You are trying to compile the example code from Post #1?
DonManfred Expert Licensed User Longtime User Jan 5, 2016 #14 Can you please post the content of you manifest content? Or directly upload the code you are using. even if it is the sample from post #1... I just tried the example above and it works fine here. Which android.jar do you have defined in the configure paths dilog?
Can you please post the content of you manifest content? Or directly upload the code you are using. even if it is the sample from post #1... I just tried the example above and it works fine here. Which android.jar do you have defined in the configure paths dilog?
A Alisson Active Member Licensed User Jan 5, 2016 #15 Yes, I try to compile the example code from Post #1.
A Alisson Active Member Licensed User Jan 5, 2016 #16 'This code will be applied to the manifest file during compilation. 'You do not need to modify it in most cases. 'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136 AddManifestText( <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/>) SetApplicationAttribute(android:icon, "@drawable/icon") SetApplicationAttribute(android:label, "$LABEL$") SetApplicationAttribute(android:theme, "@android:style/Theme.Holo") 'End of default text.
'This code will be applied to the manifest file during compilation. 'You do not need to modify it in most cases. 'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136 AddManifestText( <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/>) SetApplicationAttribute(android:icon, "@drawable/icon") SetApplicationAttribute(android:label, "$LABEL$") SetApplicationAttribute(android:theme, "@android:style/Theme.Holo") 'End of default text.
DonManfred Expert Licensed User Longtime User Jan 5, 2016 #17 Alisson said: 'End of default text. Click to expand... ok, same here.
A Alisson Active Member Licensed User Jan 5, 2016 #18 The line: 'End of default text. Is need remove? I sorry, I am beginer.
DonManfred Expert Licensed User Longtime User Jan 5, 2016 #19 Which android.jar do you have defined in the configure paths dialog in the ide? Maybe this is from interest....
Which android.jar do you have defined in the configure paths dialog in the ide? Maybe this is from interest....
DonManfred Expert Licensed User Longtime User Jan 5, 2016 #20 Alisson said: Is need remove? Click to expand... No. It starts with a ' so it is a comment...