1
0
mirror of https://github.com/ultrasonic/ultrasonic synced 2025-02-16 11:41:16 +01:00

Fix crash when viewing folder with videos

This commit is contained in:
Joshua Bahnsen 2013-12-08 00:41:30 -07:00
parent 13d9af0990
commit 98ca08badd
2 changed files with 22 additions and 8 deletions

View File

@ -2,8 +2,8 @@
<manifest xmlns:a="http://schemas.android.com/apk/res/android"
package="com.thejoshwa.ultrasonic.androidapp"
a:installLocation="auto"
a:versionCode="38"
a:versionName="1.2.0.11" >
a:versionCode="39"
a:versionName="1.2.0.12" >
<uses-permission a:name="android.permission.INTERNET" />
<uses-permission a:name="android.permission.READ_PHONE_STATE" />

View File

@ -302,7 +302,11 @@ public class SongView extends UpdateView implements Checkable
if (downloadFile.isDownloading() && !downloadFile.isDownloadCancelled() && partialFile.exists())
{
this.statusTextView.setText(Util.formatLocalizedBytes(partialFile.length(), this.context));
if (this.statusTextView != null)
{
this.statusTextView.setText(Util.formatLocalizedBytes(partialFile.length(), this.context));
}
this.rightImageType = ImageType.downloading;
this.rightImage = downloadingImage;
}
@ -326,21 +330,31 @@ public class SongView extends UpdateView implements Checkable
{
this.previousLeftImageType = leftImageType;
this.previousRightImageType = rightImageType;
this.statusTextView.setCompoundDrawablesWithIntrinsicBounds(leftImage, null, rightImage, null);
if (this.statusTextView != null)
{
this.statusTextView.setCompoundDrawablesWithIntrinsicBounds(leftImage, null, rightImage, null);
}
}
if (!song.getStarred())
{
if (starImageView.getDrawable() != starHollowDrawable)
if (starImageView != null)
{
starImageView.setImageDrawable(starHollowDrawable);
if (starImageView.getDrawable() != starHollowDrawable)
{
starImageView.setImageDrawable(starHollowDrawable);
}
}
}
else
{
if (starImageView.getDrawable() != starDrawable)
if (starImageView != null)
{
starImageView.setImageDrawable(starDrawable);
if (starImageView.getDrawable() != starDrawable)
{
starImageView.setImageDrawable(starDrawable);
}
}
}