@Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView = inflater.inflate(R.layout.list_item_icon, parent, false); TextView textView = (TextView) rowView.findViewById(R.id.label); ImageView imageView = (ImageView) rowView.findViewById(R.id.icon); textView.setText(mValues[position]); // Set icons String s = mValues[position]; if (s.equals("CPU")) { imageView.setImageResource(R.drawable.ic_drawer_cpu); } else if (s.equals("System")) { imageView.setImageResource(R.drawable.ic_drawer_system); } else if (s.equals("Disks")) { imageView.setImageResource(R.drawable.ic_drawer_disks); } else if (s.equals("Processes")) { imageView.setImageResource(R.drawable.ic_drawer_processes); } else if (s.equals("GPU")) { imageView.setImageResource(R.drawable.ic_drawer_gpu); } else if (s.equals("Overview")) { imageView.setImageResource(R.drawable.ic_drawer_overview); } else if (s.equals("History")) { imageView.setImageResource(R.drawable.ic_drawer_history); } else if (s.equals("Notifications")) { imageView.setImageResource(R.drawable.ic_drawer_notifications); } imageView.setContentDescription(s + " icon"); return rowView; }
/** * Instantiates a new SuperCardToast with a type. <br> * * @param context should be Activity * @param type choose from SuperToast.Type <br> */ public SuperCardToast(Context context, Type type) { if (context instanceof Activity) { this.mContext = context; final Activity activity = (Activity) context; mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); this.mType = type; if (activity.findViewById(R.id.card_container) != null) { mViewGroup = (LinearLayout) activity.findViewById(R.id.card_container); if (type == Type.BUTTON) { mToastView = mLayoutInflater.inflate(R.layout.supercardtoast_button, mViewGroup, false); mToastButton = (Button) mToastView.findViewById(R.id.button); mDividerView = mToastView.findViewById(R.id.divider); mToastButton.setOnTouchListener(mTouchDismissListener); } else if (type == Type.PROGRESS) { mToastView = mLayoutInflater.inflate(R.layout.supercardtoast_progresscircle, mViewGroup, false); mProgressBar = (ProgressBar) mToastView.findViewById(R.id.progressBar); } else if (type == Type.PROGRESS_HORIZONTAL) { mToastView = mLayoutInflater.inflate( R.layout.supercardtoast_progresshorizontal, mViewGroup, false); mProgressBar = (ProgressBar) mToastView.findViewById(R.id.progressBar); } else { mToastView = mLayoutInflater.inflate(R.layout.supercardtoast, mViewGroup, false); } mMessageTextView = (TextView) mToastView.findViewById(R.id.message_textView); mRootLayout = (LinearLayout) mToastView.findViewById(R.id.root_layout); } else { throw new IllegalArgumentException(TAG + ERROR_CONTAINERNULL); } } else { throw new IllegalArgumentException(TAG + ERROR_CONTEXTNOTACTIVITY); } }
@Override public boolean onOptionsItemSelected(MenuItem item) { String title = (String) item.getTitle(); if (title.equals("添加")) { final HashMap<String, String> add_journal = new HashMap<String, String>(); LayoutInflater inflater = LayoutInflater.from(this); LinearLayout linearLayout = (LinearLayout) inflater.inflate(R.layout.journal_clickitem, null); AlertDialog.Builder builder = new AlertDialog.Builder(Record_Journal.this); final EditText titleEditText = (EditText) linearLayout.findViewById(R.id.journal_title_editText); final EditText contentEditText = (EditText) linearLayout.findViewById(R.id.journal_content_editText); titleEditText.setEnabled(true); contentEditText.setEnabled(true); builder.setPositiveButton( "保 存", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // To change body of implemented methods use File | Settings | File Templates. add_journal.put("title", String.valueOf(titleEditText.getText())); add_journal.put("body", String.valueOf(contentEditText.getText())); String date = String.valueOf(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); add_journal.put("time", date); add_journal.put("userID", Login.userID); if (myJournalNetwork.add(add_journal)) { Toast.makeText(Record_Journal.this, "添加成功", Toast.LENGTH_SHORT); } else { Toast.makeText(Record_Journal.this, "添加失败", Toast.LENGTH_SHORT); } record_journal_adapter.notifyDataSetChanged(); } }); builder.setNegativeButton( "取 消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // To change body of implemented methods use File | Settings | File Templates. } }); builder.setTitle("添加日志").setView(linearLayout); builder.show(); } else if (title.equals("帮助")) { Menu_Functions.helpMe(this); } else if (title.equals("联系")) { Menu_Functions.contactMe(this); } return super.onOptionsItemSelected( item); // To change body of overridden methods use File | Settings | File Templates. }
/** * Instantiates a new SuperCardToast. <br> * * @param context should be Activity */ public SuperCardToast(Context context) { if (context instanceof Activity) { this.mContext = context; this.mType = Type.STANDARD; final Activity activity = (Activity) context; mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (activity.findViewById(R.id.card_container) != null) { mViewGroup = (LinearLayout) activity.findViewById(R.id.card_container); mToastView = mLayoutInflater.inflate(R.layout.supercardtoast, mViewGroup, false); mMessageTextView = (TextView) mToastView.findViewById(R.id.message_textView); mRootLayout = (LinearLayout) mToastView.findViewById(R.id.root_layout); } else { throw new IllegalArgumentException(TAG + ERROR_CONTAINERNULL); } } else { throw new IllegalArgumentException(TAG + ERROR_CONTEXTNOTACTIVITY); } }
/** @return A custom ContextMenu header */ public View setHeaderLayout() { // Get album name String albumName = mCursor.getString(mAlbumNameIndex); // Get artist name String artistName = mCursor.getString(mArtistNameIndex); // Get albumId String albumId = mCursor.getString(mAlbumIdIndex); // Inflate the header View LayoutInflater inflater = getActivity().getLayoutInflater(); View header = inflater.inflate(R.layout.context_menu_header, null, false); // Artist image ImageView headerImage = (ImageView) header.findViewById(R.id.header_image); ImageInfo mInfo = new ImageInfo(); mInfo.type = TYPE_ALBUM; mInfo.size = SIZE_THUMB; mInfo.source = SRC_FIRST_AVAILABLE; mInfo.data = new String[] {albumId, artistName, albumName}; ImageProvider.getInstance(getActivity()).loadImage(headerImage, mInfo); // Set artist name TextView headerText = (TextView) header.findViewById(R.id.header_text); headerText.setText(albumName); headerText.setBackgroundColor(getResources().getColor(R.color.transparent_black)); return header; }
/** It is used to create/recreate the list of rubrics It should be called in onResume method */ private void generateRubricsList() { LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rubricView; HorizontalScrollView rubricScroll; rubricsViews = new HashMap<Integer, View>(); for (Rubric rubric : articleFeed.getRubrics()) { rubricView = layoutInflater.inflate(R.layout.articles_row, null); rubricsViews.put(rubric.getId(), rubricView); rubricScroll = (HorizontalScrollView) rubricView.findViewById(R.id.rubric_scroll); rubricScroll.setTag(rubric); rubricScroll.setOnTouchListener(touchListener); for (RssArticle article : rubric.getArticles()) { insertArticleView(article); } rubricsList.addView(rubricView); updateRubricTitle(rubric); } }
@Override public View getView(int position, View convertView, ViewGroup parent) { View boardView = convertView; if (convertView == null) { LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); boardView = vi.inflate(resource, null); } Board item; // try { item = getItem(position); // } catch (IndexOutOfBoundsException e) { // item = null; // } if (item != null) { String boardName = item.name; boolean isFavorite = item.favorite; // ImageView test = (ImageView)boardView.findViewById(R.id.BoardListNew); // test.setVisibility(View.VISIBLE); ((ImageView) boardView.findViewById(R.id.BoardListNew)) .setVisibility(item.newt ? View.VISIBLE : View.GONE); ((ImageView) boardView.findViewById(R.id.BoardListComment)) .setVisibility(item.comment ? View.VISIBLE : View.GONE); ((CheckBox) boardView.findViewById(R.id.favorite)).setChecked(isFavorite); ((TextView) boardView.findViewById(R.id.BoardListTitle)).setText(boardName); ((CheckBox) boardView.findViewById(R.id.favorite)).setClickable(false); } return boardView; }
private void showUserHashDialog() { String userHash = NavigineApp.Settings.getString("user_hash", ""); LayoutInflater inflater = getLayoutInflater(); View view = inflater.inflate(R.layout.user_hash_dialog, null); _userEdit = (EditText) view.findViewById(R.id.user_hash_edit); _userEdit.setText(userHash); _userEdit.setTypeface(Typeface.MONOSPACE); // _userEdit.addTextChangedListener(new TextWatcher() // { // public void afterTextChanged(Editable s) { } // public void beforeTextChanged(CharSequence s, int start, int count, int after) { } // public void onTextChanged(CharSequence s, int start, int before, int count) // { // String text = _userEdit.getText().toString(); // int length = _userEdit.getText().length(); // // if (text.endsWith("-")) // return; // // if (count <= before) // return; // // if (length == 4 || length == 9 || length == 14) // { // _userEdit.setText((text + "-")); // _userEdit.setSelection(length + 1); // } // } // }); AlertDialog.Builder alertBuilder = new AlertDialog.Builder(mContext); alertBuilder.setView(view); alertBuilder.setTitle("Enter user ID"); alertBuilder.setNegativeButton( getString(R.string.cancel_button), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dlg, int id) {} }); alertBuilder.setPositiveButton( getString(R.string.ok_button), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dlg, int id) { String userHash = _userEdit.getText().toString(); SharedPreferences.Editor editor = NavigineApp.Settings.edit(); editor.putString("user_hash", userHash); editor.commit(); NavigineApp.applySettings(); refreshMapList(); } }); AlertDialog dialog = alertBuilder.create(); dialog.setCanceledOnTouchOutside(false); dialog.show(); }
/** * display base activity UI. */ private void showBaseScreen() { LayoutInflater inflater = LayoutInflater.from(this); mSliderView = (NavigationDrawerSliderView) inflater.inflate(R.layout.screen_scroll_with_list_menu, null); setContentView(mSliderView); leftSideListView = inflater.inflate(R.layout.left_pane_menu_list, null); setListAdapter(); }
/** @Method: openPopupwin @Description: popupwindow�����ü���Ӧ */ private void openPopupwin() { LayoutInflater mLayoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); ViewGroup menuView = (ViewGroup) mLayoutInflater.inflate(R.layout.gridview_popx, null, true); menuGrid = (GridView) menuView.findViewById(R.id.popgridview); menuGrid.setAdapter(getMenuAdapter(menu_name_array, menu_image_array)); // menuGrid�����ò��� menuGrid.requestFocus(); // ����popupwindow���������Ϣ menuGrid.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { menuPopupWindow.dismiss(); if (arg2 == 0) { // �ϴ� albumPopupwin(); } else if (arg2 == 1) // �༭ { Intent intent = new Intent(LocalImageView.this, PictureEditActivity.class); intent.putExtra("photopath", photoPath); startActivity(intent); } else if (arg2 == 2) // ɾ�� { sureToDelete(); } } }); // ���㵽��gridview�ϣ�������Ҫ����˴��ļ����¼����������ֲ���Ӧ�����¼������ menuGrid.setOnKeyListener( new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_MENU: if (menuPopupWindow != null && menuPopupWindow.isShowing()) { menuPopupWindow.dismiss(); } break; } System.out.println("menuGridfdsfdsfdfd"); return true; } }); // ��ʾpopupwindow menuPopupWindow = new PopupWindow(menuView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true); menuPopupWindow.setBackgroundDrawable(new BitmapDrawable()); menuPopupWindow.setAnimationStyle(R.style.PopupAnimation); menuPopupWindow.showAtLocation( findViewById(R.id.filpperparent), Gravity.BOTTOM | Gravity.BOTTOM, 0, 0); menuPopupWindow.update(); }
public void shEditDialog(final String key, String title, int msg) { Resources res = context.getResources(); String cancel = res.getString(R.string.cancel); String ok = res.getString(R.string.ps_volt_save); LayoutInflater factory = LayoutInflater.from(context); final View alphaDialog = factory.inflate(R.layout.sh_dialog, null); settingText = (EditText) alphaDialog.findViewById(R.id.shText); settingText.setHint(msg); settingText.setText(mPreferences.getString(key, "")); settingText.setOnEditorActionListener( new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { return true; } }); settingText.addTextChangedListener( new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) {} @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {} @Override public void afterTextChanged(Editable s) {} }); new AlertDialog.Builder(context) .setTitle(title) .setView(alphaDialog) .setNegativeButton( cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { /* nothing */ } }) .setPositiveButton( ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { final SharedPreferences.Editor editor = mPreferences.edit(); editor.putString(key, settingText.getText().toString()).commit(); } }) .create() .show(); }
private View createView(View reusableView, TModel model) { View view = reusableView; if (view == null) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(LAYOUT_ID, null); } this.setupReusableView(view, model); return view; }
private void generateSuccessToast() { LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.toast_layout, (ViewGroup) findViewById(R.id.toast_layout_root)); TextView text = (TextView) layout.findViewById(R.id.text); text.setText("Idea posted successfully"); Toast toast = new Toast(getApplicationContext()); toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); toast.setDuration(Toast.LENGTH_LONG); toast.setView(layout); toast.show(); }
private View getWorkingView(final View convertView) { View workingView = null; if (null == convertView) { final Context context = getContext(); final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); workingView = inflater.inflate(itemsItemLayoutResource, null); } else { workingView = convertView; } return workingView; }
public void setDrawerContentView(int layout_id) { LayoutInflater inflater = LayoutInflater.from(this); rightSideAppScreenView = inflater.inflate(layout_id, null); mAttachedViewID = rightSideAppScreenView.getId(); mHeaderRelativeLayout = (RelativeLayout)rightSideAppScreenView.findViewById(R.id.navigation_header); mTitleTextView = (TextView)mHeaderRelativeLayout.findViewById(R.id.tv_header_title); mSubtitleTextView = (TextView)mHeaderRelativeLayout.findViewById(R.id.tv_header_subtitle); mHeaderImageView = (ImageView)mHeaderRelativeLayout.findViewById(R.id.iv_header_icon); mTimeTrackerTextView = (TextView) mHeaderRelativeLayout.findViewById(R.id.menu_header_time_tracker); mTimerLayout = (LinearLayout)mHeaderRelativeLayout.findViewById(R.id.timer_layout); mSubtitleTextView.setOnClickListener(this); mTimeTrackerTextView.setOnClickListener(this); mTimerLayout.setOnClickListener(this); ViewGroup tabBar = (ViewGroup) rightSideAppScreenView.findViewById(mAttachedViewID); btnSlide = (ImageButton) tabBar.findViewById(R.id.bt_slider); btnSlide.setVisibility(View.VISIBLE); mSliderClickListener = new ClickListenerForScrolling(mSliderView, leftSideListView, menuOut); btnSlide.setOnClickListener(mSliderClickListener); mHomeBtnLayout = (LinearLayout)mHeaderRelativeLayout.findViewById(R.id.home_layout); if(mHomeBtnLayout!= null) { mHomeBtnLayout.setOnClickListener(mSliderClickListener); } View[] children = new View[] { leftSideListView, rightSideAppScreenView }; int scrollToViewIdx = 1; mSliderView.initViews(children, scrollToViewIdx, new SizeCallbackForMenu(btnSlide)); setSubTitle(AppConfig.getAppConfigInstance(this).getUserName()); setTitle(getResources().getString(R.string.app_title)); displayHeaderMenuBar(); //If learn mode is active, the titlebar color must be changed. if (AppConfig.getAppConfigInstance(this).getDeviceSynched()) mPresenter.checkLearnMode(this, rightSideAppScreenView, mSubtitleTextView); }
public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle) { w(); paramBundle = getActivity(); N = DictionaryEasyMetric.a(); if ((a == null) && ((paramBundle instanceof LandingPageActivity))) { paramBundle = ((LandingPageActivity)paramBundle).h(); if ((paramBundle == null) || (!(mMediabryo instanceof aji))) { paramLayoutInflater = new akf.a(); mSnapType = Mediabryo.SnapType.SNAP; a = ((akf.a)paramLayoutInflater).c(); l = true; getActivity().onBackPressed(); return mFragmentLayout; } a = mMediabryo; } if (a == null) { throw new NullPointerException(); } mFragmentLayout = paramLayoutInflater.inflate(2130968737, paramViewGroup, false); f.mView = mFragmentLayout; if ((a.h() == 0) && (a.mRawImageBitmap == null)) { f.a(); } return mFragmentLayout; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.activity_community_commentary, null); ButterKnife.bind(this, view); return view; }
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { holder = new ViewHolder(); convertView = LayoutInflater.from(getActivity()).inflate(R.layout.item_song, null); holder.mTvName = (TextView) convertView.findViewById(R.id.tv_name); holder.mTvArtist = (TextView) convertView.findViewById(R.id.tv_artist); holder.mTvDuration = (TextView) convertView.findViewById(R.id.tv_duration); holder.aboveView = convertView.findViewById(R.id.item_root); holder.behindView = convertView.findViewById(R.id.behind); convertView.setTag(holder); convertViewList.add((PullRightLayout) convertView); } else { holder = (ViewHolder) convertView.getTag(); } if (HideApplication.showListAnim) { startAnim(convertView); } SongInfo info = SongManager.with(getActivity()).getSongByIndex(position); holder.mTvName.setText(info.getTitle()); holder.mTvArtist.setText(info.getArtist() + " - " + info.getAlbum()); holder.mTvDuration.setText( CommonUtils.durationToString(info.getDuration()) + " - " + CommonUtils.getFileSize(info.getPath())); setItemSelected(holder, info.getId() == playingId); convertView.setOnClickListener(new OnItemClick(position)); holder.behindView.setOnClickListener(new OnBehindClick(position)); return convertView; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); View view = inflater.inflate(mLayout, container, false); return view; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout containing a title and body text. ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.estadistica_view, container, false); int idEstadistica = this.mPageNumber; // Titulo y descripcion de estadistica TextView tituloEstadistica = (TextView) rootView.findViewById(R.id.TxtTituloEstadistica); TextView descEstadistica = (TextView) rootView.findViewById(R.id.TxtDescEstadistica); tituloEstadistica.setText(RelacionEstadisticas.getRelacion().get(idEstadistica).getTitulo()); descEstadistica.setText(RelacionEstadisticas.getRelacion().get(idEstadistica).getDescripcion()); rootView.addView( new EstadisticaViewLayout(Utilidades.getAppContext()) .getView(RelacionEstadisticas.getRelacion().get(idEstadistica))); // } // catch (Exception e) // { // Toast.makeText(Utilidades.getAppContext(), "error: " + e.getLocalizedMessage(), // Toast.LENGTH_LONG).show(); // Log.e("ERROR", e.getLocalizedMessage()); // } // Set the title view to show the page number. /*((TextView) rootView.findViewById(android.R.id.text1)).setText( getString(R.string.title_template_step, mPageNumber + 1));*/ return rootView; }
@Override public View getChildView( int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { ViewGroup item; if (convertView != null && convertView.getId() == R.id.child_item) { // We can reuse the view item = (ViewGroup) convertView; } else { // We create a new View item = (ViewGroup) inflater.inflate(R.layout.child_item_layout, parent, false); } ChildClass child = (ChildClass) getChild(groupPosition, childPosition); TextView nameView = (TextView) item.findViewById(R.id.child_name); nameView.setText(child.getName()); TextView sizeView = (TextView) item.findViewById(R.id.child_text); sizeView.setText(child.getText()); return item; }
public View getView(int position, View convertView, ViewGroup parent) { final View view = (convertView != null) ? convertView : LayoutInflater.from(parent.getContext()) .inflate(R.layout.bookmark_item, parent, false); final ImageView imageView = (ImageView) view.findViewById(R.id.bookmark_item_icon); final TextView textView = (TextView) view.findViewById(R.id.bookmark_item_text); final TextView bookTitleView = (TextView) view.findViewById(R.id.bookmark_item_booktitle); final Bookmark bookmark = getItem(position); if (bookmark == null) { imageView.setVisibility(View.VISIBLE); imageView.setImageResource(R.drawable.ic_list_plus); textView.setText(ZLResource.resource("bookmarksView").getResource("new").getValue()); bookTitleView.setVisibility(View.GONE); } else { imageView.setVisibility(View.GONE); textView.setText(bookmark.getText()); if (myCurrentBook) { bookTitleView.setVisibility(View.GONE); } else { bookTitleView.setVisibility(View.VISIBLE); bookTitleView.setText(bookmark.getBookTitle()); } } return view; }
@Override public HomeListAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View view = LayoutInflater.from(viewGroup.getContext()) .inflate(R.layout.listview_homemenu, viewGroup, false); ViewHolder vh = new ViewHolder(view); return vh; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment, then bind views. View root = inflater.inflate(R.layout.fragment_recent, container, false); ButterKnife.bind(this, root); return root; }
public ProfileListImageCacheAdapter( Context context, ProfileImagesCache profileimagescache, Cursor cursor) { mContext = context; mInflater = LayoutInflater.from(context); mUserImagesCache = profileimagescache; mViewHolders = new ArrayList(); refreshData(cursor); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { recLifeCycle(getClass(), CALL_TO_SUPER); View v = inflater.inflate(R.layout.fragment_test, container, false); recLifeCycle(getClass(), RETURN_FROM_SUPER); return v; }
@Override public View onCreateView( final LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) { Log.i(TAG, "onCreateView"); ret = inflater.inflate(R.layout.fragment_search, container, false); initView(); refreshLocalFans(); return ret; }
public View onCreateView(LayoutInflater layoutinflater, ViewGroup viewgroup, Bundle bundle) { View view = layoutinflater.inflate(R.layout.grid_view, viewgroup, false); adapter = new ProjectSubListAdapter( getActivity(), imageCount, firstImagePos, itemSizeW, itemSizeH, projectFiles); gridView = (GridView) view.findViewById(R.id.gridFrames); gridView.setAdapter(adapter); gridView.setTag(Integer.valueOf(pageNr)); return view; }
private void initPagerItems() { for (int i = 0; i < bitmapList.size(); i++) { View v = LayoutInflater.from(this).inflate(R.layout.call_activity_itempage, null); ImageView imageView = (ImageView) v.findViewById(R.id.contactIv); TextView textView = (TextView) v.findViewById(R.id.contactTv); imageView.setImageBitmap(bitmapList.get(i)); textView.setText(nameList.get(i)); viewArrayList.add(v); } }
@Override protected View inflateView(LayoutInflater inflater, ViewGroup container) { Intent playIntent = new Intent(getActivity(), PlayService.class); getActivity().startService(playIntent); getActivity().bindService(playIntent, playConn, Context.BIND_AUTO_CREATE); ThemeManager.with(getActivity()).registerListener(this); return inflater.inflate(R.layout.fragment_song, container, false); }