Search in sources :

Example 1 with Rotate

use of android.transition.Rotate in project android_frameworks_base by ResurrectionRemix.

the class ContactsExpansion method addContact.

private void addContact(ViewGroup container, int dataIndex, int thumbnailID) {
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View contactItem = inflater.inflate(R.layout.contact_collapsed, container, false);
    ImageView thumbnailView = (ImageView) contactItem.findViewById(R.id.contact_picture);
    thumbnailView.setImageResource(thumbnailID);
    ((TextView) contactItem.findViewById(R.id.contact_name)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_street)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_city)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_phone)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_email)).setText(contactsData[dataIndex++]);
    container.addView(contactItem);
    final TransitionSet myTransition = new TransitionSet();
    myTransition.addTransition(new Fade(Fade.IN)).addTransition(new Rotate().addTarget(R.id.contact_arrow)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.OUT)).addTransition(new Crossfade().addTarget(R.id.contact_picture));
    final ToggleScene toggleScene = new ToggleScene(container, myTransition);
    contactItem.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            currentItem = v;
            toggleScene.changeToScene();
        }
    });
}
Also used : Rotate(android.transition.Rotate) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) LayoutInflater(android.view.LayoutInflater) Crossfade(android.transition.Crossfade) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Fade(android.transition.Fade)

Example 2 with Rotate

use of android.transition.Rotate in project platform_frameworks_base by android.

the class ContactsExpansion method addContact.

private void addContact(ViewGroup container, int dataIndex, int thumbnailID) {
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View contactItem = inflater.inflate(R.layout.contact_collapsed, container, false);
    ImageView thumbnailView = (ImageView) contactItem.findViewById(R.id.contact_picture);
    thumbnailView.setImageResource(thumbnailID);
    ((TextView) contactItem.findViewById(R.id.contact_name)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_street)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_city)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_phone)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_email)).setText(contactsData[dataIndex++]);
    container.addView(contactItem);
    final TransitionSet myTransition = new TransitionSet();
    myTransition.addTransition(new Fade(Fade.IN)).addTransition(new Rotate().addTarget(R.id.contact_arrow)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.OUT)).addTransition(new Crossfade().addTarget(R.id.contact_picture));
    final ToggleScene toggleScene = new ToggleScene(container, myTransition);
    contactItem.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            currentItem = v;
            toggleScene.changeToScene();
        }
    });
}
Also used : Rotate(android.transition.Rotate) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) LayoutInflater(android.view.LayoutInflater) Crossfade(android.transition.Crossfade) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Fade(android.transition.Fade)

Example 3 with Rotate

use of android.transition.Rotate in project android_frameworks_base by DirtyUnicorns.

the class ContactsExpansion method addContact.

private void addContact(ViewGroup container, int dataIndex, int thumbnailID) {
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View contactItem = inflater.inflate(R.layout.contact_collapsed, container, false);
    ImageView thumbnailView = (ImageView) contactItem.findViewById(R.id.contact_picture);
    thumbnailView.setImageResource(thumbnailID);
    ((TextView) contactItem.findViewById(R.id.contact_name)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_street)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_city)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_phone)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_email)).setText(contactsData[dataIndex++]);
    container.addView(contactItem);
    final TransitionSet myTransition = new TransitionSet();
    myTransition.addTransition(new Fade(Fade.IN)).addTransition(new Rotate().addTarget(R.id.contact_arrow)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.OUT)).addTransition(new Crossfade().addTarget(R.id.contact_picture));
    final ToggleScene toggleScene = new ToggleScene(container, myTransition);
    contactItem.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            currentItem = v;
            toggleScene.changeToScene();
        }
    });
}
Also used : Rotate(android.transition.Rotate) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) LayoutInflater(android.view.LayoutInflater) Crossfade(android.transition.Crossfade) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Fade(android.transition.Fade)

Example 4 with Rotate

use of android.transition.Rotate in project android_frameworks_base by crdroidandroid.

the class ContactsExpansion method addContact.

private void addContact(ViewGroup container, int dataIndex, int thumbnailID) {
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View contactItem = inflater.inflate(R.layout.contact_collapsed, container, false);
    ImageView thumbnailView = (ImageView) contactItem.findViewById(R.id.contact_picture);
    thumbnailView.setImageResource(thumbnailID);
    ((TextView) contactItem.findViewById(R.id.contact_name)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_street)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_city)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_phone)).setText(contactsData[dataIndex++]);
    ((TextView) contactItem.findViewById(R.id.contact_email)).setText(contactsData[dataIndex++]);
    container.addView(contactItem);
    final TransitionSet myTransition = new TransitionSet();
    myTransition.addTransition(new Fade(Fade.IN)).addTransition(new Rotate().addTarget(R.id.contact_arrow)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.OUT)).addTransition(new Crossfade().addTarget(R.id.contact_picture));
    final ToggleScene toggleScene = new ToggleScene(container, myTransition);
    contactItem.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            currentItem = v;
            toggleScene.changeToScene();
        }
    });
}
Also used : Rotate(android.transition.Rotate) TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) LayoutInflater(android.view.LayoutInflater) Crossfade(android.transition.Crossfade) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Fade(android.transition.Fade)

Aggregations

ChangeBounds (android.transition.ChangeBounds)4 Crossfade (android.transition.Crossfade)4 Fade (android.transition.Fade)4 Rotate (android.transition.Rotate)4 TransitionSet (android.transition.TransitionSet)4 LayoutInflater (android.view.LayoutInflater)4 View (android.view.View)4 ImageView (android.widget.ImageView)4 TextView (android.widget.TextView)4