use of android.support.annotation.Nullable 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;
}
use of android.support.annotation.Nullable in project Transitions-Everywhere by andkulikov.
the class ListFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
RecyclerView view = (RecyclerView) inflater.inflate(R.layout.fragment_list, container, false);
view.setLayoutManager(new LinearLayoutManager(container.getContext()));
view.setAdapter(new Adapter());
return view;
}
use of android.support.annotation.Nullable in project Transitions-Everywhere by andkulikov.
the class PathMotionSample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_path, container, false);
final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
final View button = transitionsContainer.findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
boolean mToRightAnimation;
@Override
public void onClick(View v) {
TransitionManager.beginDelayedTransition(transitionsContainer, new ChangeBounds().setPathMotion(new ArcMotion()).setDuration(500));
mToRightAnimation = !mToRightAnimation;
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) button.getLayoutParams();
params.gravity = mToRightAnimation ? (Gravity.RIGHT | Gravity.BOTTOM) : (Gravity.LEFT | Gravity.TOP);
button.setLayoutParams(params);
}
});
return view;
}
use of android.support.annotation.Nullable in project Transitions-Everywhere by andkulikov.
the class RecolorSample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_recolor, container, false);
final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
final Button button = (Button) transitionsContainer.findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
boolean mColorsInverted;
@Override
public void onClick(View v) {
TransitionManager.beginDelayedTransition(transitionsContainer, new Recolor());
mColorsInverted = !mColorsInverted;
button.setTextColor(getResources().getColor(!mColorsInverted ? R.color.second_accent : R.color.accent));
button.setBackgroundDrawable(new ColorDrawable(getResources().getColor(!mColorsInverted ? R.color.accent : R.color.second_accent)));
}
});
return view;
}
use of android.support.annotation.Nullable in project Transitions-Everywhere by andkulikov.
the class RotateSample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_rotate, container, false);
final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
final View icon = transitionsContainer.findViewById(R.id.icon);
icon.setOnClickListener(new View.OnClickListener() {
boolean mRotated;
@Override
public void onClick(View v) {
TransitionManager.beginDelayedTransition(transitionsContainer, new Rotate());
mRotated = !mRotated;
icon.setRotation(mRotated ? 135 : 0);
}
});
return view;
}
Aggregations