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


Java ImageView.setTransitionName方法代码示例

本文整理汇总了Java中android.widget.ImageView.setTransitionName方法的典型用法代码示例。如果您正苦于以下问题:Java ImageView.setTransitionName方法的具体用法?Java ImageView.setTransitionName怎么用?Java ImageView.setTransitionName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ImageView的用法示例。


在下文中一共展示了ImageView.setTransitionName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBindViewHolder

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(final PhotoViewHolder holder, final int position) {
    Photo data = photos.get(position);
    TextView authorview = holder.itemView.findViewById(R.id.author);
    ImageView photoview = holder.itemView.findViewById(R.id.photo);
    holder.setAuthor(data.author);
    photoview.setTransitionName(String.format(photoTransitionFormat, data.id));
    authorview.setText(data.author);
    authorview.setTransitionName(String.format(authorTransitionFormat, data.id));
    holder.setId(data.id);
    Glide.with(layoutInflater.getContext())
            .load(data.getPhotoUrl(requestedPhotoWidth))
            .placeholder(R.color.placeholder)
            .override(ImageSize.NORMAL[0], ImageSize.NORMAL[1])
            .into((ImageView) holder.itemView.findViewById(R.id.photo));
}
 
开发者ID:googlesamples,项目名称:android-instant-apps,代码行数:17,代码来源:PhotoAdapter.java

示例2: onCreateView

import android.widget.ImageView; //导入方法依赖的package包/类
@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;
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:24,代码来源:ArtistDetailFragment.java

示例3: instantiateItem

import android.widget.ImageView; //导入方法依赖的package包/类
@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;
}
 
开发者ID:mingdroid,项目名称:SETransitionDemo,代码行数:26,代码来源:DestinationActivity.java

示例4: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        setTheme(R.style.AppTheme);
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_share_element);
    mImageView = (ImageView) findViewById(R.id.image_view);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        mImageView.setTransitionName(MainActivity.TRANSITION_NAME_SHARE);
    } else {
        ShareElementInfo info = getIntent().getExtras().getParcelable(MainActivity.EXTRA_SHARE_ELEMENT_INFO);
        mShareElement = new FKJShareElement(info, this, mImageView.getRootView());
        mShareElement.convert(mImageView)
                .setDuration(ANIMATOR_DURATION)
                .setInterpolator(new LinearInterpolator())
                .startEnterAnimator();
    }
}
 
开发者ID:idisfkj,项目名称:AndroidShareElement,代码行数:20,代码来源:ShareElementActivity.java

示例5: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_animal_detail);
    supportPostponeEnterTransition();

    Bundle extras = getIntent().getExtras();
    AnimalItem animalItem = extras.getParcelable(RecyclerViewActivity.EXTRA_ANIMAL_ITEM);

    ImageView imageView = (ImageView) findViewById(R.id.animal_detail_image_view);
    TextView textView = (TextView) findViewById(R.id.animal_detail_text);
    textView.setText(animalItem.detail);

    String imageUrl = animalItem.imageUrl;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        String imageTransitionName = extras.getString(RecyclerViewActivity.EXTRA_ANIMAL_IMAGE_TRANSITION_NAME);
        imageView.setTransitionName(imageTransitionName);
    }

    Picasso.with(this)
            .load(imageUrl)
            .noFade()
            .into(imageView, new Callback() {
                @Override
                public void onSuccess() {
                    supportStartPostponedEnterTransition();
                }

                @Override
                public void onError() {
                    supportStartPostponedEnterTransition();
                }
            });
}
 
开发者ID:mikescamell,项目名称:shared-element-transitions,代码行数:35,代码来源:AnimalDetailActivity.java

