android.widget.ImageView.setTransitionName()方法的使用及代码示例

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

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

ImageView.setTransitionName介绍

暂无

代码示例

代码示例来源:origin: naman14/Timber

@Override
public void onBindViewHolder(ItemHolder itemHolder, int i) {
  Album localItem = arraylist.get(i);
  itemHolder.title.setText(localItem.title);
  String songCount = TimberUtils.makeLabel(mContext, R.plurals.Nsongs, localItem.songCount);
  itemHolder.details.setText(songCount);
  ImageUtils.loadAlbumArtIntoView(localItem.id, itemHolder.albumArt);
  if (TimberUtils.isLollipop())
    itemHolder.albumArt.setTransitionName("transition_album_art" + i);
}

代码示例来源:origin: naman14/Timber

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View rootView = inflater.inflate(
      R.layout.fragment_artist_detail, container, false);
  artistArt = (ImageView) rootView.findViewById(R.id.artist_art);
  collapsingToolbarLayout = (CollapsingToolbarLayout) rootView.findViewById(R.id.collapsing_toolbar);
  appBarLayout = (AppBarLayout) rootView.findViewById(R.id.app_bar);
  if (getArguments().getBoolean("transition")) {
    artistArt.setTransitionName(getArguments().getString("transition_name"));
  }
  toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
  setupToolbar();
  setUpArtistDetails();
  getChildFragmentManager().beginTransaction().replace(R.id.container, ArtistMusicFragment.newInstance(artistID)).commit();
  return rootView;
}

代码示例来源:origin: naman14/Timber

albumArt.setTransitionName(getArguments().getString("transition_name"));

代码示例来源:origin: naman14/Timber

itemHolder.artistImage.setTransitionName("transition_artist_art" + i);

代码示例来源:origin: naman14/Timber

itemHolder.albumArt.setTransitionName("transition_album_art" + i);

代码示例来源:origin: naman14/Timber

itemHolder.albumArt.setTransitionName("transition_album_art" + i);

代码示例来源:origin: JustinRoom/JSCKit

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void initSharedElement() {
  super.initSharedElement();
  imageView.setTransitionName("share_img");
}

代码示例来源:origin: alexjlockwood/adp-activity-transitions

public void bind(int position) {
  Picasso.with(MainActivity.this).load(ALBUM_IMAGE_URLS[position]).into(mAlbumImage);
  mAlbumImage.setTransitionName(ALBUM_NAMES[position]);
  mAlbumImage.setTag(ALBUM_NAMES[position]);
  mAlbumPosition = position;
}

代码示例来源:origin: JustinRoom/JSCKit

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
  @Override
  public void initSharedElement() {
    super.initSharedElement();
    imageView.setTransitionName("share_img");
  }
}

代码示例来源:origin: mingdroid/SETransitionDemo

public void bindView(ArrayList<Uri> uris) {
  this.uris = uris;
  titleView.setText("item" + getAdapterPosition());
  for (int i = 0; i < uris.size() && i < photoViews.length; i++) {
    photoViews[i].setImageURI(uris.get(i));
    photoViews[i].setTag(i);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      photoViews[i].setTransitionName(
          context.getString(R.string.transition_name, getAdapterPosition(), i));
    }
  }
}

代码示例来源:origin: google/android-transition-examples

/**
 * Binds this view holder to the given adapter position.
 *
 * The binding will load the image into the image view, as well as set its transition name for
 * later.
 */
void onBind() {
 int adapterPosition = getAdapterPosition();
 setImage(adapterPosition);
 // Set the string value of the image resource as the unique transition name for the view.
 image.setTransitionName(String.valueOf(IMAGE_DRAWABLES[adapterPosition]));
}

