当前位置: 首页>>代码示例>>Java>>正文


Java Outline.setRect方法代码示例

本文整理汇总了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);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:26,代码来源:HeaderElevationController.java

示例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());
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:12,代码来源:ViewOutlineProviderCompatUtilsLXX.java

示例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);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:29,代码来源:HeaderElevationController.java

示例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());
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:15,代码来源:ReactViewBackgroundDrawable.java

示例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());
  }
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:15,代码来源:ReactViewBackgroundDrawable.java

示例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));
   }
 
开发者ID:saki4510t,项目名称:libcommon,代码行数:8,代码来源:BaseShape.java

示例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());
  }
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:15,代码来源:ReactViewBackgroundDrawable.java

示例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());
    }
  }

}
 
开发者ID:Laisly,项目名称:weex,代码行数:16,代码来源:WXBackgroundDrawable.java

示例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);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:31,代码来源:PlayHeaderListLayout.java

示例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);
    }
}
 
开发者ID:Leao,项目名称:CodeColors,代码行数:8,代码来源:CcColorDrawable.java

示例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);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:6,代码来源:ShadowHelperApi21.java

示例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);
	}
 
开发者ID:starmelon,项目名称:lovelife,代码行数:44,代码来源:MainActivity.java

示例13: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
public void getOutline(View view, Outline outline) {
    outline.setRect(0, 0, width, height);
}
 
开发者ID:NandagopalR,项目名称:Bottom-sheet-Listview,代码行数:5,代码来源:Util.java

示例14: getOutline

import android.graphics.Outline; //导入方法依赖的package包/类
@Override
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void getOutline(@NonNull Outline outline) {
    outline.setRect(drawBounds);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:6,代码来源:IconDrawable.java


注:本文中的android.graphics.Outline.setRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。