B4A Library SelectableRoundedImageView

Discussion in 'Additional libraries, classes and official updates' started by Johan Schoeman, Jun 20, 2015.

Similar threads

B4A Tutorial [java] Custom View with Designer Support (Java library)
B4A Library PanoramaImageView
B4A Library CircleProgressMaster
B4A Library SnakeView
B4A Library LEDView
B4A Library AnimatedCheckbox V1.0.1
  1. Johan Schoeman

    Johan Schoeman Expert Licensed User

    This library wraps this project. The code is self explanatory and quite simple. Attached the B4A project. The library files (JAR & XML) are in the /files folder of the attached project. Copy them to your additional libraries folder.

    You can set the radius of each of the 4 corners of the bitmap individually (dip - pass a float)
    You can set the color of the border
    You can set the width of the border (dip - pass a float)
    You can pass a Boolean (=True) for the bitmap to appear oval shaped

    It uses resource /Objects/res/values/attrs.xml - include it in your project.

    Thanks @DonManfred!


    SelectableRoundedImageView.png

    SelectableRoundedImageView
    Version:
    1
    • SelectableRoundedImage
      Fields:
      • ba As BA
      Methods:
      • BringToFront
      • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
      • 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)
      • 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)
      • setCornerRadiiDP (leftTop As Float, rightTop As Float, leftBottom As Float, rightBottom As Float)
      Properties:
      • Background As Drawable
      • BorderColor As Int [write only]
      • BorderWidthDP As Float [write only]
      • Color As Int [write only]
      • Enabled As Boolean
      • Height As Int
      • ImageBitmap As Bitmap [write only]
      • Left As Int
      • Oval As Boolean [write only]
      • Tag As Object
      • Top As Int
      • Visible As Boolean
      • Width As Int
     

    Attached Files:

    Last edited: Jul 4, 2015
    koaunglay, ArminKH, Isac and 6 others like this.
  2. FrankBerra

    FrankBerra Active Member Licensed User

    How to set the Gravity propriety of the images?
    With your example i can see only a small picture of the dogs inside the boxes...
     
  3. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Can you post a screenshot please.
     
  4. FrankBerra

    FrankBerra Active Member Licensed User

    Yes, sure. Take a look
     

    Attached Files:

  5. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Please try it with the attached new library files (I am shooting in the dark here as I don't see what you see on any of my devices)....
     

    Attached Files:

    FrankBerra likes this.
  6. FrankBerra

    FrankBerra Active Member Licensed User

    Yeah! Now it is working! Thank you for the quick fix
     
    Johan Schoeman likes this.
  7. ArminKH

    ArminKH Well-Known Member

    great ! good luck teacher ;)
     
    Johan Schoeman likes this.
Loading...