Skip to content

Commit fd0579a

Browse files
committed
Cleanup
1 parent 5ac08e2 commit fd0579a

File tree

9 files changed

+0
-405
lines changed

9 files changed

+0
-405
lines changed

app/src/main/java/com/pdaxrom/utils/FileDialog.java

Lines changed: 0 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@
99
import android.os.Environment;
1010
import android.support.v7.app.AppCompatActivity;
1111
import android.support.v7.view.ActionMode;
12-
import android.text.InputType;
1312
import android.util.Log;
14-
import android.util.SparseBooleanArray;
1513
import android.view.KeyEvent;
16-
import android.view.Menu;
17-
import android.view.MenuItem;
1814
import android.view.View;
1915
import android.view.View.OnClickListener;
2016
import android.view.inputmethod.InputMethodManager;
@@ -186,82 +182,6 @@ private AbsListView getListView() {
186182
return findViewById(R.id.list_view);
187183
}
188184

189-
@Override
190-
public boolean onCreateOptionsMenu(Menu menu) {
191-
getMenuInflater().inflate(R.menu.file_dialog_menu, menu);
192-
return true;
193-
}
194-
195-
@Override
196-
public boolean onOptionsItemSelected(MenuItem item) {
197-
int i = item.getItemId();
198-
if (i == R.id.home_folder) {
199-
if (currentPath.startsWith(Environment.getExternalStorageDirectory().getPath())) {
200-
sdDirectory = currentPath;
201-
}
202-
if (!currentPath.startsWith(getCacheDir().getParentFile().getAbsolutePath())) {
203-
getDir(homeDirectory);
204-
if (selectionMode == SelectionMode.MODE_SELECT_DIR) {
205-
selectedFile = new File(currentPath);
206-
mFileName.setText(selectedFile.getName());
207-
selectButton.setEnabled(true);
208-
}
209-
}
210-
211-
} else if (i == R.id.sd_folder) {
212-
if (currentPath.startsWith(getCacheDir().getParentFile().getAbsolutePath())) {
213-
homeDirectory = currentPath;
214-
}
215-
if (!currentPath.startsWith(Environment.getExternalStorageDirectory().getPath())) {
216-
getDir(sdDirectory);
217-
if (selectionMode == SelectionMode.MODE_SELECT_DIR) {
218-
selectedFile = new File(currentPath);
219-
mFileName.setText(selectedFile.getName());
220-
selectButton.setEnabled(true);
221-
}
222-
}
223-
224-
} else if (i == R.id.new_folder) {
225-
newDir();
226-
227-
}
228-
return true;
229-
}
230-
231-
private void newDir() {
232-
final EditText input = new EditText(context);
233-
input.setInputType(InputType.TYPE_CLASS_TEXT);
234-
input.setSingleLine(true);
235-
new AlertDialog.Builder(context)
236-
.setMessage(getString(R.string.create_new))
237-
.setView(input)
238-
.setPositiveButton(getString(R.string.button_continue), new DialogInterface.OnClickListener() {
239-
public void onClick(DialogInterface dialog, int whichButton) {
240-
if ((new File(currentPath + "/" + input.getText().toString())).mkdirs() == false) {
241-
new AlertDialog.Builder(context)
242-
.setIcon(android.R.drawable.ic_dialog_alert)
243-
.setTitle(R.string.newDirectory)
244-
.setMessage(getString(R.string.cannot_create))
245-
.show();
246-
} else {
247-
getDir(currentPath + "/" + input.getText().toString());
248-
if (selectionMode == SelectionMode.MODE_SELECT_DIR) {
249-
selectedFile = new File(currentPath);
250-
mFileName.setText(selectedFile.getName());
251-
selectButton.setEnabled(true);
252-
}
253-
}
254-
}
255-
})
256-
.setNegativeButton(getString(R.string.button_cancel), new DialogInterface.OnClickListener() {
257-
258-
public void onClick(DialogInterface dialog, int which) {
259-
// TODO Auto-generated method stub
260-
261-
}
262-
}).show();
263-
}
264-
265185
private void getDir(String dirPath) {
266186

267187
boolean useAutoSelection = dirPath.length() < currentPath.length();
@@ -377,8 +297,6 @@ private void addItem(String fileName, int imageId) {
377297
}
378298

379299
protected void onLongListItemClick(View v, int pos, long id) {
380-
Log.i(TAG, "onLongListItemClick id=" + id);
381-
mMode = startSupportActionMode(new FileActionMode());
382300
}
383301

384302

@@ -453,69 +371,6 @@ public void onClick(DialogInterface dialog, int which) {
453371
}
454372
}
455373

456-
private final class FileActionMode implements ActionMode.Callback {
457-
private List<String> getSelectedFiles() {
458-
List<String> files = new ArrayList<String>();
459-
SparseBooleanArray checked = getListView().getCheckedItemPositions();
460-
461-
for (int i = 0; i < checked.size(); i++) {
462-
if (checked.valueAt(i)) {
463-
HashMap<String, Object> item = (HashMap<String, Object>) getListView().getAdapter().getItem(checked.keyAt(i));
464-
if (item.get(ITEM_KEY).equals("..")) {
465-
continue;
466-
}
467-
files.add(currentPath + "/" + item.get(ITEM_KEY));
468-
}
469-
}
470-
471-
return files;
472-
}
473-
474-
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
475-
int i = item.getItemId();
476-
if (i == R.id.file_delete) {
477-
List<String> files = getSelectedFiles();
478-
if (files.size() > 0) {
479-
actionOp = item.getItemId();
480-
new ActionFiles().execute(files);
481-
}
482-
483-
} else if (i == R.id.file_copy || i == R.id.file_cut) {
484-
actionFiles = getSelectedFiles();
485-
if (actionFiles.size() > 0) {
486-
actionOp = item.getItemId();
487-
}
488-
489-
} else if (i == R.id.file_paste) {
490-
if (actionOp == R.id.file_copy || actionOp == R.id.file_cut) {
491-
new ActionFiles().execute(actionFiles);
492-
}
493-
494-
}
495-
mode.finish();
496-
return true;
497-
}
498-
499-
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
500-
getMenuInflater().inflate(R.menu.file_action_menu, menu);
501-
if (actionOp == 0) {
502-
menu.findItem(R.id.file_paste).setVisible(false);
503-
}
504-
return true;
505-
}
506-
507-
public void onDestroyActionMode(ActionMode mode) {
508-
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
509-
getDir(currentPath);
510-
mMode = null;
511-
}
512-
513-
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
514-
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
515-
return false;
516-
}
517-
}
518-
519374
private class ActionFiles extends AsyncTask<List<String>, String, Boolean> {
520375
protected void onPreExecute() {
521376
super.onPreExecute();

app/src/main/res-cctools/layout/buildlog_item.xml

Lines changed: 0 additions & 51 deletions
This file was deleted.

app/src/main/res-cctools/layout/cctools_editor.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/src/main/res-cctools/layout/dialog_gcc_args.xml

Lines changed: 0 additions & 54 deletions
This file was deleted.

app/src/main/res-cctools/menu/file_action_menu.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/src/main/res-cctools/menu/file_dialog_menu.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)