代码示例来源:origin: rohanoid5/Muzesto

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View rootView = inflater.inflate(
      R.layout.fragment_artist_detail, container, false);
  artistArt = (ImageView) rootView.findViewById(R.id.artist_art);
  collapsingToolbarLayout = (CollapsingToolbarLayout) rootView.findViewById(R.id.collapsing_toolbar);
  appBarLayout = (AppBarLayout) rootView.findViewById(R.id.app_bar);
  if (getArguments().getBoolean("transition")) {
    artistArt.setTransitionName(getArguments().getString("transition_name"));
  }
  toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
  setupToolbar();
  setUpArtistDetails();
  getChildFragmentManager().beginTransaction().replace(R.id.container, ArtistMusicFragment.newInstance(artistID)).commit();
  return rootView;
}

代码示例来源:origin: brainysoon/cyberCar

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View rootView = inflater.inflate(
      R.layout.fragment_artist_detail, container, false);
  artistArt = (ImageView) rootView.findViewById(R.id.artist_art);
  collapsingToolbarLayout = (CollapsingToolbarLayout) rootView.findViewById(R.id.collapsing_toolbar);
  appBarLayout = (AppBarLayout) rootView.findViewById(R.id.app_bar);
  if (getArguments().getBoolean("transition")) {
    artistArt.setTransitionName(getArguments().getString("transition_name"));
  }
  toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
  setupToolbar();
  setUpArtistDetails();
  getChildFragmentManager().beginTransaction().replace(R.id.container, ArtistMusicFragment.newInstance(artistID)).commit();
  return rootView;
}

代码示例来源:origin: mingdroid/SETransitionDemo

@Override
public Object instantiateItem(ViewGroup container, int position) {
  ImageView imageView = new ImageView(container.getContext());
  imageView.setLayoutParams(new ViewGroup.LayoutParams(
      ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
  imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
  imageView.setImageURI(uris.get(position));
  DismissFrameLayout layout = new DismissFrameLayout(container.getContext());
  layout.setDismissListener(onDismissListener);
  layout.setLayoutParams(new ViewPager.LayoutParams());
  layout.addView(imageView);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    String name = container.getContext()
        .getString(R.string.transition_name, adapterPosition, position);
    imageView.setTransitionName(name);
    imageView.setTag(name);
    if (position == current) {
      setStartPostTransition(imageView);
    }
  }
  container.addView(layout);
  return layout;
}

代码示例来源:origin: filippella/Dagger-Rx-Database-MVP

@Override
protected void onViewReady(Bundle savedInstanceState, Intent intent) {
  super.onViewReady(savedInstanceState, intent);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    mCakeImage.setTransitionName("cakeImageAnimation");
  }
  showBackArrow();
  Cake cake = (Cake) intent.getSerializableExtra(CAKE);
  setTitle("Cake Detail");
  mCakeTitle.setText(cake.getTitle());
  mCakeDescription.setText(cake.getDetailDescription());
  Glide.with(this).load(cake.getImageUrl())
      .diskCacheStrategy(DiskCacheStrategy.SOURCE)
      .into(new ImageHandler(mCakeImage));
}

代码示例来源:origin: luhaoaimama1/LollipopTransition

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
  @Override
  public void onMapSharedElements(List<String> names, Map<String, View> sharedElements) {
    super.onMapSharedElements(names, sharedElements);
    if (mIsReturning) {
      ImageView sharedElement = ViewPagerHelper.getPositionFrament(SharePicAcitivity.this,
          mCurrentFragment, vpHelper.getCurrentPostion()).getAlbumImage();
      if (sharedElement != null) {
        sharedElement.setTransitionName(FiveShareNormalAcitivty.PIC);
        sharedElements.put(sharedElement.getTransitionName(), sharedElement);
      }
    } else {
      ImageView sharedElement = mCurrentFragment.getAlbumImage();
      if (sharedElement != null) {
        sharedElement.setTransitionName(FiveShareNormalAcitivty.PIC);
        sharedElements.put(sharedElement.getTransitionName(), sharedElement);
      }
    }
  }
};

代码示例来源:origin: xbmc/Kore

