Skip to content

Instantly share code, notes, and snippets.

@suchithm
Last active March 31, 2016 18:41
Show Gist options
  • Save suchithm/9dc598580525413c050463ccfea617eb to your computer and use it in GitHub Desktop.
Save suchithm/9dc598580525413c050463ccfea617eb to your computer and use it in GitHub Desktop.
//customized snackbar
void fnSnackBar( string strText,bool isLengthIndefinite)
{
Snackbar objSnackBar = Snackbar.Make (linearLayoutMain, strText, isLengthIndefinite ? Snackbar.LengthIndefinite : Snackbar.LengthShort)
.SetAction (Resource.String.retry, (v) => {
//set action
});
//set action button text color
objSnackBar.SetActionTextColor(Android.Graphics.Color.Aqua);
Android.Views.View objView = objSnackBar.View;
TextView txtAction = objView.FindViewById<TextView> (Resource.Id.snackbar_action);
txtAction.SetTextSize (Android.Util.ComplexUnitType.Dip, 18);
//set message text color
TextView txtMessage = objView.FindViewById<TextView> (Resource.Id.snackbar_text);
txtMessage.SetTextColor (Android.Graphics.Color.Red);
txtMessage.SetTextSize (Android.Util.ComplexUnitType.Dip, 18);
objSnackBar.Show ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment