@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; }
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; }