private void TakePhoto() { var result = CheckImagesPermission(); if (!result) { return; } else { try { BSImagePicker multiSelectionPicker = new BSImagePicker .Builder("com.company.proyect.fileprovider") // Insert here your File Provider .IsMultiSelect() //Set this if you want to use multi selection mode. .SetMultiSelectBarBgColor(Resource.Color.colorPrimary) //Default: #FFFFFF. You can also set it to a translucent color. .SetMultiSelectTextColor(Resource.Color.colorAccent) //Default: #212121(Dark grey). This is the message in the multi-select bottom bar. .SetMultiSelectDoneTextColor(Resource.Color.colorAccent) //Default: #388e3c(Green). This is the color of the "Done" TextView. .SetOverSelectTextColor(Resource.Color.colorAccent) //Default: #b71c1c. This is the color of the message shown when user tries to select more than maximum select count. .DisableOverSelectionMessage() //You can also decide not to show this over select message. .Build(); multiSelectionPicker.Show(SupportFragmentManager, "picker"); } catch (Exception ex) { string exception = ex.Message; } //var multiIntent = XamarinFirebaseAndroid.Helper.ImagePickerHelper.GetPickImageIntent(this); //StartActivityForResult(multiIntent, (int)Constants.ActionResult.CameraRequestResult); } }
public async Task OpenGallery() { await Task.Delay(TimeSpan.FromMilliseconds(100)); var multiSelectionPicker = new BSImagePicker.Builder("com.xamconsultant.xctapplication.fileprovider") .IsMultiSelect() //Set this if you want to use multi selection mode. .SetMinimumMultiSelectCount(1) //Default: 1. .SetMaximumMultiSelectCount(24) //Default: Integer.MAX_VALUE (i.e. User can select as many images as he/she wants) //Default: #FFFFFF. You can also set it to a translucent color. //.SetMultiSelectBarBgColor(Resource.Color.primary) .SetMultiSelectTextColor(Resource.Color .colorPrimary) //Default: #212121(Dark grey). This is the message in the multi-select bottom bar. .SetMultiSelectDoneTextColor(Resource.Color .colorAccent) //Default: #388e3c(Green). This is the color of the "Done" TextView. .SetOverSelectTextColor(Resource.Color .design_dark_default_color_on_error) //Default: #b71c1c. This is the color of the message shown when user tries to select more than maximum select count. .DisableOverSelectionMessage() //You can also decide not to show this over select message .SetSpanCount(3) //Default: 3. This is the number of columns .SetGridSpacing(Asksira.BSImagePickerLib.Utils.Dp2Px(2)) //Default: 2dp. Remember to pass in a value in pixel. .SetPeekHeight(Asksira.BSImagePickerLib.Utils.Dp2Px(360)) //Default: 360dp. This is the initial height of the dialog. .SetTag("A request ID") //Default: null. Set this if you need to identify which picker is calling back your fragment / activity. .Build(); multiSelectionPicker.Show(SupportFragmentManager, "Picker"); }
public async Task OpenCameraAndGallery() { await Task.Delay(TimeSpan.FromMilliseconds(100)); var singleSelectionPicker = new BSImagePicker.Builder("com.xamconsultant.xctapplication.fileprovider") .SetMaximumDisplayingImages(24) //Default: Integer.MAX_VALUE. Don't worry about performance :) .SetSpanCount(3) //Default: 3. This is the number of columns .SetGridSpacing(Asksira.BSImagePickerLib.Utils.Dp2Px(2)) //Default: 2dp. Remember to pass in a value in pixel. .SetPeekHeight(Asksira.BSImagePickerLib.Utils.Dp2Px(360)) //Default: 360dp. This is the initial height of the dialog. .HideGalleryTile() //Default: show. Set this if you don't want to further let user select from a gallery app. In such case, I suggest you to set maximum displaying images to Integer.MAX_VALUE. .SetTag("A request ID") //Default: null. Set this if you need to identify which picker is calling back your fragment / activity. .Build(); singleSelectionPicker.Show(SupportFragmentManager, "Picker"); }