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);

8 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. Gordon Bullard & Company builds revenue through identifying, recruiting, training, motivating, and managing sales agencies, distributors, and dealers for small to medium size businesses in the lighting industry. Located in Richland, MI.

    ReplyDelete
  5. At Reliable Permit Solutions, LLC we realize that bidding on loads is highly competitive and fast paced. We have experienced agents with a vast knowledge of the costs that can be incurred throughout your permitting process to ensure you get the best rates when acquiring your trucking permits.

    ReplyDelete
  6. 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
  7. First Motion Products offers an unmatched inventory of commercial truck part products. Our strength is the ability to service “truck down” and rush shipments. We can fill those requests for the everyday parts or hard-to-find parts. We specialize in Flywheels, Flywheel Ring Gears, Flywheel Housings, Oil Pans, and Clutch Accessories for truck applications. Located in Bourbon, MO.

    ReplyDelete