diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-06-02 19:47:36 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-06-02 19:47:36 +0200 |
| commit | d2494279b07b4675d0303cce90e615934c422850 (patch) | |
| tree | 0fe912ed11a7f0d6c141f84bfdffed360467d296 /main/src/cgeo/geocaching/LogViewHolder.java | |
| parent | f17865dcd020d5b8d488fa5fb6b98ec72409c92d (diff) | |
| download | cgeo-d2494279b07b4675d0303cce90e615934c422850.zip cgeo-d2494279b07b4675d0303cce90e615934c422850.tar.gz cgeo-d2494279b07b4675d0303cce90e615934c422850.tar.bz2 | |
refactoring: extract some common code out of log viewers
Diffstat (limited to 'main/src/cgeo/geocaching/LogViewHolder.java')
| -rw-r--r-- | main/src/cgeo/geocaching/LogViewHolder.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/LogViewHolder.java b/main/src/cgeo/geocaching/LogViewHolder.java new file mode 100644 index 0000000..1fb3f55 --- /dev/null +++ b/main/src/cgeo/geocaching/LogViewHolder.java @@ -0,0 +1,46 @@ +package cgeo.geocaching; + +import butterknife.InjectView; +import butterknife.Views; + +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +public class LogViewHolder { + @InjectView(R.id.added) protected TextView date ; + @InjectView(R.id.type) protected TextView type; + @InjectView(R.id.author) protected TextView author; + @InjectView(R.id.count_or_location) protected TextView countOrLocation; + @InjectView(R.id.log) protected TextView text; + @InjectView(R.id.log_images) protected TextView images; + @InjectView(R.id.log_mark) protected ImageView marker; + + private int position; + + public LogViewHolder(View rowView) { + Views.inject(this, rowView); + rowView.setTag(this); + } + + /** + * Read the position of the cursor pointed to by this holder. <br/> + * This must be called by the UI thread. + * + * @return the cursor position + */ + public int getPosition() { + return position; + } + + /** + * Set the position of the cursor pointed to by this holder. <br/> + * This must be called by the UI thread. + * + * @param position + * the cursor position + */ + public void setPosition(final int position) { + this.position = position; + } +}
\ No newline at end of file |
