private void showLoadingMessage() { Device.BeginInvokeOnMainThread(async() => { Android.App.Activity activity = CrossCurrentActivity.Current.Activity; Android.Views.View activityRootView = activity.FindViewById(Android.Resource.Id.Content); mLoadingMessageSnackbar = Snackbar.Make(activityRootView, "Searching for surfaces...", Snackbar.LengthIndefinite); mLoadingMessageSnackbar.View.SetBackgroundColor(Android.Graphics.Color.DarkGray); mLoadingMessageSnackbar.Show(); }); }
public static T GetDataView <T>(this FieldItem field, Android.App.Activity context) where T : Android.Views.View { //we convert these into int Ids var fieldName = (field.dataType == Constants.DATEPICKER || field.dataType == Constants.TIMEPICKER) ? Constants.DATE_TEXT_PREFIX + field.name : field.name; int resourceId = context.Resources.GetIdentifier( fieldName, "id", context.PackageName); T view = null; view = context.FindViewById <T>(resourceId); return(view); }