Hi all, I have went through Android Developer site and ended up here-
https://developer.android.com/reference/com/google/android/material/button/package-summary
In this I can see that there are more other methods for button. So I decided to create an extension with more functions. Now, my problem is that how can I import the library to my extension-With what name I have to import. Your answers will be highly appreciated.
Thank you.
import com.google.android.material.button;
Yes if din't work try
import com.google.android.material.button.*;
For button I posted
For general
import com.google.android.material.*;
1 Like
Really I needed the library for Snackbar
I thought that it would be better to learn from simplest to hardest
Import last line of the chart
com.google....
So for Snackbar, we need to use-
com.google.android.material.snackbar.Snackbar
1 Like
@HIFI_APPS Can you please say what are the imports for a snackbar. I am confused.
U can pm,
import com.google.android.material.snackbar.*;
For snackbar
1 Like
As far as I know app Inventor doesn't have any library that adds the snackbar class, you would also have to add the android material design library to your extension ( which contains the Snackbar classes ). Or you would get an error that the package doesn't exist.
I have added this class-
com.google.android.material.floatingactionbutton.FloatingActionButton
You would have to get the material library jar file, because it doesn't exist in the current sources.
You will find its Aar file here, you can try to extract the classes.jar file, and use it with your extension ( for the app Inventor Sources see here, for the extension template see this topic, if you are using Appybuilder, so it's not possible ):
https://mvnrepository.com/artifact/com.google.android.material/material/1.3.0
4 Likes