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();
}
});
}
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;
}
}
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);
}
});
}
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;
}
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;
}
Aggregations