More small improvements.

parent dc35133a
......@@ -13,7 +13,6 @@ import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
......@@ -407,15 +406,13 @@ public class ImageActivity extends AppCompatActivity {
move_to = positionArray - 1;
mPager.setCurrentItem(move_to, true);
}else{
if(list_of_images.size() == 1) {
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);
move_to = positionArray + 1;
mPager.setCurrentItem(move_to, true);
}
}
......
......@@ -68,6 +68,7 @@ public class MainActivity extends AppCompatActivity {
// When permissions are granted
}else{
setFABListener();
loadFolders(columns);
}
}
......@@ -142,15 +143,6 @@ public class MainActivity extends AppCompatActivity {
}
}
@Override
public void onResume(){
super.onResume();
// Refresh grid onResume(also load grid for the first time)
startRefresh();
}
private void startRefresh(){
swipeLayout.setRefreshing(true);
......@@ -356,13 +348,10 @@ public class MainActivity extends AppCompatActivity {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1) {
if(resultCode == 1) {
System.out.println("1");
list_of_folders.remove(folder_position);
gridAdapter.notifyDataSetChanged();
}
if(resultCode == 2) {
System.out.println("2");
gridView.setAdapter(null);
startRefresh();
}
}
......
......@@ -29,9 +29,10 @@
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="@+id/gridViewFolder"
android:textColor="@color/text_white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/gridViewFolder"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
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