Friday, July 24, 2020

Customizing a Snackbar in Android

In Android we can customize a Snackbar
We can change the Text Color, Action text color, Background color and chnage/add an image



 TextView mainTextView = (TextView) (mSnackBar.getView()).findViewById(android.support.design.R.id.snackbar_text);
            TextView actionTextView = (TextView) (mSnackBar.getView()).findViewById(android.support.design.R.id.snackbar_action);

// change background color
            mSnackBar.getView().setBackgroundColor(Color.WHITE);
            Typeface font = Typeface.createFromAsset(getAssets(), "LatoRegular.ttf");
// Change the Font
            mainTextView.setTypeface(font);
            actionTextView.setTypeface(font);
// Change the colors
            mainTextView.setTextColor(Color.BLACK);
            actionTextView.setTextColor(Color.BLACK);

4 comments:

  1. A debt of gratitude is in order for sharing the information, keep doing awesome... I truly delighted in investigating your site. great asset... Download Mini Militia God Mod + Apk Unlimited Ammo/Nitro

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. In Android we can customize a Snackbar
    We can change the Text Color,
    Action text color, Background color and chnage/add an image.

    Steinco Industrial Solutions, Inc.

    ReplyDelete
  4. J.E. Flores Bakery Services, Inc. is a full-service company committed to the bakery industry’s machinery operation. Flores Bakery Service installs, repairs and services new and legacy bakery equipment. We are specialists in Latendorf, BEW, and Baker Perkins equipment. Located in Bayonne, NJ.

    ReplyDelete