Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dnldsht committed May 26, 2016
2 parents 637084d + 18db07b commit 3afc211
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package="com.horaapps.leafpic">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/horaapps/leafpic/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ public void setThemeOnChangeListener(){
/** TextViews **/
//TextView txtAV = (TextView) findViewById(R.id.about_version_item);
TextView txtAL = (TextView) findViewById(R.id.about_libs_item);
TextView txtLDesc = (TextView) findViewById(R.id.about_app_light_description);
TextView txtDName = (TextView) findViewById(R.id.about_author_donald_item);
TextView txtGName = (TextView) findViewById(R.id.about_author_gilbert_item);
TextView txtSRate = (TextView) findViewById(R.id.about_support_rate_item);
Expand All @@ -221,6 +222,7 @@ public void setThemeOnChangeListener(){

color=getTextColor();
//txtAV.setTextColor(color);
txtLDesc.setTextColor(color);
txtAL.setTextColor(color);
txtDName.setTextColor(color);
txtGName.setTextColor(color);
Expand Down
70 changes: 70 additions & 0 deletions app/src/main/java/com/horaapps/leafpic/SelectAlbumBottomSheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
Expand All @@ -29,7 +32,9 @@
import com.horaapps.leafpic.Base.HandlingAlbums;
import com.mikepenz.iconics.view.IconicsImageView;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class SelectAlbumBottomSheet extends BottomSheetDialogFragment {
Expand Down Expand Up @@ -166,10 +171,75 @@ public void onClick(View v) {
}
}


Button btnUP;
TextView textFolder;
ListView dialog_ListView;
File root;
File curFolder;
private List<String> fileList = new ArrayList<String>();

private void newFolderDialog() {
Toast.makeText(getContext(),"New Folder",Toast.LENGTH_SHORT).show();

/*
root = new File(Environment.getExternalStorageDirectory().getAbsolutePath());
curFolder=root;
ListDir(curFolder);
Dialog dialog= new Dialog(getContext());
dialog.setContentView(R.layout.dialog_explorer);
dialog.setTitle("Dialog Explorer");
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
textFolder = (TextView) dialog.findViewById(R.id.folder);
btnUP = (Button) dialog.findViewById(R.id.up);
btnUP.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
ListDir(curFolder.getParentFile());
}
});
dialog_ListView = (ListView) dialog.findViewById(R.id.folder_list);
dialog_ListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
File selected=new File(fileList.get(position));
if(selected.isDirectory()){
ListDir(selected);
} else {
Toast.makeText(getContext(), selected.toString() + "selected ", Toast.LENGTH_SHORT).show();
//dialog.dismiss();
}
}
});
*/
}

void ListDir(File f){
if(f.equals(root)){
btnUP.setEnabled(false);
} else {
btnUP.setEnabled(true);
}

curFolder=f;
textFolder.setText(f.getPath());

File[] files = f.listFiles();
fileList.clear();

for (File file : files)
fileList.add(file.getPath());

ArrayAdapter<String> directoryList = new ArrayAdapter<String>(getContext(),
android.R.layout.simple_list_item_1, fileList);
dialog_ListView.setAdapter(directoryList);
}



class ToggleAlbumsTask extends AsyncTask<Boolean, Integer, Void> {

@Override
Expand Down
39 changes: 39 additions & 0 deletions app/src/main/res/layout/dialog_explorer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="15dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
>
<com.mikepenz.iconics.view.IconicsImageView
android:id="@+id/folder_icon_bottom_sheet_item"
android:layout_height="20dp"
android:layout_width="20dp"
android:layout_gravity="center"
app:iiv_icon="gmd-folder"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/up"
android:text="Parent Folder"
/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/folder"
android:text="folder"
/>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/folder_list"
>
</ListView>
</LinearLayout>

0 comments on commit 3afc211

Please sign in to comment.