Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Mihalachi committed Oct 31, 2014
1 parent 614274c commit b359950
Show file tree
Hide file tree
Showing 144 changed files with 326 additions and 519 deletions.
4 changes: 2 additions & 2 deletions app-pro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
applicationId "com.maskyn.fileeditorpro"
minSdkVersion 11
targetSdkVersion 21
versionCode 32
versionName "1.13.1"
versionCode 35
versionName "1.13.2"
}

compileOptions {
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ android {
applicationId "com.maskyn.fileeditor"
minSdkVersion 11
targetSdkVersion 21
versionCode 32
versionName "1.13.1"
versionCode 35
versionName "1.13.2"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
Expand Down
40 changes: 32 additions & 8 deletions build/intermediates/dex-cache/cache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
jumboMode="false"
revision="21.0.2"
sha1="b1b6ea3b7e4aa4f492509a4952029cd8e48019ad"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\pre-dexed\release\classes-8e5760a518ace60ad40fe7ea0fedc1faa57ee342.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\exploded-aar\com.crashlytics.sdk.android\beta\1.0.1\classes.jar"
jumboMode="false"
revision="21.0.2"
sha1="ac8bb9f7af7ca5dae03650dc1b43a305e1df2f1b"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\pre-dexed\release\classes-4dd6beddde59ff8bd6c22bd0d65ac974f7e489d2.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\exploded-aar\turbo-editor.libraries\sharedCode\unspecified\classes.jar"
jumboMode="false"
revision="21.0.2"
sha1="f54c5ec0937fc814350e44db6c20f6eaf0b7e0c7"/>
sha1="7a292d3770cffc1bb19e8f0232954da498bb87ea"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\pre-dexed\debug\classes-40c5f3698ba688207904eaae4b4b57dbf850297e.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\exploded-aar\com.crashlytics.sdk.android\answers\1.0.0\classes.jar"
Expand Down Expand Up @@ -127,12 +133,6 @@
jumboMode="false"
revision="21.0.2"
sha1="95fd37732ec852e99f07eeb516a3650172f1d136"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\pre-dexed\debug\juniversalchardet-1.0.3-65b2b356e3f2da4b67e00aba70923d6321852204.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\exploded-aar\turbo-editor.libraries\sharedCode\unspecified\libs\juniversalchardet-1.0.3.jar"
jumboMode="false"
revision="21.0.2"
sha1="591d72211acc0b909b79c840e0b3ed9a0982d807"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\pre-dexed\debug\juniversalchardet-1.0.3-sources-58cfedaebe3b94ec0eaa2ede4e66aae8dbe309b0.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\exploded-aar\turbo-editor.libraries\sharedCode\unspecified\libs\juniversalchardet-1.0.3-sources.jar"
Expand All @@ -145,6 +145,12 @@
jumboMode="false"
revision="19.1.0"
sha1="2e2f6526f3c5fb34230d14e52bdc24addb67ea9f"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\pre-dexed\debug\juniversalchardet-1.0.3-65b2b356e3f2da4b67e00aba70923d6321852204.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\exploded-aar\turbo-editor.libraries\sharedCode\unspecified\libs\juniversalchardet-1.0.3.jar"
jumboMode="false"
revision="21.0.2"
sha1="591d72211acc0b909b79c840e0b3ed9a0982d807"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\pre-dexed\debug\juniversalchardet-1.0.3-9db20cdcb8ae72104757d81297c98978c65bd91b.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\exploded-aar\turbo-editor.libraries\sharedCode\unspecified\libs\juniversalchardet-1.0.3.jar"
Expand Down Expand Up @@ -175,6 +181,12 @@
jumboMode="false"
revision="21.0.2"
sha1="068f232cbc319d814ad6ad01fd0ed0ac6d6c5414"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\pre-dexed\release\classes-28f23d0edd8f234d170b23285799ff5873131bbe.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\exploded-aar\io.fabric.sdk.android\fabric\1.0.1\classes.jar"
jumboMode="false"
revision="21.0.2"
sha1="7b46e0b1175dbb7d47f130d6ed14097340e1b77f"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\pre-dexed\debug\classes-39edd57531ecc124992725bca5e8b42be236e3ec.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\exploded-aar\io.fabric.sdk.android\fabric\1.0.0\classes.jar"
Expand Down Expand Up @@ -223,6 +235,12 @@
jumboMode="false"
revision="21.0.2"
sha1="74a89f0f8b56d9f11d70b8d8134cf4109f4797dc"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\pre-dexed\release\classes-5c418babb57b5fe1e6e82a2f3ba51f2da968ba87.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\exploded-aar\com.crashlytics.sdk.android\crashlytics\2.0.1\classes.jar"
jumboMode="false"
revision="21.0.2"
sha1="1adf75e3d87301236c2d4de507b4a668092ff070"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\pre-dexed\debug\classes-82d5b6cab7f16bad663de7c7008673037efb0e1b.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\exploded-aar\turbo-editor.libraries\FloatingActionButton\unspecified\classes.jar"
Expand Down Expand Up @@ -252,12 +270,18 @@
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\exploded-aar\turbo-editor.libraries\sharedCode\unspecified\classes.jar"
jumboMode="false"
revision="21.0.2"
sha1="f54c5ec0937fc814350e44db6c20f6eaf0b7e0c7"/>
sha1="7a292d3770cffc1bb19e8f0232954da498bb87ea"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\pre-dexed\debug\internal_impl-21.0.0-b15535acecaec42d04239e17e0a03ab072a43104.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app-pro\build\intermediates\exploded-aar\com.android.support\support-v4\21.0.0\libs\internal_impl-21.0.0.jar"
jumboMode="false"
revision="21.0.2"
sha1="1609e6d42d0480b0f4188e2c29f75388fa12a8f0"/>
<item
dex="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\pre-dexed\release\classes-354dd0849ce9caff8f6b5b0f6428cf9e2ccbe27e.jar"
jar="C:\Users\Vlad\Documents\AndroidStudioProjects\turbo-editor\app\build\intermediates\exploded-aar\com.crashlytics.sdk.android\answers\1.0.1\classes.jar"
jumboMode="false"
revision="21.0.2"
sha1="7363bd9461c166e18592b58547720fbad8d4b0bc"/>

</pre-dex-items>
Binary file modified build/intermediates/model_data.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ void previousResult() {
return;
if (searchResult.index > 0) {
searchResult.index--;
final int line = mEditor.getLineUtils().getLineFromIndex(searchResult.foundIndex.get
final int line = LineUtils.getLineFromIndex(searchResult.foundIndex.get
(searchResult.index), mEditor.getLineCount(), mEditor.getLayout());
verticalScroll.post(new Runnable() {
@Override
Expand All @@ -551,6 +551,8 @@ public void run() {
}
});

mEditor.setFocusable(true);
mEditor.requestFocus();
mEditor.setSelection(searchResult.foundIndex.get(searchResult.index),
searchResult.foundIndex.get(searchResult.index) + searchResult.textLength);
}
Expand Down Expand Up @@ -794,7 +796,7 @@ void onEvent(final EventBusEvents.NewFileToOpen event) {

new AsyncTask<Void, Void, Void>() {

File file = event.getFile();
File file;
String message = "";
String fileText;
String encoding;
Expand All @@ -813,9 +815,12 @@ protected void onPreExecute() {

@Override
protected Void doInBackground(Void... params) {
file = event.getFile();
try {
if (!file.exists() || !file.isFile()) {
fileText = event.getFileText();
sFilePath = file.getAbsolutePath();
fileExtension = "txt";
return null;
}

Expand Down Expand Up @@ -857,6 +862,7 @@ protected Void doInBackground(Void... params) {
message = e.getMessage();
fileText = "";
}

while (mDrawerLayout.isDrawerOpen(Gravity.START)) {
try {
Thread.sleep(50);
Expand Down Expand Up @@ -1135,7 +1141,7 @@ public void onSearchDone(SearchResult searchResult) {
searchingText = true;
invalidateOptionsMenu();

final int line = mEditor.getLineUtils().getLineFromIndex(searchResult.foundIndex.getFirst
final int line = LineUtils.getLineFromIndex(searchResult.foundIndex.getFirst
(), mEditor.getLineCount(), mEditor.getLayout());
verticalScroll.post(new Runnable() {
@Override
Expand All @@ -1150,6 +1156,8 @@ public void run() {
}
});

mEditor.setFocusable(true);
mEditor.requestFocus();
mEditor.setSelection(searchResult.foundIndex.getFirst(), searchResult.foundIndex.getFirst
() + searchResult.textLength);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
this.mName = (EditText) view.findViewById(android.R.id.text1);
this.mFolder = (EditText) view.findViewById(android.R.id.text2);

this.mName.setText(".txt");
this.mFolder.setText(PreferenceHelper.getWorkingFolder(getActivity()));

// Show soft keyboard automatically
this.mName.requestFocus();
this.mName.setSelection(0);
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);

return new AlertDialog.Builder(getActivity())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package sharedcode.turboeditor.texteditor;

import android.text.Layout;
import android.text.TextUtils;
import android.widget.ScrollView;

public class LineUtils {
Expand Down Expand Up @@ -56,6 +57,9 @@ public void updateHasNewLineArray(int startingLine, int lineCount, Layout layout
toCountLinesArray = new boolean[lineCount];
realLines = new int[lineCount];

if(TextUtils.isEmpty(text))
return;

int i;

// for every line on the edittext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@ public PageSystem(Context context, PageSystemInterface pageSystemInterface, Stri
this.pageSystemInterface = pageSystemInterface;
pages = new LinkedList<>();

final boolean doWithoutPageSystem;
if(file != null)
doWithoutPageSystem = FileUtils.sizeOf(file) < MAX_KBs_WITHOUT_PAGE_SYSTEM * FileUtils.ONE_KB;
final boolean dimensionOverLimit;
if(file != null && file.exists() && file.isFile())
dimensionOverLimit = FileUtils.sizeOf(file) >= MAX_KBs_WITHOUT_PAGE_SYSTEM * FileUtils.ONE_KB;
else
doWithoutPageSystem = false;
dimensionOverLimit = false;

int i = 0;
int to;
int nextIndexOfReturn;
final int textLength = text.length();
boolean pageSystemEnabled = PreferenceHelper.getSplitText(context);

if (pageSystemEnabled && !doWithoutPageSystem) {
if (pageSystemEnabled && dimensionOverLimit) {
while (i < textLength) {
to = i + charForPage;
nextIndexOfReturn = text.indexOf("\n", to);
if (nextIndexOfReturn > to) to = nextIndexOfReturn;
//if (to > text.length()) to = text.length();
if (to > text.length()) to = text.length();
pages.add(text.substring(i, to));
i = to + 1;
}
Expand Down
1 change: 0 additions & 1 deletion libraries/sharedCode/src/main/res/raw/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<changelog bulletedList="true">

<changelogversion versionName="1.13.1" changeDate="Oct 30, 2014">
<changelogtext>Happy Halloween!</changelogtext>
<changelogtext>Manly bug fixes</changelogtext>
</changelogversion>

Expand Down
3 changes: 1 addition & 2 deletions libraries/sharedCode/src/main/res/values-af-rZA/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
Expand All @@ -17,8 +18,6 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<!--Generated by crowdin.com-->
<!--Generated by crowdin.net-->
<resources>
<string name="use_monospace">Use monospace</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
Expand All @@ -17,9 +18,6 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<!--Generated by crowdin.com-->

<resources>
<string name="close">Close</string>
<string name="about_action">About</string>
Expand All @@ -29,7 +27,7 @@
<br/>
Many thanks to all who
<a href="http://crowdin.net/project/turbo-client">helped with translations</a> or
donated to me</a>.<br/>
donated to me.<br/>
<br/>
If you want to send feedback here is the <a href="http://forum.xda-developers.com/android/apps-games/app-turbo-editor-text-editor-t2832016">XDA thread</a>
]]></string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
Expand All @@ -17,9 +18,6 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<!--Generated by crowdin.com-->

<resources>
<string name="donation_action">Donate</string>
<string name="donation_title">Donate to developer</string>
Expand Down
3 changes: 1 addition & 2 deletions libraries/sharedCode/src/main/res/values-ar-rSA/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
Expand All @@ -17,8 +18,6 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<!--Generated by crowdin.com-->
<!--Generated by crowdin.net-->
<resources>
<string name="use_monospace">استخدم مسافة موحدة</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
Expand All @@ -17,9 +18,6 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<!--Generated by crowdin.com-->

<resources>
<string name="close">Close</string>
<string name="about_action">About</string>
Expand All @@ -29,7 +27,7 @@
<br/>
Many thanks to all who
<a href="http://crowdin.net/project/turbo-client">helped with translations</a> or
donated to me</a>.<br/>
donated to me.<br/>
<br/>
If you want to send feedback here is the <a href="http://forum.xda-developers.com/android/apps-games/app-turbo-editor-text-editor-t2832016">XDA thread</a>
]]></string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
Expand All @@ -17,9 +18,6 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<!--Generated by crowdin.com-->

<resources>
<string name="donation_action">Donate</string>
<string name="donation_title">Donate to developer</string>
Expand Down
3 changes: 1 addition & 2 deletions libraries/sharedCode/src/main/res/values-az-rAZ/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
Expand All @@ -17,8 +18,6 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<!--Generated by crowdin.com-->
<!--Generated by crowdin.net-->
<resources>
<string name="use_monospace">Use monospace</string>
Expand Down
Loading

0 comments on commit b359950

Please sign in to comment.