implement the Properties dialog at the albums view

This commit is contained in:
tibbi 2016-11-03 23:12:04 +01:00
parent 60536bfdf6
commit 97d6f2d452
1 changed files with 17 additions and 7 deletions

View File

@ -27,6 +27,7 @@ import android.widget.EditText;
import android.widget.GridView;
import android.widget.TextView;
import com.simplemobiletools.fileproperties.dialogs.PropertiesDialog;
import com.simplemobiletools.gallery.Config;
import com.simplemobiletools.gallery.Constants;
import com.simplemobiletools.gallery.R;
@ -250,9 +251,22 @@ public class MainActivity extends SimpleActivity
}
};
private void updateGridView() {
final DirectoryAdapter adapter = (DirectoryAdapter) mGridView.getAdapter();
adapter.updateItems(mDirs);
private void showProperties() {
final SparseBooleanArray items = mGridView.getCheckedItemPositions();
if (items.size() == 1) {
new PropertiesDialog(this, (String) getSelectedPaths().toArray()[0], false);
} else {
final List<String> paths = new ArrayList<>(items.size());
final int cnt = items.size();
for (int i = 0; i < cnt; i++) {
if (items.valueAt(i)) {
final int id = items.keyAt(i);
paths.add(mDirs.get(id).getPath());
}
}
new PropertiesDialog(this, paths, false);
}
}
private void editDirectory() {
@ -382,10 +396,6 @@ public class MainActivity extends SimpleActivity
return type != null && (type.startsWith("video/") || type.equals(MediaStore.Video.Media.CONTENT_TYPE));
}
private void showProperties() {
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {