When you download/select album art in the tag editor, the album detail screen will refresh its art when it's returned to.
This commit is contained in:
parent
b9bbccf196
commit
6c5bff9b25
3 changed files with 17 additions and 4 deletions
|
|
@ -52,6 +52,7 @@ import java.util.ArrayList;
|
|||
public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorHolder {
|
||||
|
||||
public static final String TAG = AlbumDetailActivity.class.getSimpleName();
|
||||
private static final int TAG_EDITOR_REQUEST = 2001;
|
||||
private Album album;
|
||||
|
||||
private ObservableRecyclerView recyclerView;
|
||||
|
|
@ -300,7 +301,7 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
|
|||
case R.id.action_tag_editor:
|
||||
Intent intent = new Intent(this, AlbumTagEditorActivity.class);
|
||||
intent.putExtra(AppKeys.E_ID, album.id);
|
||||
startActivity(intent);
|
||||
startActivityForResult(intent, TAG_EDITOR_REQUEST);
|
||||
return true;
|
||||
case R.id.action_go_to_artist:
|
||||
Pair[] artistPairs = getSharedViewsWithFab(null);
|
||||
|
|
@ -310,6 +311,13 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
|
|||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == TAG_EDITOR_REQUEST)
|
||||
setUpAlbumArtAndApplyPalette();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onUIPreferenceChanged(UIPreferenceChangedEvent event) {
|
||||
switch (event.getAction()) {
|
||||
|
|
|
|||
|
|
@ -103,13 +103,15 @@ public class AlbumTagEditorActivity extends AbsTagEditorActivity implements Text
|
|||
.setCallback(new FutureCallback<Bitmap>() {
|
||||
@Override
|
||||
public void onCompleted(Exception e, Bitmap result) {
|
||||
if(result != null) {
|
||||
if (result != null) {
|
||||
albumArtBitmap = result;
|
||||
setImageBitmap(albumArtBitmap);
|
||||
deleteAlbumArt = false;
|
||||
dataChanged();
|
||||
setResult(RESULT_OK);
|
||||
} else {
|
||||
//TODO Toast failed message
|
||||
Toast.makeText(AlbumTagEditorActivity.this,
|
||||
R.string.failed_download_albumart, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -117,7 +119,8 @@ public class AlbumTagEditorActivity extends AbsTagEditorActivity implements Text
|
|||
|
||||
@Override
|
||||
public void onError() {
|
||||
//TODO Toast failed message
|
||||
Toast.makeText(AlbumTagEditorActivity.this,
|
||||
R.string.failed_download_albumart, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
@ -194,6 +197,7 @@ public class AlbumTagEditorActivity extends AbsTagEditorActivity implements Text
|
|||
setImageBitmap(albumArtBitmap);
|
||||
deleteAlbumArt = false;
|
||||
dataChanged();
|
||||
setResult(RESULT_OK);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@
|
|||
<string name="pref_only_lollipop">Only available on Lollipop.</string>
|
||||
<string name="pref_summary_transparent_toolbar">Content scrolling underneath the toolbar is visible.</string>
|
||||
<string name="pref_summary_colored_album_footers">Album footers in the grid are colored with the album cover\'s palette.</string>
|
||||
<string name="failed_download_albumart">Unable to download the art for this album.</string>
|
||||
|
||||
<string-array name="update_albumcover_options">
|
||||
<item>Download from LastFM</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue