android.content.Intent.getSourceBounds()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(346)

本文整理了Java中android.content.Intent.getSourceBounds()方法的一些代码示例,展示了Intent.getSourceBounds()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Intent.getSourceBounds()方法的具体详情如下:
包路径:android.content.Intent
类名称:Intent
方法名:getSourceBounds

Intent.getSourceBounds介绍

暂无

代码示例

代码示例来源:origin: elvishew/xLog

b.append("cmp=").append(mComponent.flattenToShortString());
Rect mSourceBounds = intent.getSourceBounds();
if (mSourceBounds != null) {
 if (!first) {

代码示例来源:origin: joyoyao/superCleanMaster

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_short_cut);
rect = getIntent().getSourceBounds();
if (rect == null) {
  finish();

代码示例来源:origin: stackoverflow.com

public void onReceive(Context context, Intent intent) {  
 if (intent.getAction().equals(ACTION_WIDGET_RECEIVER)) {  
  Uri uri = intent.getData();
  if ( uri != null ) {
    QuickContact.showQuickContact(context, intent.getSourceBounds(), uri, ContactsContract.QuickContact.MODE_SMALL, null);
  }
 }  
 super.onReceive(context, intent);
}

代码示例来源:origin: zhangke3016/TranslationCompat

@Override
  public void run() {
    final Rect mRect = intent.getSourceBounds();
    View virtalView = new View(activity);
    Bitmap cacheBitmap = BitmapUtil.getCacheBitmapFromView(next_view);
    // 获取上一个界面中,元素的宽度和高度
    final int mOriginWidth = mRect.right - mRect.left;
    final int mOriginHeight = mRect.bottom - mRect.top;
    getBundleInfo(next_view,mOriginWidth,mOriginHeight,mRect);
    mContainer = new FrameLayout(activity);
    FrameLayout.LayoutParams mContainerParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    parent.addView(mContainer,mContainerParams);
    if (mBgColor!=-1)
       mContainer.setBackgroundColor(ContextCompat.getColor(activity, mBgColor));
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(mOriginWidth, mOriginHeight);
    params.setMargins(mRect.left, mRect.top - BarUtils.getActionBarHeight(activity) -getStatusBarHeight(activity), mRect.right, mRect.bottom);
    virtalView.setBackgroundDrawable(new BitmapDrawable(activity.getResources(), cacheBitmap));
    virtalView.setLayoutParams(params);
    mContainer.addView(virtalView);
    cacheBitmap=null;
    runEnterAnim(virtalView,next_view,mContainer);
  }
});

代码示例来源:origin: Blankj/ALog

sb.append("cmp=").append(mComponent.flattenToShortString());
Rect mSourceBounds = intent.getSourceBounds();
if (mSourceBounds != null) {
  if (!first) {

代码示例来源:origin: wl9739/UITransitionDemo

/**
 * 初始化场景
 */
private void initial() {
  // 获取上一个界面传入的信息
  mRect = getIntent().getSourceBounds();
  mRescourceId = getIntent().getExtras().getInt(EXTRA_IMAGE);
  // 获取上一个界面中,图片的宽度和高度
  mOriginWidth = mRect.right - mRect.left;
  mOriginHeight = mRect.bottom - mRect.top;
  // 设置 ImageView 的位置,使其和上一个界面中图片的位置重合
  FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(mOriginWidth, mOriginHeight);
  params.setMargins(mRect.left, mRect.top - getStatusBarHeight(), mRect.right, mRect.bottom);
  mImageView.setLayoutParams(params);
  // 设置 ImageView 的图片和缩放类型
  mImageView.setImageResource(mRescourceId);
  mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
  // 根据上一个界面传入的图片资源 ID,获取图片的 Bitmap 对象。
  BitmapDrawable bitmapDrawable = (BitmapDrawable) getResources().getDrawable(mRescourceId);
  Bitmap bitmap = bitmapDrawable.getBitmap();
  // 计算图片缩放比例和位移距离
  getBundleInfo(bitmap);
  // 创建一个 Pallette 对象
  mImagePalette = Palette.from(bitmap).generate();
  // 使用 Palette 设置背景颜色
  mContainer.setBackgroundColor(
      mImagePalette.getVibrantColor(ContextCompat.getColor(this, android.R.color.black)));
}

代码示例来源:origin: nirhart/shortrain

final Rect trainRect = getIntent().getSourceBounds();
addTrainToScreen(trainRect);

代码示例来源:origin: enricocid/LaunchEnr

} else {
  LauncherAppsCompat.getInstance(this).startActivityForProfile(
      intent.getComponent(), user, intent.getSourceBounds(), optsBundle);

代码示例来源:origin: nirhart/shortrain

Rect r = getIntent().getSourceBounds();
ShortcutInfo thisRailShortcut = ShortcutsUtils.createRailShortcut(this, railNumber, nextIcon, nextRotation, r);

代码示例来源:origin: klinker24/launcher3

if (targetIntent != null && info.user.equals(user)) {
  Intent copyIntent = new Intent(targetIntent);
  copyIntent.setSourceBounds(intent.getSourceBounds());
  String s = copyIntent.toUri(0);
  if (intentWithPkg.equals(s) || intentWithoutPkg.equals(s)) {

代码示例来源:origin: fookwood/Launcher3

intent.getSourceBounds(), optsBundle);

代码示例来源:origin: WeAreFairphone/FP2-Launcher

intent.getSourceBounds(), optsBundle);

代码示例来源:origin: klinker24/Android-Blur-Launcher

if (targetIntent != null && info.user.equals(user)) {
  Intent copyIntent = new Intent(targetIntent);
  copyIntent.setSourceBounds(intent.getSourceBounds());
  String s = copyIntent.toUri(0);
  if (intentWithPkg.equals(s) || intentWithoutPkg.equals(s)) {

代码示例来源:origin: enricocid/LaunchEnr

if (item.getIntent() != null && info.user.equals(user)) {
  Intent copyIntent = new Intent(item.getIntent());
  copyIntent.setSourceBounds(intent.getSourceBounds());
  String s = copyIntent.toUri(0);
  if (intentWithPkg.equals(s) || intentWithoutPkg.equals(s)) {

代码示例来源:origin: klinker24/Android-Blur-Launcher

intent.getComponent(), user, intent.getSourceBounds(), optsBundle);

代码示例来源:origin: klinker24/launcher3

intent.getComponent(), user, intent.getSourceBounds(), optsBundle);

代码示例来源:origin: enricocid/LaunchEnr

String packageName = intent.getPackage();
  DeepShortcutManager.getInstance(this).startShortcut(
      packageName, id, intent.getSourceBounds(), optsBundle, info.user);
} else {

代码示例来源:origin: klinker24/launcher3

String packageName = intent.getPackage();
  LauncherAppState.getInstance().getShortcutManager().startShortcut(
      packageName, id, intent.getSourceBounds(), optsBundle, info.user);
} else {

代码示例来源:origin: klinker24/Android-Blur-Launcher

String packageName = intent.getPackage();
  LauncherAppState.getInstance().getShortcutManager().startShortcut(
      packageName, id, intent.getSourceBounds(), optsBundle, info.user);
} else {

相关文章

Intent类方法