Minor code improvements.

parent 01f48d90
......@@ -28,15 +28,15 @@ repositories {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:27.0.1'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:design:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.github.bumptech.glide:glide:4.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.8.0'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
compile 'com.google.android.exoplayer:exoplayer:r2.5.4'
......
......@@ -281,8 +281,8 @@ public class FolderActivity extends AppCompatActivity {
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1) {
// One image was deleted
if(resultCode == 1) {
// One image was deleted
int position = data.getIntExtra("file", 0);
list_of_paths.remove(list_of_paths.get(position));
list_of_files.remove(list_of_files.get(position));
......@@ -304,11 +304,6 @@ public class FolderActivity extends AppCompatActivity {
// Folder emptied
setResult(1);
}
// The first image of the folder was deleted, need a new thumbnail
else if(resultCode == 3) {
// Thumbnail needs change
setResult(2);
}
// UI needs to be reloaded
else if(resultCode == 4) {
// One image was renamed
......
......@@ -493,7 +493,6 @@ public class ImageActivity extends AppCompatActivity {
if (image.exists()) {
// Remove file from device
if (image.delete()) {
int move_to;
// Add deleted file position to ArrayList and send it as Extra
int fileToDelete = positionArray;
Intent intent = new Intent();
......@@ -508,16 +507,13 @@ public class ImageActivity extends AppCompatActivity {
mPagerAdapter.notifyDataSetChanged();
// Set adapter position
if(positionArray != 0){
move_to = positionArray - 1;
int move_to = positionArray - 1;
mPager.setCurrentItem(move_to, true);
}else{
if(list_of_images.size() == 0) {
// Set result of activity to 2 -> Last file of folder was deleted
setResult(2, intent);
finish();
}else{
// Set result of activity to 3 -> First image of folder was deleted -> Need to recalculate folder thumbnail
setResult(3, intent);
}
}
......@@ -562,9 +558,6 @@ public class ImageActivity extends AppCompatActivity {
// Set result of activity to 2 -> Last file of folder was deleted
setResult(2, intent);
finish();
}else{
// Set result of activity to 3 -> First file of folder was deleted -> Need to recalculate folder thumbnail
setResult(3, intent);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment