If record doesnt have name - description will be put instead

This commit is contained in:
Denis 2014-12-15 17:18:44 +02:00
parent fafe89040c
commit 15824993f5

View file

@ -81,8 +81,14 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
for (final AudioVideoNotesPlugin.Recording recording : notes){
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.dash_note_item, null, false);
((TextView) view.findViewById(R.id.name)).setText(recording.name);
((TextView) view.findViewById(R.id.descr)).setText(recording.getDescription(getActivity()));
if (recording.name != null){
((TextView) view.findViewById(R.id.name)).setText(recording.name);
((TextView) view.findViewById(R.id.descr)).setText(recording.getDescription(getActivity()));
} else {
((TextView) view.findViewById(R.id.name)).setText(recording.getDescription(getActivity()));
}
ImageView icon = (ImageView) view.findViewById(R.id.icon);
if (recording.isAudio()){
icon.setImageResource(R.drawable.ic_type_audio);