diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 81f256966b..7b9a17ad4e 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -22,9 +22,9 @@ - + android:versionCode="2" + android:versionName="1.1" > + @@ -53,10 +53,10 @@ - + - + android:title="@string/setringtone" />--> diff --git a/res/values/strings.xml b/res/values/strings.xml index 7fac8649f9..575179e427 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -104,7 +104,7 @@ Random Skin Sets random theme at startup Colorize Icons - Sets some icons color different than theme + Sets static icon color Back Home Paste @@ -129,8 +129,15 @@ Use Default Image Gallery Path - <font color="#524ef8"><b>v1.0</font></b><i><font color="#5299f2"><br>Nov 11, 2014</i></font><br><br> + <font color="#524ef8"><b>v1.0</font></b><i><font color="#5299f2"><br>Nov 11, 2014</i></font><br> - Initial release<br><br> + <font color="#524ef8"><b>v1.1</font></b><i><font color="#5299f2"><br>Dec 04, 2014</i></font><br> + - Fixed cut/paste<br> + - Fixed text editor for root<br> + - Added German, French, Italian, Russian and Chinese languages<br> + - Added bookmarks to navigation drawer<br> + - Added material dialogs<br> + - more...<br><br> @@ -242,5 +249,6 @@ Root New Set as ringtone + Copy Path diff --git a/src/com/amaze/filemanager/activities/MainActivity.java b/src/com/amaze/filemanager/activities/MainActivity.java index 9734876298..8093a5d53d 100644 --- a/src/com/amaze/filemanager/activities/MainActivity.java +++ b/src/com/amaze/filemanager/activities/MainActivity.java @@ -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; @@ -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 list; + public ArrayList list; public int theme1; private EasyTracker easyTracker = null; boolean rootmode; @@ -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(); for (int i = 0; i < val.size(); i++) { File file = new File(val.get(i)); diff --git a/src/com/amaze/filemanager/adapters/DrawerAdapter.java b/src/com/amaze/filemanager/adapters/DrawerAdapter.java index bd5a49f7bd..112789dcae 100644 --- a/src/com/amaze/filemanager/adapters/DrawerAdapter.java +++ b/src/com/amaze/filemanager/adapters/DrawerAdapter.java @@ -119,6 +119,7 @@ public void onClick(View p1) { // TODO: Implement this method }); + float[] src = { color[0], 0, 0, 0, 0, diff --git a/src/com/amaze/filemanager/fragments/Main.java b/src/com/amaze/filemanager/fragments/Main.java index ffa5f7d44a..155b7829eb 100644 --- a/src/com/amaze/filemanager/fragments/Main.java +++ b/src/com/amaze/filemanager/fragments/Main.java @@ -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); @@ -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); @@ -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); @@ -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); @@ -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) @@ -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: diff --git a/src/com/amaze/filemanager/fragments/Preffrag.java b/src/com/amaze/filemanager/fragments/Preffrag.java index bf4147a63c..cc823d517b 100644 --- a/src/com/amaze/filemanager/fragments/Preffrag.java +++ b/src/com/amaze/filemanager/fragments/Preffrag.java @@ -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)); @@ -486,7 +488,33 @@ public boolean onPreferenceClick(Preference arg0) { "
  • FloatingActionButton
" + //FloatingActionBar "

" + "
/*
" + - " * Copyright 2014 Jerzy Chalupski
" + + " * The MIT License (MIT)
" + + " *
" + + " * Copyright (c) 2014 Oleksandr Melnykov
" + + " *
" + + " * Permission is hereby granted, free of charge, to any person obtaining a copy
" + + " * of this software and associated documentation files (the \"Software\"), to deal
" + + " * in the Software without restriction, including without limitation the rights
" + + " * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
" + + " * copies of the Software, and to permit persons to whom the Software is
" + + " * furnished to do so, subject to the following conditions:" + + " *
" + + " * The above copyright notice and this permission notice shall be included in
" + + " * all copies or substantial portions of the Software.
" + + " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" + + " * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" + + " * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
" + + " * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
" + + " * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
" + + " * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
" + + " * THE SOFTWARE.
" + + " */ " + + "

" + + "

Notices for libraries:

" + + "
  • Material-ish Progress
" + //progressBar + "

" + + "
/*
" + + " * Copyright 2014 Nico Hormazábal
" + " *
" + " * Licensed under the Apache License, Version 2.0 (the \"License\");
" + " * you may not use this file except in compliance with the License.
" + @@ -501,6 +529,32 @@ public boolean onPreferenceClick(Preference arg0) { " * limitations under the License.
" + " */ " + "

" + + "

Notices for libraries:

" + + "
  • Material Dialogs
" + //Material Dialogs + "

" + + "
/*
" + + " * The MIT License (MIT)
" + + " *
" + + " * Copyright (c) 2014 Aidan Michael Follestad
" + + " *
" + + " * Permission is hereby granted, free of charge, to any person obtaining a copy
" + + " * of this software and associated documentation files (the \"Software\"), to deal
" + + " * in the Software without restriction, including without limitation the rights
" + + " * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
" + + " * copies of the Software, and to permit persons to whom the Software is
" + + " * furnished to do so, subject to the following conditions:" + + " *
" + + " * The above copyright notice and this permission notice shall be included in
" + + " * all copies or substantial portions of the Software.
" + + " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" + + " * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" + + " * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
" + + " * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
" + + " * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
" + + " * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
" + + " * THE SOFTWARE.
" + + " */ " + + "

" + ""; WebView wv = (WebView) dialog_view.findViewById(R.id.webView1); wv.loadData(oss_dialog, "text/html", null); diff --git a/src/com/amaze/filemanager/utils/Futils.java b/src/com/amaze/filemanager/utils/Futils.java index b850a8a943..4b3f88f84e 100644 --- a/src/com/amaze/filemanager/utils/Futils.java +++ b/src/com/amaze/filemanager/utils/Futils.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; +import android.content.SharedPreferences; import android.content.res.Resources; import android.graphics.BitmapFactory; import android.graphics.Color; @@ -32,6 +33,7 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; +import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; @@ -280,7 +282,7 @@ public int calculateInSampleSize(BitmapFactory.Options options, return inSampleSize; } - public void showProps(File f, Main c,boolean root) { + public void showProps(final File f, final Main c,boolean root) { String date = getString(c.getActivity(), R.string.date) + getdate(f); String items = "", size = "", name, parent; name = getString(c.getActivity(), R.string.name) + f.getName(); @@ -292,6 +294,8 @@ public void showProps(File f, Main c,boolean root) { items = ""; size = getString(c.getActivity(), R.string.size) + getSize(f); } + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(c.getActivity()); + String skin = sp.getString("skin_color", "#5677fc"); MaterialDialog.Builder a = new MaterialDialog.Builder(c.getActivity()); a.title(getString(c.getActivity(), R.string.properties)); @@ -299,6 +303,23 @@ public void showProps(File f, Main c,boolean root) { a.theme(Theme.DARK); a.content(name + "\n" + parent + "\n" + size + "\n" + items + "\n" + date); + a.positiveText(R.string.copy_path); + a.negativeText(R.string.close); + a.positiveColor(Color.parseColor(skin)).negativeColor(Color.parseColor(skin)); + a.callback(new MaterialDialog.Callback() { + @Override + public void onPositive(MaterialDialog materialDialog) { + + c.copyToClipboard(c.getActivity(), f.getPath()); + Toast.makeText(c.getActivity(), c.getResources().getString(R.string.pathcopied), Toast.LENGTH_SHORT).show(); + } + + @Override + public void onNegative(MaterialDialog materialDialog) { + + materialDialog.cancel(); + } + }); a.build().show(); } @@ -486,6 +507,8 @@ public void showNameDialog(final MainActivity m, final ArrayList b, fina final EditText e = (EditText) v.findViewById(R.id.newname); e.setText("Newzip.zip"); a.customView(v); + if(m.theme1==1) + a.theme(Theme.DARK); a.title(getString(m, R.string.enterzipname)); e.setHint(getString(m, R.string.enterzipname)); a.positiveText(R.string.create);