Skip to content

Commit

Permalink
update v1.1
Browse files Browse the repository at this point in the history
lots of fixes
  • Loading branch information
VishalNehra committed Dec 3, 2014
1 parent aee1cd4 commit 31f506e
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 54 deletions.
10 changes: 5 additions & 5 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.amaze.filemanager"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
android:versionCode="2"
android:versionName="1.1" >
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down Expand Up @@ -53,10 +53,10 @@
<category android:name="android.intent.category.OPENABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<!--<intent-filter>
<action android:name="android.intent.action.RINGTONE_PICKER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</intent-filter>-->
</activity>
<activity
android:uiOptions="splitActionBarWhenNarrow"
Expand Down
4 changes: 2 additions & 2 deletions res/menu/contextual.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<item
android:id="@+id/hide"
android:title="@string/hide" />
<item
<!--<item
android:id="@+id/setringtone"
android:title="@string/setringtone" />
android:title="@string/setringtone" />-->
</menu>
12 changes: 10 additions & 2 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<string name="random">Random Skin</string>
<string name="random_summary">Sets random theme at startup</string>
<string name="colorize">Colorize Icons</string>
<string name="colorize_summary">Sets some icons color different than theme</string>
<string name="colorize_summary">Sets static icon color</string>
<string name="back">Back</string>
<string name="home">Home</string>
<string name="paste">Paste</string>
Expand All @@ -129,8 +129,15 @@
<string name="usedefaultgallerypath">Use Default Image Gallery Path</string>

<!-- Changelog -->
<string name="changelog_version_1">&lt;font color="#524ef8">&lt;b>v1.0&lt;/font>&lt;/b>&lt;i>&lt;font color="#5299f2">&lt;br>Nov 11, 2014&lt;/i>&lt;/font>&lt;br>&lt;br></string>
<string name="changelog_version_1">&lt;font color="#524ef8">&lt;b>v1.0&lt;/font>&lt;/b>&lt;i>&lt;font color="#5299f2">&lt;br>Nov 11, 2014&lt;/i>&lt;/font>&lt;br></string>
<string name="changelog_change_1">- Initial release&lt;br>&lt;br></string>
<string name="changelog_version_2">&lt;font color="#524ef8">&lt;b>v1.1&lt;/font>&lt;/b>&lt;i>&lt;font color="#5299f2">&lt;br>Dec 04, 2014&lt;/i>&lt;/font>&lt;br></string>
<string name="changelog_change_2">- Fixed cut/paste&lt;br>
- Fixed text editor for root&lt;br>
- Added German, French, Italian, Russian and Chinese languages&lt;br>
- Added bookmarks to navigation drawer&lt;br>
- Added material dialogs&lt;br>
- more...&lt;br>&lt;br></string>

<!-- New -->
<!-- Array -->
Expand Down Expand Up @@ -242,5 +249,6 @@
<string name="rootdirectory">Root</string>
<string name="new_string">New</string>
<string name="setringtone">Set as ringtone</string>
<string name="copy_path">Copy Path</string>
</resources>

