diff options
author | lado <herrlado@gmail.com> | 2014-02-10 23:03:26 +0100 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2014-02-10 23:03:26 +0100 |
commit | 30d66c8e4d2fc2f11b07711acbf727946a2b6ce0 (patch) | |
tree | 90582edb2dcb6719cdb74ad6f68809f21850a5ed /vdrmanager | |
parent | 82898e69214fb416bb8df75f7c50d6cf4efc6baa (diff) | |
download | vdr-manager-30d66c8e4d2fc2f11b07711acbf727946a2b6ce0.tar.gz vdr-manager-30d66c8e4d2fc2f11b07711acbf727946a2b6ce0.tar.bz2 |
http://projects.vdr-developer.org/issues/1689
Diffstat (limited to 'vdrmanager')
4 files changed, 55 insertions, 29 deletions
diff --git a/vdrmanager/AndroidManifest.xml b/vdrmanager/AndroidManifest.xml index ba96716..9387b3e 100644 --- a/vdrmanager/AndroidManifest.xml +++ b/vdrmanager/AndroidManifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.bjusystems.vdrmanager" - android:versionCode="1200" - android:versionName="120-beta" > + android:versionCode="1210" + android:versionName="12-beta" > <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java index dde92d0..0d23964 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java @@ -158,32 +158,9 @@ abstract class BaseEventAdapter<T extends EventListItem> extends return itemHolder; } - public void fillEventViewHolder(EventListItemHolder itemHolder, + protected void handleState(EventListItemHolder itemHolder, EventListItem item) { - - itemHolder.state.setVisibility(View.VISIBLE); - - if (item.getEvent() instanceof Recording) { - Recording r = (Recording) item.getEvent(); - if (r.getTimerStopTime() != null) { - itemHolder.state.setImageResource(R.drawable.timer_recording); - } else { - itemHolder.state.setImageResource(R.drawable.timer_none); - itemHolder.other.setVisibility(View.GONE); - if (r.isNeww() == true) { - itemHolder.state.setImageResource(R.drawable.newrecording); - if (r.isCut()) { - itemHolder.other.setVisibility(View.VISIBLE); - itemHolder.other.setImageResource(R.drawable.schere); - } else { - itemHolder.other.setVisibility(View.GONE); - } - } else if (r.isCut()) { - itemHolder.state.setImageResource(R.drawable.schere); - } - } - - } else if (item.getEvent() instanceof Timerable) { + if (item.getEvent() instanceof Timerable) { TimerMatch match = ((Timerable) item.getEvent()).getTimerMatch(); switch (((Timerable) item.getEvent()).getTimerState()) { case Active: @@ -215,6 +192,15 @@ abstract class BaseEventAdapter<T extends EventListItem> extends itemHolder.state.setImageResource(R.drawable.timer_none); } + } + + public void fillEventViewHolder(EventListItemHolder itemHolder, + EventListItem item) { + + itemHolder.state.setVisibility(View.VISIBLE); + + handleState(itemHolder, item); + final EventFormatter formatter = getEventFormatter(item); itemHolder.time.setText(formatter.getTime()); if (hideChannelName) { diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java index 892e857..b664276 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingAdapter.java @@ -8,6 +8,7 @@ import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.data.Event; import de.bjusystems.vdrmanager.data.EventFormatter; import de.bjusystems.vdrmanager.data.EventListItem; +import de.bjusystems.vdrmanager.data.Recording; import de.bjusystems.vdrmanager.data.RecordingListItem; class RecordingAdapter extends BaseEventAdapter<EventListItem> { @@ -100,6 +101,7 @@ class RecordingAdapter extends BaseEventAdapter<EventListItem> { public RecordingListItem getItem(int position) { return (RecordingListItem) super.getItem(position); } + // // protected void addSuper(RecordingListItem item) { // super.addSuper(item); @@ -108,5 +110,28 @@ class RecordingAdapter extends BaseEventAdapter<EventListItem> { // protected void clearSuper() { // super.clear(); // } + protected void handleState(EventListItemHolder itemHolder, + EventListItem item) { + + Recording r = (Recording) item.getEvent(); + if (r.getTimerStopTime() != null) { + itemHolder.state.setImageResource(R.drawable.timer_recording); + } else { + itemHolder.state.setImageResource(R.drawable.timer_none); + itemHolder.other.setVisibility(View.GONE); + if (r.isNeww() == true) { + itemHolder.state.setImageResource(R.drawable.newrecording); + if (r.isCut()) { + itemHolder.other.setVisibility(View.VISIBLE); + itemHolder.other.setImageResource(R.drawable.schere); + } else { + itemHolder.other.setVisibility(View.GONE); + } + } else if (r.isCut()) { + itemHolder.state.setImageResource(R.drawable.schere); + } + } + + } }
\ No newline at end of file diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java index f5cca64..b577e11 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java @@ -1,10 +1,12 @@ package de.bjusystems.vdrmanager.gui; import android.content.Context; +import android.view.View; import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.data.Event; import de.bjusystems.vdrmanager.data.EventFormatter; import de.bjusystems.vdrmanager.data.EventListItem; +import de.bjusystems.vdrmanager.data.Timer; public class TimeEventAdapter extends BaseEventAdapter<EventListItem> { @@ -13,11 +15,24 @@ public class TimeEventAdapter extends BaseEventAdapter<EventListItem> { } public void sortItems() { - // sortItemsByChannel(); + // sortItemsByChannel(); } @Override protected EventFormatter getEventFormatter(Event event) { - return new EventFormatter(event,true); + return new EventFormatter(event, true); + } + + @Override + protected void handleState(EventListItemHolder itemHolder, + EventListItem item) { + super.handleState(itemHolder, item); + Timer r = (Timer) item.getEvent(); + if (r.isVps()) { + itemHolder.other.setVisibility(View.VISIBLE); + itemHolder.other.setImageResource(R.drawable.timer_vps); + } else { + itemHolder.other.setVisibility(View.GONE); + } } }
\ No newline at end of file |