A wrap for this Github project. Posting
1. B4A project
2. Java Code (src and libs folders)
3. B4A library files
4. Other JAR's and XML's to be copied to your additional library folder.
It will raise an event in the B4A project when a book is clicked.
Copy LibRes.zip from here https://www.dropbox.com/s/z8g1y000r3go6iv/ShelfViewLibRes.zip?dl=0
Extract it and copy folder LibRes and its contents to be on the same folder level as that of the /Files and /Objects folders of the B4A project
Ensure that you have AppCompat V3.20 enabled in your B4A project's library tab
Change the wrapper and original Java code to your liking.
Take note of the permissions added in the B4A manifest file.
Sample Code:
Library:
ShelfView
Author: Github: Adeyinka Adediji, Wrapped by: Johan Schoeman
Version: 1
1. B4A project
2. Java Code (src and libs folders)
3. B4A library files
4. Other JAR's and XML's to be copied to your additional library folder.
It will raise an event in the B4A project when a book is clicked.
Copy LibRes.zip from here https://www.dropbox.com/s/z8g1y000r3go6iv/ShelfViewLibRes.zip?dl=0
Extract it and copy folder LibRes and its contents to be on the same folder level as that of the /Files and /Objects folders of the B4A project
Ensure that you have AppCompat V3.20 enabled in your B4A project's library tab
Change the wrapper and original Java code to your liking.
Take note of the permissions added in the B4A manifest file.
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddManifestText(<uses-permission android:name="android.permission.INTERNET" />)
AddManifestText(<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />)
'End of default text.
Sample Code:
B4X:
#Region Project Attributes
#ApplicationLabel: b4aShelfView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\LibRes
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private sv1 As ShelfView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
Dim url() As String = Array As String("http://eurodroid.com/pics/beginning_android_book.jpg", _
"http://eurodroid.com/wp3/wp-content/uploads/2014/10/samsung-galaxy-a5.jpg", _
"http://3.bp.blogspot.com/-aDUhP55KerE/UGbxmCkyKOI/AAAAAAAAKM8/Ms7Hs6Ln524/s1600/cover.png", _
"https://raw.githubusercontent.com/emmby/android-For-dummies-v3/master/assets/book-cover.png", _
"http://devproconnections.com/site-files/devproconnections.com/files/uploads/2014/06/Riley%20DCM1061%20Pro_Android_book_cover.jpg", _
"http://whatpixel.com/images/2016/08/android-programming-pushing-the-limits.jpg", _
"http://www.lopez-manas.com/wp-content/uploads/2015/07/cover-Kopie-212x300.png", _
"https://www.packtpub.com/sites/default/files/9781785883262.png")
Dim index() As String = Array As String("1", "2", "3", "4", "5", "6", "7", "8")
Dim bookname() As String = Array As String("Beginning Android", _
"Samsung", _
"Smashing Android UI", _
"Android For Dummies V3", _
"Professional Android Programming", _
"Pushing The Limits", _
"100 Questions and Answers", _
"Android Programming for Beginners")
sv1.loadFromURL(url, index, bookname)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub sv1_book_clicked(position As Int, bookId As String, bookTitle As String)
Log("position = " & position)
Log("book ID = " & bookId)
Log("book Title = " & bookTitle)
End Sub
Library:
ShelfView
Author: Github: Adeyinka Adediji, Wrapped by: Johan Schoeman
Version: 1
- ShelfView
Events:- book_clicked (position As Int, bookId As String, bookTitle As String)
- ba As BA
- 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)
- 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)
- loadFromURL (booksurl() As String, booksid() As String, bookname() As String)
- onBookClicked (position As Int, bookId As String, bookTitle As String)
- Background As Drawable
- Color As Int [write only]
- Enabled As Boolean
- Height As Int
- Left As Int
- Padding()() As Int
- Parent As Object [read only]
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int