Back to project page AndroidMooch.
The source code is released under:
Copyright (c) 2010 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software witho...
If you think the Android project AndroidMooch listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.github.stchris.views; // ww w . j a va2s . com import android.content.Context; import android.widget.LinearLayout; import android.widget.TextView; public class BookListView extends LinearLayout { private TextView tvTitle; private TextView tvAuthor; public BookListView(Context context) { super(context); } public BookListView(Context context, String title, String author) { this(context); this.setOrientation(VERTICAL); tvTitle = new TextView(context); tvTitle.setText(title); tvAuthor = new TextView(context); tvAuthor.setText(author); addView(tvTitle, new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); addView(tvAuthor, new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); } public void setTitle(String title) { tvTitle.setText(title); } public void setAuthor(String author) { tvAuthor.setText(author); } }