77import android .app .Dialog ;
88import android .content .SharedPreferences ;
99import android .os .AsyncTask ;
10+ import android .os .Environment ;
1011import android .preference .PreferenceManager ;
1112import android .support .annotation .NonNull ;
1213import android .support .design .widget .BottomSheetBehavior ;
1314import android .support .design .widget .BottomSheetDialogFragment ;
1415import android .support .design .widget .CoordinatorLayout ;
1516import android .support .v4 .content .ContextCompat ;
17+ import android .support .v7 .app .AlertDialog ;
1618import android .support .v7 .widget .GridLayoutManager ;
1719import android .support .v7 .widget .RecyclerView ;
1820import android .text .Html ;
1921import android .view .LayoutInflater ;
2022import android .view .View ;
2123import android .view .ViewGroup ;
24+ import android .widget .AdapterView ;
2225import android .widget .ArrayAdapter ;
2326import android .widget .Button ;
2427import android .widget .LinearLayout ;
@@ -138,7 +141,7 @@ public void onClick(View v) {
138141 llNewFolder .setOnClickListener (new View .OnClickListener () {
139142 @ Override
140143 public void onClick (View v ) {
141- newFolderDialog ();
144+ // newFolderDialog();
142145 }
143146 });
144147
@@ -182,15 +185,17 @@ public void onClick(View v) {
182185 private void newFolderDialog () {
183186 Toast .makeText (getContext (),"New Folder" ,Toast .LENGTH_SHORT ).show ();
184187
185- /*
188+
186189 root = new File (Environment .getExternalStorageDirectory ().getAbsolutePath ());
187190 curFolder =root ;
188191 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 ());
190197 dialog .setContentView (R .layout .dialog_explorer );
191198 dialog .setTitle ("Dialog Explorer" );
192- dialog.setCancelable(true);
193- dialog.setCanceledOnTouchOutside(true);
194199
195200 textFolder = (TextView ) dialog .findViewById (R .id .folder );
196201 btnUP = (Button ) dialog .findViewById (R .id .up );
@@ -202,6 +207,7 @@ public void onClick(View v){
202207 });
203208
204209 dialog_ListView = (ListView ) dialog .findViewById (R .id .folder_list );
210+
205211 dialog_ListView .setOnItemClickListener (new AdapterView .OnItemClickListener (){
206212 @ Override
207213 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)
214220 }
215221 }
216222 });
217- */
223+
218224 }
219225
220226 void ListDir (File f ){
227+
221228 if (f .equals (root )){
222229 btnUP .setEnabled (false );
223230 } else {
0 commit comments