當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。