B4A Library MSCardView

xor83

Member
Licensed User
Longtime User
Cannot find the res folder. I have this path: C:\android\extras\android\m2repository\com\android\support\cardview-v7\23.0.0

Got this error message:
invalid resource directory name: c:\android\extras\android\m2repository\com\android\support\cardview-v7 21.0.0
invalid resource directory name: c:\android\extras\android\m2repository\com\android\support\cardview-v7 21.0.2
invalid resource directory name: c:\android\extras\android\m2repository\com\android\support\cardview-v7 21.0.3
 

DonManfred

Expert
Licensed User
Longtime User
Cannot find the res folder. I have this path: C:\android\extras\android\m2repository\com\android\support\cardview-v7\23.0.0
You need to remove the resourcefolder-reference. Remove the #additionalres line and add
B4X:
#additionaljar: com.android.support:cardview-v7
instead

Hopefully it works...
 

xor83

Member
Licensed User
Longtime User
I am also getting this error:

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Landroid/support/v7/widget/CardViewJellybeanMr1;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)


I am using MSCardView

Please help.
 

thedesolatesoul

Expert
Licensed User
Longtime User
The library jar file includes classes from the support library. This is a mistake. You will need to open the jar file with 7zip and remove the android folder.
I dont think the mistake was to include the classes. The mistake was not to rename them to something else. I didnt want to re-code the wrapper everytime google changed the support library.
 

Kwame Twum

Active Member
Licensed User
Longtime User
Kindly disabled the logs in your library... it's irritating if you have a list of CardViews to scroll through. Your logcat ends up having lots of those. This wastes time since a user might not readily find their own logs.
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
Wow, this is cool stuff, just experimented with this library and used layouts to load to the cards. Thing is even if you set your anchors, these dont get adjusted when the layout is loaded to the card. As I was checking out views that fit the whole width of the card, I had to adjust the width after loading the layout to the card.

B4X:
Sub SetUpCards
    cv1.MaxElevation = 10dip
    cv1.Elevation = 4dip
    cv1.Radius = 0dip
    cv1.Panel.LoadLayout("card1")
    txtFirstName.Width = cv1.Width - 40dip

    cv2.Panel.LoadLayout("card2")
    cv2.Radius = 5
    cv2.MaxElevation = 10dip
    cv2.Elevation = 5dip

    btnCard2.Width = cv2.Width - 40dip
    cboSpinner.Width = cv2.Width - 40dip
End Sub

NB: All I had to do was to reference the MSCardView library only. Adding the AdditionalRes created an exception. You can check the example herein and see the designer layouts. Overall, this is brilliant stuff!!!

 

Attachments

  • MSCardView.zip
    17.4 KB · Views: 318
Cookies are required to use this site. You must accept them to continue using the site. Learn more…