5 changes: 3 additions & 2 deletions src/com/amaze/filemanager/activities/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class MainActivity extends android.support.v4.app.FragmentActivity {
private boolean backPressedToExitOnce = false;
private Toast toast = null;
private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
public ListView mDrawerList;
SharedPreferences Sp;
private ActionBarDrawerToggle mDrawerToggle;
public Spinner tabsSpinner;
Expand All @@ -126,7 +126,7 @@ public class MainActivity extends android.support.v4.app.FragmentActivity {
public boolean mReturnIntent = false;
private Intent intent;
private static final Pattern DIR_SEPARATOR = Pattern.compile("/");
private ArrayList<String> list;
public ArrayList<String> list;
public int theme1;
private EasyTracker easyTracker = null;
boolean rootmode;
Expand Down Expand Up @@ -240,6 +240,7 @@ public void onClick(View view) {
mDrawerLinear = (RelativeLayout) findViewById(R.id.left_drawer);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (ListView) findViewById(R.id.menu_drawer);

list = new ArrayList<String>();
for (int i = 0; i < val.size(); i++) {
File file = new File(val.get(i));
Expand Down
1 change: 1 addition & 0 deletions src/com/amaze/filemanager/adapters/DrawerAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void onClick(View p1) {
// TODO: Implement this method

});

float[] src = {

color[0], 0, 0, 0, 0,
Expand Down
105 changes: 65 additions & 40 deletions src/com/amaze/filemanager/fragments/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ public boolean onCreateActionMode(ActionMode mode, Menu menu) {
hideOption(R.id.about, menu);
hideOption(R.id.openwith, menu);
hideOption(R.id.ex, menu);
hideOption(R.id.setringtone,menu);
//hideOption(R.id.setringtone,menu);
mode.setTitle(utils.getString(getActivity(), R.string.select));
if(Build.VERSION.SDK_INT<19)
getActivity().findViewById(R.id.action_bar).setVisibility(View.GONE);
Expand Down Expand Up @@ -792,11 +792,11 @@ public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
showOption(R.id.share, menu);

} else {
if (x.getName().endsWith(".mp3"))
/*if (x.getName().endsWith(".mp3"))
{
showOption(R.id.setringtone, menu);
}
}*/


hideOption(R.id.ex, menu);
Expand All @@ -821,7 +821,7 @@ public boolean onPrepareActionMode(ActionMode mode, Menu menu) {

hideOption(R.id.openwith, menu);

hideOption(R.id.setringtone, menu);
//hideOption(R.id.setringtone, menu);

hideOption(R.id.permissions, menu);

Expand Down Expand Up @@ -860,16 +860,35 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
utils.showProps(new File(x), ma,rootMode);
mode.finish();
return true;
case R.id.setringtone:
/*case R.id.setringtone:
File fx;
if(results)
fx=new File(slist.get((plist.get(0))).getDesc());
else
fx=new File(list.get((plist.get(0))).getDesc());
Uri uri = MediaStore.Audio.Media.getContentUriForPath(fx.getPath());
Settings.System.putString(getActivity().getContentResolver(),
Settings.System.RINGTONE, uri.toString());
return true;
fx=new File(list.get((plist.get(0))).getDesc());
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, fx.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE, "Amaze");
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mp3");
//values.put(MediaStore.MediaColumns.SIZE, fx.);
values.put(MediaStore.Audio.Media.ARTIST, R.string.app_name);
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);
values.put(MediaStore.Audio.Media.IS_ALARM, false);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
Uri uri = MediaStore.Audio.Media.getContentUriForPath(fx.getAbsolutePath());
Uri newUri = getActivity().getContentResolver().insert(uri, values);
try {
RingtoneManager.setActualDefaultRingtoneUri(getActivity(), RingtoneManager.TYPE_RINGTONE, newUri);
//Settings.System.putString(getActivity().getContentResolver(), Settings.System.RINGTONE, newUri.toString());
Toast.makeText(getActivity(), "Successful" + fx.getAbsolutePath(), Toast.LENGTH_LONG).show();
} catch (Throwable t) {
Log.d("ringtone", "failed");
}
return true;*/
case R.id.delete:
if(results)
utils.deleteFiles(slist,ma,plist);
Expand Down Expand Up @@ -907,6 +926,7 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {

return true;
case R.id.rename:

final ActionMode m = mode;
final File f;
if(results)
Expand All @@ -916,41 +936,46 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
(plist.get(0))).getDesc());
View dialog = getActivity().getLayoutInflater().inflate(
R.layout.dialog, null);
AlertDialog.Builder a = new AlertDialog.Builder(getActivity());
MaterialDialog.Builder a = new MaterialDialog.Builder(getActivity());
final EditText edit = (EditText) dialog
.findViewById(R.id.newname);
edit.setText(f.getName());
a.setView(dialog);
a.setTitle(utils.getString(getActivity(), R.string.rename));
a.setPositiveButton(utils.getString(getActivity(), R.string.save),
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface p1, int p2) {
boolean b = utils.rename(f, edit.getText()
.toString());
m.finish();
updateList();
if (b) {
Toast.makeText(getActivity(),
utils.getString(getActivity(), R.string.renamed),
Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getActivity(),
utils.getString(getActivity(), R.string.renameerror),
Toast.LENGTH_LONG).show();
}
}
}
);
a.setNegativeButton(utils.getString(getActivity(), R.string.cancel),
new DialogInterface.OnClickListener() {
a.customView(dialog);
if(theme1==1)
a.theme(Theme.DARK);
a.title(utils.getString(getActivity(), R.string.rename));

a.callback(new MaterialDialog.Callback() {
@Override
public void onPositive(MaterialDialog materialDialog) {

boolean b = utils.rename(f, edit.getText()
.toString());
m.finish();
updateList();
if (b) {
Toast.makeText(getActivity(),
utils.getString(getActivity(), R.string.renamed),
Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getActivity(),
utils.getString(getActivity(), R.string.renameerror),
Toast.LENGTH_LONG).show();

public void onClick(DialogInterface p1, int p2) {
m.finish();
}
}
);
a.show();
}

@Override
public void onNegative(MaterialDialog materialDialog) {

materialDialog.cancel();
}
});
a.positiveText(R.string.save);
a.negativeText(R.string.cancel);
a.positiveColor(Color.parseColor(skin));
a.negativeColor(Color.parseColor(skin));
a.build().show();
mode.finish();
return true;
case R.id.hide:
Expand Down
58 changes: 56 additions & 2 deletions src/com/amaze/filemanager/fragments/Preffrag.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ public boolean onPreferenceClick(Preference preference) {
MaterialDialog.Builder a = new MaterialDialog.Builder(getActivity());
if(theme==1)a.theme(Theme.DARK);
a.title(R.string.changelog);
a.content(Html.fromHtml(getActivity().getString(R.string.changelog_version_1) +
a.content(Html.fromHtml(getActivity().getString(R.string.changelog_version_2) +
getActivity().getString(R.string.changelog_change_2) +
getActivity().getString(R.string.changelog_version_1) +
getActivity().getString(R.string.changelog_change_1)));
a.negativeText(R.string.close);
a.negativeColor(Color.parseColor(skin));
Expand Down Expand Up @@ -486,7 +488,33 @@ public boolean onPreferenceClick(Preference arg0) {
"<ul><li>FloatingActionButton</ul></li>" + //FloatingActionBar
"<p style = 'background-color:#eeeeee;padding-left:1em'><code>" +
"<br>/*<br>" +
"&nbsp;* Copyright 2014 Jerzy Chalupski<br>" +
"&nbsp;* The MIT License (MIT)<br>" +
"&nbsp;*<br>" +
"&nbsp;* Copyright (c) 2014 Oleksandr Melnykov<br>" +
"&nbsp;*<br>" +
"&nbsp;* Permission is hereby granted, free of charge, to any person obtaining a copy<br>" +
"&nbsp;* of this software and associated documentation files (the \"Software\"), to deal<br>" +
"&nbsp;* in the Software without restriction, including without limitation the rights<br>" +
"&nbsp;* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>" +
"&nbsp;* copies of the Software, and to permit persons to whom the Software is<br>" +
"&nbsp;* furnished to do so, subject to the following conditions:" +
"&nbsp;*<br>" +
"&nbsp;* The above copyright notice and this permission notice shall be included in<br>" +
"&nbsp;* all copies or substantial portions of the Software.<br>" +
"&nbsp;* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>" +
"&nbsp;* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>" +
"&nbsp;* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>" +
"&nbsp;* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>" +
"&nbsp;* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>" +
"&nbsp;* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>" +
"&nbsp;* THE SOFTWARE.<br>" +
"&nbsp;*/ " +
"<br><br></code></p>" +
"<h3>Notices for libraries:</h3>" +
"<ul><li>Material-ish Progress</ul></li>" + //progressBar
"<p style = 'background-color:#eeeeee;padding-left:1em'><code>" +
"<br>/*<br>" +
"&nbsp;* Copyright 2014 Nico Hormazábal<br>" +
"&nbsp;* <br>" +
"&nbsp;* Licensed under the Apache License, Version 2.0 (the \"License\");<br>" +
"&nbsp;* you may not use this file except in compliance with the License.<br>" +
Expand All @@ -501,6 +529,32 @@ public boolean onPreferenceClick(Preference arg0) {
"&nbsp;* limitations under the License.<br>" +
"&nbsp;*/ " +
"<br><br></code></p>" +
"<h3>Notices for libraries:</h3> " +
"<ul><li>Material Dialogs</ul></li>" + //Material Dialogs
"<p style = 'background-color:#eeeeee;padding-left:1em'><code>" +
"<br>/*<br>" +
"&nbsp;* The MIT License (MIT)<br>" +
"&nbsp;*<br>" +
"&nbsp;* Copyright (c) 2014 Aidan Michael Follestad<br>" +
"&nbsp;*<br>" +
"&nbsp;* Permission is hereby granted, free of charge, to any person obtaining a copy<br>" +
"&nbsp;* of this software and associated documentation files (the \"Software\"), to deal<br>" +
"&nbsp;* in the Software without restriction, including without limitation the rights<br>" +
"&nbsp;* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>" +
"&nbsp;* copies of the Software, and to permit persons to whom the Software is<br>" +
"&nbsp;* furnished to do so, subject to the following conditions:" +
"&nbsp;*<br>" +
"&nbsp;* The above copyright notice and this permission notice shall be included in<br>" +
"&nbsp;* all copies or substantial portions of the Software.<br>" +
"&nbsp;* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>" +
"&nbsp;* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>" +
"&nbsp;* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>" +
"&nbsp;* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>" +
"&nbsp;* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>" +
"&nbsp;* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>" +
"&nbsp;* THE SOFTWARE.<br>" +
"&nbsp;*/ " +
"<br><br></code></p>" +
"</body></html>";
WebView wv = (WebView) dialog_view.findViewById(R.id.webView1);
wv.loadData(oss_dialog, "text/html", null);
Expand Down
Loading

0 comments on commit 31f506e

Please sign in to comment.