When you update an album cover from the tag editor, not only will the album detail screen update, the artist detail screen will when you go back to it too. This uses activity results.
This commit is contained in:
parent
58b277354b
commit
f8d9d5106e
3 changed files with 14 additions and 3 deletions
|
|
@ -314,8 +314,10 @@ public class AlbumDetailActivity extends AbsFabActivity implements PaletteColorH
|
|||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == TAG_EDITOR_REQUEST)
|
||||
if (requestCode == TAG_EDITOR_REQUEST) {
|
||||
setUpAlbumArtAndApplyPalette();
|
||||
setResult(RESULT_OK);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.kabouzeid.gramophone.ui.activities;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
|
|
@ -78,6 +79,7 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
|
|||
private View songListHeader;
|
||||
private RecyclerView albumRecyclerView;
|
||||
private Spanned biography;
|
||||
private ArtistAlbumAdapter albumAdapter;
|
||||
|
||||
private final SmallObservableScrollViewCallbacks observableScrollViewCallbacks = new SmallObservableScrollViewCallbacks() {
|
||||
@Override
|
||||
|
|
@ -234,7 +236,7 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
|
|||
private void setUpAlbumRecyclerView() {
|
||||
albumRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
List<Album> albums = ArtistAlbumLoader.getArtistAlbumList(this, artist.id);
|
||||
ArtistAlbumAdapter albumAdapter = new ArtistAlbumAdapter(this, albums);
|
||||
albumAdapter = new ArtistAlbumAdapter(this, albums);
|
||||
albumRecyclerView.setAdapter(albumAdapter);
|
||||
}
|
||||
|
||||
|
|
@ -309,6 +311,13 @@ public class ArtistDetailActivity extends AbsFabActivity implements PaletteColor
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK)
|
||||
albumAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPaletteColor() {
|
||||
return toolbarColor;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class NavigationUtil {
|
|||
@SuppressWarnings("unchecked") ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(activity,
|
||||
sharedViews
|
||||
);
|
||||
ActivityCompat.startActivity(activity, intent, optionsCompat.toBundle());
|
||||
ActivityCompat.startActivityForResult(activity, intent, 1001, optionsCompat.toBundle());
|
||||
} else {
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue