B4A Library [Library] B4aGridView v3.80

Douglas Farias

Expert
Licensed User
Longtime User
because i want show the images from web automatic later the app is on resume without click at button *-*
loadgrid and later download images automatic

without
GridView.ShowFromWeb(fromWeb,False)
If posSelected > GridView.Length Then
posSelected = GridView.Length-1EndIf
GridView.Selection = posSelected
on resume i have the same error
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi Douglas, for this error

it.giuseppe.salvi.library.photo.grid.view.adapter.PhotoGridBaseAdapter.getBitmapFromAssets(PhotoGridBaseAdapter.java:248)

did u copy the 3 icons stored in assets folder in the demo to your assets folder

P.S.

U can use your icons instead of my one but give the same name.
 

lonleystar

Well-Known Member
Licensed User
Longtime User
because i want show the images from web automatic later the app is on resume without click at button *-*
loadgrid and later download images automatic

without

on resume i have the same error

If u use GridView.ResumeEngine in Activity_Resume please use also GridView.StopEngine in Activity_Pause anyway I test it now and i din get any error
 

Douglas Farias

Expert
Licensed User
Longtime User
and its possible use square with border?
in my code is border = true and color = white but dont work on the device *-*
 

Douglas Farias

Expert
Licensed User
Longtime User
If u use GridView.ResumeEngine in Activity_Resume please use also GridView.StopEngine in Activity_Pause anyway I test it now and i din get any error
yes now with the icons on assets i dont have error thx *-*
i need only fix the border on square
 

lonleystar

Well-Known Member
Licensed User
Longtime User
and its possible use square with border?
in my code is border = true and color = white but dont work on the device *-*


yes this way below

B4X:
GridView.SetNoEffect = False

GridView.FadeInTime = 300

GridView.RoundedBitmap = False

GridView.SetBorderColor = Colors.Yellow

GridView.SetCornerRadius = 20

GridView.SetBorderWidth = 2
 

Douglas Farias

Expert
Licensed User
Longtime User
i m using
B4X:
    'GRID
    GridView.Initialize("GridView")
    '*************************************
    Activity.AddView(GridView,2%X,56%Y,95%x,15%y)
    '*************************************
    GridView.ItemWidth= 25%x
    GridView.ItemHeight= 23%y
    GridView.HorizontalSpacing = 4dip
    GridView.VerticalSpacing = 4dip
    GridView.NumColumns = 4
    '*************************************
    GridView.ScaleType = GridView.ScaleType.Center
    '*************************************
    GridView.SetNoEffect = False
    GridView.FadeInTime = 300
    GridView.RoundedBitmap = False
    GridView.SetBorderColor = Colors.White
    GridView.SetCornerRadius = 20
    GridView.SetBorderWidth = 2
    '*************************************
    GridView.ProgressBarIndeterminate = False
    GridView.ProgressBarVisible = True
    '*************************************
    fromWeb = Array As String( _
    "https://lh4.googleusercontent.com/-Z4zGiC5nWdc/URqvBdEwivI/AAAAAAAAAbs/ZRZR1VJ84QA/s1024/Sin%252520Lights.jpg", _
            "https://lh4.googleusercontent.com/-_0cYiWW8ccY/URqvBz3iM4I/AAAAAAAAAbs/9N_Wq8MhLTY/s1024/Starry%252520Lake.jpg", _
            "https://lh3.googleusercontent.com/-A9LMoRyuQUA/URqvCYx_JoI/AAAAAAAAAbs/s7sde1Bz9cI/s1024/Starry%252520Night.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg")