示例6: onViewCreated

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    AnimalItem animalItem = getArguments().getParcelable(EXTRA_ANIMAL_ITEM);
    String transitionName = getArguments().getString(EXTRA_TRANSITION_NAME);

    TextView detailTextView = (TextView) view.findViewById(R.id.animal_detail_text);
    detailTextView.setText(animalItem.detail);

    ImageView imageView = (ImageView) view.findViewById(R.id.animal_detail_image_view);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        imageView.setTransitionName(transitionName);
    }

    Picasso.with(getContext())
            .load(animalItem.imageUrl)
            .noFade()
            .into(imageView, new Callback() {
                @Override
                public void onSuccess() {
                    startPostponedEnterTransition();
                }

                @Override
                public void onError() {
                    startPostponedEnterTransition();
                }
            });
}
 
开发者ID:mikescamell,项目名称:shared-element-transitions,代码行数:31,代码来源:AnimalDetailFragment.java

示例7: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_streamer_info);

	// Get the various handles of view and layouts that is part of this view
	streamerImage 			= (ImageView) findViewById(R.id.profileImageView);
	additionalInfoLayout 	= (LinearLayout) findViewById(R.id.additional_info_wrapper);
	streamerInfoName 		= (TextView) findViewById(R.id.twitch_name);
	streamerViewers 		= (TextView) findViewById(R.id.txt_viewers);
	streamerFollowers 		= (TextView) findViewById(R.id.txt_followers);
	toolbar 				= (Toolbar) findViewById(R.id.StreamerInfo_Toolbar);
	additionalToolbar 		= (Toolbar) findViewById(R.id.additional_toolbar);
	mViewPager				= (ViewPager) findViewById(R.id.container);
	mTabs					= (TabLayout) findViewById(R.id.tabs);
	mAppBar					= (AppBarLayout) findViewById(R.id.appbar);
	mFab 					= (FloatingActionButton) findViewById(R.id.fab);

	setSupportActionBar(toolbar);
	if (getSupportActionBar() != null) {
		getSupportActionBar().setDisplayHomeAsUpEnabled(true);
	}

	// Get the StreamerInfo object sent with the intent to open this activity
	Intent intent = getIntent();
	info = intent.getParcelableExtra(getResources().getString(R.string.channel_info_intent_object));

	streamerInfoName		.setText(info.getDisplayName());
	streamerFollowers		.setText(getReadableInt(info.getFollowers()));
	streamerViewers			.setText(getReadableInt(info.getViews()));

	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
		streamerImage.setTransitionName(getString(R.string.streamerInfo_transition));
	}

	setUpTabs();
	initStreamerImageAndColors();
	initiateFAB();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:40,代码来源:ChannelActivity.java

示例8: onCreateView

import android.widget.ImageView; //导入方法依赖的package包/类
@TargetApi(21)
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(
            R.layout.fragment_album_detail, container, false);

    albumArt = (ImageView) rootView.findViewById(R.id.album_art);
    artistArt = (ImageView) rootView.findViewById(R.id.artist_art);
    albumTitle = (TextView) rootView.findViewById(R.id.album_title);
    albumDetails = (TextView) rootView.findViewById(R.id.album_details);

    toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);

    fab = (FloatingActionButton) rootView.findViewById(R.id.fab);

    if (getArguments().getBoolean("transition")) {
        albumArt.setTransitionName(getArguments().getString("transition_name"));
    }
    recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
    collapsingToolbarLayout = (CollapsingToolbarLayout) rootView.findViewById(R.id.collapsing_toolbar);
    appBarLayout = (AppBarLayout) rootView.findViewById(R.id.app_bar);
    recyclerView.setEnabled(false);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

    album = AlbumLoader.getAlbum(getActivity(), albumID);

    setAlbumart();

    setUpEverything();


    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    AlbumSongsAdapter adapter = (AlbumSongsAdapter) recyclerView.getAdapter();
                    MusicPlayer.playAll(getActivity(), adapter.getSongIds(), 0, albumID, TimberUtils.IdType.Album, true);
                    NavigationUtils.navigateToNowplaying(getActivity(), false);
                }
            }, 150);
        }
    });

    return rootView;
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:49,代码来源:AlbumDetailFragment.java


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