use of com.transitionseverywhere.ChangeText in project Transitions-Everywhere by andkulikov.
the class ChangeTextSample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_change_text, container, false);
final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
final TextView textView = (TextView) transitionsContainer.findViewById(R.id.text1);
textView.setText(TEXT_1);
textView.setOnClickListener(new View.OnClickListener() {
boolean mSecondText;
@Override
public void onClick(View v) {
mSecondText = !mSecondText;
TransitionManager.beginDelayedTransition(transitionsContainer, new ChangeText().setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN));
textView.setText(mSecondText ? TEXT_2 : TEXT_1);
}
});
return view;
}
Aggregations