Example usage for android.widget TextView setTransitionName

List of usage examples for android.widget TextView setTransitionName

Introduction

In this page you can find the example usage for android.widget TextView setTransitionName.

Prototype

public final void setTransitionName(String transitionName) 

Source Link

Document

Sets the name of the View to be used to identify Views in Transitions.

Usage

From source file:com.example.android.unsplash.ui.pager.DetailViewPagerAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    View view = layoutInflater.inflate(R.layout.detail_view, container, false);
    ThreeTwoImageView photoview = view.findViewById(R.id.photo);
    TextView authorview = view.findViewById(R.id.author);
    Photo photo = allPhotos.get(position);
    photoview.setTransitionName(String.format(photoTransitionFormat, photo.id));
    authorview.setText(photo.author);/*from  w  w w  .j a  v a  2  s. c o m*/
    authorview.setTransitionName(String.format(authorTransitionFormat, photo.id));
    onViewBound(photoview, photo);
    container.addView(view);
    return view;
}

From source file:app.jorge.mobile.com.transportalert.DetailActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detail);

    ImageView imageView = (ImageView) findViewById(R.id.iconTube);
    TextView textTubeName = (TextView) findViewById(R.id.tubeName);
    TextView textStatusView = (TextView) findViewById(R.id.tubeStatus);

    String category = getCategory(getIntent().getStringExtra(getString(R.string.activity_info_category)));
    String description = getDescription(
            getIntent().getStringExtra(getString(R.string.activity_info_description)));
    String additional = getIntent().getStringExtra(getString(R.string.activity_info_additional));
    String name = getIntent().getStringExtra(getString(R.string.activity_info_icon));
    String status = getIntent().getStringExtra(getString(R.string.activity_info_status));

    textTubeName.setText(name);//  w  ww.  java  2  s .c om
    textStatusView.setText(status);
    imageView.setBackgroundResource(getIconLine(name));

    TextView textCategoryView = (TextView) findViewById(R.id.category);
    textCategoryView.setText(category);

    TextView textDescriptionView = (TextView) findViewById(R.id.description);
    textDescriptionView.setText(description);

    TextView textAdditionalView = (TextView) findViewById(R.id.additional);
    textAdditionalView.setText(additional);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

        imageView.setTransitionName(getString(R.string.activity_image_trans));
        textTubeName.setTransitionName(getString(R.string.activity_text_tube_name));
        textStatusView.setTransitionName(getString(R.string.activity_text_tube_status));

    }

}