List of usage examples for android.widget ImageView getTransitionName
@ViewDebug.ExportedProperty
public String getTransitionName()
From source file:org.xbmc.kore.ui.BaseMediaActivity.java
@TargetApi(21) protected void showFragment(AbstractFragment fragment, ImageView sharedImageView, AbstractFragment.DataHolder dataHolder) { FragmentTransaction fragTrans = getSupportFragmentManager().beginTransaction(); // Set up transitions if (Utils.isLollipopOrLater()) { dataHolder.setPosterTransitionName(sharedImageView.getTransitionName()); sharedElementTransition.setupEnterTransition(this, fragTrans, fragment, sharedImageView); } else {/*from w ww . jav a 2s . c o m*/ fragTrans.setCustomAnimations(R.anim.fragment_details_enter, 0, R.anim.fragment_list_popenter, 0); } fragTrans.replace(R.id.fragment_container, fragment, getActionBarTitle()).addToBackStack(null).commit(); }
From source file:app.jorge.mobile.com.transportalert.ScrollingActivity.java
private void addCard(LinearLayout item, CardFactory.TUBE_LINE line) { CardTube card = CardFactory.getCard(line); View child = getLayoutInflater().inflate(R.layout.tube_line, null); ImageView imageView = (ImageView) child.findViewById(R.id.iconTube); //imageView.setImageResource(card.getIcon()); imageView.setImageBitmap(decodeSampledBitmapFromResource(getResources(), card.getIcon(), 100, 100)); TextView lineName = (TextView) child.findViewById(R.id.tubeName); lineName.setText(card.getName());//from w w w . ja v a 2 s. c om lineName.setTextColor(Color.parseColor(card.getColour())); TextView text = (TextView) child.findViewById(R.id.tubeStatus); text.setText(card.getStatus()); item.addView(child); child.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { View imageView = v.findViewById(R.id.iconTube); imageView.setTransitionName(getString(R.string.activity_image_trans)); View textTubeNameView = v.findViewById(R.id.tubeName); textTubeNameView.setTransitionName(getString(R.string.activity_text_tube_name)); View textStatusView = v.findViewById(R.id.tubeStatus); textStatusView.setTransitionName(getString(R.string.activity_text_tube_status)); Intent intent = new Intent(ScrollingActivity.this, DetailActivity.class); Pair<View, String> pair1 = Pair.create(imageView, imageView.getTransitionName()); Pair<View, String> pair2 = Pair.create(textTubeNameView, textTubeNameView.getTransitionName()); Pair<View, String> pair3 = Pair.create(textStatusView, textStatusView.getTransitionName()); ActivityOptionsCompat options = ActivityOptionsCompat .makeSceneTransitionAnimation(ScrollingActivity.this, pair1, pair2, pair3); String line = ((TextView) textTubeNameView).getText().toString(); String status = ((TextView) textStatusView).getText().toString(); LineStatuses ls = tubeStatus.get(line); if ((ls != null) && (ls.getDisruption() != null)) { intent.putExtra(getString(R.string.activity_info_category), ls.getDisruption().getCategory()); intent.putExtra(getString(R.string.activity_info_description), ls.getDisruption().getDescription()); intent.putExtra(getString(R.string.activity_info_additional), ls.getDisruption().getAdditionalInfo()); intent.putExtra(getString(R.string.activity_info_icon), line); intent.putExtra(getString(R.string.activity_info_status), status); startActivity(intent, options.toBundle()); } } }); }