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
    Screenshot_20151001-110844.png
  • 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.
    Screenshot_20151001-110749.pngScreenshot_20151001-110809.png
  • FloatlabelEditText - An enhanced EditText object that supports a floating label, counter and error messages.
    Screenshot_20160624-105201.png
  • FloatingActionButton - A very simple Floating Action Button. Has show- and hide animations but is very simple.
    Screenshot_20160624-104708.png
  • NavigationDrawer - Material Design compliant Navigation Drawer. See NavigationView Example for detailed instructions.
    Screenshot_20160826-160906.png
  • BottomNavigationView - Material Design compliant Bottom Navigation View. See BottomNavigationView Example for detailed instructions.
    Screenshot_20161219-091326.png
Installation:
Note: Please, Please read these instructions carefully. AppCompat depends on many things like a special theme with special features. Even special versions of build tools are required and last but not least there are often bugs in the Google support libraries.

I created this instructions to help you getting things ready for using AppCompat. So please follow these instructions carefully and all should work as expected and you don't have to ask in the forum.

Thanks.
  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>

Your support:
Creating libraries and wrappers for existing library projects is a lot of work. The use of this library is totally free and you even don't need to mention in your app that you use it.
But if you use this library in your projects and you think it is useful to you please consider to make a donation:

Thanks very much for your support.


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: 1,988
  • FloatLabelEditText1_0.zip
    8.2 KB · Views: 1,628
  • FloatingActionButton1_0.zip
    12.5 KB · Views: 1,747
  • ScrollingTabsExample2_00.zip
    8.3 KB · Views: 1,754
  • SnackBarExample2_00.zip
    7.7 KB · Views: 1,618
  • TabsWithCustomViewExample2_0.zip
    24.5 KB · Views: 1,884
  • NavigationView1_0.zip
    108.9 KB · Views: 2,542
  • BottomNavigationViewExample1_0.zip
    28.7 KB · Views: 1,784
  • DesignSupportLib2_31.zip
    58.3 KB · Views: 1,423
  • DesignSupportLib2_32.zip
    58.3 KB · Views: 2,182
  • DesignSupportLib3_00.zip
    65.9 KB · Views: 2,453
Last edited:

prajinpraveen

Active Member
Licensed User
Longtime User
any pointers please. i have tried with no luck.
I could add the ACSearchview to the Navigation Drawer, not to the Tool bar. Please advise.
 

corwin42

Expert
Licensed User
Longtime User
Hello Corwin42, any update on this feature, CollapsingToolbarLayout

I have some test apps created which work quite well. I'm still not sure about the API. It should be simple to use but it must be flexible as well. It will still need some days of work.
 

Rochow

Member
Licensed User
Longtime User
Help, This code:

DSFloatLabelEditTextEmail.Text="email"

Throw:

java.lang.NoSuchMethodError: No virtual method setText(Ljava/lang/CharSequence;)V in class Lde/amberhome/objects/appcompat/ACEditTextWrapper; or its super classes (declaration of 'de.amberhome.objects.appcompat.ACEditTextWrapper' appears in /data/app/com.apps.material-2/base.apk)
 

corwin42

Expert
Licensed User
Longtime User
Help, This code:

DSFloatLabelEditTextEmail.Text="email"

Throw:

java.lang.NoSuchMethodError: No virtual method setText(Ljava/lang/CharSequence;)V in class Lde/amberhome/objects/appcompat/ACEditTextWrapper; or its super classes (declaration of 'de.amberhome.objects.appcompat.ACEditTextWrapper' appears in /data/app/com.apps.material-2/base.apk)

Which versions of AppCompat and Designsupport library do you use?
 

corwin42

Expert
Licensed User
Longtime User
AppCompat 3.51 and DesignSupport 2.32
If you use B4A 6.80 update to AppCompat library 3.52. Otherwise downgrade DesignSupport library to 2.31.
 

peacemaker

Expert
Licensed User
Longtime User
OK, i was ready to donate for such development, but ... tried myself to make such interface, where scrollable views (GoogleMap and ListView) are placed into the vertical scrollable container (ScrollView) and see that it's impossible to make all scroll combinations workable at the same time.
So, no need in such lib modification. But it's curious how this scrolling combination is made on video.
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi @corwin42, thanks for your patience and your great job. Only one question, how can i use add submenu? What is it? I thought it's little menu header, but when i tried to add it nothing appears. Can you post a little code example to achieve it (like screenshot in first post). Thanks anyway
 

A Z M JANNAT UL KARIM

Member
Licensed User
Hi, sorry I am a newbie in android world, started my journey through B4A. Cant manage to change the Sample NavDrawer Header text and Sub Title as per image. Can you please help me how to do it? Thanks in advance.
 

Attachments

  • Screenshot.png
    Screenshot.png
    29.1 KB · Views: 282

A Z M JANNAT UL KARIM

Member
Licensed User
A simple solution based on AppCompat library + jfeinstein sliding menu library is available here: https://www.b4x.com/android/forum/threads/appcompat-with-toolbar-minimal-example.79896/#post-505911

Hi Erel, thank you for your reply. I tried to download and install the apps to my mobile through B4A-Bridge. While installing it just says App not installed. Am I missing something. Thank you.

Update ---

Sorry, My Bad. Need to update the Manifest File to 25, Was 21. Now it's working. Thank You.

Corwin42 NavigationDrawer looks great. Want to stand my project with his NavigationDrawer. Will be helpful if I can find a way to change the Navigation Title. Thanks in Advance.
 
Last edited:
Top