Adding Snackbar Library

import com.google.android.material.button;

It is for button?

or Generalized

Yes if din't work try

import com.google.android.material.button.*;

And what about Floating Action Button
https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton#summary

For button I posted
For general
import com.google.android.material.*;

1 Like

What about This.... :sweat_smile:

Really I needed the library for Snackbar
I thought that it would be better to learn from simplest to hardest :joy:

Import last line of the chart
com.google....
Screenshot_20210207-165403-1

So for Snackbar, we need to use-

com.google.android.material.snackbar.Snackbar
1 Like

Screenshot_20210207-165911-1
Import that fully

Yes use it

1 Like

Thank you let me check.. :smiling_face_with_three_hearts:

Can I PM you?

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

How can I add?

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

Ya I thought same in extension template after

There won't be

So u need .jar file or .aar file...