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,860
  • FloatLabelEditText1_0.zip
    8.2 KB · Views: 1,523
  • FloatingActionButton1_0.zip
    12.5 KB · Views: 1,618
  • ScrollingTabsExample2_00.zip
    8.3 KB · Views: 1,626
  • SnackBarExample2_00.zip
    7.7 KB · Views: 1,509
  • TabsWithCustomViewExample2_0.zip
    24.5 KB · Views: 1,755
  • NavigationView1_0.zip
    108.9 KB · Views: 2,419
  • BottomNavigationViewExample1_0.zip
    28.7 KB · Views: 1,658
  • DesignSupportLib2_31.zip
    58.3 KB · Views: 1,293
  • DesignSupportLib2_32.zip
    58.3 KB · Views: 2,047
  • DesignSupportLib3_00.zip
    65.9 KB · Views: 2,276
Last edited:

ken87

Active Member
Licensed User
Longtime User
Buongiorno,
Compilando il progetto ho i seguenti errori:
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:339: error: Attribute "android:alpha" has already been defined
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationX" has already been defined
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationY" has already been defined
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationZ" has already been defined
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\savedstate\savedstate\1.1.0\unpacked-savedstate-1.1.0\res\values\values.xml:3: error: Found tag id where item is expected
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\lifecycle\lifecycle-viewmodel\2.3.1\unpacked-lifecycle-viewmodel-2.3.1\res\values\values.xml:3: error: Found tag id where item is expected
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\lifecycle\lifecycle-runtime\2.3.1\unpacked-lifecycle-runtime-2.3.1\res\values\values.xml:3: error: Found tag id where item is expected


Come posso risolvere?
 

so27

Active Member
Licensed User
Longtime User
Buongiorno,
Compilando il progetto ho i seguenti errori:
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:339: error: Attribute "android:alpha" has already been defined
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationX" has already been defined
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationY" has already been defined
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\constraintlayout\constraintlayout\2.0.4\unpacked-constraintlayout-2.0.4\res\values\values.xml:342: error: Attribute "android:translationZ" has already been defined
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\savedstate\savedstate\1.1.0\unpacked-savedstate-1.1.0\res\values\values.xml:3: error: Found tag id where item is expected
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\lifecycle\lifecycle-viewmodel\2.3.1\unpacked-lifecycle-viewmodel-2.3.1\res\values\values.xml:3: error: Found tag id where item is expected
d:\sdk2\sdk\tools\..\extras\b4a_remote\androidx\lifecycle\lifecycle-runtime\2.3.1\unpacked-lifecycle-runtime-2.3.1\res\values\values.xml:3: error: Found tag id where item is expected


Come posso risolvere?
Did you update the files in the SDK Manager? If so, then this could be where the error lies. The only thing that helped me was a backup to work around the error.
 

ken87

Active Member
Licensed User
Longtime User
good evening
Only version that finds 2.0.4 that doesn't work
 

Attachments

  • cons.png
    cons.png
    26.1 KB · Views: 262

DonManfred

Expert
Licensed User
Longtime User
Only version that finds 2.0.4 that doesn't work
You are compiling against AndroidX?
Or are you strill using the old android support libraries?

Post your Compilewindow-Text...

Based on your inital post some parts are "already defined".
This usually happen if you are using Components which are not compatible with AndroidX.
 
Top