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

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

lildinti
 

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
 

fredo

Well-Known 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:

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

GGSoft

Member
Licensed User
V3.41:
  • Fix: Change packagename to anywheresoftware.b4a.orbjects to reduce resouce fields
Since V3.41 I can not get
B4X:
Sub Activity_Create(FirstTime As Boolean)
    ...
    ActionBar.InitMenuListener
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.
 

corwin42

Expert
Licensed User
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?
Thanks for reporting. Indeed this is a bug caused by an internal change. I will fix it as soon as possible.
 

kelevra1602

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

B4X:
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)
 

corwin42

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

B4X:
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)
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:

corwin42

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

B4X:
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)
Please try V3.52 of this library. It should fix the problem.
 

kelevra1602

Member
Licensed User
Thanks for the update so fast, ACButton works fine, but now I have this error
B4X:
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:392)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
    at Us.InsEncues.com.config.afterFirstLayout(config.java:102)
    at Us.InsEncues.com.config.access$000(config.java:17)
    at Us.InsEncues.com.config$WaitForLayout.run(config.java:80)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5258)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:974)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
 

SandroB4A

Member
Licensed User
Hello,
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:

Support.png

Appcompact-V7.png

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.

SDK.png
 
Last edited:

corwin42

Expert
Licensed User
Hello,
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:
Which part should be updated in your opinion? I think everything in the instructions is still correct.
 

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?
 

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
TabLayout.SetViewPager(VP)
javac 1.8.0_66
src\b4A\joinme\mainevent.java:3822: error: incompatible types: AHViewPager cannot be converted to ViewPager
mostCurrent._tablayout.SetViewPager(mostCurrent._vp);

regard
jng
 
Top