本文整理汇总了Java中android.view.View.setClipToOutline方法的典型用法代码示例。如果您正苦于以下问题:Java View.setClipToOutline方法的具体用法?Java View.setClipToOutline怎么用?Java View.setClipToOutline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.setClipToOutline方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import android.view.View; //导入方法依赖的package包/类
@Override
public void initialize(CardViewDelegate cardView, Context context, int backgroundColor,
float radius, float elevation, float maxElevation) {
final RoundRectDrawable backgroundDrawable = new RoundRectDrawable(backgroundColor, radius);
cardView.setBackgroundDrawable(backgroundDrawable);
View view = (View) cardView;
view.setClipToOutline(true);
view.setElevation(elevation);
setMaxElevation(cardView, maxElevation);
}
示例2: initialize
import android.view.View; //导入方法依赖的package包/类
public void initialize(CardViewDelegate cardView, Context context, int backgroundColor, float radius, float elevation, float maxElevation) {
cardView.setBackgroundDrawable(new RoundRectDrawable(backgroundColor, radius));
View view = (View) cardView;
view.setClipToOutline(true);
view.setElevation(elevation);
setMaxElevation(cardView, maxElevation);
}
示例3: initialize
import android.view.View; //导入方法依赖的package包/类
private void initialize(Context context) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rootView = inflater.inflate(R.layout.colored_progress, this, true);
progressElementsContainer = rootView.findViewById(R.id.container_progress);
View progressContainer = rootView.findViewById(R.id.container_progress_x);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
progressContainer.setClipToOutline(true);
}
greyScaleColor = ContextCompat.getColor(context, R.color.greyscale_progress);
}
示例4: addView
import android.view.View; //导入方法依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
super.addView(child, index, params);
int i;
if (index == -1) {
i = getChildCount() - 1;
} else {
i = index;
}
child.setVisibility(i == visibleChild ? VISIBLE : INVISIBLE);
child.setClipToOutline(false);
}
示例5: initialize
import android.view.View; //导入方法依赖的package包/类
@Override
public void initialize(ToggleGroupDelegate groupView, Context context,
ColorStateList backgroundColor, float radius, float elevation, float maxElevation) {
final RoundRectDrawable background = new RoundRectDrawable(backgroundColor, radius);
groupView.setGroupBackground(background);
View view = groupView.getToggleGroup();
view.setClipToOutline(true);
view.setElevation(elevation);
setMaxElevation(groupView, maxElevation);
}
示例6: setClipToRoundedOutline
import android.view.View; //导入方法依赖的package包/类
public static void setClipToRoundedOutline(View view, boolean clip) {
view.setOutlineProvider(clip ? sOutlineProvider : ViewOutlineProvider.BACKGROUND);
view.setClipToOutline(clip);
}