Search in sources :

Example 51 with Nullable

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;
}
Also used : ChangeText(com.transitionseverywhere.ChangeText) ViewGroup(android.view.ViewGroup) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 52 with Nullable

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;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Nullable(android.support.annotation.Nullable)

Example 53 with Nullable

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;
}
Also used : ViewGroup(android.view.ViewGroup) ChangeBounds(com.transitionseverywhere.ChangeBounds) FrameLayout(android.widget.FrameLayout) View(android.view.View) ArcMotion(com.transitionseverywhere.ArcMotion) Nullable(android.support.annotation.Nullable)

Example 54 with Nullable

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;
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) Button(android.widget.Button) ViewGroup(android.view.ViewGroup) View(android.view.View) Recolor(com.transitionseverywhere.Recolor) Nullable(android.support.annotation.Nullable)

Example 55 with Nullable

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;
}
Also used : Rotate(com.transitionseverywhere.Rotate) ViewGroup(android.view.ViewGroup) View(android.view.View) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)582 View (android.view.View)315 TextView (android.widget.TextView)163 RecyclerView (android.support.v7.widget.RecyclerView)85 BindView (butterknife.BindView)57 ImageView (android.widget.ImageView)52 ArrayList (java.util.ArrayList)43 IOException (java.io.IOException)36 Bundle (android.os.Bundle)35 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)35 Intent (android.content.Intent)32 ViewGroup (android.view.ViewGroup)32 Cursor (android.database.Cursor)29 Uri (android.net.Uri)27 File (java.io.File)24 AdapterView (android.widget.AdapterView)22 List (java.util.List)20 NonNull (android.support.annotation.NonNull)19 Context (android.content.Context)15 Bitmap (android.graphics.Bitmap)15