7
7
import android .app .Dialog ;
8
8
import android .content .SharedPreferences ;
9
9
import android .os .AsyncTask ;
10
+ import android .os .Environment ;
10
11
import android .preference .PreferenceManager ;
11
12
import android .support .annotation .NonNull ;
12
13
import android .support .design .widget .BottomSheetBehavior ;
13
14
import android .support .design .widget .BottomSheetDialogFragment ;
14
15
import android .support .design .widget .CoordinatorLayout ;
15
16
import android .support .v4 .content .ContextCompat ;
17
+ import android .support .v7 .app .AlertDialog ;
16
18
import android .support .v7 .widget .GridLayoutManager ;
17
19
import android .support .v7 .widget .RecyclerView ;
18
20
import android .text .Html ;
19
21
import android .view .LayoutInflater ;
20
22
import android .view .View ;
21
23
import android .view .ViewGroup ;
24
+ import android .widget .AdapterView ;
22
25
import android .widget .ArrayAdapter ;
23
26
import android .widget .Button ;
24
27
import android .widget .LinearLayout ;
@@ -138,7 +141,7 @@ public void onClick(View v) {
138
141
llNewFolder .setOnClickListener (new View .OnClickListener () {
139
142
@ Override
140
143
public void onClick (View v ) {
141
- newFolderDialog ();
144
+ // newFolderDialog();
142
145
}
143
146
});
144
147
@@ -182,15 +185,17 @@ public void onClick(View v) {
182
185
private void newFolderDialog () {
183
186
Toast .makeText (getContext (),"New Folder" ,Toast .LENGTH_SHORT ).show ();
184
187
185
- /*
188
+
186
189
root = new File (Environment .getExternalStorageDirectory ().getAbsolutePath ());
187
190
curFolder =root ;
188
191
ListDir (curFolder );
189
- Dialog dialog= new Dialog(getContext());
192
+
193
+ final AlertDialog .Builder deleteDialog = new AlertDialog .Builder (getContext (),
194
+ R .style .AlertDialog_Light );
195
+
196
+ Dialog dialog = new Dialog (getContext ());
190
197
dialog .setContentView (R .layout .dialog_explorer );
191
198
dialog .setTitle ("Dialog Explorer" );
192
- dialog.setCancelable(true);
193
- dialog.setCanceledOnTouchOutside(true);
194
199
195
200
textFolder = (TextView ) dialog .findViewById (R .id .folder );
196
201
btnUP = (Button ) dialog .findViewById (R .id .up );
@@ -202,6 +207,7 @@ public void onClick(View v){
202
207
});
203
208
204
209
dialog_ListView = (ListView ) dialog .findViewById (R .id .folder_list );
210
+
205
211
dialog_ListView .setOnItemClickListener (new AdapterView .OnItemClickListener (){
206
212
@ Override
207
213
public void onItemClick (AdapterView <?> parent , View view , int position , long id ) {
@@ -214,10 +220,11 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
214
220
}
215
221
}
216
222
});
217
- */
223
+
218
224
}
219
225
220
226
void ListDir (File f ){
227
+
221
228
if (f .equals (root )){
222
229
btnUP .setEnabled (false );
223
230
} else {
0 commit comments