我正在尝试使用 jetpack compose 来圆化 CircularProgressIndicator 的角落。但我没有看到任何成员变量可以这样做。以下是源代码,但它没有将 Stroke 作为参数。如果可以的话,我们就可以创建带有圆帽的自定义笔画。
@Composable
fun CircularProgressIndicator(
/*@FloatRange(from = 0.0, to = 1.0)*/
progress: Float,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colors.primary,
strokeWidth: Dp = ProgressIndicatorDefaults.StrokeWidth
) {
val stroke = with(LocalDensity.current) {
Stroke(width = strokeWidth.toPx(), cap = StrokeCap.Butt)
}
Canvas(
modifier
.progressSemantics(progress)
.size(CircularIndicatorDiameter)
.focusable()
) {
// Start at 12 O'clock
val startAngle = 270f
val sweep = progress * 360f
drawDeterminateCircularIndicator(startAngle, sweep, color, stroke)
}
}
Run Code Online (Sandbox Code Playgroud) 要实现的目标:我需要像 Netflix 一样支持 android 设备上的离线视频,并使用 DRM 支持禁止其分发。
到目前为止我所做的:我使用 Shaka Packager 将示例视频转换为 m3u8 格式。使用此链接https://google.github.io/shakapackager/html/tutorials/widevine.html
面临的问题: 1. 这是否足以进行 DRM 保护?2. 我知道我必须使用许可的 Widevine 服务器,但我无法在任何地方找到有关如何获取的信息。请帮我解决这个问题。3. 我想对于第 2 点,我必须在服务器上存储一个密钥。android 设备上将使用相同的密钥来启用视频播放器。我对如何设置这个有点困惑。
提前致谢!!
我有一个自定义视图类 DoubleTextView.java 如下所示,
public class DoubleTextView extends LinearLayout {
LinearLayout layout;
TextView upTextView;
TextView downTextView;
Context mContext;
public DoubleTextView(Context context) {
super(context);
mContext = context;
}
public DoubleTextView(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
String service = Context.LAYOUT_INFLATER_SERVICE;
LayoutInflater li = (LayoutInflater) getContext().getSystemService(service);
layout = (LinearLayout) li.inflate(R.layout.custom_double_text, this, true);
upTextView = layout.findViewById(R.id.text_up);
downTextView = layout.findViewById(R.id.text_down);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DoubleTextView);
String upText = a.getString(R.styleable.DoubleTextView_upText);
String downText = a.getString(R.styleable.DoubleTextView_downText);
int upTextStyle = a.getInteger(R.styleable.DoubleTextView_styleUpText,R.style.ListOtherLightInfo);
int downTextStyle = a.getInteger(R.styleable.DoubleTextView_styleDownText,R.style.ListOtherLightInfo);
upText …Run Code Online (Sandbox Code Playgroud)