本文整理汇总了Java中android.graphics.Outline.setRect方法的典型用法代码示例。如果您正苦于以下问题:Java Outline.setRect方法的具体用法?Java Outline.setRect怎么用?Java Outline.setRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.Outline
的用法示例。
在下文中一共展示了Outline.setRect方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HeaderElevationController
import android.graphics.Outline; //导入方法依赖的package包/类
HeaderElevationController(View header) {
mHeader = header;
final Resources res = mHeader.getContext().getResources();
mMaxElevation = res.getDimension(R.dimen.all_apps_header_max_elevation);
mScrollToElevation = res.getDimension(R.dimen.all_apps_header_scroll_to_elevation);
// We need to provide a custom outline so the shadow only appears on the bottom edge.
// The top, left and right edges are all extended out, and the shadow is clipped
// by the parent.
final ViewOutlineProvider vop = new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
final View parent = (View) mHeader.getParent();
final int left = parent.getLeft(); // Use the parent to account for offsets
final int top = view.getTop();
final int right = left + view.getWidth();
final int bottom = view.getBottom();
final int offset = Utilities.pxFromDp(mMaxElevation, res.getDisplayMetrics());
outline.setRect(left - offset, top - offset, right + offset, bottom);
}
};
mHeader.setOutlineProvider(vop);
}
示例2: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(final View view, final Outline outline) {
if (mLastVisibleTopInsets == NO_DATA) {
// Call default implementation.
ViewOutlineProvider.BACKGROUND.getOutline(view, outline);
return;
}
// TODO: Revisit this when floating/resize keyboard is supported.
outline.setRect(
view.getLeft(), mLastVisibleTopInsets, view.getRight(), view.getBottom());
}
示例3: ControllerVL
import android.graphics.Outline; //导入方法依赖的package包/类
public ControllerVL(View header) {
mHeader = header;
Resources res = mHeader.getContext().getResources();
mMaxElevation = res.getDimension(R.dimen.all_apps_header_max_elevation);
mScrollToElevation = res.getDimension(R.dimen.all_apps_header_scroll_to_elevation);
// We need to provide a custom outline so the shadow only appears on the bottom edge.
// The top, left and right edges are all extended out, and the shadow is clipped
// by the parent.
final ViewOutlineProvider vop = new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
final View parent = (View) mHeader.getParent();
final int left = parent.getLeft(); // Use the parent to account for offsets
final int top = view.getTop();
final int right = left + view.getWidth();
final int bottom = view.getBottom();
outline.setRect(
left - (int) mMaxElevation,
top - (int) mMaxElevation,
right + (int) mMaxElevation,
bottom);
}
};
mHeader.setOutlineProvider(vop);
}
示例4: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
super.getOutline(outline);
return;
}
if ((!YogaConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
updatePath();
outline.setConvexPath(mPathForBorderRadiusOutline);
} else {
outline.setRect(getBounds());
}
}
示例5: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
super.getOutline(outline);
return;
}
if((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
updatePath();
outline.setConvexPath(mPathForBorderRadiusOutline);
} else {
outline.setRect(getBounds());
}
}
示例6: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void getOutline(final Outline outline) {
final RectF rect = boundsRect();
outline.setRect((int) Math.ceil(rect.left), (int) Math.ceil(rect.top),
(int) Math.floor(rect.right), (int) Math.floor(rect.bottom));
}
示例7: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(Outline outline) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
super.getOutline(outline);
return;
}
if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
updatePath();
outline.setConvexPath(mPathForBorderRadiusOutline);
} else {
outline.setRect(getBounds());
}
}
示例8: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(@NonNull Outline outline) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
super.getOutline(outline);
} else {
if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
updatePath();
outline.setConvexPath(mPathForBorderRadiusOutline);
} else {
outline.setRect(getBounds());
}
}
}
示例9: setControlsBackground
import android.graphics.Outline; //导入方法依赖的package包/类
private void setControlsBackground(Drawable paramDrawable, boolean paramBoolean)
{
if ((paramBoolean) && (USE_ANIMATIONS))
{
Drawable localDrawable = this.mControlsContainer.getBackground();
if (localDrawable == null) {
localDrawable = makeNonFloatingBackground();
}
if (paramDrawable == null) {
paramDrawable = makeNonFloatingBackground();
}
if (localDrawable == paramDrawable) {
return;
}
TransitionDrawable local6 = new TransitionDrawable(new Drawable[] { localDrawable, paramDrawable })
{
@TargetApi(21)
public final void getOutline(Outline paramAnonymousOutline)
{
paramAnonymousOutline.setRect(getBounds());
paramAnonymousOutline.setAlpha(1.0F);
}
};
local6.setCrossFadeEnabled(true);
local6.startTransition(300);
this.mControlsContainer.setBackgroundDrawable(local6);
return;
}
this.mControlsContainer.setBackgroundDrawable(paramDrawable);
}
示例10: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(@NonNull Outline outline) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
outline.setRect(getBounds());
outline.setAlpha(getAlpha() / 255.0f);
}
}
示例11: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
outline.setRect(0, 0, view.getWidth(), view.getHeight());
outline.setAlpha(1.0f);
}
示例12: initViews
import android.graphics.Outline; //导入方法依赖的package包/类
private void initViews() {
mTabNews = (LinearLayout) findViewById(R.id.main_tab_news);
mTabNews.setOnClickListener(tabClickListener);
mTabNewsImg = (ImageView) findViewById(R.id.main_tab_news_img);
mTabNewsTxt = (TextView) findViewById(R.id.main_tab_news_txt);
mTabColletion = (LinearLayout) findViewById(R.id.main_tab_collection);
mTabColletion.setOnClickListener(tabClickListener);
mTabColletionImg = (ImageView) findViewById(R.id.main_tab_collection_img);
mTabColletionTxt = (TextView)findViewById(R.id.main_tab_collection_txt);
mTabUser = (LinearLayout) findViewById(R.id.main_tab_user);
mTabUser.setOnClickListener(tabClickListener);
mTabUserImg = (ImageView) findViewById(R.id.tab_main_center_img);
mTabUserTxt = (TextView) findViewById(R.id.tab_main_center_txt);
/**
* 获取自定义的 ?/attr 值
*/
TypedValue colorPressed = new TypedValue();
TypedValue colorNormal = new TypedValue();
this.getTheme().resolveAttribute(R.attr.tab_bottom_text_pressed, colorPressed, true);
this.getTheme().resolveAttribute(R.attr.tab_bottom_text_normal, colorNormal, true);
mTabTxtColorPressed = getResources().getColor(colorPressed.resourceId);
mTabTxtColorNormal = getResources().getColor(colorNormal.resourceId);
//设置阴影
ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
//outline.setOval(0, 0, view.getWidth(), view.getHeight());
outline.setRect(new Rect(0, 0, view.getWidth(), view.getHeight() + 5));
}
};
mTabBottom = (LinearLayout) findViewById(R.id.main_tab_bottom);
mTabBottom.setOutlineProvider(viewOutlineProvider);
}
示例13: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
outline.setRect(0, 0, width, height);
}
示例14: getOutline
import android.graphics.Outline; //导入方法依赖的package包/类
@Override
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void getOutline(@NonNull Outline outline) {
outline.setRect(drawBounds);
}