B4A Library AppCompat - Make Material Design apps compatible with older Android versions

Discussion in 'Additional libraries, classes and official updates' started by corwin42, Dec 19, 2014.

  1. Lildinti

    Lildinti Member Licensed User

    Hi Corwin,
    Love the library but have a question: How do you define other items in the theme? For example primary text color, divider color, etc?
    If I add them to the manifest, compilation gives error:

    Generating R file. Error
    res\values\theme.xml:7: error: Error: No resource found that matches the given name: attr 'colorTextPrimary'.

    Any thoughts?
    Thanks heaps

  2. Fusseldieb

    Fusseldieb Active Member Licensed User

    Hi corwin42, could you please post the older appcompact library version? i dont have the b4a 6.0, and i realy need the second version of it.... thanks
    stanks likes this.
  3. fredo

    fredo Active Member Licensed User

    Since there was a compile error after updating the SDK this morning I posted a new thread here.

    Edit: Never mind. Erel had a working tip very fast at hand.
    Last edited: Dec 15, 2016
  4. chrjak

    chrjak Active Member Licensed User

    I am wondering if it is possible to set the click effect to a view but keep its background drawable...
  5. dragonguy

    dragonguy Active Member Licensed User

    is it we can add control ACSwitch into ACMenuItem?

    like below screenshot

    Attached Files:

  6. dragonguy

    dragonguy Active Member Licensed User

    i found the solution.

    corwin42 likes this.
  7. GGSoft

    GGSoft Member Licensed User

    Since V3.41 I can not get
    Sub Activity_Create(FirstTime As Boolean)
    End Sub


    Sub ActionBar_NavigationItemClick
    ' Any stuff here
    End Sub
    to work i.e. "Up" button does not respond when no menu is present.

    Until V3.30 it worked perfectly. Can it be a side effect?

    Best regards.
  8. corwin42

    corwin42 Expert Licensed User

    Thanks for reporting. Indeed this is a bug caused by an internal change. I will fix it as soon as possible.
  9. corwin42

    corwin42 Expert Licensed User

    Fixed in V3.42. See the first post.
    Erel likes this.
  10. GGSoft

    GGSoft Member Licensed User

    Thank you very much for your prompt response... and action.
  11. kelevra1602

    kelevra1602 Member Licensed User

    In b4a v6.8, I get the following error when
    Compile the app AppCompatBaseExample3_20

    java.lang.NoSuchMethodError: No virtual method setText(Ljava/lang/Object;)V in class Lde/amberhome/objects/appcompat/ACButtonWrapper; or its super classes (declaration of 'de.amberhome.objects.appcompat.ACButtonWrapper' appears in /data/app/de.amberhome.appcompat.basicexample-1/base.apk)
  12. corwin42

    corwin42 Expert Licensed User

    Yes. I expected these problems with B4A 6.80. It is because some of the AppCompat Views extend TextViewWrapper and the signature of some methods in this class changed because of the new CharSequence feature. I will update the library very soon.
    Last edited: Feb 21, 2017
  13. corwin42

    corwin42 Expert Licensed User

    Please try V3.52 of this library. It should fix the problem.
  14. kelevra1602

    kelevra1602 Member Licensed User

    Thanks for the update so fast, ACButton works fine, but now I have this error
    config_activity_create (java line: 392)
    java.lang.NoSuchMethodError: No virtual method setText(Ljava/lang/Object;)V 
    in class Lde/amberhome/objects/appcompat/ACEditTextWrapper; or its super classes (declaration of 'de.amberhome.objects.appcompat.ACEditTextWrapper' appears in /data/app/Us.InsEncues.com-2/base.apk)
        at de.amberhome.objects.FloatlabelEditTextWrapper.setText(FloatlabelEditTextWrapper.java:188)
        at Us.InsEncues.com.config._activity_create(config.java:
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
        at Us.InsEncues.com.config.afterFirstLayout(config.java:
        at Us.InsEncues.com.config.access$
        at Us.InsEncues.com.config$WaitForLayout.run(config.java:
        at android.os.Handler.handleCallback(Handler.java:
        at android.os.Handler.dispatchMessage(Handler.java:
        at android.os.Looper.loop(Looper.java:
        at android.app.ActivityThread.main(ActivityThread.java:
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
  15. corwin42

    corwin42 Expert Licensed User

    Did you update DesignSupport library, too? FloatlabelEditText is in the DesignSupport library which is also updated.
  16. SandroB4A

    SandroB4A Member Licensed User

    I just installed B4A 6.5 and downloaded sdk tools, and I have NOT problems!:D

    But may be instructions on the first page must be updated, with last release of sdk the paths seem to be different, and also libraries name:



    Appcompact-V7 sub.png

    In my case I simply copied the appcompat lib (3.51 as I use B4A 6.5), pointed to the last android.jar (25) and all was fine! this is my sdk config.

    Last edited: Feb 23, 2017
  17. corwin42

    corwin42 Expert Licensed User

    Which part should be updated in your opinion? I think everything in the instructions is still correct.
  18. SandroB4A

    SandroB4A Member Licensed User

    corwin42 you're right, in the first post there are no indications about paths and instructions are still correct.

    I had in mind all the problems encountered by users in later posts where the tip was often: "Copy android-support-v4.jar and android-support-v7-appcompat.jar to support lib" .

    Now that procedure is not longer necessary, correct?
  19. corwin42

    corwin42 Expert Licensed User

    Yes. There is no need to copy any support library jar to the customlibs folder anymore.
    Since B4A 6.0 the maven repository for the support libraries is used.
  20. JNG

    JNG Member Licensed User

    Yesterday I updated to library ver 3.51(I am using B4A 6.50) and also the latest design support lib I got the following error; Earlier working fine.

    Compiling generated Java code. Error
    B4A line: 558
    javac 1.8.0_66
    src\b4A\joinme\mainevent.java:3822: error: incompatible types: AHViewPager cannot be converted to ViewPager

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice