Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
Conflicts:
	AmazeFileManager.iml
  • Loading branch information
VishalNehra committed Jul 16, 2014
2 parents f01d123 + 1c65117 commit f7367a3
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ local.properties
gradlew
gradlew.bat
.project
AmazeFileManager.iml
64 changes: 64 additions & 0 deletions AmazeFileManager.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugJava" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/res" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build-types/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build-types/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build-types/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build-types/debug/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build-types/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build-types/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build-types/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
</content>
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="android-support-v4" level="project" />
<orderEntry type="library" exported="" name="crouton" level="project" />
<orderEntry type="library" exported="" name="RootTools" level="project" />
</component>
</module>

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
apply plugin: 'android'
apply plugin: 'com.android.application'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
Expand Down
6 changes: 6 additions & 0 deletions res/menu/activity_extra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@
<item android:id="@+id/item9"
android:title="Set Current Directory As Home"
android:showAsAction="ifRoom"/>
<item android:id="@+id/item10"
android:title="Sort by"
android:showAsAction="ifRoom"/>
<item android:id="@+id/item11"
android:title="Directory Sort Mode"
android:showAsAction="ifRoom"/>
</menu>
55 changes: 55 additions & 0 deletions res/values/arrays.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="uimode">
<item>Simple Ui</item>
<item>Card Ui</item>

</string-array>
<string-array name="theme">
<item>Light</item>
<item>Dark</item>

</string-array>
<string-array name="directorysortmode">
<item>Folders on Top</item>
<item>Files on Top</item>
<item>None on Top</item>
</string-array>
<string-array name="sortby">
<item>Name</item>
<item>Last Modified</item>
<item>Size</item>
<item>Name (Desc)</item>
<item>Last Modified (Desc)</item>
<item>Size (Desc)</item>
</string-array>


<string-array name="ints2">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<string-array name="ints1">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="listmode">
<item>Detailed View</item>
<item>Simple View</item>
</string-array>
<string-array name="folder">
<item>Orange</item>
<item>Yellow</item>
<item>Blue</item>
</string-array>

<string-array name="ints">
<item>0</item>
<item>1</item>
</string-array>
</resources>
60 changes: 11 additions & 49 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,54 +1,6 @@
<resources>
<string name="app_name">Navigation Drawer Example</string>
<string-array name="listmode">
<item>Detailed View</item>
<item>Simple View</item>
</string-array>
<string-array name="folder">
<item>Orange</item>
<item>Yellow</item>
<item>Blue</item>
</string-array>
<string-array name="directorysortmode">
<item>Folders on Top</item>
<item>Files on Top</item>
<item>None on Top</item>
</string-array>
<string-array name="sortby">
<item>Name</item>
<item>Last Modified</item>
<item>Size</item>
<item>Name (Desc)</item>
<item>Last Modified (Desc)</item>
<item>Size (Desc)</item>
</string-array>
<string-array name="uimode">
<item>Simple Ui</item>
<item>Card Ui</item>

</string-array>
<string-array name="theme">
<item>Light</item>
<item>Dark</item>

</string-array>
<string-array name="ints2">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<string-array name="ints1">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="ints">
<item>0</item>
<item>1</item>
</string-array>

<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>
<string name="books">Bookmarks</string>
Expand Down Expand Up @@ -123,5 +75,15 @@
<string name="confirm">Confirm</string>
<string name="deleting">Deleting</string>
<string name="questiondelete">Do you really want to delete following files?</string>
<string name="viewmode">View Mode</string>
<string name="uimode">UI Mode</string>
<string name="directorysort">Directory Sort Mode</string>
<string name="sortby">Sort By</string>
<string name="theme">Theme</string>
<string name="foldercolor">Folder Color</string>
<string name="imagegallery">Image Gallery</string>
<string name="fileexplorer">File Explorer</string>
<string name="changegallerypath">Change Gallery Path</string>
<string name="usedefaultgallerypath">Use Default Image Gallery Path</string>
</resources>

22 changes: 11 additions & 11 deletions res/xml/preferences.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<ListPreference android:key="theme" android:entries="@array/theme" android:title="@string/theme" android:defaultValue="0" android:entryValues="@array/ints" />

<PreferenceCategory android:title="File Explorer">

<PreferenceCategory android:title="File Explorer">

<ListPreference android:key="viewmode" android:entries="@array/listmode" android:title="View Mode" android:entryValues="@array/ints" android:defaultValue="0" android:summary="Choose ListView Mode" />
<ListPreference android:key="uimode" android:entries="@array/uimode" android:title="UI Mode" android:entryValues="@array/ints" android:defaultValue="0" android:summary="Choose Item Ui" />
<ListPreference android:key="dirontop" android:entries="@array/directorysortmode" android:title="Directory Sort Mode" android:defaultValue="0" android:entryValues="@array/ints1" />
<ListPreference android:key="viewmode" android:entries="@array/listmode" android:title="@string/viewmode" android:entryValues="@array/ints" android:defaultValue="0" android:summary="Choose ListView Mode" />
<ListPreference android:key="uimode" android:entries="@array/uimode" android:title="@string/uimode" android:entryValues="@array/ints" android:defaultValue="0" android:summary="Choose Item Ui" />
<ListPreference android:key="dirontop" android:entries="@array/directorysortmode" android:title="@string/directorysort" android:defaultValue="0" android:entryValues="@array/ints1" />



<ListPreference android:key="sortby" android:entries="@array/sortby" android:title="Sort By" android:defaultValue="0" android:entryValues="@array/ints2" />
<ListPreference android:key="folder" android:entries="@array/folder" android:title="Folder Color" android:defaultValue="1" android:entryValues="@array/ints1" />
<ListPreference android:key="sortby" android:entries="@array/sortby" android:title="@string/sortby" android:defaultValue="0" android:entryValues="@array/ints2" />
<ListPreference android:key="folder" android:entries="@array/folder" android:title="@string/foldercolor" android:defaultValue="1" android:entryValues="@array/ints1" />
</PreferenceCategory>

<PreferenceCategory android:title="Image Gallery">
<PreferenceCategory android:title="@string/imagegallery">

<EditTextPreference android:key="Ipath" android:title="Change Gallery Path" />
<EditTextPreference android:key="Ipath" android:title="@string/changegallerypath" />

<CheckBoxPreference android:key="Ipathset" android:title="Use Default Image Gallery Path" android:defaultValue="true"/>
<CheckBoxPreference android:key="Ipathset" android:title="@string/usedefaultgallerypath" android:defaultValue="true"/>

</PreferenceCategory>
<ListPreference android:key="theme" android:entries="@array/theme" android:title="Theme" android:defaultValue="0" android:entryValues="@array/ints" />

</PreferenceScreen>
2 changes: 1 addition & 1 deletion src/com/amaze/filemanager/fragments/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Main extends ListFragment {
public ActionMode mActionMode;
ProgressBar pbar;
NotificationCompat.Builder mBuilder;
SharedPreferences Sp;
public SharedPreferences Sp;
Drawable folder,apk,unknown,archive,text;
Resources res;
LinearLayout buttons;
Expand Down
6 changes: 6 additions & 0 deletions src/com/amaze/filemanager/fragments/TabFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.item2:
home();
break;
case R.id.item10:
utils.showSortDialog(getCurrentTab());
break;
case R.id.item11:
utils.showDirectorySortDialog(getCurrentTab());
break;
case R.id.item3:
removePage(mViewPager.getCurrentItem());
break;
Expand Down
94 changes: 67 additions & 27 deletions src/com/amaze/filemanager/utils/Futils.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import de.keyboardsurfer.android.widget.crouton.*;
import java.io.*;
import java.lang.reflect.Array;
import java.text.*;
import java.util.*;

Expand Down Expand Up @@ -379,33 +380,72 @@ public void longClickSearchItem(final Main main,String files){
adapter.add(getString(main.getActivity(),R.string.compress));
if(!f.isDirectory() && f.getName().endsWith(".zip"))
adapter.add(getString(main.getActivity(),R.string.extract));
ba.setAdapter(adapter, new DialogInterface.OnClickListener(){

public void onClick(DialogInterface p1, int p2)
{switch(p2){
case 0:main.loadlist(new File(main.slist.get(p2).getDesc()).getParentFile(),true);
break;
case 1:openWith(f, main.getActivity());
break;
case 2:showProps(f,main.getActivity());
break;
case 3: Intent i = new Intent();
i.setAction(Intent.ACTION_SEND);
i.setType("*/*");
i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
main.startActivity(i);
break;
case 4:ArrayList<String> copies1=new ArrayList<String>();
copies1.add(f.getPath());
showNameDialog((MainActivity)main.getActivity(),copies1,main.current);

break;
case 5:Intent intent=new Intent(main.getActivity(),ExtractService.class);
intent.putExtra("zip",f.getPath());
main.getActivity().startService(intent);
break;
} }
});
ba.setAdapter(adapter, new DialogInterface.OnClickListener() {

public void onClick(DialogInterface p1, int p2) {
switch (p2) {
case 0:
main.loadlist(new File(main.slist.get(p2).getDesc()).getParentFile(), true);
break;
case 1:
openWith(f, main.getActivity());
break;
case 2:
showProps(f, main.getActivity());
break;
case 3:
Intent i = new Intent();
i.setAction(Intent.ACTION_SEND);
i.setType("*/*");
i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
main.startActivity(i);
break;
case 4:
ArrayList<String> copies1 = new ArrayList<String>();
copies1.add(f.getPath());
showNameDialog((MainActivity) main.getActivity(), copies1, main.current);

break;
case 5:
Intent intent = new Intent(main.getActivity(), ExtractService.class);
intent.putExtra("zip", f.getPath());
main.getActivity().startService(intent);
break;
}
}
});
ba.show();
}
public void showSortDialog(final Main m){
String[] sort= m.getResources().getStringArray(R.array.sortby);
AlertDialog.Builder a=new AlertDialog.Builder(m.getActivity());

a.setAdapter(new ArrayAdapter<String>(m.getActivity(),android.R.layout.select_dialog_singlechoice,sort),new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
m.Sp.edit().putString("sortby",""+i).commit();
m.getSortModes();
m.loadlist(new File(m.current),false);
}
});
a.setTitle("Sort By");
a.setNegativeButton(getString(m.getActivity(), R.string.cancel), null);
a.show();
}
public void showDirectorySortDialog(final Main m){
String[] sort= m.getResources().getStringArray(R.array.directorysortmode);
AlertDialog.Builder a=new AlertDialog.Builder(m.getActivity());

a.setAdapter(new ArrayAdapter<String>(m.getActivity(),android.R.layout.select_dialog_singlechoice,sort),new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
m.Sp.edit().putString("dirontop",""+i).commit();
m.getSortModes();
m.loadlist(new File(m.current),false);
}
});
a.setTitle("Directory Sort Mode");
a.setNegativeButton(getString(m.getActivity(), R.string.cancel), null);
a.show();
}
}

0 comments on commit f7367a3

Please sign in to comment.