Two quick bug fixes
This commit is contained in:
parent
d3d37ccab3
commit
2ae6dd8c91
3 changed files with 8 additions and 11 deletions
|
|
@ -23,8 +23,8 @@ android {
|
|||
applicationId "com.kabouzeid.gramophone"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 22
|
||||
versionCode 5
|
||||
versionName "0.9.3b"
|
||||
versionCode 6
|
||||
versionName "0.9.3.1b"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public class SongAdapter extends RecyclerView.Adapter<SongAdapter.ViewHolder> {
|
|||
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
final int position = getAdapterPosition();
|
||||
final int position = getAdapterPosition() - 1;
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_delete_from_disk:
|
||||
DeleteSongsDialogHelper.getDialog(activity, dataSet.get(position)).show();
|
||||
|
|
|
|||
|
|
@ -354,12 +354,7 @@ public abstract class AbsTagEditorActivity extends ActionBarActivity {
|
|||
}
|
||||
}
|
||||
if (deleteArtwork) {
|
||||
String imagePath = MusicUtil.getAlbumArtUri(getId()).toString();
|
||||
//TODO delete from picasso cache
|
||||
MusicUtil.deleteAlbumArt(AbsTagEditorActivity.this, getId());
|
||||
} else if (artwork != null) {
|
||||
String imagePath = MusicUtil.getAlbumArtUri(getId()).toString();
|
||||
//TODO delete from Picasso cache
|
||||
}
|
||||
progressDialog.dismiss();
|
||||
rescanMedia();
|
||||
|
|
@ -370,17 +365,19 @@ public abstract class AbsTagEditorActivity extends ActionBarActivity {
|
|||
private void rescanMedia() {
|
||||
String[] toBeScanned = new String[songPaths.size()];
|
||||
toBeScanned = songPaths.toArray(toBeScanned);
|
||||
final int toBeScannedLength = toBeScanned.length;
|
||||
MediaScannerConnection.scanFile(this, toBeScanned, null, new MediaScannerConnection.OnScanCompletedListener() {
|
||||
boolean refreshed;
|
||||
int i = 0;
|
||||
|
||||
@Override
|
||||
public void onScanCompleted(String s, Uri uri) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(!refreshed) {
|
||||
if (i == 0 || i == toBeScannedLength - 1) {
|
||||
App.bus.post(new DataBaseChangedEvent(DataBaseChangedEvent.DATABASE_CHANGED));
|
||||
}
|
||||
refreshed = true;
|
||||
i++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue