parent
45ecfc2e25
commit
206b5c9bc6
|
@ -35,6 +35,7 @@ import org.xbmc.kore.jsonrpc.ApiCallback;
|
||||||
import org.xbmc.kore.jsonrpc.method.PVR;
|
import org.xbmc.kore.jsonrpc.method.PVR;
|
||||||
import org.xbmc.kore.jsonrpc.type.PVRType;
|
import org.xbmc.kore.jsonrpc.type.PVRType;
|
||||||
import org.xbmc.kore.utils.LogUtils;
|
import org.xbmc.kore.utils.LogUtils;
|
||||||
|
import org.xbmc.kore.utils.UIUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
@ -223,10 +224,11 @@ public class PVRChannelEPGListFragment extends Fragment
|
||||||
viewHolder.broadcastId = broadcastDetails.broadcastid;
|
viewHolder.broadcastId = broadcastDetails.broadcastid;
|
||||||
viewHolder.title = broadcastDetails.title;
|
viewHolder.title = broadcastDetails.title;
|
||||||
|
|
||||||
viewHolder.titleView.setText(broadcastDetails.title);
|
Context context = getContext();
|
||||||
viewHolder.detailsView.setText(broadcastDetails.plot);
|
viewHolder.titleView.setText(UIUtils.applyMarkup(context, broadcastDetails.title));
|
||||||
String duration = String.format(this.getContext().getString(R.string.minutes_abbrev2),
|
viewHolder.detailsView.setText(UIUtils.applyMarkup(context, broadcastDetails.plot));
|
||||||
String.valueOf(broadcastDetails.runtime));
|
String duration = context.getString(R.string.minutes_abbrev2,
|
||||||
|
String.valueOf(broadcastDetails.runtime));
|
||||||
|
|
||||||
int flags = DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_TIME;
|
int flags = DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_TIME;
|
||||||
viewHolder.startTimeView.setText(DateUtils.formatDateTime(getActivity(), broadcastDetails.starttime.getTime(), flags));
|
viewHolder.startTimeView.setText(DateUtils.formatDateTime(getActivity(), broadcastDetails.starttime.getTime(), flags));
|
||||||
|
|
|
@ -479,11 +479,12 @@ public class PVRChannelsListFragment extends Fragment
|
||||||
viewHolder.channelId = channelDetails.channelid;
|
viewHolder.channelId = channelDetails.channelid;
|
||||||
viewHolder.channelName = channelDetails.channel;
|
viewHolder.channelName = channelDetails.channel;
|
||||||
|
|
||||||
viewHolder.titleView.setText(channelDetails.channel);
|
Context context = getContext();
|
||||||
|
viewHolder.titleView.setText(UIUtils.applyMarkup(context, channelDetails.channel));
|
||||||
String details = (channelDetails.broadcastnow != null)?
|
String details = (channelDetails.broadcastnow != null)?
|
||||||
channelDetails.broadcastnow.title : null;
|
channelDetails.broadcastnow.title : null;
|
||||||
viewHolder.detailsView.setText(details);
|
viewHolder.detailsView.setText(UIUtils.applyMarkup(context, details));
|
||||||
UIUtils.loadImageWithCharacterAvatar(getContext(), hostManager,
|
UIUtils.loadImageWithCharacterAvatar(context, hostManager,
|
||||||
channelDetails.thumbnail, channelDetails.channel,
|
channelDetails.thumbnail, channelDetails.channel,
|
||||||
viewHolder.artView, artWidth, artHeight);
|
viewHolder.artView, artWidth, artHeight);
|
||||||
|
|
||||||
|
|
|
@ -230,9 +230,10 @@ public class PVRRecordingsListFragment extends Fragment
|
||||||
viewHolder.recordingId = recordingDetails.recordingid;
|
viewHolder.recordingId = recordingDetails.recordingid;
|
||||||
viewHolder.title = recordingDetails.title;
|
viewHolder.title = recordingDetails.title;
|
||||||
|
|
||||||
viewHolder.titleView.setText(recordingDetails.title);
|
Context context = getContext();
|
||||||
viewHolder.detailsView.setText(recordingDetails.channel);
|
viewHolder.titleView.setText(UIUtils.applyMarkup(context, recordingDetails.title));
|
||||||
UIUtils.loadImageWithCharacterAvatar(getContext(), hostManager,
|
viewHolder.detailsView.setText(UIUtils.applyMarkup(context, recordingDetails.channel));
|
||||||
|
UIUtils.loadImageWithCharacterAvatar(context, hostManager,
|
||||||
(recordingDetails.art != null) ?
|
(recordingDetails.art != null) ?
|
||||||
recordingDetails.art.poster : recordingDetails.icon,
|
recordingDetails.art.poster : recordingDetails.icon,
|
||||||
recordingDetails.channel,
|
recordingDetails.channel,
|
||||||
|
@ -240,7 +241,7 @@ public class PVRRecordingsListFragment extends Fragment
|
||||||
int runtime = recordingDetails.runtime / 60;
|
int runtime = recordingDetails.runtime / 60;
|
||||||
String duration =
|
String duration =
|
||||||
recordingDetails.starttime + " | " +
|
recordingDetails.starttime + " | " +
|
||||||
String.format(this.getContext().getString(R.string.minutes_abbrev), String.valueOf(runtime));
|
context.getString(R.string.minutes_abbrev, String.valueOf(runtime));
|
||||||
viewHolder.durationView.setText(duration);
|
viewHolder.durationView.setText(duration);
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
|
|
|
@ -625,6 +625,9 @@ public class UIUtils {
|
||||||
* or derivatives.
|
* or derivatives.
|
||||||
*/
|
*/
|
||||||
public static SpannableStringBuilder applyMarkup(Context context, String src) {
|
public static SpannableStringBuilder applyMarkup(Context context, String src) {
|
||||||
|
if (src == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
SpannableStringBuilder sb = new SpannableStringBuilder();
|
SpannableStringBuilder sb = new SpannableStringBuilder();
|
||||||
int start = src.indexOf('[');
|
int start = src.indexOf('[');
|
||||||
if (start == -1) {
|
if (start == -1) {
|
||||||
|
@ -768,6 +771,7 @@ public class UIUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* This must be called after every {@link #end()}.
|
||||||
* @return true if we found a close tag when there are no open tags
|
* @return true if we found a close tag when there are no open tags
|
||||||
*/
|
*/
|
||||||
boolean imbalanced() {
|
boolean imbalanced() {
|
||||||
|
|
Loading…
Reference in New Issue