private void SetupEmptyState() { emptyState.FindViewById <TextView>(Resource.Id.infoText).Text = "No comments on this idea yet."; emptyState.FindViewById <ImageView>(Resource.Id.emptyIcon) .SetImageDrawable(AppCompatDrawableManager.Get().GetDrawable(this, Resource.Drawable.no_comments)); ShowEmptyState(); }
/// <summary> /// Use when emptystate view is inflated from empty_state_2.xml in the app's layout resources folder /// </summary> /// <param name="emptyState">The emptyState view</param> /// <param name="iconResId">The resource id for the icon to be used in the empty state. It should be a vector drawable</param> /// <param name="emptyStateText">The text to set for the empty state</param> public static void SetEmptyState(View emptyState, int iconResId, string emptyStateText) { var iconHolder = emptyState.FindViewById <ImageView>(Resource.Id.emptyIcon); var emptyStateTextLbl = emptyState.FindViewById <TextView>(Resource.Id.infoText); iconHolder.SetImageDrawable(AppCompatDrawableManager.Get().GetDrawable(App.CurrentActivity, iconResId)); emptyStateTextLbl.Text = emptyStateText; }
public static void SetEmptyState(View emptyState, int iconResId, string emptyStateLabelText) { emptyState.FindViewById <TextView>(Resource.Id.stateText).Text = emptyStateLabelText; emptyState.FindViewById <ImageView>(Resource.Id.emptyIcon).SetImageDrawable(AppCompatDrawableManager.Get().GetDrawable(App.CurrentActivity, iconResId)); }
public Drawable GetIcon(Context context) { return(this._iconResource != 0 ? AppCompatDrawableManager.Get().GetDrawable(context, this._iconResource) : this._icon); }