B4A Library DesignSupport - Additional Material Design components

This library is a wrapper to some of the objects of Googles Design Support library.

Requirements:

This library requires B4A 6.31 or above.
From V2.32 on B4A V6.80 or newer is required. If you use an older B4A version use the V2.31 library.
AppCompat 3.30 or above is required.
The examples need some additional libraries like AHViewPager, XMLViewEx, XMLLayoutBuilder

Currently it supports:
  • Snackbar - The new modern toastmessages

  • TabLayout - The new material like tabs with fixed tabs and scrolling tabs feature. Works standalone or together with a ViewPager library. Supports icons as tabs and custom layouts for the tabs.

  • FloatlabelEditText - An enhanced EditText object that supports a floating label, counter and error messages.

  • FloatingActionButton - A very simple Floating Action Button. Has show- and hide animations but is very simple.
  • NavigationDrawer - Material Design compliant Navigation Drawer. See NavigationView Example for detailed instructions.
  • BottomNavigationView - Material Design compliant Bottom Navigation View. See BottomNavigationView Example for detailed instructions.
Installation:
  1. This library depends on the AppCompat library. So do all the setup needed for AppCompat.
  2. Copy the DesignSupport.xml, DesignSupport.jar and DesignSupport.aar files to your CustomLibs folder
  3. Install/Update Android Support Packages with the SDK Manager.
Setup and usage:
  1. Setup your project like a project that uses AppCompat library.
If you want to use the DSFloatlabelEditText object with the ErrorText or counter feature you should add the following item to your Theme:
B4X:
<item name="textColorError">@color/design_textinput_error_color_light</item>
Otherwise your app will crash if the textinput reaches the maxCounter length.

If you want to use the DSNavigationDrawer object you should add the following items to your Theme:
B4X:
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>



Version History:

V1.00
  • Initial version with SnackBar and TabLayout objects.
V2.00
  • Requires B4A 6.0 or above
  • Uses new Maven repositories for support libraries
  • Enhanced Designer support (custom properties are supported)
  • New: DSFloatlabelEditText - New EditText with floating label, counter, error messages
  • New: DSFloatingActionButton - Standard Floating Action Button.
V2.10
  • New: Requires Support Repository 36
  • New: DSNavigationDrawer - A complete DrawerLayout implementation/wrapper
  • New: DSNavigationView
  • New: Support for ShowPasswordToggle in FloatLabelEditText
  • Fix: FloatLabelEditText.Enabled=True/False should work now.
V2.20
  • Fix: DSNavigationDrawer should work without a secondary drawer.
  • New: BottomNavigationView - Wrapper for the BottomNavigationView
  • Fix: Some minor fixes and changes
V2.21
  • Fix: DSTablayout can use other ViewPagers than AHViewPager
  • Fix: Small internal bugfixes.
V2.22
  • Fix: Change packagename to anywheresoftware.b4a.orbjects to reduce resouce fields
V2.23
  • Fix: Fix error in FloatLabelEditText
V2.30
  • New: Dismiss event for DSSnackbar
  • New: Support CharSequence where possible
V2.31
  • Fix: Getters return String instead of CharSequence to avoid problems.
V2.32
  • Fix: Compiled against B4A 6.80 Core library to avoid some problems with CharSequences.
V3.00
  • Fix: Compiled against Support Library 28.0.0 to fix a problem with TabLayout
 

Attachments

  • FixedTabsExample2_00.zip
    23.4 KB · Views: 2,008
  • FloatLabelEditText1_0.zip
    8.2 KB · Views: 1,640
  • FloatingActionButton1_0.zip
    12.5 KB · Views: 1,766
  • ScrollingTabsExample2_00.zip
    8.3 KB · Views: 1,768
  • SnackBarExample2_00.zip
    7.7 KB · Views: 1,630
  • TabsWithCustomViewExample2_0.zip
    24.5 KB · Views: 1,896
  • NavigationView1_0.zip
    108.9 KB · Views: 2,559
  • BottomNavigationViewExample1_0.zip
    28.7 KB · Views: 1,796
  • DesignSupportLib2_31.zip
    58.3 KB · Views: 1,441
  • DesignSupportLib2_32.zip
    58.3 KB · Views: 2,195
  • DesignSupportLib3_00.zip
    65.9 KB · Views: 2,468