@Override
  public void bindView(Cursor cursor) {
    dataHolder.setId(cursor.getInt(ArtistListQuery.ARTISTID));
    dataHolder.setTitle(cursor.getString(ArtistListQuery.ARTIST));
    dataHolder.setUndertitle(cursor.getString(ArtistListQuery.GENRE));
    dataHolder.setDescription(cursor.getString(ArtistListQuery.DESCRIPTION));
    dataHolder.setFanArtUrl(cursor.getString(ArtistListQuery.FANART));
    nameView.setText(cursor.getString(ArtistListQuery.ARTIST));
    genresView.setText(cursor.getString(ArtistListQuery.GENRE));
    dataHolder.setPosterUrl(cursor.getString(ArtistListQuery.THUMBNAIL));
    UIUtils.loadImageWithCharacterAvatar(context, hostManager,
                       dataHolder.getPosterUrl(), dataHolder.getTitle(),
                       artView, artWidth, artHeight);
    if (Utils.isLollipopOrLater()) {
      artView.setTransitionName("ar"+dataHolder.getId());
    }
  }
}

代码示例来源:origin: rohanoid5/Muzesto

@Override
public void onBindViewHolder(ItemHolder itemHolder, int i) {
  Album localItem = arraylist.get(i);
  itemHolder.title.setText(localItem.title);
  String songCount = TimberUtils.makeLabel(mContext, R.plurals.Nsongs, localItem.songCount);
  itemHolder.details.setText(songCount);
  ImageLoader.getInstance().displayImage(TimberUtils.getAlbumArtUri(localItem.id).toString(), itemHolder.albumArt,
      new DisplayImageOptions.Builder().cacheInMemory(true)
          .showImageOnFail(R.drawable.ic_dribble)
          .resetViewBeforeLoading(true)
          .build());
  if (TimberUtils.isLollipop())
    itemHolder.albumArt.setTransitionName("transition_album_art" + i);
}

代码示例来源:origin: brainysoon/cyberCar

@Override
public void onBindViewHolder(ItemHolder itemHolder, int i) {
  Album localItem = arraylist.get(i);
  itemHolder.title.setText(localItem.title);
  String songCount = TimberUtils.makeLabel(mContext, R.plurals.Nsongs, localItem.songCount);
  itemHolder.details.setText(songCount);
  ImageLoader.getInstance().displayImage(TimberUtils.getAlbumArtUri(localItem.id).toString(), itemHolder.albumArt,
      new DisplayImageOptions.Builder().cacheInMemory(true)
          .showImageOnFail(R.drawable.ic_empty_music2)
          .resetViewBeforeLoading(true)
          .build());
  if (TimberUtils.isLollipop())
    itemHolder.albumArt.setTransitionName("transition_album_art" + i);
}

代码示例来源:origin: xbmc/Kore

public void onBind(AddonType.Details addonDetails) {
    dataHolder.setTitle(addonDetails.name);
    dataHolder.setDescription(addonDetails.description);
    dataHolder.setUndertitle(addonDetails.summary);
    dataHolder.setFanArtUrl(addonDetails.fanart);
    dataHolder.setPosterUrl(addonDetails.thumbnail);
    dataHolder.setDetails(author + " " + addonDetails.author + "\n" +
               version + " " +addonDetails.version);
    dataHolder.getBundle().putString(AddonInfoFragment.BUNDLE_KEY_ADDONID, addonDetails.addonid);
    dataHolder.getBundle().putBoolean(AddonInfoFragment.BUNDLE_KEY_BROWSABLE,
                     AddonType.Types.XBMC_PYTHON_PLUGINSOURCE.equals(addonDetails.type));
    titleView.setText(dataHolder.getTitle());
    detailsView.setText(addonDetails.summary);
    disabledView.setVisibility(addonDetails.enabled ? View.INVISIBLE : View.VISIBLE);
    UIUtils.loadImageWithCharacterAvatar(context, hostManager,
                       addonDetails.thumbnail, dataHolder.getTitle(),
                       artView, artWidth, artHeight);
    if(Utils.isLollipopOrLater()) {
      artView.setTransitionName("a"+addonDetails.addonid);
    }
  }
}

相关文章

ImageView类方法