Search in sources :

Example 46 with LayoutInflater

use of android.view.LayoutInflater 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 47 with LayoutInflater

use of android.view.LayoutInflater in project platform_frameworks_base by android.

the class Demo0 method sendMessage.

public void sendMessage(View view) {
    if (mCurrentScene == RESULTS_SCREEN) {
        mSceneRoot.removeAllViews();
        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.search_screen, mSceneRoot);
        mCurrentScene = SEARCH_SCREEN;
    } else {
        mSceneRoot.removeAllViews();
        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.results_screen, mSceneRoot);
        mCurrentScene = RESULTS_SCREEN;
    }
}
Also used : LayoutInflater(android.view.LayoutInflater)

Example 48 with LayoutInflater

use of android.view.LayoutInflater in project platform_frameworks_base by android.

the class Demo1 method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search_screen);
    View container = (View) findViewById(R.id.container);
    mSceneRoot = (ViewGroup) container.getParent();
    //        mResultsScreen = new MyScene(mSceneRoot, R.layout.results_screen);
    //        mSearchScreen = new MyScene(mSceneRoot, R.layout.search_screen);
    mResultsScreen = new Scene(mSceneRoot);
    mResultsScreen.setEnterAction(new Runnable() {

        @Override
        public void run() {
            LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            inflater.inflate(R.layout.results_screen, mSceneRoot);
        }
    });
    mSearchScreen = new Scene(mSceneRoot);
    mSearchScreen.setEnterAction(new Runnable() {

        @Override
        public void run() {
            LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            inflater.inflate(R.layout.search_screen, mSceneRoot);
        }
    });
}
Also used : LayoutInflater(android.view.LayoutInflater) Scene(android.transition.Scene) View(android.view.View)

Example 49 with LayoutInflater

use of android.view.LayoutInflater in project platform_frameworks_base by android.

the class OverflowMenuAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
        LayoutInflater mInflater = LayoutInflater.from(context);
        convertView = mInflater.inflate(com.android.internal.R.layout.popup_menu_item_layout, parent, false);
    }
    MenuView.ItemView itemView = (MenuView.ItemView) convertView;
    itemView.initialize(getItem(position), 0);
    return convertView;
}
Also used : LayoutInflater(android.view.LayoutInflater) MenuView(com.android.internal.view.menu.MenuView)

Example 50 with LayoutInflater

use of android.view.LayoutInflater in project android-demos by novoda.

the class GridViewAdapter method getView.

public View getView(int position, View convertView, ViewGroup parent) {
    View view;
    if (convertView == null) {
        final LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        view = inflater.inflate(R.layout.grid_item, null);
    } else {
        view = convertView;
    }
    return view;
}
Also used : LayoutInflater(android.view.LayoutInflater) View(android.view.View)

Aggregations

LayoutInflater (android.view.LayoutInflater)1292 View (android.view.View)803 TextView (android.widget.TextView)615 ImageView (android.widget.ImageView)259 ViewGroup (android.view.ViewGroup)139 Context (android.content.Context)131 ListView (android.widget.ListView)123 LinearLayout (android.widget.LinearLayout)106 RecyclerView (android.support.v7.widget.RecyclerView)104 AdapterView (android.widget.AdapterView)100 Intent (android.content.Intent)92 AlertDialog (android.app.AlertDialog)88 DialogInterface (android.content.DialogInterface)81 Button (android.widget.Button)57 Bundle (android.os.Bundle)54 FrameLayout (android.widget.FrameLayout)49 TypedArray (android.content.res.TypedArray)43 Activity (android.app.Activity)41 AlertDialog (android.support.v7.app.AlertDialog)41 EditText (android.widget.EditText)41