but dont show me border =(
 

Douglas Farias

Expert
Licensed User
Longtime User
and last question its possible add a slide horizontal?

< show 4 imagens on screnn > but have 60 and user can scrool to horizontal *-*

can u add this on your next version ?


and 2° sugestion is
add removeallimages
 
Last edited:

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi douglas, I tested the code and whith different scaletype work use
GridView.ScaleType = GridView.ScaleType.... instead ScaleType.Center i really dont know why it doesnt work now but I'll fix it.

For to add a slide horizontal U mean to scroll the grid Horizontally ? if yes I dont know when i can do this but I'll try
 

Douglas Farias

Expert
Licensed User
Longtime User
For to add a slide horizontal U mean to scroll the grid Horizontally ? if yes I dont know when i can do this but I'll try
yes = HorizontalScrollView1 on the design

u move to right and left *-*



thx for u fast suport man
 

Douglas Farias

Expert
Licensed User
Longtime User
this is a lib?
i like B4aGridView because download fast the url images *-*-* realy fast io go need download imagens all time
 

Douglas Farias

Expert
Licensed User
Longtime User
Look this
i m making a social app
on the fotos não enviadas is = 4 photos ever

on fotos enviadas is = unlimited user can send to my serve 200 + photos but is realy bad use scroll only on fotos enviadas

look at 2° image scrool this up and down is not a good ideia here xD
i think left and right is perfect *-*

if u have a time try make pls man *-*
 

Attachments

  • 10517589_797742306922654_2513594936626201227_n.jpg
    64.7 KB · Views: 284
  • 10517589_797742306922654_2513594936626201227_n.jpg
    239.5 KB · Views: 291

Mrjoey

Active Member
Licensed User
Longtime User
i got outofmemory error , im using GridView.ShowFromWeb.....what is wrong?
B4X:
java.lang.OutOfMemoryError
    at android.graphics.Bitmap.nativeCreate(Native Method)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:640)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:620)
    at it.giuseppe.salvi.library.photo.grid.view.utility.bitmap.RoundedDrawable.drawableToBitmap(RoundedDrawable.java:112)
    at it.giuseppe.salvi.library.photo.grid.view.adapter.PhotoGridBaseAdapter.addBorderToBitmap(PhotoGridBaseAdapter.java:238)
    at it.giuseppe.salvi.library.photo.grid.view.adapter.PhotoGridBaseAdapter.getBitmapFromAssets(PhotoGridBaseAdapter.java:251)
    at it.giuseppe.salvi.library.photo.grid.view.adapter.PhotoGridBaseAdapter.initOptions(PhotoGridBaseAdapter.java:85)
    at it.giuseppe.salvi.library.photo.grid.view.adapter.PhotoGridBaseAdapter.<init>(PhotoGridBaseAdapter.java:79)
    at it.giuseppe.salvi.gridview.library.main.activity.PhotoGridViewActivity.Initialize(PhotoGridViewActivity.java:79)
    at b4a.example.loadcovers._activity_create(loadcovers.java:311)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
    at b4a.example.loadcovers.afterFirstLayout(loadcovers.java:98)
    at b4a.example.loadcovers.access$100(loadcovers.java:16)
    at b4a.example.loadcovers$WaitForLayout.run(loadcovers.java:76)
    at android.os.Handler.handleCallback(Handler.java:615)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4898)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
    at dalvik.system.NativeStart.main(Native Method)
 

Mrjoey

Active Member
Licensed User
Longtime User
another bug:
setarraylist wont show the images , instead it shows an exlamation mark picture like an error , but it shows in the photoviewpager activity...
 

Mrjoey

Active Member
Licensed User
Longtime User

solved , i was calling GridView.ShowFromWeb many times with the same array string.....
 

Constantin Cosoiu

New Member
Licensed User
Longtime User
Hi Constantin, Which help u mean?.
Because I know you are busy and I thought of a more "general" way to implement "embedded views" for each item, i would like to help, if possible, with coding, to make this the best library around.

I do not know if you are using a panel for an item and if you keep a reference to it (in order to change its on the fly later, after a certain image has been downloaded), but if you do, I'd try to write couple of functions to implement the behaviors from my #1 and #2.

Of course, if you don't do them yourself or come with a better solution.

thank you
 

Shahid Saeed

Active Member
Licensed User
Longtime User

If you are loading the GridView in a panel or any other view but not the Activity it will cut from the bottom, I had this issue. And the solution was to load the GridView directly in Activity.
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi guys, I'm happy to release b4gridView v3.20. Added:

TextLines - Get or Sets the TextView exactly this many lines tall.

TextColor - Get or Sets Text Color.

TextSize - Get or Sets the size of the text

ShowText - Get or Sets the visibility of the text

SetText - Sets the string value of the TextView.

TextGravity - Get or Sets the horizontal alignment of the text gravity that will be used.

TextPosition - Get or Sets the position alignment of the text that will be used.

TextBackGroundAlpha - Get or Sets alpha property of the view, as a value between 0 (completely transparent) and 255 (completely opaque).

TextBackGroundColor - Sets the background color for this view.

**************************************************************************************

LoadFontFromAssets - Loads a new Typeface from the specified font data.

TextTypeFace.LoadFontFromAssets - Loads a new Typeface from the specified font data.

LoadFontFromFile - Loads a new Typeface from the specified font data.

TextTypeFace.LoadFontFromFile - Loads a new Typeface from the specified font data.

**************************************************************************************

TextTypeFace - Get or Sets the typeface and style in which the text should be displayed. Note that not all Typeface families actually have bold and italic variants, so you may need to use TextStyle(style) to get the appearance that you actually want.

TextStyle - Sets the style in which the text should be displayed.

CompressFormat - Get or Sets the known formats a bitmap can be compressed into [ JPG or PNG ]

CompressQuality - Get or Sets the quality of a bitmap, that can be compressed. [ 0 = low - 100 = high ]


SetImageOnLoading - Sets own icon from assets [ on loading ]

SetImageOnFail - Sets own icon from assets [ on fail ]

Initialize2 - Initialize the object and set own cache directory

Tag - Returns this view's tag.

ScaleTypeForRounded - Controls how the RoundedBitmap should be resized or moved to match the size of this ImageView.


Any comment or suggestion will be appreciated.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…