public static void RequestPermissionsForApp(this Android.App.Fragment frag)
        {
            var showRequestRationale = ActivityCompat.ShouldShowRequestPermissionRationale(frag.Activity, Manifest.Permission.AccessFineLocation) ||
                                       ActivityCompat.ShouldShowRequestPermissionRationale(frag.Activity, Manifest.Permission.AccessCoarseLocation);

            if (showRequestRationale)
            {
                var rootView = frag.Activity.FindViewById(AndroidResource.Id.Content);
                //Snackbar.Make(rootView, AppResource.String.request_location_permissions, Snackbar.LengthIndefinite)
                //        .SetAction(AppResource.String.ok, v =>
                //        {
                //            frag.RequestPermissions(LOCATION_PERMISSIONS, RC_LOCATION_PERMISSIONS);
                //        })
                //        .Show();
            }
            else
            {
                frag.RequestPermissions(LOCATION_PERMISSIONS, RC_LOCATION_PERMISSIONS);
            }
        }
 /// <summary>
 /// Creates a new Tab for the BottomBar.
 /// </summary>
 /// <param name="fragment"> a Fragment to be shown when this Tab is selected.</param>
 /// <param name="iconResource"> a resource for the Tab icon.</param>
 /// <param name="titleResource"> resource for the title.</param>
 public BottomBarFragment(Android.App.Fragment fragment, int iconResource, int titleResource)
 {
     Fragment       = fragment;
     _iconResource  = iconResource;
     _titleResource = titleResource;
 }
 /// <summary>
 /// Creates a new Tab for the BottomBar.
 /// </summary>
 /// <param name="fragment"> a Fragment to be shown when this Tab is selected.</param>
 /// <param name="icon"> an icon for the Tab.</param>
 /// <param name="titleResource">resource for the title.</param>
 public BottomBarFragment(Android.App.Fragment fragment, Drawable icon, int titleResource)
 {
     Fragment       = fragment;
     _icon          = icon;
     _titleResource = titleResource;
 }
 /// <summary>
 /// Creates a new Tab for the BottomBar.
 /// </summary>
 /// <param name="fragment"> a Fragment to be shown when this Tab is selected.</param>
 /// <param name="icon">an icon for the Tab.</param>
 /// <param name="title">title for the Tab.</param>
 public BottomBarFragment(Android.App.Fragment fragment, Drawable icon, string title)
 {
     Fragment = fragment;
     _icon    = icon;
     _title   = title;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new Tab for the BottomBar.
 /// </summary>
 /// <param name="fragment"> a Fragment to be shown when this Tab is selected.</param>
 /// <param name="icon">an icon for the Tab.</param>
 /// <param name="title">title for the Tab.</param>
 public BottomBarFragment(Android.App.Fragment fragment, Drawable icon, String title)
 {
     this.Fragment = fragment;
     this._icon    = icon;
     this._title   = title;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Creates a new Tab for the BottomBar.
 /// </summary>
 /// <param name="fragment">a Fragment to be shown when this Tab is selected.</param>
 /// <param name="iconResource"> a resource for the Tab icon.</param>
 /// <param name="title">title for the Tab.</param>
 public BottomBarFragment(Android.App.Fragment fragment, int iconResource, String title)
 {
     this.Fragment      = fragment;
     this._iconResource = iconResource;
     this._title        = title;
 }
 internal static View GetObjectAdapter <T>(this Android.App.Fragment fragment, Func <T, string> stringFunc, T obj,
                                           View view,
                                           int layoutId, int tvId)
 => ActivityExtensions.GetObjectAdapter(stringFunc, obj, view, layoutId, tvId, fragment.Activity);