Fix artwork path

Fix crash if the artwork file doesn't exist
Update to 5.1 sdk target and update appcompat
This commit is contained in:
David Schulte 2015-05-09 19:41:57 +02:00
parent a088fd22d0
commit 608ebc2034
9 changed files with 71 additions and 15 deletions

View file

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="appcompat-v7-22.1.1">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/classes.jar!/" />
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="support-annotations-22.1.1">
<CLASSES>
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-annotations/22.1.1/support-annotations-22.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-annotations/22.1.1/support-annotations-22.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="support-v4-22.1.1">
<CLASSES>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/libs/internal_impl-22.1.1.jar!/" />
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/res" />
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -25,15 +25,15 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "de.arcus.playmusicexporter2"
minSdkVersion 8
targetSdkVersion 21
versionCode 65
versionName '2.4.0'
targetSdkVersion 22
versionCode 101
versionName '2.4.1'
}
buildTypes {
release {
@ -45,8 +45,8 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v4:22.1.1'
compile project(':framework')
compile project(':playmusiclib')
}

View file

@ -84,11 +84,11 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
<orderEntry type="module" module-name="playmusiclib" exported="" />
<orderEntry type="module" module-name="framework" exported="" />
</component>

View file

@ -77,6 +77,12 @@ public class ImageViewLoader {
return mImagePath;
}
/**
* Starts an image loader
* @param imageView The image view
* @param path The file path
* @param defaultImage The default image in case the image could not be loaded
*/
public static void loadImage(ImageView imageView, String path, int defaultImage) {
// Checks for an old artwork loader on this image view
ImageViewLoader imageViewLoader = (ImageViewLoader)imageView.getTag();
@ -164,8 +170,15 @@ public class ImageViewLoader {
e.printStackTrace();
}
} else {
// File not found
imageView.setImageResource(R.drawable.cd_case);
// Sets the bitmap in the UI thread
Runnable runnable = new Runnable() {
@Override
public void run() {
// File not found
imageView.setImageResource(R.drawable.cd_case);
}
};
imageView.post(runnable);
}
}

View file

@ -23,12 +23,12 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}

View file

@ -85,7 +85,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="mp3agic-0.8.4-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />

View file

@ -385,6 +385,10 @@ public class PlayMusicManager {
String path;
// Fix the path for Play Music 5.9.1854
if (!artworkPath.startsWith("artwork2/folder/"))
artworkPath = "artwork2/folder/" + artworkPath;
// Search in the public data
for (String publicData : mPathPublicData) {
path = publicData + "/files/" + artworkPath;