想在底部添加图标选项 sheet 类似于 Whatsapp 新群组页面
Wants to add icon options in bottom sheet similar to Whatsapp New group page
打开 Whatsapp 新组页面,单击该组图标,出现底页并显示已安装的列表 camera/icon 相关 options.My 问题是我们如何编写这些权限(如果我们写)以添加我们应用程序中的那些 camera/icon 相关选项?我想添加一个外观相似的底片。
您无需创建底部 sheet,因为您可以从选择器 Intent 中获得相同的功能。
//Create an intent
final Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
galleryIntent.setType("image/*");
//Create any other intents you want
final Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
//Add them to an intent array
Intent[] intents = new Intent[]{cameraIntent};
//Create a choose from your first intent then pass in the intent array
final Intent chooserIntent = Intent.createChooser(galleryIntent, "Choose icon");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intents);
startActivityForResult(chooserIntent, 101);
您需要通过覆盖 onActivityResult 来捕获输入。
打开 Whatsapp 新组页面,单击该组图标,出现底页并显示已安装的列表 camera/icon 相关 options.My 问题是我们如何编写这些权限(如果我们写)以添加我们应用程序中的那些 camera/icon 相关选项?我想添加一个外观相似的底片。
您无需创建底部 sheet,因为您可以从选择器 Intent 中获得相同的功能。
//Create an intent
final Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
galleryIntent.setType("image/*");
//Create any other intents you want
final Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
//Add them to an intent array
Intent[] intents = new Intent[]{cameraIntent};
//Create a choose from your first intent then pass in the intent array
final Intent chooserIntent = Intent.createChooser(galleryIntent, "Choose icon");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intents);
startActivityForResult(chooserIntent, 101);
您需要通过覆盖 onActivityResult 来捕获输入。