我有一个自定义进度栏,如下所示:
这是我用来创建它的.xml代码:
background_drawable.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="@dimen/progress_bar_radial_inner_radius"
android:thickness="@dimen/progress_bar_radial_thickness"
android:shape="ring"
android:useLevel="false" >
<solid android:color="@color/main_color_alpha"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
progress_drawable.xml
<?xml version="1.0" encoding="UTF-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="270"
android:toDegrees="270">
<shape
android:innerRadius="@dimen/progress_bar_radial_inner_radius"
android:thickness="@dimen/progress_bar_radial_thickness"
android:shape="ring" >
<solid android:color="@color/main_color"/>
</shape>
</rotate>
Run Code Online (Sandbox Code Playgroud)
我想要得到的是我用来显示进度的圆角。看起来像这样的东西:
有人对如何实现这一目标有任何想法吗?
android drawable android-progressbar xml-drawable android-drawable
我在Android API 19(Kitkat)上使用内容uri和FileProvider时遇到问题.这是我用来在设备上打开相机并录制视频的代码:
File file = new File(pathname);
Uri fileUri = FileProvider.getUriForFile(this, AUTHORITY_STRING, file);
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
startActivityForResult(intent, requestCode);
Run Code Online (Sandbox Code Playgroud)
我已经在API的23-24上测试了这个代码,它运行得很好,但在我开始在相机应用程序中拍摄视频后,API 19相机以RESULT_CANCELED关闭.当我试图用ACTION_IMAGE_CAPTURE动作拍照时,同样的事情发生了.我试图用Uri.fromFile()更改FileProvider.getUriForFile().这在Kitkat上完美运行,但我无法在Android 7上使用它.为什么Adnroid Kitkat上的Camera不想使用内容uri?