zolive33 Active Member Licensed User Longtime User Jan 17, 2022 #1 Hi, I would like to use Material Design components for Android (https://material.io/). In the manifest editor, I declare : [CODE lang="b4x" title="manifest.xml"]CreateResource(values-v25, theme.xml, <resources> <style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight"> <!-- ... --> </style> </resources> )[/CODE] But I have an error when I build sample projet. I think I have checked everything, so I dont no why Can anyone help me ? thanks in advance. ? I add an example to test, and the list of installed components. Attachments smallProject.zip smallProject.zip 9 KB · Views: 572 installed-components.txt installed-components.txt 13.8 KB · Views: 615
Hi, I would like to use Material Design components for Android (https://material.io/). In the manifest editor, I declare : [CODE lang="b4x" title="manifest.xml"]CreateResource(values-v25, theme.xml, <resources> <style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight"> <!-- ... --> </style> </resources> )[/CODE] But I have an error when I build sample projet. I think I have checked everything, so I dont no why Can anyone help me ? thanks in advance. ? I add an example to test, and the list of installed components.
Pendrush Well-Known Member Licensed User Longtime User Jan 17, 2022 #2 Best practice for Android Dark theme? Hi all, I have a question concerning the Dark theme that has been introduced with Android 10. What is the best practice to support Dark themes in B4A? How can I select an image based on the night mode flag? thanks a lot, Johannes www.b4x.com Upvote 0
Best practice for Android Dark theme? Hi all, I have a question concerning the Dark theme that has been introduced with Android 10. What is the best practice to support Dark themes in B4A? How can I select an image based on the night mode flag? thanks a lot, Johannes www.b4x.com
zolive33 Active Member Licensed User Longtime User Jan 18, 2022 #3 Pendrush said: Best practice for Android Dark theme? Hi all, I have a question concerning the Dark theme that has been introduced with Android 10. What is the best practice to support Dark themes in B4A? How can I select an image based on the night mode flag? thanks a lot, Johannes www.b4x.com Click to expand... thank you for your response, but I develop a library that uses new Material Components theme attributes. So I can't use AppCompat themes. Upvote 0
Pendrush said: Best practice for Android Dark theme? Hi all, I have a question concerning the Dark theme that has been introduced with Android 10. What is the best practice to support Dark themes in B4A? How can I select an image based on the night mode flag? thanks a lot, Johannes www.b4x.com Click to expand... thank you for your response, but I develop a library that uses new Material Components theme attributes. So I can't use AppCompat themes.
zolive33 Active Member Licensed User Longtime User Jan 23, 2022 #4 Finally I found the solution: I put "sdk manager" back in its original configuration. I added the libraries "androidx.annotation:annotation-experimental" and "androidx.viewpager2:viewpager2". And now I can Build Problem solved Last edited: Jan 23, 2022 Upvote 0
Finally I found the solution: I put "sdk manager" back in its original configuration. I added the libraries "androidx.annotation:annotation-experimental" and "androidx.viewpager2:viewpager2". And now I can Build Problem solved
S Spavlyuk Active Member Licensed User Longtime User Jan 24, 2022 #5 Note that if you want to use newer versions of material components, you might need to manually install and modify dependencies. As far as I know, the sdk manager doesn't always let you install the newer dependencies. For example, I've had to do that for constraintlayout 2.0.1, which is required for v1.3.0 of material components. You can download these from google maven, place them in your android skd folder under extras\b4a_remote and edit installed-components.txt to reflect the changes you made. This should work for up to v1.4.0. For v1.5.0 you have to change the targetSdkVersion to 31, which I don't know if B4A supports at this point. Upvote 0
Note that if you want to use newer versions of material components, you might need to manually install and modify dependencies. As far as I know, the sdk manager doesn't always let you install the newer dependencies. For example, I've had to do that for constraintlayout 2.0.1, which is required for v1.3.0 of material components. You can download these from google maven, place them in your android skd folder under extras\b4a_remote and edit installed-components.txt to reflect the changes you made. This should work for up to v1.4.0. For v1.5.0 you have to change the targetSdkVersion to 31, which I don't know if B4A supports at this point.
mcqueccu Expert Licensed User Longtime User Jan 24, 2022 #6 zolive33 said: Finally I found the solution: I put "sdk manager" back in its original configuration. I added the libraries "androidx.annotation:annotation-experimental" and "androidx.viewpager2:viewpager2". And now I can Build Problem solved Click to expand... Am interested, post example manifest and example project with the day/night Upvote 0
zolive33 said: Finally I found the solution: I put "sdk manager" back in its original configuration. I added the libraries "androidx.annotation:annotation-experimental" and "androidx.viewpager2:viewpager2". And now I can Build Problem solved Click to expand... Am interested, post example manifest and example project with the day/night
zolive33 Active Member Licensed User Longtime User Jan 24, 2022 #7 @mcqueccu : Yes, as soon as I have a good example. Please be patient. Upvote 0
zolive33 Active Member Licensed User Longtime User Jan 30, 2022 #8 Hi, Here is an example. You will find: An extract of the source code The library and An example of use. Create a B4X library with Android Studio - Step by step to integrate the library in an Android Studio project. Best regards. Attachments source.zip source.zip 9.4 KB · Views: 694 Library.zip Library.zip 44.5 KB · Views: 630 _test2.zip _test2.zip 9.5 KB · Views: 613 Upvote 0
Hi, Here is an example. You will find: An extract of the source code The library and An example of use. Create a B4X library with Android Studio - Step by step to integrate the library in an Android Studio project. Best regards.
mcqueccu Expert Licensed User Longtime User Jan 31, 2022 #9 zolive33 said: Hi, Here is an example. You will find: An extract of the source code The library and An example of use. Create a B4X library with Android Studio - Step by step to integrate the library in an Android Studio project. View attachment 124961 Best regards. Click to expand... Works great. I think you should post the library in libraries thread and also, I hope you will wrap more material components views when you are free. Upvote 0
zolive33 said: Hi, Here is an example. You will find: An extract of the source code The library and An example of use. Create a B4X library with Android Studio - Step by step to integrate the library in an Android Studio project. View attachment 124961 Best regards. Click to expand... Works great. I think you should post the library in libraries thread and also, I hope you will wrap more material components views when you are free.