Last edited:

Lello1964

Well-Known Member
Licensed User
Longtime User
I have updated to Android-28 sdk and cannot complie.
Have this error.

How can i do ???
 

Attachments

  • errore.png
    39.6 KB · Views: 418
  • errore1.png
    55.1 KB · Views: 415

Roberto P.

Well-Known Member
Licensed User
Longtime User
It seems that google messed up something with the design-support dependencies.

I can confirm that I have this error, too. Currently I don't know of a fix for it.


Hello
I just updated sdk and it appeared error:



did you find the solution? Do you have any advice to give?

I'm blocked!

thank you
 

jimmyF

Active Member
Licensed User
Longtime User
I solved the update to Android 28 by downloading the entire, up-to-date, sdk from Google https://developer.android.com/studio/ (go to bottom of the page).
I extracted it completely to my b4a_sdk folder and overwrote everything.
I then ran my sdkManager, searched for Android Platform 28 and checked it, updated all, and and got everything working, including AH PageViewer, but excluding DSTabLayout, in my app.

DSTabLayout error: same as first post
 

scsjc

Well-Known Member
Licensed User
Longtime User

Any solution for DSTabLayout error with SDK28 ???
 

corwin42

Expert
Licensed User
Longtime User

corwin42

Expert
Licensed User
Longtime User
First post is updated with a new version which should fix the crash with 28.0.0 support library TabLayout.
 

scsjc

Well-Known Member
Licensed User
Longtime User
First post is updated with a new version which should fix the crash with 28.0.0 support library TabLayout.

Work Perfectly

̶O̶n̶e̶ ̶i̶d̶e̶a̶,̶ ̶i̶s̶ ̶p̶o̶s̶s̶i̶b̶l̶e̶ ̶a̶ ̶c̶h̶a̶n̶g̶e̶ ̶c̶o̶l̶o̶r̶t̶e̶x̶t̶ ̶o̶r̶ ̶b̶a̶c̶k̶g̶r̶o̶u̶n̶d̶c̶o̶l̶o̶r̶ ̶f̶r̶o̶m̶ ̶e̶s̶p̶e̶c̶i̶f̶i̶c̶ ̶t̶a̶b̶ ̶i̶n̶d̶e̶x̶?̶

Correct, there was already a way to do it, of course very good library

B4X:
Dim cs As CSBuilder
cs.Initialize.Color(colors.red).Append("TEXT").PopAll
TabLayout.SetTabText(1, cs)

Thank you
 
Last edited:

Scantech

Well-Known Member
Licensed User
Longtime User
still crashes with new update.

Installed v3.00 and crashes with both 27.1.1 and 28.0.0 support library

Update: I missed the appcompat update. i will try it later on
 
Last edited:

IlCasti

Active Member
Licensed User
Longtime User
How to set custom typeface to items in NavigationView?
How to change typeface font?
Thank you for helping me.
 

Pedro Hu

Member
thanks but now I get this error and I don't know how to solve it:
res\values\theme.xml:9: error: Error: No resource found that matches the given name: attr 'textColorError'.
Sorry I'm something new if this is very obvious.
 

Lello1964

Well-Known Member
Licensed User
Longtime User
Try to copy resource folder into your app folder.

The folder is inside demo app folder.
 

Pedro Hu

Member
I'm trying to compile the FloatingActionButton 1_0 example to understand how it works but the example gives me this error:
res \ values \ theme.xml: 9: error: Error: No resource found that matches the given name: attr 'textColorError'.
I don't know if I installed the library wrong or what should I do?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…