First mac commit

This commit is contained in:
Vlad Mihalachi
2014-12-11 18:28:54 +01:00
parent b359950e34
commit 7a86540c60
147 changed files with 14630 additions and 14798 deletions

View File

@@ -1,32 +1,32 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}

View File

@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sharedcode.turboeditor" >
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sharedcode.turboeditor" >
</manifest>

View File

@@ -1,389 +1,389 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Filter;
import android.widget.ListView;
import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
import com.faizmalkani.floatingactionbutton.FloatingActionButton;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.sufficientlysecure.rootcommands.Shell;
import org.sufficientlysecure.rootcommands.Toolbox;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.concurrent.TimeoutException;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.adapter.AdapterDetailedList;
import sharedcode.turboeditor.dialogfragment.EditTextDialog;
import sharedcode.turboeditor.preferences.PreferenceHelper;
import sharedcode.turboeditor.root.RootUtils;
import sharedcode.turboeditor.util.AlphanumComparator;
import sharedcode.turboeditor.util.Build;
import sharedcode.turboeditor.util.ThemeUtils;
public class SelectFileActivity extends ActionBarActivity implements SearchView.OnQueryTextListener, AdapterView.OnItemClickListener, EditTextDialog.EditDialogListener {
private String currentFolder = PreferenceHelper.SD_CARD_ROOT;
private ListView listView;
private boolean wantAFile = true;
private MenuItem mSearchViewMenuItem;
private SearchView mSearchView;
private Filter filter;
@Override
protected void onCreate(Bundle savedInstanceState) {
ThemeUtils.setTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_file);
Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
final Actions action = (Actions) getIntent().getExtras().getSerializable("action");
wantAFile = action == Actions.SelectFile;
listView = (ListView) findViewById(android.R.id.list);
listView.setOnItemClickListener(this);
listView.setTextFilterEnabled(true);
FloatingActionButton mFab = (FloatingActionButton) findViewById(R.id.fabbutton);
mFab.setColor(getResources().getColor(R.color.fab_light));
mFab.setDrawable(getResources().getDrawable(R.drawable.ic_fab_add));
mFab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PopupMenu popup = new PopupMenu(SelectFileActivity.this, v);
popup.getMenuInflater().inflate(R.menu.popup_new_file, popup.getMenu());
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
int i = item.getItemId();
if (i == R.id.im_new_file) {
EditTextDialog.newInstance(EditTextDialog.Actions.NewFile).show(getFragmentManager().beginTransaction(), "dialog");
return true;
} else if (i == R.id.im_new_folder) {
EditTextDialog.newInstance(EditTextDialog.Actions.NewFolder).show(getFragmentManager().beginTransaction(), "dialog");
return true;
} else {
return false;
}
}
});
popup.show();
}
});
mFab.listenTo(listView);
String lastNavigatedPath = PreferenceHelper.getWorkingFolder(this);
File file = new File(lastNavigatedPath);
if (!file.exists()) {
PreferenceHelper.setWorkingFolder(this, PreferenceHelper.SD_CARD_ROOT);
file = new File(PreferenceHelper.SD_CARD_ROOT);
}
new UpdateList().execute(file.getAbsolutePath());
}
@Override
public void onBackPressed() {
if (currentFolder.isEmpty() || currentFolder.equals("/")) {
finish();
} else {
File file = new File(currentFolder);
String parentFolder = file.getParent();
new UpdateList().execute(parentFolder);
}
}
public boolean onQueryTextChange(String newText) {
if (filter == null)
return true;
if (TextUtils.isEmpty(newText)) {
filter.filter(null);
} else {
filter.filter(newText);
}
return true;
}
public boolean onQueryTextSubmit(String query) {
return false;
}
void returnData(String path) {
final Intent returnIntent = new Intent();
returnIntent.putExtra("path", path);
setResult(RESULT_OK, returnIntent);
// finish the activity
finish();
}
@Override
public void onItemClick(AdapterView<?> parent,
View view, int position, long id) {
final String name = ((TextView) view.findViewById(android.R.id.text1)).getText().toString();
if (name.equals("..")) {
if (currentFolder.equals("/")) {
new UpdateList().execute(PreferenceHelper.getWorkingFolder(this));
} else {
File tempFile = new File(currentFolder);
if (tempFile.isFile()) {
tempFile = tempFile.getParentFile()
.getParentFile();
} else {
tempFile = tempFile.getParentFile();
}
new UpdateList().execute(tempFile.getAbsolutePath());
}
return;
} else if (name.equals(getString(R.string.home))) {
new UpdateList().execute(PreferenceHelper.getWorkingFolder(this));
return;
}
final File selectedFile = new File(currentFolder, name);
if (selectedFile.isFile() && wantAFile) {
returnData(selectedFile.getAbsolutePath());
} else if (selectedFile.isDirectory()) {
new UpdateList().execute(selectedFile.getAbsolutePath());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_select_file, menu);
mSearchViewMenuItem = menu.findItem(R.id.im_search);
mSearchView = (SearchView) MenuItemCompat.getActionView(mSearchViewMenuItem);
mSearchView.setIconifiedByDefault(true);
mSearchView.setOnQueryTextListener(this);
mSearchView.setSubmitButtonEnabled(false);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// menu items
MenuItem imSetAsWorkingFolder = menu.findItem(R.id.im_set_as_working_folder);
MenuItem imIsWorkingFolder = menu.findItem(R.id.im_is_working_folder);
MenuItem imSelectFolder = menu.findItem(R.id.im_select_folder);
if (imSetAsWorkingFolder != null) {
// set the imSetAsWorkingFolder visible only if the two folder dont concide
imSetAsWorkingFolder.setVisible(!currentFolder.equals(PreferenceHelper.getWorkingFolder(SelectFileActivity.this)));
}
if (imIsWorkingFolder != null) {
// set visible is the other is invisible
imIsWorkingFolder.setVisible(!imSetAsWorkingFolder.isVisible());
}
if (imSelectFolder != null) {
imSelectFolder.setVisible(!wantAFile);
}
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int i = item.getItemId();
if (i == android.R.id.home) {
finish();
return true;
} else if (i == R.id.im_set_as_working_folder) {
PreferenceHelper.setWorkingFolder(SelectFileActivity.this, currentFolder);
invalidateOptionsMenu();
return true;
} else if (i == R.id.im_is_working_folder) {
Toast.makeText(getBaseContext(), R.string.is_the_working_folder, Toast.LENGTH_SHORT).show();
return true;
} else if (i == R.id.im_select_folder) {
returnData(currentFolder);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onFinishEditDialog(final String inputText, final String hint, final EditTextDialog.Actions actions) {
if (actions == EditTextDialog.Actions.NewFile && !TextUtils.isEmpty(inputText)) {
File file = new File(currentFolder, inputText);
returnData(file.getAbsolutePath());
} else if (actions == EditTextDialog.Actions.NewFolder && !TextUtils.isEmpty(inputText)) {
File file = new File(currentFolder, inputText);
file.mkdirs();
new UpdateList().execute(currentFolder);
}
}
public enum Actions {
SelectFile, SelectFolder
}
private class UpdateList extends AsyncTask<String, Void, LinkedList<AdapterDetailedList.FileDetail>> {
String exceptionMessage;
@Override
protected void onPreExecute() {
super.onPreExecute();
if (mSearchView != null) {
mSearchView.setIconified(true);
MenuItemCompat.collapseActionView(mSearchViewMenuItem);
mSearchView.setQuery("", false);
}
}
/**
* {@inheritDoc}
*/
@Override
protected LinkedList<AdapterDetailedList.FileDetail> doInBackground(final String... params) {
try {
final String path = params[0];
if (TextUtils.isEmpty(path)) {
return null;
}
File tempFile = new File(path);
if (tempFile.isFile()) {
tempFile = tempFile.getParentFile();
}
String[] unopenableExtensions = {"apk", "mp3", "mp4", "png", "jpg", "jpeg"};
final LinkedList<AdapterDetailedList.FileDetail> fileDetails = new LinkedList<>();
final LinkedList<AdapterDetailedList.FileDetail> folderDetails = new LinkedList<>();
final ArrayList<File> files;
currentFolder = tempFile.getAbsolutePath();
boolean isRoot = false;
if (!tempFile.canRead()) {
try {
Shell shell = null;
shell = Shell.startRootShell();
Toolbox tb = new Toolbox(shell);
isRoot = tb.isRootAccessGiven();
} catch (IOException | TimeoutException e) {
e.printStackTrace();
isRoot = false;
}
}
files = RootUtils.getFileList(currentFolder, isRoot);
Collections.sort(files, getFileNameComparator());
if (files != null) {
for (final File f : files) {
if (f.isDirectory()) {
folderDetails.add(new AdapterDetailedList.FileDetail(f.getName(),
getString(R.string.folder),
""));
} else if (f.isFile()
&& !FilenameUtils.isExtension(f.getName().toLowerCase(), unopenableExtensions)
&& FileUtils.sizeOf(f) <= Build.MAX_FILE_SIZE * FileUtils.ONE_KB) {
final long fileSize = f.length();
SimpleDateFormat format = new SimpleDateFormat("MMM dd, yyyy hh:mm a");
String date = format.format(f.lastModified());
fileDetails.add(new AdapterDetailedList.FileDetail(f.getName(),
FileUtils.byteCountToDisplaySize(fileSize), date));
}
}
}
folderDetails.addAll(fileDetails);
return folderDetails;
} catch (Exception e) {
exceptionMessage = e.getMessage();
return null;
}
}
/**
* {@inheritDoc}
*/
@Override
protected void onPostExecute(final LinkedList<AdapterDetailedList.FileDetail> names) {
if (names != null) {
boolean isRoot = currentFolder.equals("/");
AdapterDetailedList mAdapter = new AdapterDetailedList(getBaseContext(), names, isRoot);
listView.setAdapter(mAdapter);
filter = mAdapter.getFilter();
}
if (exceptionMessage != null) {
Toast.makeText(SelectFileActivity.this, exceptionMessage, Toast.LENGTH_SHORT).show();
}
invalidateOptionsMenu();
super.onPostExecute(names);
}
public final Comparator<File> getFileNameComparator() {
return new AlphanumComparator() {
/**
* {@inheritDoc}
*/
@Override
public String getTheString(Object obj) {
return ((File) obj).getName()
.toLowerCase();
}
};
}
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Filter;
import android.widget.ListView;
import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
import com.faizmalkani.floatingactionbutton.FloatingActionButton;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.sufficientlysecure.rootcommands.Shell;
import org.sufficientlysecure.rootcommands.Toolbox;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.concurrent.TimeoutException;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.adapter.AdapterDetailedList;
import sharedcode.turboeditor.dialogfragment.EditTextDialog;
import sharedcode.turboeditor.preferences.PreferenceHelper;
import sharedcode.turboeditor.root.RootUtils;
import sharedcode.turboeditor.util.AlphanumComparator;
import sharedcode.turboeditor.util.Build;
import sharedcode.turboeditor.util.ThemeUtils;
public class SelectFileActivity extends ActionBarActivity implements SearchView.OnQueryTextListener, AdapterView.OnItemClickListener, EditTextDialog.EditDialogListener {
private String currentFolder = PreferenceHelper.SD_CARD_ROOT;
private ListView listView;
private boolean wantAFile = true;
private MenuItem mSearchViewMenuItem;
private SearchView mSearchView;
private Filter filter;
@Override
protected void onCreate(Bundle savedInstanceState) {
ThemeUtils.setTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_file);
Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
final Actions action = (Actions) getIntent().getExtras().getSerializable("action");
wantAFile = action == Actions.SelectFile;
listView = (ListView) findViewById(android.R.id.list);
listView.setOnItemClickListener(this);
listView.setTextFilterEnabled(true);
FloatingActionButton mFab = (FloatingActionButton) findViewById(R.id.fabbutton);
mFab.setColor(getResources().getColor(R.color.fab_light));
mFab.setDrawable(getResources().getDrawable(R.drawable.ic_fab_add));
mFab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PopupMenu popup = new PopupMenu(SelectFileActivity.this, v);
popup.getMenuInflater().inflate(R.menu.popup_new_file, popup.getMenu());
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
int i = item.getItemId();
if (i == R.id.im_new_file) {
EditTextDialog.newInstance(EditTextDialog.Actions.NewFile).show(getFragmentManager().beginTransaction(), "dialog");
return true;
} else if (i == R.id.im_new_folder) {
EditTextDialog.newInstance(EditTextDialog.Actions.NewFolder).show(getFragmentManager().beginTransaction(), "dialog");
return true;
} else {
return false;
}
}
});
popup.show();
}
});
mFab.listenTo(listView);
String lastNavigatedPath = PreferenceHelper.getWorkingFolder(this);
File file = new File(lastNavigatedPath);
if (!file.exists()) {
PreferenceHelper.setWorkingFolder(this, PreferenceHelper.SD_CARD_ROOT);
file = new File(PreferenceHelper.SD_CARD_ROOT);
}
new UpdateList().execute(file.getAbsolutePath());
}
@Override
public void onBackPressed() {
if (currentFolder.isEmpty() || currentFolder.equals("/")) {
finish();
} else {
File file = new File(currentFolder);
String parentFolder = file.getParent();
new UpdateList().execute(parentFolder);
}
}
public boolean onQueryTextChange(String newText) {
if (filter == null)
return true;
if (TextUtils.isEmpty(newText)) {
filter.filter(null);
} else {
filter.filter(newText);
}
return true;
}
public boolean onQueryTextSubmit(String query) {
return false;
}
void returnData(String path) {
final Intent returnIntent = new Intent();
returnIntent.putExtra("path", path);
setResult(RESULT_OK, returnIntent);
// finish the activity
finish();
}
@Override
public void onItemClick(AdapterView<?> parent,
View view, int position, long id) {
final String name = ((TextView) view.findViewById(android.R.id.text1)).getText().toString();
if (name.equals("..")) {
if (currentFolder.equals("/")) {
new UpdateList().execute(PreferenceHelper.getWorkingFolder(this));
} else {
File tempFile = new File(currentFolder);
if (tempFile.isFile()) {
tempFile = tempFile.getParentFile()
.getParentFile();
} else {
tempFile = tempFile.getParentFile();
}
new UpdateList().execute(tempFile.getAbsolutePath());
}
return;
} else if (name.equals(getString(R.string.home))) {
new UpdateList().execute(PreferenceHelper.getWorkingFolder(this));
return;
}
final File selectedFile = new File(currentFolder, name);
if (selectedFile.isFile() && wantAFile) {
returnData(selectedFile.getAbsolutePath());
} else if (selectedFile.isDirectory()) {
new UpdateList().execute(selectedFile.getAbsolutePath());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_select_file, menu);
mSearchViewMenuItem = menu.findItem(R.id.im_search);
mSearchView = (SearchView) MenuItemCompat.getActionView(mSearchViewMenuItem);
mSearchView.setIconifiedByDefault(true);
mSearchView.setOnQueryTextListener(this);
mSearchView.setSubmitButtonEnabled(false);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// menu items
MenuItem imSetAsWorkingFolder = menu.findItem(R.id.im_set_as_working_folder);
MenuItem imIsWorkingFolder = menu.findItem(R.id.im_is_working_folder);
MenuItem imSelectFolder = menu.findItem(R.id.im_select_folder);
if (imSetAsWorkingFolder != null) {
// set the imSetAsWorkingFolder visible only if the two folder dont concide
imSetAsWorkingFolder.setVisible(!currentFolder.equals(PreferenceHelper.getWorkingFolder(SelectFileActivity.this)));
}
if (imIsWorkingFolder != null) {
// set visible is the other is invisible
imIsWorkingFolder.setVisible(!imSetAsWorkingFolder.isVisible());
}
if (imSelectFolder != null) {
imSelectFolder.setVisible(!wantAFile);
}
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int i = item.getItemId();
if (i == android.R.id.home) {
finish();
return true;
} else if (i == R.id.im_set_as_working_folder) {
PreferenceHelper.setWorkingFolder(SelectFileActivity.this, currentFolder);
invalidateOptionsMenu();
return true;
} else if (i == R.id.im_is_working_folder) {
Toast.makeText(getBaseContext(), R.string.is_the_working_folder, Toast.LENGTH_SHORT).show();
return true;
} else if (i == R.id.im_select_folder) {
returnData(currentFolder);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onFinishEditDialog(final String inputText, final String hint, final EditTextDialog.Actions actions) {
if (actions == EditTextDialog.Actions.NewFile && !TextUtils.isEmpty(inputText)) {
File file = new File(currentFolder, inputText);
returnData(file.getAbsolutePath());
} else if (actions == EditTextDialog.Actions.NewFolder && !TextUtils.isEmpty(inputText)) {
File file = new File(currentFolder, inputText);
file.mkdirs();
new UpdateList().execute(currentFolder);
}
}
public enum Actions {
SelectFile, SelectFolder
}
private class UpdateList extends AsyncTask<String, Void, LinkedList<AdapterDetailedList.FileDetail>> {
String exceptionMessage;
@Override
protected void onPreExecute() {
super.onPreExecute();
if (mSearchView != null) {
mSearchView.setIconified(true);
MenuItemCompat.collapseActionView(mSearchViewMenuItem);
mSearchView.setQuery("", false);
}
}
/**
* {@inheritDoc}
*/
@Override
protected LinkedList<AdapterDetailedList.FileDetail> doInBackground(final String... params) {
try {
final String path = params[0];
if (TextUtils.isEmpty(path)) {
return null;
}
File tempFile = new File(path);
if (tempFile.isFile()) {
tempFile = tempFile.getParentFile();
}
String[] unopenableExtensions = {"apk", "mp3", "mp4", "png", "jpg", "jpeg"};
final LinkedList<AdapterDetailedList.FileDetail> fileDetails = new LinkedList<>();
final LinkedList<AdapterDetailedList.FileDetail> folderDetails = new LinkedList<>();
final ArrayList<File> files;
currentFolder = tempFile.getAbsolutePath();
boolean isRoot = false;
if (!tempFile.canRead()) {
try {
Shell shell = null;
shell = Shell.startRootShell();
Toolbox tb = new Toolbox(shell);
isRoot = tb.isRootAccessGiven();
} catch (IOException | TimeoutException e) {
e.printStackTrace();
isRoot = false;
}
}
files = RootUtils.getFileList(currentFolder, isRoot);
Collections.sort(files, getFileNameComparator());
if (files != null) {
for (final File f : files) {
if (f.isDirectory()) {
folderDetails.add(new AdapterDetailedList.FileDetail(f.getName(),
getString(R.string.folder),
""));
} else if (f.isFile()
&& !FilenameUtils.isExtension(f.getName().toLowerCase(), unopenableExtensions)
&& FileUtils.sizeOf(f) <= Build.MAX_FILE_SIZE * FileUtils.ONE_KB) {
final long fileSize = f.length();
SimpleDateFormat format = new SimpleDateFormat("MMM dd, yyyy hh:mm a");
String date = format.format(f.lastModified());
fileDetails.add(new AdapterDetailedList.FileDetail(f.getName(),
FileUtils.byteCountToDisplaySize(fileSize), date));
}
}
}
folderDetails.addAll(fileDetails);
return folderDetails;
} catch (Exception e) {
exceptionMessage = e.getMessage();
return null;
}
}
/**
* {@inheritDoc}
*/
@Override
protected void onPostExecute(final LinkedList<AdapterDetailedList.FileDetail> names) {
if (names != null) {
boolean isRoot = currentFolder.equals("/");
AdapterDetailedList mAdapter = new AdapterDetailedList(getBaseContext(), names, isRoot);
listView.setAdapter(mAdapter);
filter = mAdapter.getFilter();
}
if (exceptionMessage != null) {
Toast.makeText(SelectFileActivity.this, exceptionMessage, Toast.LENGTH_SHORT).show();
}
invalidateOptionsMenu();
super.onPostExecute(names);
}
public final Comparator<File> getFileNameComparator() {
return new AlphanumComparator() {
/**
* {@inheritDoc}
*/
@Override
public String getTheString(Object obj) {
return ((File) obj).getName()
.toLowerCase();
}
};
}
}
}

View File

@@ -1,204 +1,204 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Filter;
import android.widget.ImageView;
import android.widget.TextView;
import org.apache.commons.io.FilenameUtils;
import java.util.Arrays;
import java.util.LinkedList;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.util.MimeTypes;
public class AdapterDetailedList extends
ArrayAdapter<AdapterDetailedList.FileDetail> {
// Layout Inflater
private final LayoutInflater inflater;
private final LinkedList<FileDetail> orig;
private CustomFilter customFilter;
// List of file details
private LinkedList<FileDetail> fileDetails;
public AdapterDetailedList(final Context context,
final LinkedList<FileDetail> fileDetails,
final boolean isRoot) {
super(context, R.layout.item_file_list, fileDetails);
this.fileDetails = fileDetails;
this.orig = fileDetails;
this.inflater = LayoutInflater.from(context);
if (!isRoot) {
this.fileDetails.addFirst(new FileDetail("..", context.getString(R.string.folder), ""));
} else {
this.fileDetails.addFirst(new FileDetail(context.getString(R.string.home), context.getString(R.string.folder), ""));
}
}
@Override
public View getView(final int position,
View convertView, final ViewGroup parent) {
if (convertView == null) {
convertView = this.inflater
.inflate(R.layout.item_file_list,
null);
final ViewHolder hold = new ViewHolder();
hold.nameLabel = (TextView) convertView.findViewById(android.R.id.text1);
hold.detailLabel = (TextView) convertView.findViewById(android.R.id.text2);
hold.icon = (ImageView) convertView.findViewById(android.R.id.icon);
convertView.setTag(hold);
final FileDetail fileDetail = fileDetails.get(position);
final String fileName = fileDetail.getName();
setIcon(hold, fileDetail);
hold.nameLabel.setText(fileName);
hold.detailLabel.setText(fileDetail.getSize() + "\t\t" + fileDetail.getDateModified());
} else {
final ViewHolder hold = ((ViewHolder) convertView.getTag());
final FileDetail fileDetail = fileDetails.get(position);
final String fileName = fileDetail.getName();
setIcon(hold, fileDetail);
hold.nameLabel.setText(fileName);
hold.detailLabel.setText(fileDetail.getSize() + "\t\t" + fileDetail.getDateModified());
}
return convertView;
}
@Override
public int getCount() {
return fileDetails.size();
}
private void setIcon(final ViewHolder viewHolder, final FileDetail fileDetail) {
final String fileName = fileDetail.getName();
final String ext = FilenameUtils.getExtension(fileName);
if (fileDetail.isFolder()) {
viewHolder.icon.setImageResource(R.color.file_folder);
} else if (Arrays.asList(MimeTypes.MIME_HTML).contains(ext) || ext.endsWith("html")) {
viewHolder.icon.setImageResource(R.color.file_html);
} else if (Arrays.asList(MimeTypes.MIME_CODE).contains(ext)
|| fileName.endsWith("css")
|| fileName.endsWith("js")) {
viewHolder.icon.setImageResource(R.color.file_code);
} else if (Arrays.asList(MimeTypes.MIME_ARCHIVE).contains(ext)) {
viewHolder.icon.setImageResource(R.color.file_archive);
} else if (Arrays.asList(MimeTypes.MIME_MUSIC)
.contains(ext)) {
viewHolder.icon.setImageResource(R.color.file_media_music);
} else if (Arrays.asList(MimeTypes.MIME_PICTURE).contains(ext)) {
viewHolder.icon.setImageResource(R.color.file_media_picture);
} else if (Arrays.asList(MimeTypes.MIME_VIDEO).contains(ext)) {
viewHolder.icon.setImageResource(R.color.file_media_video);
} else {
viewHolder.icon.setImageResource(R.color.file_text);
}
}
@Override
public Filter getFilter() {
if (customFilter == null) {
customFilter = new CustomFilter();
}
return customFilter;
}
public static class ViewHolder {
// Name of the file
public TextView nameLabel;
// Size of the file
public TextView detailLabel;
// Icon of the file
public ImageView icon;
}
public static class FileDetail {
private final String name;
private final String size;
private final String dateModified;
private final boolean isFolder;
public FileDetail(String name, String size,
String dateModified) {
this.name = name;
this.size = size;
this.dateModified = dateModified;
isFolder = TextUtils.isEmpty(dateModified);
}
public String getDateModified() {
return dateModified;
}
public String getSize() {
return size;
}
public String getName() {
return name;
}
public boolean isFolder() {
return isFolder;
}
}
private class CustomFilter extends Filter {
@Override
protected FilterResults performFiltering(CharSequence constraint) {
FilterResults results = new FilterResults();
if (constraint == null || constraint.length() == 0) {
results.values = orig;
results.count = orig.size();
} else {
LinkedList<FileDetail> nHolderList = new LinkedList<>();
for (FileDetail h : orig) {
if (h.getName().toLowerCase().contains(constraint.toString().toLowerCase()))
nHolderList.add(h);
}
results.values = nHolderList;
results.count = nHolderList.size();
}
return results;
}
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint,
FilterResults results) {
fileDetails = (LinkedList<FileDetail>) results.values;
notifyDataSetChanged();
}
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Filter;
import android.widget.ImageView;
import android.widget.TextView;
import org.apache.commons.io.FilenameUtils;
import java.util.Arrays;
import java.util.LinkedList;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.util.MimeTypes;
public class AdapterDetailedList extends
ArrayAdapter<AdapterDetailedList.FileDetail> {
// Layout Inflater
private final LayoutInflater inflater;
private final LinkedList<FileDetail> orig;
private CustomFilter customFilter;
// List of file details
private LinkedList<FileDetail> fileDetails;
public AdapterDetailedList(final Context context,
final LinkedList<FileDetail> fileDetails,
final boolean isRoot) {
super(context, R.layout.item_file_list, fileDetails);
this.fileDetails = fileDetails;
this.orig = fileDetails;
this.inflater = LayoutInflater.from(context);
if (!isRoot) {
this.fileDetails.addFirst(new FileDetail("..", context.getString(R.string.folder), ""));
} else {
this.fileDetails.addFirst(new FileDetail(context.getString(R.string.home), context.getString(R.string.folder), ""));
}
}
@Override
public View getView(final int position,
View convertView, final ViewGroup parent) {
if (convertView == null) {
convertView = this.inflater
.inflate(R.layout.item_file_list,
null);
final ViewHolder hold = new ViewHolder();
hold.nameLabel = (TextView) convertView.findViewById(android.R.id.text1);
hold.detailLabel = (TextView) convertView.findViewById(android.R.id.text2);
hold.icon = (ImageView) convertView.findViewById(android.R.id.icon);
convertView.setTag(hold);
final FileDetail fileDetail = fileDetails.get(position);
final String fileName = fileDetail.getName();
setIcon(hold, fileDetail);
hold.nameLabel.setText(fileName);
hold.detailLabel.setText(fileDetail.getSize() + "\t\t" + fileDetail.getDateModified());
} else {
final ViewHolder hold = ((ViewHolder) convertView.getTag());
final FileDetail fileDetail = fileDetails.get(position);
final String fileName = fileDetail.getName();
setIcon(hold, fileDetail);
hold.nameLabel.setText(fileName);
hold.detailLabel.setText(fileDetail.getSize() + "\t\t" + fileDetail.getDateModified());
}
return convertView;
}
@Override
public int getCount() {
return fileDetails.size();
}
private void setIcon(final ViewHolder viewHolder, final FileDetail fileDetail) {
final String fileName = fileDetail.getName();
final String ext = FilenameUtils.getExtension(fileName);
if (fileDetail.isFolder()) {
viewHolder.icon.setImageResource(R.color.file_folder);
} else if (Arrays.asList(MimeTypes.MIME_HTML).contains(ext) || ext.endsWith("html")) {
viewHolder.icon.setImageResource(R.color.file_html);
} else if (Arrays.asList(MimeTypes.MIME_CODE).contains(ext)
|| fileName.endsWith("css")
|| fileName.endsWith("js")) {
viewHolder.icon.setImageResource(R.color.file_code);
} else if (Arrays.asList(MimeTypes.MIME_ARCHIVE).contains(ext)) {
viewHolder.icon.setImageResource(R.color.file_archive);
} else if (Arrays.asList(MimeTypes.MIME_MUSIC)
.contains(ext)) {
viewHolder.icon.setImageResource(R.color.file_media_music);
} else if (Arrays.asList(MimeTypes.MIME_PICTURE).contains(ext)) {
viewHolder.icon.setImageResource(R.color.file_media_picture);
} else if (Arrays.asList(MimeTypes.MIME_VIDEO).contains(ext)) {
viewHolder.icon.setImageResource(R.color.file_media_video);
} else {
viewHolder.icon.setImageResource(R.color.file_text);
}
}
@Override
public Filter getFilter() {
if (customFilter == null) {
customFilter = new CustomFilter();
}
return customFilter;
}
public static class ViewHolder {
// Name of the file
public TextView nameLabel;
// Size of the file
public TextView detailLabel;
// Icon of the file
public ImageView icon;
}
public static class FileDetail {
private final String name;
private final String size;
private final String dateModified;
private final boolean isFolder;
public FileDetail(String name, String size,
String dateModified) {
this.name = name;
this.size = size;
this.dateModified = dateModified;
isFolder = TextUtils.isEmpty(dateModified);
}
public String getDateModified() {
return dateModified;
}
public String getSize() {
return size;
}
public String getName() {
return name;
}
public boolean isFolder() {
return isFolder;
}
}
private class CustomFilter extends Filter {
@Override
protected FilterResults performFiltering(CharSequence constraint) {
FilterResults results = new FilterResults();
if (constraint == null || constraint.length() == 0) {
results.values = orig;
results.count = orig.size();
} else {
LinkedList<FileDetail> nHolderList = new LinkedList<>();
for (FileDetail h : orig) {
if (h.getName().toLowerCase().contains(constraint.toString().toLowerCase()))
nHolderList.add(h);
}
results.values = nHolderList;
results.count = nHolderList.size();
}
return results;
}
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint,
FilterResults results) {
fileDetails = (LinkedList<FileDetail>) results.values;
notifyDataSetChanged();
}
}
}

View File

@@ -1,130 +1,130 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.adapter;
import android.content.Context;
import android.graphics.Typeface;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.io.File;
import java.util.List;
import sharedcode.turboeditor.R;
public class AdapterDrawer extends
ArrayAdapter<File> {
private final Callbacks callbacks;
// Layout Inflater
private final LayoutInflater inflater;
// List of file details
private final List<File> files;
private String selectedPath = "";
public AdapterDrawer(Context context,
List<File> files,
Callbacks callbacks) {
super(context, R.layout.item_file_list, files);
this.files = files;
this.inflater = LayoutInflater.from(context);
this.callbacks = callbacks;
}
@Override
public View getView(final int position,
View convertView, final ViewGroup parent) {
if (convertView == null) {
convertView = this.inflater
.inflate(R.layout.item_drawer_list,
parent, false);
final ViewHolder hold = new ViewHolder();
hold.nameLabel = (TextView) convertView.findViewById(android.R.id.text1);
hold.cancelButton = (ImageView) convertView.findViewById(R.id.button_remove_from_list);
convertView.setTag(hold);
final String fileName = files.get(position).getName();
hold.nameLabel.setText(fileName);
hold.cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean closeOpenedFile = TextUtils.equals(selectedPath, files.get(position).getAbsolutePath());
callbacks.CancelItem(position, closeOpenedFile);
if (closeOpenedFile)
selectedPath = "";
}
});
if (TextUtils.equals(selectedPath, files.get(position).getAbsolutePath())) {
hold.nameLabel.setTypeface(null, Typeface.BOLD);
} else {
hold.nameLabel.setTypeface(null, Typeface.NORMAL);
}
} else {
final ViewHolder hold = ((ViewHolder) convertView.getTag());
final String fileName = files.get(position).getName();
hold.nameLabel.setText(fileName);
hold.cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean closeOpenedFile = TextUtils.equals(selectedPath, files.get(position).getAbsolutePath());
callbacks.CancelItem(position, closeOpenedFile);
if (closeOpenedFile)
selectedPath = "";
}
});
if (TextUtils.equals(selectedPath, files.get(position).getAbsolutePath())) {
hold.nameLabel.setTypeface(null, Typeface.BOLD);
} else {
hold.nameLabel.setTypeface(null, Typeface.NORMAL);
}
}
return convertView;
}
public void selectView(String selectedPath) {
//callbacks.ItemSelected(selectedPath);
this.selectedPath = selectedPath;
notifyDataSetChanged();
}
public interface Callbacks {
void CancelItem(int position, boolean andCloseOpenedFile);
//void ItemSelected(String path);
}
public static class ViewHolder {
// Name of the file
public TextView nameLabel;
public ImageView cancelButton;
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.adapter;
import android.content.Context;
import android.graphics.Typeface;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.io.File;
import java.util.List;
import sharedcode.turboeditor.R;
public class AdapterDrawer extends
ArrayAdapter<File> {
private final Callbacks callbacks;
// Layout Inflater
private final LayoutInflater inflater;
// List of file details
private final List<File> files;
private String selectedPath = "";
public AdapterDrawer(Context context,
List<File> files,
Callbacks callbacks) {
super(context, R.layout.item_file_list, files);
this.files = files;
this.inflater = LayoutInflater.from(context);
this.callbacks = callbacks;
}
@Override
public View getView(final int position,
View convertView, final ViewGroup parent) {
if (convertView == null) {
convertView = this.inflater
.inflate(R.layout.item_drawer_list,
parent, false);
final ViewHolder hold = new ViewHolder();
hold.nameLabel = (TextView) convertView.findViewById(android.R.id.text1);
hold.cancelButton = (ImageView) convertView.findViewById(R.id.button_remove_from_list);
convertView.setTag(hold);
final String fileName = files.get(position).getName();
hold.nameLabel.setText(fileName);
hold.cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean closeOpenedFile = TextUtils.equals(selectedPath, files.get(position).getAbsolutePath());
callbacks.CancelItem(position, closeOpenedFile);
if (closeOpenedFile)
selectedPath = "";
}
});
if (TextUtils.equals(selectedPath, files.get(position).getAbsolutePath())) {
hold.nameLabel.setTypeface(null, Typeface.BOLD);
} else {
hold.nameLabel.setTypeface(null, Typeface.NORMAL);
}
} else {
final ViewHolder hold = ((ViewHolder) convertView.getTag());
final String fileName = files.get(position).getName();
hold.nameLabel.setText(fileName);
hold.cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean closeOpenedFile = TextUtils.equals(selectedPath, files.get(position).getAbsolutePath());
callbacks.CancelItem(position, closeOpenedFile);
if (closeOpenedFile)
selectedPath = "";
}
});
if (TextUtils.equals(selectedPath, files.get(position).getAbsolutePath())) {
hold.nameLabel.setTypeface(null, Typeface.BOLD);
} else {
hold.nameLabel.setTypeface(null, Typeface.NORMAL);
}
}
return convertView;
}
public void selectView(String selectedPath) {
//callbacks.ItemSelected(selectedPath);
this.selectedPath = selectedPath;
notifyDataSetChanged();
}
public interface Callbacks {
void CancelItem(int position, boolean andCloseOpenedFile);
//void ItemSelected(String path);
}
public static class ViewHolder {
// Name of the file
public TextView nameLabel;
public ImageView cancelButton;
}
}

View File

@@ -1,75 +1,75 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import sharedcode.turboeditor.R;
public class AdapterTwoItem extends
ArrayAdapter<String> {
private final LayoutInflater inflater;
private final String[] lines1;
private final String[] lines2;
public AdapterTwoItem(Context context,
String[] lines1,
String[] lines2) {
super(context, R.layout.item_two_lines, lines1);
this.lines1 = lines1;
this.lines2 = lines2;
this.inflater = LayoutInflater.from(context);
}
@Override
public View getView(final int position,
View convertView, final ViewGroup parent) {
if (convertView == null) {
convertView = this.inflater
.inflate(R.layout.item_two_lines,
parent, false);
final ViewHolder hold = new ViewHolder();
hold.line1 = (TextView) convertView.findViewById(android.R.id.text1);
hold.line2 = (TextView) convertView.findViewById(android.R.id.text2);
convertView.setTag(hold);
hold.line1.setText(lines1[position]);
hold.line2.setText(lines2[position]);
} else {
final ViewHolder hold = ((ViewHolder) convertView.getTag());
hold.line1.setText(lines1[position]);
hold.line2.setText(lines2[position]);
}
return convertView;
}
public static class ViewHolder {
public TextView line1;
public TextView line2;
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import sharedcode.turboeditor.R;
public class AdapterTwoItem extends
ArrayAdapter<String> {
private final LayoutInflater inflater;
private final String[] lines1;
private final String[] lines2;
public AdapterTwoItem(Context context,
String[] lines1,
String[] lines2) {
super(context, R.layout.item_two_lines, lines1);
this.lines1 = lines1;
this.lines2 = lines2;
this.inflater = LayoutInflater.from(context);
}
@Override
public View getView(final int position,
View convertView, final ViewGroup parent) {
if (convertView == null) {
convertView = this.inflater
.inflate(R.layout.item_two_lines,
parent, false);
final ViewHolder hold = new ViewHolder();
hold.line1 = (TextView) convertView.findViewById(android.R.id.text1);
hold.line2 = (TextView) convertView.findViewById(android.R.id.text2);
convertView.setTag(hold);
hold.line1.setText(lines1[position]);
hold.line2.setText(lines2[position]);
} else {
final ViewHolder hold = ((ViewHolder) convertView.getTag());
hold.line1.setText(lines1[position]);
hold.line2.setText(lines2[position]);
}
return convertView;
}
public static class ViewHolder {
public TextView line1;
public TextView line2;
}
}

View File

@@ -1,44 +1,44 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.application;
import android.app.Application;
import android.view.ViewConfiguration;
import java.lang.reflect.Field;
public class MyApp extends Application {
@Override
public void onCreate() {
super.onCreate();
// force to sow the overflow menu icon
try {
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
if (menuKeyField != null) {
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
}
} catch (Exception ex) {
// Ignore
}
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.application;
import android.app.Application;
import android.view.ViewConfiguration;
import java.lang.reflect.Field;
public class MyApp extends Application {
@Override
public void onCreate() {
super.onCreate();
// force to sow the overflow menu icon
try {
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
if (menuKeyField != null) {
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
}
} catch (Exception ex) {
// Ignore
}
}
}

View File

@@ -1,91 +1,91 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import it.gmariotti.changelibs.library.view.ChangeLogListView;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.util.Build;
public class ChangelogDialog extends DialogFragment {
public static void showChangeLogDialog(FragmentManager fragmentManager) {
ChangelogDialog changelogDialog = new ChangelogDialog();
FragmentTransaction ft = fragmentManager.beginTransaction();
Fragment prev = fragmentManager.findFragmentByTag("changelogdemo_dialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
changelogDialog.show(ft, "changelogdemo_dialog");
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ChangeLogListView chgList = (ChangeLogListView) layoutInflater.inflate(R.layout.demo_changelog_fragment_dialogstandard, null);
return new AlertDialog.Builder(getActivity())
.setTitle(R.string.changelog)
.setView(chgList)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
}
)
.setPositiveButton(R.string.vota, new DialogInterface.OnClickListener() {
/**
* {@inheritDoc}
*/
@Override
public void onClick(final DialogInterface dialog, final int which) {
try {
if (Build.FOR_AMAZON) {
String url = "amzn://apps/android?p=com.maskyn.fileeditor";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} else {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.maskyn.fileeditor"))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
} catch (Exception e) {
}
}
})
.create();
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import it.gmariotti.changelibs.library.view.ChangeLogListView;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.util.Build;
public class ChangelogDialog extends DialogFragment {
public static void showChangeLogDialog(FragmentManager fragmentManager) {
ChangelogDialog changelogDialog = new ChangelogDialog();
FragmentTransaction ft = fragmentManager.beginTransaction();
Fragment prev = fragmentManager.findFragmentByTag("changelogdemo_dialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
changelogDialog.show(ft, "changelogdemo_dialog");
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ChangeLogListView chgList = (ChangeLogListView) layoutInflater.inflate(R.layout.demo_changelog_fragment_dialogstandard, null);
return new AlertDialog.Builder(getActivity())
.setTitle(R.string.changelog)
.setView(chgList)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
}
)
.setPositiveButton(R.string.vota, new DialogInterface.OnClickListener() {
/**
* {@inheritDoc}
*/
@Override
public void onClick(final DialogInterface dialog, final int which) {
try {
if (Build.FOR_AMAZON) {
String url = "amzn://apps/android?p=com.maskyn.fileeditor";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} else {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.maskyn.fileeditor"))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
} catch (Exception e) {
}
}
})
.create();
}
}

View File

@@ -1,132 +1,132 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class EditTextDialog extends DialogFragment implements TextView.OnEditorActionListener {
private EditText mEditText;
public static EditTextDialog newInstance(final Actions action) {
return EditTextDialog.newInstance(action, "");
}
public static EditTextDialog newInstance(final Actions action, final String hint) {
final EditTextDialog f = new EditTextDialog();
final Bundle args = new Bundle();
args.putSerializable("action", action);
args.putString("hint", hint);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Actions action = (Actions) getArguments().getSerializable("action");
final String title;
switch (action) {
case NewFile:
title = getString(R.string.file);
break;
case NewFolder:
title = getString(R.string.folder);
break;
default:
title = null;
break;
}
View view = new DialogHelper.Builder(getActivity())
.setTitle(title)
.setView(R.layout.dialog_fragment_edittext)
.createSkeletonView();
this.mEditText = (EditText) view.findViewById(android.R.id.edit);
this.mEditText.setHint(R.string.name);
// Show soft keyboard automatically
this.mEditText.setText(getArguments().getString("hint"));
this.mEditText.requestFocus();
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
this.mEditText.setOnEditorActionListener(this);
return new AlertDialog.Builder(getActivity())
.setView(view)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
returnData();
}
}
)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.create();
}
void returnData() {
EditDialogListener target = (EditDialogListener) getTargetFragment();
if (target == null) {
target = (EditDialogListener) getActivity();
}
target.onFinishEditDialog(this.mEditText.getText().toString(), getArguments().getString("hint"),
(Actions) getArguments().getSerializable("action"));
this.dismiss();
}
@Override
public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
if (EditorInfo.IME_ACTION_DONE == actionId) {
returnData();
return true;
}
return false;
}
public enum Actions {
NewFile, NewFolder
}
public interface EditDialogListener {
void onFinishEditDialog(String result, String hint, Actions action);
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class EditTextDialog extends DialogFragment implements TextView.OnEditorActionListener {
private EditText mEditText;
public static EditTextDialog newInstance(final Actions action) {
return EditTextDialog.newInstance(action, "");
}
public static EditTextDialog newInstance(final Actions action, final String hint) {
final EditTextDialog f = new EditTextDialog();
final Bundle args = new Bundle();
args.putSerializable("action", action);
args.putString("hint", hint);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Actions action = (Actions) getArguments().getSerializable("action");
final String title;
switch (action) {
case NewFile:
title = getString(R.string.file);
break;
case NewFolder:
title = getString(R.string.folder);
break;
default:
title = null;
break;
}
View view = new DialogHelper.Builder(getActivity())
.setTitle(title)
.setView(R.layout.dialog_fragment_edittext)
.createSkeletonView();
this.mEditText = (EditText) view.findViewById(android.R.id.edit);
this.mEditText.setHint(R.string.name);
// Show soft keyboard automatically
this.mEditText.setText(getArguments().getString("hint"));
this.mEditText.requestFocus();
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
this.mEditText.setOnEditorActionListener(this);
return new AlertDialog.Builder(getActivity())
.setView(view)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
returnData();
}
}
)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.create();
}
void returnData() {
EditDialogListener target = (EditDialogListener) getTargetFragment();
if (target == null) {
target = (EditDialogListener) getActivity();
}
target.onFinishEditDialog(this.mEditText.getText().toString(), getArguments().getString("hint"),
(Actions) getArguments().getSerializable("action"));
this.dismiss();
}
@Override
public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
if (EditorInfo.IME_ACTION_DONE == actionId) {
returnData();
return true;
}
return false;
}
public enum Actions {
NewFile, NewFolder
}
public interface EditDialogListener {
void onFinishEditDialog(String result, String hint, Actions action);
}
}

View File

@@ -1,120 +1,120 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.support.v7.widget.SwitchCompat;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.ListView;
import org.mozilla.universalchardet.Constants;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.preferences.PreferenceHelper;
public class EncodingDialog extends DialogFragment implements AdapterView.OnItemClickListener {
private final String[] encodings = new String[]{
Constants.CHARSET_BIG5,
Constants.CHARSET_EUC_JP,
Constants.CHARSET_EUC_KR,
Constants.CHARSET_EUC_TW,
Constants.CHARSET_GB18030,
"GB2312",
Constants.CHARSET_IBM855,
Constants.CHARSET_IBM866,
Constants.CHARSET_ISO_2022_CN,
Constants.CHARSET_ISO_2022_JP,
Constants.CHARSET_ISO_2022_KR,
Constants.CHARSET_ISO_8859_5,
Constants.CHARSET_ISO_8859_7,
Constants.CHARSET_ISO_8859_8,
Constants.CHARSET_KOI8_R,
Constants.CHARSET_MACCYRILLIC,
Constants.CHARSET_SHIFT_JIS,
Constants.CHARSET_UTF_16BE,
Constants.CHARSET_UTF_16LE,
Constants.CHARSET_UTF_32BE,
Constants.CHARSET_UTF_32LE,
Constants.CHARSET_UTF_8,
Constants.CHARSET_WINDOWS_1251,
Constants.CHARSET_WINDOWS_1252,
Constants.CHARSET_WINDOWS_1253,
Constants.CHARSET_WINDOWS_1255
};
private ListView list;
public static EncodingDialog newInstance() {
final EncodingDialog f = new EncodingDialog();
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_encoding_list, null);
list = (ListView) view.findViewById(android.R.id.list);
SwitchCompat autoencoding = (SwitchCompat) view.findViewById(android.R.id.checkbox);
autoencoding.setChecked(PreferenceHelper.getAutoEncoding(getActivity()));
autoencoding.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setAutoencoding(getActivity(), isChecked);
}
});
list.setAdapter(new ArrayAdapter<>(getActivity(), R.layout.item_single_choice, encodings));
list.setOnItemClickListener(this);
String currentEncoding = PreferenceHelper.getEncoding(getActivity());
for (int i = 0; i < encodings.length; i++) {
if (currentEncoding.equals(encodings[i])) {
list.setItemChecked(i, true);
}
}
return new AlertDialog.Builder(getActivity())
.setView(view)
.create();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
DialogListener target = (DialogListener) getTargetFragment();
if (target == null) {
target = (DialogListener) getActivity();
}
target.onEncodingSelected(encodings[position]);
this.dismiss();
}
public interface DialogListener {
void onEncodingSelected(String result);
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.support.v7.widget.SwitchCompat;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.ListView;
import org.mozilla.universalchardet.Constants;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.preferences.PreferenceHelper;
public class EncodingDialog extends DialogFragment implements AdapterView.OnItemClickListener {
private final String[] encodings = new String[]{
Constants.CHARSET_BIG5,
Constants.CHARSET_EUC_JP,
Constants.CHARSET_EUC_KR,
Constants.CHARSET_EUC_TW,
Constants.CHARSET_GB18030,
"GB2312",
Constants.CHARSET_IBM855,
Constants.CHARSET_IBM866,
Constants.CHARSET_ISO_2022_CN,
Constants.CHARSET_ISO_2022_JP,
Constants.CHARSET_ISO_2022_KR,
Constants.CHARSET_ISO_8859_5,
Constants.CHARSET_ISO_8859_7,
Constants.CHARSET_ISO_8859_8,
Constants.CHARSET_KOI8_R,
Constants.CHARSET_MACCYRILLIC,
Constants.CHARSET_SHIFT_JIS,
Constants.CHARSET_UTF_16BE,
Constants.CHARSET_UTF_16LE,
Constants.CHARSET_UTF_32BE,
Constants.CHARSET_UTF_32LE,
Constants.CHARSET_UTF_8,
Constants.CHARSET_WINDOWS_1251,
Constants.CHARSET_WINDOWS_1252,
Constants.CHARSET_WINDOWS_1253,
Constants.CHARSET_WINDOWS_1255
};
private ListView list;
public static EncodingDialog newInstance() {
final EncodingDialog f = new EncodingDialog();
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_encoding_list, null);
list = (ListView) view.findViewById(android.R.id.list);
SwitchCompat autoencoding = (SwitchCompat) view.findViewById(android.R.id.checkbox);
autoencoding.setChecked(PreferenceHelper.getAutoEncoding(getActivity()));
autoencoding.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setAutoencoding(getActivity(), isChecked);
}
});
list.setAdapter(new ArrayAdapter<>(getActivity(), R.layout.item_single_choice, encodings));
list.setOnItemClickListener(this);
String currentEncoding = PreferenceHelper.getEncoding(getActivity());
for (int i = 0; i < encodings.length; i++) {
if (currentEncoding.equals(encodings[i])) {
list.setItemChecked(i, true);
}
}
return new AlertDialog.Builder(getActivity())
.setView(view)
.create();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
DialogListener target = (DialogListener) getTargetFragment();
if (target == null) {
target = (DialogListener) getActivity();
}
target.onEncodingSelected(encodings[position]);
this.dismiss();
}
public interface DialogListener {
void onEncodingSelected(String result);
}
}

View File

@@ -1,97 +1,97 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.Date;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.adapter.AdapterTwoItem;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class FileInfoDialog extends DialogFragment {
public static FileInfoDialog newInstance(String filePath) {
final FileInfoDialog f = new FileInfoDialog();
final Bundle args = new Bundle();
args.putString("filePath", filePath);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View view = new DialogHelper.Builder(getActivity())
.setTitle(R.string.info)
.setView(R.layout.dialog_fragment_file_info)
.createSkeletonView();
//final View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_fragment_file_info, null);
ListView list = (ListView) view.findViewById(android.R.id.list);
File file = new File(getArguments().getString("filePath"));
// Get the last modification information.
Long lastModified = file.lastModified();
// Create a new date object and pass last modified information
// to the date object.
Date date = new Date(lastModified);
String[] lines1 = {
getString(R.string.name),
getString(R.string.folder),
getString(R.string.size),
getString(R.string.modification_date)
};
String[] lines2 = {
file.getName(),
file.getParent(),
FileUtils.byteCountToDisplaySize(file.length()),
date.toString()
};
list.setAdapter(new AdapterTwoItem(getActivity(), lines1, lines2));
return new AlertDialog.Builder(getActivity())
.setView(view)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.create();
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.Date;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.adapter.AdapterTwoItem;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class FileInfoDialog extends DialogFragment {
public static FileInfoDialog newInstance(String filePath) {
final FileInfoDialog f = new FileInfoDialog();
final Bundle args = new Bundle();
args.putString("filePath", filePath);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View view = new DialogHelper.Builder(getActivity())
.setTitle(R.string.info)
.setView(R.layout.dialog_fragment_file_info)
.createSkeletonView();
//final View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_fragment_file_info, null);
ListView list = (ListView) view.findViewById(android.R.id.list);
File file = new File(getArguments().getString("filePath"));
// Get the last modification information.
Long lastModified = file.lastModified();
// Create a new date object and pass last modified information
// to the date object.
Date date = new Date(lastModified);
String[] lines1 = {
getString(R.string.name),
getString(R.string.folder),
getString(R.string.size),
getString(R.string.modification_date)
};
String[] lines2 = {
file.getName(),
file.getParent(),
FileUtils.byteCountToDisplaySize(file.length()),
date.toString()
};
list.setAdapter(new AdapterTwoItem(getActivity(), lines1, lines2));
return new AlertDialog.Builder(getActivity())
.setView(view)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.create();
}
}

View File

@@ -1,207 +1,207 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Toast;
import java.util.LinkedList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.texteditor.SearchResult;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class FindTextDialog extends DialogFragment {
private EditText textToFind, textToReplace;
private CheckBox regexCheck, replaceCheck, matchCaseCheck;
public static FindTextDialog newInstance(String allText) {
final FindTextDialog f = new FindTextDialog();
final Bundle args = new Bundle();
args.putString("allText", allText);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
//final View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_fragment_find_text, null);
View view = new DialogHelper.Builder(getActivity())
.setTitle(R.string.find)
.setView(R.layout.dialog_fragment_find_text)
.createSkeletonView();
this.textToFind = (EditText) view.findViewById(R.id.text_to_find);
this.textToReplace = (EditText) view.findViewById(R.id.text_to_replace);
this.regexCheck = (CheckBox) view.findViewById(R.id.regex_check);
this.replaceCheck = (CheckBox) view.findViewById(R.id.replace_check);
this.matchCaseCheck = (CheckBox) view.findViewById(R.id.match_case_check);
replaceCheck.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
textToReplace.setVisibility(isChecked ? View.VISIBLE : View.GONE);
}
});
return new AlertDialog.Builder(getActivity())
.setView(view)
.setPositiveButton(R.string.find,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.setNegativeButton(android.R.string.cancel, null)
.create();
}
@Override
public void onStart() {
super.onStart(); //super.onStart() is where dialog.show() is actually called on the underlying dialog, so we have to do it after this point
AlertDialog d = (AlertDialog) getDialog();
if (d != null) {
Button positiveButton = (Button) d.getButton(Dialog.BUTTON_POSITIVE);
positiveButton.setText(getString(R.string.find));
positiveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
returnData();
}
});
Button negativeButton = (Button) d.getButton(Dialog.BUTTON_NEGATIVE);
negativeButton.setText(getString(android.R.string.cancel));
negativeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
}
}
void returnData() {
if (textToFind.getText().toString().isEmpty()) {
this.dismiss();
} else {
// we disable the okButton while we search
new SearchTask().execute();
}
}
public interface SearchDialogInterface {
void onSearchDone(SearchResult searchResult);
}
private class SearchTask extends AsyncTask<Void, Void, Void> {
LinkedList<Integer> foundIndex;
boolean foundSomething;
@Override
protected Void doInBackground(Void... params) {
String allText = getArguments().getString("allText");
String whatToSearch = textToFind.getText().toString();
boolean caseSensitive = matchCaseCheck.isChecked();
boolean isRegex = regexCheck.isChecked();
foundIndex = new LinkedList<>();
Matcher matcher = null;
foundSomething = false;
if (isRegex) {
try {
if (caseSensitive)
matcher = Pattern.compile(whatToSearch, Pattern.MULTILINE).matcher(allText);
else
matcher = Pattern.compile(whatToSearch, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE).matcher(allText);
} catch (Exception e) {
isRegex = false;
}
}
if (isRegex) {
while (matcher.find()) {
foundSomething = true;
foundIndex.add(matcher.start());
}
} else {
if (caseSensitive == false) { // by default is case sensitive
whatToSearch = whatToSearch.toLowerCase();
allText = allText.toLowerCase();
}
int index = allText.indexOf(whatToSearch);
while (index >= 0) {
foundSomething = true;
foundIndex.add(index);
index = allText.indexOf(whatToSearch, index + 1);
}
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
if (foundSomething) {
// the class that called this Dialog should implement the SearchDialogIterface
SearchDialogInterface searchDialogInterface;
searchDialogInterface = ((SearchDialogInterface) getTargetFragment());
if (searchDialogInterface == null)
searchDialogInterface = ((SearchDialogInterface) getActivity());
// if who called this has not implemented the interface we return nothing
if (searchDialogInterface == null)
return;
// else we return positions and other things
else {
SearchResult searchResult = new SearchResult(foundIndex, textToFind.length(), replaceCheck.isChecked(), textToReplace.getText().toString());
searchDialogInterface.onSearchDone(searchResult);
}
} else {
}
Toast.makeText(getActivity(), String.format(getString(R.string.occurrences_found), foundIndex.size()), Toast.LENGTH_SHORT).show();
// dismiss the dialog
FindTextDialog.this.dismiss();
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Toast;
import java.util.LinkedList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.texteditor.SearchResult;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class FindTextDialog extends DialogFragment {
private EditText textToFind, textToReplace;
private CheckBox regexCheck, replaceCheck, matchCaseCheck;
public static FindTextDialog newInstance(String allText) {
final FindTextDialog f = new FindTextDialog();
final Bundle args = new Bundle();
args.putString("allText", allText);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
//final View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_fragment_find_text, null);
View view = new DialogHelper.Builder(getActivity())
.setTitle(R.string.find)
.setView(R.layout.dialog_fragment_find_text)
.createSkeletonView();
this.textToFind = (EditText) view.findViewById(R.id.text_to_find);
this.textToReplace = (EditText) view.findViewById(R.id.text_to_replace);
this.regexCheck = (CheckBox) view.findViewById(R.id.regex_check);
this.replaceCheck = (CheckBox) view.findViewById(R.id.replace_check);
this.matchCaseCheck = (CheckBox) view.findViewById(R.id.match_case_check);
replaceCheck.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
textToReplace.setVisibility(isChecked ? View.VISIBLE : View.GONE);
}
});
return new AlertDialog.Builder(getActivity())
.setView(view)
.setPositiveButton(R.string.find,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.setNegativeButton(android.R.string.cancel, null)
.create();
}
@Override
public void onStart() {
super.onStart(); //super.onStart() is where dialog.show() is actually called on the underlying dialog, so we have to do it after this point
AlertDialog d = (AlertDialog) getDialog();
if (d != null) {
Button positiveButton = (Button) d.getButton(Dialog.BUTTON_POSITIVE);
positiveButton.setText(getString(R.string.find));
positiveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
returnData();
}
});
Button negativeButton = (Button) d.getButton(Dialog.BUTTON_NEGATIVE);
negativeButton.setText(getString(android.R.string.cancel));
negativeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
}
}
void returnData() {
if (textToFind.getText().toString().isEmpty()) {
this.dismiss();
} else {
// we disable the okButton while we search
new SearchTask().execute();
}
}
public interface SearchDialogInterface {
void onSearchDone(SearchResult searchResult);
}
private class SearchTask extends AsyncTask<Void, Void, Void> {
LinkedList<Integer> foundIndex;
boolean foundSomething;
@Override
protected Void doInBackground(Void... params) {
String allText = getArguments().getString("allText");
String whatToSearch = textToFind.getText().toString();
boolean caseSensitive = matchCaseCheck.isChecked();
boolean isRegex = regexCheck.isChecked();
foundIndex = new LinkedList<>();
Matcher matcher = null;
foundSomething = false;
if (isRegex) {
try {
if (caseSensitive)
matcher = Pattern.compile(whatToSearch, Pattern.MULTILINE).matcher(allText);
else
matcher = Pattern.compile(whatToSearch, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE).matcher(allText);
} catch (Exception e) {
isRegex = false;
}
}
if (isRegex) {
while (matcher.find()) {
foundSomething = true;
foundIndex.add(matcher.start());
}
} else {
if (caseSensitive == false) { // by default is case sensitive
whatToSearch = whatToSearch.toLowerCase();
allText = allText.toLowerCase();
}
int index = allText.indexOf(whatToSearch);
while (index >= 0) {
foundSomething = true;
foundIndex.add(index);
index = allText.indexOf(whatToSearch, index + 1);
}
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
if (foundSomething) {
// the class that called this Dialog should implement the SearchDialogIterface
SearchDialogInterface searchDialogInterface;
searchDialogInterface = ((SearchDialogInterface) getTargetFragment());
if (searchDialogInterface == null)
searchDialogInterface = ((SearchDialogInterface) getActivity());
// if who called this has not implemented the interface we return nothing
if (searchDialogInterface == null)
return;
// else we return positions and other things
else {
SearchResult searchResult = new SearchResult(foundIndex, textToFind.length(), replaceCheck.isChecked(), textToReplace.getText().toString());
searchDialogInterface.onSearchDone(searchResult);
}
} else {
}
Toast.makeText(getActivity(), String.format(getString(R.string.occurrences_found), foundIndex.size()), Toast.LENGTH_SHORT).show();
// dismiss the dialog
FindTextDialog.this.dismiss();
}
}
}

View File

@@ -1,98 +1,98 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import java.io.File;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.activity.MainActivity;
import sharedcode.turboeditor.preferences.PreferenceHelper;
import sharedcode.turboeditor.task.SaveFileTask;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class NewFileDetailsDialog extends DialogFragment {
private EditText mName;
private EditText mFolder;
public static NewFileDetailsDialog newInstance(String fileText, String fileEncoding) {
final NewFileDetailsDialog f = new NewFileDetailsDialog();
final Bundle args = new Bundle();
args.putString("fileText", fileText);
args.putString("fileEncoding", fileEncoding);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View view = new DialogHelper.Builder(getActivity())
.setTitle(R.string.file)
.setView(R.layout.dialog_fragment_new_file_details)
.createSkeletonView();
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())
.setView(view)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (!mName.getText().toString().isEmpty() && !mFolder.getText().toString().isEmpty()) {
File file = new File(mFolder.getText().toString(), mName.getText().toString());
new SaveFileTask((MainActivity) getActivity(), file.getPath(), getArguments().getString("fileText"), getArguments().getString("fileEncoding")).execute();
PreferenceHelper.setWorkingFolder(getActivity(), file.getParent());
}
}
}
)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.create();
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import java.io.File;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.activity.MainActivity;
import sharedcode.turboeditor.preferences.PreferenceHelper;
import sharedcode.turboeditor.task.SaveFileTask;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class NewFileDetailsDialog extends DialogFragment {
private EditText mName;
private EditText mFolder;
public static NewFileDetailsDialog newInstance(String fileText, String fileEncoding) {
final NewFileDetailsDialog f = new NewFileDetailsDialog();
final Bundle args = new Bundle();
args.putString("fileText", fileText);
args.putString("fileEncoding", fileEncoding);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View view = new DialogHelper.Builder(getActivity())
.setTitle(R.string.file)
.setView(R.layout.dialog_fragment_new_file_details)
.createSkeletonView();
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())
.setView(view)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (!mName.getText().toString().isEmpty() && !mFolder.getText().toString().isEmpty()) {
File file = new File(mFolder.getText().toString(), mName.getText().toString());
new SaveFileTask((MainActivity) getActivity(), file.getPath(), getArguments().getString("fileText"), getArguments().getString("fileEncoding")).execute();
PreferenceHelper.setWorkingFolder(getActivity(), file.getParent());
}
}
}
)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.create();
}
}

View File

@@ -1,123 +1,123 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.NumberPicker;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class NumberPickerDialog extends DialogFragment {
private NumberPicker mSeekBar;
public static NumberPickerDialog newInstance(final Actions action) {
return NumberPickerDialog.newInstance(action, 0, 50, 100);
}
public static NumberPickerDialog newInstance(final Actions action, final int min, final int current, final int max) {
final NumberPickerDialog f = new NumberPickerDialog();
final Bundle args = new Bundle();
args.putSerializable("action", action);
args.putInt("min", min);
args.putInt("current", current);
args.putInt("max", max);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Actions action = (Actions) getArguments().getSerializable("action");
int title;
switch (action){
case FontSize:
title = R.string.font_size;
break;
case SelectPage:
title = R.string.goto_page;
break;
case GoToLine:
title = R.string.goto_line;
break;
default:
title = R.string.nome_app_turbo_editor;
break;
}
View view = new DialogHelper.Builder(getActivity())
.setTitle(title)
.setView(R.layout.dialog_fragment_seekbar)
.createSkeletonView();
this.mSeekBar = (NumberPicker) view.findViewById(android.R.id.input);
this.mSeekBar.setMaxValue(getArguments().getInt("max"));
this.mSeekBar.setMinValue(getArguments().getInt("min"));
this.mSeekBar.setValue(getArguments().getInt("current"));
return new AlertDialog.Builder(getActivity())
//.setTitle(title)
.setView(view)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
returnData();
}
}
)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.create();
}
void returnData() {
INumberPickerDialog target = (INumberPickerDialog) getTargetFragment();
if (target == null) {
target = (INumberPickerDialog) getActivity();
}
target.onNumberPickerDialogDismissed(
(Actions) getArguments().getSerializable("action"),
mSeekBar.getValue()
);
this.dismiss();
}
public enum Actions {
FontSize, SelectPage, GoToLine
}
public interface INumberPickerDialog {
void onNumberPickerDialogDismissed(Actions action, int value);
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.NumberPicker;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.views.DialogHelper;
// ...
public class NumberPickerDialog extends DialogFragment {
private NumberPicker mSeekBar;
public static NumberPickerDialog newInstance(final Actions action) {
return NumberPickerDialog.newInstance(action, 0, 50, 100);
}
public static NumberPickerDialog newInstance(final Actions action, final int min, final int current, final int max) {
final NumberPickerDialog f = new NumberPickerDialog();
final Bundle args = new Bundle();
args.putSerializable("action", action);
args.putInt("min", min);
args.putInt("current", current);
args.putInt("max", max);
f.setArguments(args);
return f;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Actions action = (Actions) getArguments().getSerializable("action");
int title;
switch (action){
case FontSize:
title = R.string.font_size;
break;
case SelectPage:
title = R.string.goto_page;
break;
case GoToLine:
title = R.string.goto_line;
break;
default:
title = R.string.nome_app_turbo_editor;
break;
}
View view = new DialogHelper.Builder(getActivity())
.setTitle(title)
.setView(R.layout.dialog_fragment_seekbar)
.createSkeletonView();
this.mSeekBar = (NumberPicker) view.findViewById(android.R.id.input);
this.mSeekBar.setMaxValue(getArguments().getInt("max"));
this.mSeekBar.setMinValue(getArguments().getInt("min"));
this.mSeekBar.setValue(getArguments().getInt("current"));
return new AlertDialog.Builder(getActivity())
//.setTitle(title)
.setView(view)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
returnData();
}
}
)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}
)
.create();
}
void returnData() {
INumberPickerDialog target = (INumberPickerDialog) getTargetFragment();
if (target == null) {
target = (INumberPickerDialog) getActivity();
}
target.onNumberPickerDialogDismissed(
(Actions) getArguments().getSerializable("action"),
mSeekBar.getValue()
);
this.dismiss();
}
public enum Actions {
FontSize, SelectPage, GoToLine
}
public interface INumberPickerDialog {
void onNumberPickerDialogDismissed(Actions action, int value);
}
}

View File

@@ -1,113 +1,113 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import org.apache.commons.io.FilenameUtils;
import java.io.File;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.activity.MainActivity;
import sharedcode.turboeditor.task.SaveFileTask;
import sharedcode.turboeditor.views.DialogHelper;
public class SaveFileDialog extends DialogFragment {
public static SaveFileDialog newInstance(String filePath, String text, String encoding) {
return newInstance(filePath, text, encoding, false, "");
}
public static SaveFileDialog newInstance(String filePath, String text, String encoding, boolean openNewFileAfter, String pathOfNewFile) {
SaveFileDialog frag = new SaveFileDialog();
Bundle args = new Bundle();
args.putString("filePath", filePath);
args.putString("text", text);
args.putString("encoding", encoding);
args.putBoolean("openNewFileAfter", openNewFileAfter);
args.putString("pathOfNewFile", pathOfNewFile);
frag.setArguments(args);
return frag;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final String filePath = getArguments().getString("filePath");
final String text = getArguments().getString("text");
final String encoding = getArguments().getString("encoding");
final String fileName = FilenameUtils.getName(filePath);
final File file = new File(filePath);
View view = new DialogHelper.Builder(getActivity())
.setIcon(getResources().getDrawable(R.drawable.ic_action_save))
.setTitle(R.string.salva)
.setMessage(String.format(getString(R.string.save_changes), fileName))
.createCommonView();
return new AlertDialog.Builder(getActivity())
.setView(view)
.setPositiveButton(R.string.salva,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (!fileName.isEmpty())
new SaveFileTask((MainActivity) getActivity(), filePath, text,
encoding).execute();
else {
NewFileDetailsDialog dialogFrag =
NewFileDetailsDialog.newInstance(text,
encoding);
dialogFrag.show(getFragmentManager().beginTransaction(),
"dialog");
}
}
}
)
.setNeutralButton(android.R.string.cancel, null)
.setNegativeButton(R.string.no,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ISaveDialog target = (ISaveDialog) getTargetFragment();
if (target == null) {
target = (ISaveDialog) getActivity();
}
target.userDoesntWantToSave(
getArguments().getBoolean("openNewFileAfter"),
getArguments().getString("pathOfNewFile")
);
}
}
)
.create();
}
public interface ISaveDialog {
void userDoesntWantToSave(boolean openNewFile, String pathOfNewFile);
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.dialogfragment;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import org.apache.commons.io.FilenameUtils;
import java.io.File;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.activity.MainActivity;
import sharedcode.turboeditor.task.SaveFileTask;
import sharedcode.turboeditor.views.DialogHelper;
public class SaveFileDialog extends DialogFragment {
public static SaveFileDialog newInstance(String filePath, String text, String encoding) {
return newInstance(filePath, text, encoding, false, "");
}
public static SaveFileDialog newInstance(String filePath, String text, String encoding, boolean openNewFileAfter, String pathOfNewFile) {
SaveFileDialog frag = new SaveFileDialog();
Bundle args = new Bundle();
args.putString("filePath", filePath);
args.putString("text", text);
args.putString("encoding", encoding);
args.putBoolean("openNewFileAfter", openNewFileAfter);
args.putString("pathOfNewFile", pathOfNewFile);
frag.setArguments(args);
return frag;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final String filePath = getArguments().getString("filePath");
final String text = getArguments().getString("text");
final String encoding = getArguments().getString("encoding");
final String fileName = FilenameUtils.getName(filePath);
final File file = new File(filePath);
View view = new DialogHelper.Builder(getActivity())
.setIcon(getResources().getDrawable(R.drawable.ic_action_save))
.setTitle(R.string.salva)
.setMessage(String.format(getString(R.string.save_changes), fileName))
.createCommonView();
return new AlertDialog.Builder(getActivity())
.setView(view)
.setPositiveButton(R.string.salva,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (!fileName.isEmpty())
new SaveFileTask((MainActivity) getActivity(), filePath, text,
encoding).execute();
else {
NewFileDetailsDialog dialogFrag =
NewFileDetailsDialog.newInstance(text,
encoding);
dialogFrag.show(getFragmentManager().beginTransaction(),
"dialog");
}
}
}
)
.setNeutralButton(android.R.string.cancel, null)
.setNegativeButton(R.string.no,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ISaveDialog target = (ISaveDialog) getTargetFragment();
if (target == null) {
target = (ISaveDialog) getActivity();
}
target.userDoesntWantToSave(
getArguments().getBoolean("openNewFileAfter"),
getArguments().getString("pathOfNewFile")
);
}
}
)
.create();
}
public interface ISaveDialog {
void userDoesntWantToSave(boolean openNewFile, String pathOfNewFile);
}
}

View File

@@ -1,188 +1,188 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.preferences;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Environment;
import android.preference.PreferenceManager;
public final class PreferenceHelper {
public static final String SD_CARD_ROOT = Environment.getExternalStorageDirectory().getAbsolutePath();
private PreferenceHelper() {
}
// Getter Methods
private static SharedPreferences getPrefs(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context);
}
private static SharedPreferences.Editor getEditor(Context context) {
return getPrefs(context).edit();
}
public static boolean getUseMonospace(Context context) {
return getPrefs(context).getBoolean("use_monospace", false);
}
public static boolean getLineNumbers(Context context) {
return getPrefs(context).getBoolean("editor_line_numbers", true);
}
public static boolean getSyntaxHighlight(Context context) {
return getPrefs(context).getBoolean("editor_syntax_highlight", false);
}
public static boolean getWrapContent(Context context) {
return getPrefs(context).getBoolean("editor_wrap_content", true);
}
public static boolean getLightTheme(Context context) {
return getPrefs(context).getBoolean("light_theme", false);
}
public static boolean getSuggestionActive(Context context) {
return getPrefs(context).getBoolean("suggestion_active", false);
}
public static boolean getAutoEncoding(Context context) {
return getPrefs(context).getBoolean("autoencoding", true);
}
public static boolean getSendErrorReports(Context context) {
return getPrefs(context).getBoolean("send_error_reports", true);
}
public static String getEncoding(Context context) {
return getPrefs(context).getString("editor_encoding", "UTF-8");
}
public static int getFontSize(Context context) {
return getPrefs(context).getInt("font_size", 16);
}
public static String getWorkingFolder(Context context) {
return getPrefs(context).getString("working_folder", SD_CARD_ROOT);
}
public static String[] getSavedPaths(Context context) {
return getPrefs(context).getString("savedPaths", "").split(",");
}
public static boolean getPageSystemButtonsPopupShown(Context context) {
return getPrefs(context).getBoolean("page_system_button_popup_shown", false);
}
public static boolean getAutoSave(Context context) {
return getPrefs(context).getBoolean("auto_save", false);
}
public static boolean getReadOnly(Context context) {
return getPrefs(context).getBoolean("read_only", false);
}
public static boolean getIgnoreBackButton(Context context) {
return getPrefs(context).getBoolean("ignore_back_button", false);
}
public static boolean getSplitText(Context context) {
return getPrefs(context).getBoolean("page_system_active", true);
}
public static boolean hasDonated(Context context) {
return getPrefs(context).getBoolean("has_donated", false);
}
// Setter methods
public static void setUseMonospace(Context context, boolean value) {
getEditor(context).putBoolean("use_monospace", value).commit();
}
public static void setLineNumbers(Context context, boolean value) {
getEditor(context).putBoolean("editor_line_numbers", value).commit();
}
public static void setSyntaxHighlight(Context context, boolean value) {
getEditor(context).putBoolean("editor_syntax_highlight", value).commit();
}
public static void setWrapContent(Context context, boolean value) {
getEditor(context).putBoolean("editor_wrap_content", value).commit();
}
public static void setAutoencoding(Context context, boolean value) {
getEditor(context).putBoolean("autoencoding", value).commit();
}
public static void setFontSize(Context context, int value) {
getEditor(context).putInt("font_size", value).commit();
}
public static void setWorkingFolder(Context context, String value) {
getEditor(context).putString("working_folder", value).commit();
}
public static void setSavedPaths(Context context, StringBuilder stringBuilder) {
getEditor(context).putString("savedPaths", stringBuilder.toString()).commit();
}
public static void setPageSystemButtonsPopupShown(Context context, boolean value) {
getEditor(context).putBoolean("page_system_button_popup_shown", value).commit();
}
public static void setReadOnly(Context context, boolean value) {
getEditor(context).putBoolean("read_only", value).commit();
}
public static void setHasDonated(Context context, boolean value) {
getEditor(context).putBoolean("has_donated", value).commit();
}
public static void setLightTheme(Context context, boolean value) {
getEditor(context).putBoolean("light_theme", value).commit();
}
public static void setSuggestionsActive(Context context, boolean value) {
getEditor(context).putBoolean("suggestion_active", value).commit();
}
public static void setAutoSave(Context context, boolean value) {
getEditor(context).putBoolean("auto_save", value).commit();
}
public static void setIgnoreBackButton(Context context, boolean value) {
getEditor(context).putBoolean("ignore_back_button", value).commit();
}
public static void setSplitText(Context context, boolean value) {
getEditor(context).putBoolean("page_system_active", value).commit();
}
public static void setSendErrorReport(Context context, boolean value) {
getEditor(context).putBoolean("ignore_back_button", value).commit();
}
public static void setEncoding(Context context, String value) {
getEditor(context).putString("editor_encoding", value).commit();
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.preferences;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Environment;
import android.preference.PreferenceManager;
public final class PreferenceHelper {
public static final String SD_CARD_ROOT = Environment.getExternalStorageDirectory().getAbsolutePath();
private PreferenceHelper() {
}
// Getter Methods
private static SharedPreferences getPrefs(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context);
}
private static SharedPreferences.Editor getEditor(Context context) {
return getPrefs(context).edit();
}
public static boolean getUseMonospace(Context context) {
return getPrefs(context).getBoolean("use_monospace", false);
}
public static boolean getLineNumbers(Context context) {
return getPrefs(context).getBoolean("editor_line_numbers", true);
}
public static boolean getSyntaxHighlight(Context context) {
return getPrefs(context).getBoolean("editor_syntax_highlight", false);
}
public static boolean getWrapContent(Context context) {
return getPrefs(context).getBoolean("editor_wrap_content", true);
}
public static boolean getLightTheme(Context context) {
return getPrefs(context).getBoolean("light_theme", false);
}
public static boolean getSuggestionActive(Context context) {
return getPrefs(context).getBoolean("suggestion_active", false);
}
public static boolean getAutoEncoding(Context context) {
return getPrefs(context).getBoolean("autoencoding", true);
}
public static boolean getSendErrorReports(Context context) {
return getPrefs(context).getBoolean("send_error_reports", true);
}
public static String getEncoding(Context context) {
return getPrefs(context).getString("editor_encoding", "UTF-8");
}
public static int getFontSize(Context context) {
return getPrefs(context).getInt("font_size", 16);
}
public static String getWorkingFolder(Context context) {
return getPrefs(context).getString("working_folder", SD_CARD_ROOT);
}
public static String[] getSavedPaths(Context context) {
return getPrefs(context).getString("savedPaths", "").split(",");
}
public static boolean getPageSystemButtonsPopupShown(Context context) {
return getPrefs(context).getBoolean("page_system_button_popup_shown", false);
}
public static boolean getAutoSave(Context context) {
return getPrefs(context).getBoolean("auto_save", false);
}
public static boolean getReadOnly(Context context) {
return getPrefs(context).getBoolean("read_only", false);
}
public static boolean getIgnoreBackButton(Context context) {
return getPrefs(context).getBoolean("ignore_back_button", false);
}
public static boolean getSplitText(Context context) {
return getPrefs(context).getBoolean("page_system_active", true);
}
public static boolean hasDonated(Context context) {
return getPrefs(context).getBoolean("has_donated", false);
}
// Setter methods
public static void setUseMonospace(Context context, boolean value) {
getEditor(context).putBoolean("use_monospace", value).commit();
}
public static void setLineNumbers(Context context, boolean value) {
getEditor(context).putBoolean("editor_line_numbers", value).commit();
}
public static void setSyntaxHighlight(Context context, boolean value) {
getEditor(context).putBoolean("editor_syntax_highlight", value).commit();
}
public static void setWrapContent(Context context, boolean value) {
getEditor(context).putBoolean("editor_wrap_content", value).commit();
}
public static void setAutoencoding(Context context, boolean value) {
getEditor(context).putBoolean("autoencoding", value).commit();
}
public static void setFontSize(Context context, int value) {
getEditor(context).putInt("font_size", value).commit();
}
public static void setWorkingFolder(Context context, String value) {
getEditor(context).putString("working_folder", value).commit();
}
public static void setSavedPaths(Context context, StringBuilder stringBuilder) {
getEditor(context).putString("savedPaths", stringBuilder.toString()).commit();
}
public static void setPageSystemButtonsPopupShown(Context context, boolean value) {
getEditor(context).putBoolean("page_system_button_popup_shown", value).commit();
}
public static void setReadOnly(Context context, boolean value) {
getEditor(context).putBoolean("read_only", value).commit();
}
public static void setHasDonated(Context context, boolean value) {
getEditor(context).putBoolean("has_donated", value).commit();
}
public static void setLightTheme(Context context, boolean value) {
getEditor(context).putBoolean("light_theme", value).commit();
}
public static void setSuggestionsActive(Context context, boolean value) {
getEditor(context).putBoolean("suggestion_active", value).commit();
}
public static void setAutoSave(Context context, boolean value) {
getEditor(context).putBoolean("auto_save", value).commit();
}
public static void setIgnoreBackButton(Context context, boolean value) {
getEditor(context).putBoolean("ignore_back_button", value).commit();
}
public static void setSplitText(Context context, boolean value) {
getEditor(context).putBoolean("page_system_active", value).commit();
}
public static void setSendErrorReport(Context context, boolean value) {
getEditor(context).putBoolean("ignore_back_button", value).commit();
}
public static void setEncoding(Context context, String value) {
getEditor(context).putString("editor_encoding", value).commit();
}
}

View File

@@ -1,269 +1,269 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.preferences;
import android.app.Fragment;
import android.os.Bundle;
import android.support.v7.widget.SwitchCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.TextView;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.activity.MainActivity;
import sharedcode.turboeditor.dialogfragment.EncodingDialog;
import sharedcode.turboeditor.dialogfragment.NumberPickerDialog;
import sharedcode.turboeditor.util.ProCheckUtils;
import sharedcode.turboeditor.util.ViewUtils;
import sharedcode.turboeditor.views.DialogHelper;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.ENCODING;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.FONT_SIZE;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.LINE_NUMERS;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.MONOSPACE;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.READ_ONLY;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.SYNTAX;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.TEXT_SUGGESTIONS;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.THEME_CHANGE;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.WRAP_CONTENT;
public class SettingsFragment extends Fragment implements NumberPickerDialog.INumberPickerDialog, EncodingDialog.DialogListener {
// Editor Variables
private boolean sLineNumbers;
private boolean sColorSyntax;
private boolean sWrapContent;
private boolean sUseMonospace;
private boolean sReadOnly;
private boolean sLightTheme;
private boolean sSuggestions;
private boolean sAutoSave;
private boolean sIgnoreBackButton;
private boolean sSplitText;
private boolean sErrorReports;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
sUseMonospace = PreferenceHelper.getUseMonospace(getActivity());
sColorSyntax = PreferenceHelper.getSyntaxHighlight(getActivity());
sWrapContent = PreferenceHelper.getWrapContent(getActivity());
sLineNumbers = PreferenceHelper.getLineNumbers(getActivity());
sReadOnly = PreferenceHelper.getReadOnly(getActivity());
sLightTheme = PreferenceHelper.getLightTheme(getActivity());
sSuggestions = PreferenceHelper.getSuggestionActive(getActivity());
sAutoSave = PreferenceHelper.getAutoSave(getActivity());
sIgnoreBackButton = PreferenceHelper.getIgnoreBackButton(getActivity());
sSplitText = PreferenceHelper.getSplitText(getActivity());
sErrorReports = PreferenceHelper.getSendErrorReports(getActivity());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Our custom layout
final View rootView = inflater.inflate(R.layout.fragment_settings, container, false);
final SwitchCompat swLineNumbers, swSyntax, swWrapContent, swMonospace, swReadOnly;
final SwitchCompat swLightTheme, swSuggestions, swAutoSave, swIgnoreBackButton, swSplitText, swErrorReports;
swLineNumbers = (SwitchCompat) rootView.findViewById(R.id.switch_line_numbers);
swSyntax = (SwitchCompat) rootView.findViewById(R.id.switch_syntax);
swWrapContent = (SwitchCompat) rootView.findViewById(R.id.switch_wrap_content);
swMonospace = (SwitchCompat) rootView.findViewById(R.id.switch_monospace);
swReadOnly = (SwitchCompat) rootView.findViewById(R.id.switch_read_only);
swLightTheme = (SwitchCompat) rootView.findViewById(R.id.switch_light_theme);
swSuggestions = (SwitchCompat) rootView.findViewById(R.id.switch_suggestions_active);
swAutoSave = (SwitchCompat) rootView.findViewById(R.id.switch_auto_save);
swIgnoreBackButton = (SwitchCompat) rootView.findViewById(R.id.switch_ignore_backbutton);
swSplitText = (SwitchCompat) rootView.findViewById(R.id.switch_page_system);
swErrorReports = (SwitchCompat) rootView.findViewById(R.id.switch_send_error_reports);
swLineNumbers.setChecked(sLineNumbers);
swSyntax.setChecked(sColorSyntax);
swWrapContent.setChecked(sWrapContent);
swMonospace.setChecked(sUseMonospace);
swReadOnly.setChecked(sReadOnly);
swLightTheme.setChecked(sLightTheme);
swSuggestions.setChecked(sSuggestions);
swAutoSave.setChecked(sAutoSave);
swIgnoreBackButton.setChecked(sIgnoreBackButton);
swSplitText.setChecked(sSplitText);
swErrorReports.setChecked(sErrorReports);
TextView fontSizeView, encodingView, donateView, extraOptionsView;
fontSizeView = (TextView) rootView.findViewById(R.id.drawer_button_font_size);
encodingView = (TextView) rootView.findViewById(R.id.drawer_button_encoding);
extraOptionsView = (TextView) rootView.findViewById(R.id.drawer_button_extra_options);
donateView = (TextView) rootView.findViewById(R.id.drawer_button_go_pro);
if(ProCheckUtils.isPro(getActivity(), false))
ViewUtils.setVisible(donateView, false);
swLineNumbers.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setLineNumbers(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(LINE_NUMERS));
}
});
swSyntax.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
sColorSyntax = isChecked;
PreferenceHelper.setSyntaxHighlight(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(SYNTAX));
}
});
swWrapContent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setWrapContent(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(WRAP_CONTENT));
}
});
swMonospace.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
sUseMonospace = isChecked;
PreferenceHelper.setUseMonospace(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(MONOSPACE));
}
});
swReadOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setReadOnly(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(READ_ONLY));
}
});
fontSizeView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int fontMax = 36;
int fontCurrent = //(int) (mEditor.getTextSize() / scaledDensity);
//fontMax / 2;
PreferenceHelper.getFontSize(getActivity());
NumberPickerDialog dialogFrag = NumberPickerDialog.newInstance(NumberPickerDialog
.Actions
.FontSize, 1, fontCurrent, fontMax);
dialogFrag.setTargetFragment(SettingsFragment.this, 0);
dialogFrag.show(getFragmentManager().beginTransaction(), "dialog");
}
});
encodingView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EncodingDialog dialogFrag = EncodingDialog.newInstance();
dialogFrag.setTargetFragment(SettingsFragment.this, 0);
dialogFrag.show(getFragmentManager().beginTransaction(), "dialog");
}
});
extraOptionsView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View otherOptions = rootView.findViewById(R.id.other_options);
boolean isVisible = otherOptions.getVisibility() == View.VISIBLE;
ViewUtils.setVisible(otherOptions, !isVisible);
}
});
donateView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DialogHelper.showDonateDialog(getActivity());
}
});
swLightTheme.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setLightTheme(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(THEME_CHANGE));
}
});
swSuggestions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setSuggestionsActive(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(TEXT_SUGGESTIONS));
}
});
swAutoSave.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setAutoSave(getActivity(), isChecked);
}
});
swIgnoreBackButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setIgnoreBackButton(getActivity(), isChecked);
}
});
swSplitText.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setSplitText(getActivity(), isChecked);
}
});
swErrorReports.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setSendErrorReport(getActivity(), isChecked);
}
});
return rootView;
}
@Override
public void onNumberPickerDialogDismissed(NumberPickerDialog.Actions action, int value) {
PreferenceHelper.setFontSize(getActivity(), value);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(FONT_SIZE));
}
@Override
public void onEncodingSelected(String result) {
PreferenceHelper.setEncoding(getActivity(), result);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(ENCODING));
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.preferences;
import android.app.Fragment;
import android.os.Bundle;
import android.support.v7.widget.SwitchCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.TextView;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.activity.MainActivity;
import sharedcode.turboeditor.dialogfragment.EncodingDialog;
import sharedcode.turboeditor.dialogfragment.NumberPickerDialog;
import sharedcode.turboeditor.util.ProCheckUtils;
import sharedcode.turboeditor.util.ViewUtils;
import sharedcode.turboeditor.views.DialogHelper;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.ENCODING;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.FONT_SIZE;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.LINE_NUMERS;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.MONOSPACE;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.READ_ONLY;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.SYNTAX;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.TEXT_SUGGESTIONS;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.THEME_CHANGE;
import static sharedcode.turboeditor.util.EventBusEvents.APreferenceValueWasChanged.Type.WRAP_CONTENT;
public class SettingsFragment extends Fragment implements NumberPickerDialog.INumberPickerDialog, EncodingDialog.DialogListener {
// Editor Variables
private boolean sLineNumbers;
private boolean sColorSyntax;
private boolean sWrapContent;
private boolean sUseMonospace;
private boolean sReadOnly;
private boolean sLightTheme;
private boolean sSuggestions;
private boolean sAutoSave;
private boolean sIgnoreBackButton;
private boolean sSplitText;
private boolean sErrorReports;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
sUseMonospace = PreferenceHelper.getUseMonospace(getActivity());
sColorSyntax = PreferenceHelper.getSyntaxHighlight(getActivity());
sWrapContent = PreferenceHelper.getWrapContent(getActivity());
sLineNumbers = PreferenceHelper.getLineNumbers(getActivity());
sReadOnly = PreferenceHelper.getReadOnly(getActivity());
sLightTheme = PreferenceHelper.getLightTheme(getActivity());
sSuggestions = PreferenceHelper.getSuggestionActive(getActivity());
sAutoSave = PreferenceHelper.getAutoSave(getActivity());
sIgnoreBackButton = PreferenceHelper.getIgnoreBackButton(getActivity());
sSplitText = PreferenceHelper.getSplitText(getActivity());
sErrorReports = PreferenceHelper.getSendErrorReports(getActivity());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Our custom layout
final View rootView = inflater.inflate(R.layout.fragment_settings, container, false);
final SwitchCompat swLineNumbers, swSyntax, swWrapContent, swMonospace, swReadOnly;
final SwitchCompat swLightTheme, swSuggestions, swAutoSave, swIgnoreBackButton, swSplitText, swErrorReports;
swLineNumbers = (SwitchCompat) rootView.findViewById(R.id.switch_line_numbers);
swSyntax = (SwitchCompat) rootView.findViewById(R.id.switch_syntax);
swWrapContent = (SwitchCompat) rootView.findViewById(R.id.switch_wrap_content);
swMonospace = (SwitchCompat) rootView.findViewById(R.id.switch_monospace);
swReadOnly = (SwitchCompat) rootView.findViewById(R.id.switch_read_only);
swLightTheme = (SwitchCompat) rootView.findViewById(R.id.switch_light_theme);
swSuggestions = (SwitchCompat) rootView.findViewById(R.id.switch_suggestions_active);
swAutoSave = (SwitchCompat) rootView.findViewById(R.id.switch_auto_save);
swIgnoreBackButton = (SwitchCompat) rootView.findViewById(R.id.switch_ignore_backbutton);
swSplitText = (SwitchCompat) rootView.findViewById(R.id.switch_page_system);
swErrorReports = (SwitchCompat) rootView.findViewById(R.id.switch_send_error_reports);
swLineNumbers.setChecked(sLineNumbers);
swSyntax.setChecked(sColorSyntax);
swWrapContent.setChecked(sWrapContent);
swMonospace.setChecked(sUseMonospace);
swReadOnly.setChecked(sReadOnly);
swLightTheme.setChecked(sLightTheme);
swSuggestions.setChecked(sSuggestions);
swAutoSave.setChecked(sAutoSave);
swIgnoreBackButton.setChecked(sIgnoreBackButton);
swSplitText.setChecked(sSplitText);
swErrorReports.setChecked(sErrorReports);
TextView fontSizeView, encodingView, donateView, extraOptionsView;
fontSizeView = (TextView) rootView.findViewById(R.id.drawer_button_font_size);
encodingView = (TextView) rootView.findViewById(R.id.drawer_button_encoding);
extraOptionsView = (TextView) rootView.findViewById(R.id.drawer_button_extra_options);
donateView = (TextView) rootView.findViewById(R.id.drawer_button_go_pro);
if(ProCheckUtils.isPro(getActivity(), false))
ViewUtils.setVisible(donateView, false);
swLineNumbers.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setLineNumbers(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(LINE_NUMERS));
}
});
swSyntax.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
sColorSyntax = isChecked;
PreferenceHelper.setSyntaxHighlight(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(SYNTAX));
}
});
swWrapContent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setWrapContent(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(WRAP_CONTENT));
}
});
swMonospace.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
sUseMonospace = isChecked;
PreferenceHelper.setUseMonospace(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(MONOSPACE));
}
});
swReadOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setReadOnly(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(READ_ONLY));
}
});
fontSizeView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int fontMax = 36;
int fontCurrent = //(int) (mEditor.getTextSize() / scaledDensity);
//fontMax / 2;
PreferenceHelper.getFontSize(getActivity());
NumberPickerDialog dialogFrag = NumberPickerDialog.newInstance(NumberPickerDialog
.Actions
.FontSize, 1, fontCurrent, fontMax);
dialogFrag.setTargetFragment(SettingsFragment.this, 0);
dialogFrag.show(getFragmentManager().beginTransaction(), "dialog");
}
});
encodingView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EncodingDialog dialogFrag = EncodingDialog.newInstance();
dialogFrag.setTargetFragment(SettingsFragment.this, 0);
dialogFrag.show(getFragmentManager().beginTransaction(), "dialog");
}
});
extraOptionsView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View otherOptions = rootView.findViewById(R.id.other_options);
boolean isVisible = otherOptions.getVisibility() == View.VISIBLE;
ViewUtils.setVisible(otherOptions, !isVisible);
}
});
donateView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DialogHelper.showDonateDialog(getActivity());
}
});
swLightTheme.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setLightTheme(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(THEME_CHANGE));
}
});
swSuggestions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setSuggestionsActive(getActivity(), isChecked);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(TEXT_SUGGESTIONS));
}
});
swAutoSave.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setAutoSave(getActivity(), isChecked);
}
});
swIgnoreBackButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setIgnoreBackButton(getActivity(), isChecked);
}
});
swSplitText.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setSplitText(getActivity(), isChecked);
}
});
swErrorReports.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
PreferenceHelper.setSendErrorReport(getActivity(), isChecked);
}
});
return rootView;
}
@Override
public void onNumberPickerDialogDismissed(NumberPickerDialog.Actions action, int value) {
PreferenceHelper.setFontSize(getActivity(), value);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(FONT_SIZE));
}
@Override
public void onEncodingSelected(String result) {
PreferenceHelper.setEncoding(getActivity(), result);
((MainActivity) getActivity()).onEvent(new APreferenceValueWasChanged(ENCODING));
}
}

View File

@@ -1,77 +1,77 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.root;
import android.util.Log;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class LinuxShell {
private static final String UNIX_ESCAPE_EXPRESSION = "(\\(|\\)|\\[|\\]|\\s|\'|\"|`|\\{|\\}|&|\\\\|\\?)";
public static String getCommandLineString(String input) {
return input.replaceAll(UNIX_ESCAPE_EXPRESSION, "\\\\$1");
}
public static BufferedReader execute(String cmd) {
BufferedReader reader = null;
try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(
process.getOutputStream());
os.writeBytes(cmd + "\n");
os.writeBytes("exit\n");
reader = new BufferedReader(new InputStreamReader(
process.getInputStream()));
String err = (new BufferedReader(new InputStreamReader(
process.getErrorStream()))).readLine();
os.flush();
if (process.waitFor() != 0 || (!"".equals(err) && null != err)
&& containsIllegals(err) != true) {
Log.e("Root Error, cmd: " + cmd, err);
return null;
}
return reader;
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static boolean containsIllegals(String toExamine) {
// checks for "+" sign so the program doesn't throw an error when its
// not erroring.
Pattern pattern = Pattern.compile("[+]");
Matcher matcher = pattern.matcher(toExamine);
return matcher.find();
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.root;
import android.util.Log;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class LinuxShell {
private static final String UNIX_ESCAPE_EXPRESSION = "(\\(|\\)|\\[|\\]|\\s|\'|\"|`|\\{|\\}|&|\\\\|\\?)";
public static String getCommandLineString(String input) {
return input.replaceAll(UNIX_ESCAPE_EXPRESSION, "\\\\$1");
}
public static BufferedReader execute(String cmd) {
BufferedReader reader = null;
try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(
process.getOutputStream());
os.writeBytes(cmd + "\n");
os.writeBytes("exit\n");
reader = new BufferedReader(new InputStreamReader(
process.getInputStream()));
String err = (new BufferedReader(new InputStreamReader(
process.getErrorStream()))).readLine();
os.flush();
if (process.waitFor() != 0 || (!"".equals(err) && null != err)
&& containsIllegals(err) != true) {
Log.e("Root Error, cmd: " + cmd, err);
return null;
}
return reader;
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static boolean containsIllegals(String toExamine) {
// checks for "+" sign so the program doesn't throw an error when its
// not erroring.
Pattern pattern = Pattern.compile("[+]");
Matcher matcher = pattern.matcher(toExamine);
return matcher.find();
}
}

View File

@@ -1,101 +1,101 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* 920 Text Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 920 Text Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 920 Text Editor. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.root;
import android.content.Context;
import org.apache.commons.io.FileUtils;
import org.sufficientlysecure.rootcommands.Shell;
import org.sufficientlysecure.rootcommands.Toolbox;
import java.io.BufferedReader;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
public class RootUtils {
public static void writeFile(Context context, String path, String text, String encoding, boolean isRoot) throws Exception {
File file = new File(path);
if (!file.canWrite() && isRoot) {
File appFolder = context.getFilesDir();
File tempFile = new File(appFolder, "temp.root.file");
if (!tempFile.exists())
tempFile.createNewFile();
FileUtils.write(tempFile, text, encoding);
Shell shell = Shell.startRootShell();
Toolbox tb = new Toolbox(shell);
String mount = tb.getFilePermissions(path);
tb.copyFile(tempFile.getAbsolutePath(), path, true, false);
tb.setFilePermissions(path, mount);
tempFile.delete();
} else {
FileUtils.write(file,
text,
encoding);
}
}
public static ArrayList<File> getFileList(String path, boolean runAtRoot) {
ArrayList<File> filesList = new ArrayList<File>();
if (runAtRoot == false) {
File base = new File(path);
File[] files = base.listFiles();
if (files == null)
return null;
Collections.addAll(filesList, files);
} else {
BufferedReader reader = null; //errReader = null;
try {
LinuxShell.execute("ls -a " + LinuxShell.getCommandLineString(path));
if (reader == null)
return null;
File f;
String line;
while ((line = reader.readLine()) != null) {
f = new File(line.substring(2));
filesList.add(f);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return filesList;
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* 920 Text Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 920 Text Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 920 Text Editor. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.root;
import android.content.Context;
import org.apache.commons.io.FileUtils;
import org.sufficientlysecure.rootcommands.Shell;
import org.sufficientlysecure.rootcommands.Toolbox;
import java.io.BufferedReader;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
public class RootUtils {
public static void writeFile(Context context, String path, String text, String encoding, boolean isRoot) throws Exception {
File file = new File(path);
if (!file.canWrite() && isRoot) {
File appFolder = context.getFilesDir();
File tempFile = new File(appFolder, "temp.root.file");
if (!tempFile.exists())
tempFile.createNewFile();
FileUtils.write(tempFile, text, encoding);
Shell shell = Shell.startRootShell();
Toolbox tb = new Toolbox(shell);
String mount = tb.getFilePermissions(path);
tb.copyFile(tempFile.getAbsolutePath(), path, true, false);
tb.setFilePermissions(path, mount);
tempFile.delete();
} else {
FileUtils.write(file,
text,
encoding);
}
}
public static ArrayList<File> getFileList(String path, boolean runAtRoot) {
ArrayList<File> filesList = new ArrayList<File>();
if (runAtRoot == false) {
File base = new File(path);
File[] files = base.listFiles();
if (files == null)
return null;
Collections.addAll(filesList, files);
} else {
BufferedReader reader = null; //errReader = null;
try {
LinuxShell.execute("ls -a " + LinuxShell.getCommandLineString(path));
if (reader == null)
return null;
File f;
String line;
while ((line = reader.readLine()) != null) {
f = new File(line.substring(2));
filesList.add(f);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return filesList;
}
}

View File

@@ -1,106 +1,106 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.task;
import android.os.AsyncTask;
import android.widget.Toast;
import org.sufficientlysecure.rootcommands.Shell;
import org.sufficientlysecure.rootcommands.Toolbox;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.activity.MainActivity;
import sharedcode.turboeditor.root.RootUtils;
import sharedcode.turboeditor.util.EventBusEvents;
public class SaveFileTask extends AsyncTask<Void, Void, Void> {
private final MainActivity activity;
private final String filePath;
private final String text;
private final String encoding;
private File file;
private String message;
private String positiveMessage;
public SaveFileTask(MainActivity activity, String filePath, String text, String encoding) {
this.activity = activity;
this.filePath = filePath;
this.text = text;
this.encoding = encoding;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
file = new File(filePath);
positiveMessage = String.format(activity.getString(R.string.file_saved_with_success), file.getName());
}
/**
* {@inheritDoc}
*/
@Override
protected Void doInBackground(final Void... voids) {
try {
if (!file.exists()) {
file.getParentFile().mkdirs();
file.createNewFile();
}
boolean isRoot = false;
if (!file.canWrite()) {
try {
Shell shell = null;
shell = Shell.startRootShell();
Toolbox tb = new Toolbox(shell);
isRoot = tb.isRootAccessGiven();
} catch (IOException | TimeoutException e) {
e.printStackTrace();
isRoot = false;
}
}
RootUtils.writeFile(activity, file.getAbsolutePath(), text, encoding, isRoot);
message = positiveMessage;
} catch (Exception e) {
message = e.getMessage();
}
return null;
}
/**
* {@inheritDoc}
*/
@Override
protected void onPostExecute(final Void aVoid) {
super.onPostExecute(aVoid);
Toast.makeText(activity, message, Toast.LENGTH_LONG).show();
if (message.equals(positiveMessage))
activity.onEvent(new EventBusEvents.SavedAFile(filePath));
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.task;
import android.os.AsyncTask;
import android.widget.Toast;
import org.sufficientlysecure.rootcommands.Shell;
import org.sufficientlysecure.rootcommands.Toolbox;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.activity.MainActivity;
import sharedcode.turboeditor.root.RootUtils;
import sharedcode.turboeditor.util.EventBusEvents;
public class SaveFileTask extends AsyncTask<Void, Void, Void> {
private final MainActivity activity;
private final String filePath;
private final String text;
private final String encoding;
private File file;
private String message;
private String positiveMessage;
public SaveFileTask(MainActivity activity, String filePath, String text, String encoding) {
this.activity = activity;
this.filePath = filePath;
this.text = text;
this.encoding = encoding;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
file = new File(filePath);
positiveMessage = String.format(activity.getString(R.string.file_saved_with_success), file.getName());
}
/**
* {@inheritDoc}
*/
@Override
protected Void doInBackground(final Void... voids) {
try {
if (!file.exists()) {
file.getParentFile().mkdirs();
file.createNewFile();
}
boolean isRoot = false;
if (!file.canWrite()) {
try {
Shell shell = null;
shell = Shell.startRootShell();
Toolbox tb = new Toolbox(shell);
isRoot = tb.isRootAccessGiven();
} catch (IOException | TimeoutException e) {
e.printStackTrace();
isRoot = false;
}
}
RootUtils.writeFile(activity, file.getAbsolutePath(), text, encoding, isRoot);
message = positiveMessage;
} catch (Exception e) {
message = e.getMessage();
}
return null;
}
/**
* {@inheritDoc}
*/
@Override
protected void onPostExecute(final Void aVoid) {
super.onPostExecute(aVoid);
Toast.makeText(activity, message, Toast.LENGTH_LONG).show();
if (message.equals(positiveMessage))
activity.onEvent(new EventBusEvents.SavedAFile(filePath));
}
}

View File

@@ -1,39 +1,39 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import android.content.Context;
import sharedcode.turboeditor.util.PixelDipConverter;
public class EditTextPadding {
public static int getPaddingWithoutLineNumbers(Context context) {
return (int) PixelDipConverter.convertDpToPixel(5, context);
}
public static int getPaddingWithLineNumbers(Context context, float fontSize) {
return (int) PixelDipConverter.convertDpToPixel(fontSize * 2f, context);
}
public static int getPaddingTop(Context context) {
return getPaddingWithoutLineNumbers(context);
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import android.content.Context;
import sharedcode.turboeditor.util.PixelDipConverter;
public class EditTextPadding {
public static int getPaddingWithoutLineNumbers(Context context) {
return (int) PixelDipConverter.convertDpToPixel(5, context);
}
public static int getPaddingWithLineNumbers(Context context, float fontSize) {
return (int) PixelDipConverter.convertDpToPixel(fontSize * 2f, context);
}
public static int getPaddingTop(Context context) {
return getPaddingWithoutLineNumbers(context);
}
}

View File

@@ -1,58 +1,58 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import org.mozilla.universalchardet.UniversalDetector;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
public class FileUtils {
public static String getDetectedEncoding(File file) {
InputStream is = null;
String encoding = null;
try {
is = new FileInputStream(file);
UniversalDetector detector = new UniversalDetector(null);
byte[] buf = new byte[4096];
int nread;
while ((nread = is.read(buf)) > 0 && !detector.isDone()) {
detector.handleData(buf, 0, nread);
}
detector.dataEnd();
encoding = detector.getDetectedCharset();
} catch (IOException e) {
// nothing to do
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
if (encoding == null) {
return Charset.defaultCharset().name();
}
}
return encoding;
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import org.mozilla.universalchardet.UniversalDetector;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
public class FileUtils {
public static String getDetectedEncoding(File file) {
InputStream is = null;
String encoding = null;
try {
is = new FileInputStream(file);
UniversalDetector detector = new UniversalDetector(null);
byte[] buf = new byte[4096];
int nread;
while ((nread = is.read(buf)) > 0 && !detector.isDone()) {
detector.handleData(buf, 0, nread);
}
detector.dataEnd();
encoding = detector.getDetectedCharset();
} catch (IOException e) {
// nothing to do
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
if (encoding == null) {
return Charset.defaultCharset().name();
}
}
return encoding;
}
}

View File

@@ -1,133 +1,136 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import android.text.Layout;
import android.text.TextUtils;
import android.widget.ScrollView;
public class LineUtils {
private boolean[] toCountLinesArray;
private int[] realLines;
public boolean[] getToCountLinesArray() {
return toCountLinesArray;
}
public int[] getRealLines() {
return realLines;
}
public static int getYAtLine(ScrollView scrollView, int lineCount, int line) {
return scrollView.getChildAt(0).getHeight() / lineCount * line;
}
public static int getFirstVisibleLine(ScrollView scrollView, int childHeight, int lineCount) throws ArithmeticException {
int line = (scrollView.getScrollY() * lineCount) / childHeight;
if (line < 0) line = 0;
return line;
}
public static int getLastVisibleLine(ScrollView scrollView, int childHeight, int lineCount, int deviceHeight) {
int line = ((scrollView.getScrollY() + deviceHeight) * lineCount) / childHeight;
if (line > lineCount) line = lineCount;
return line;
}
public void updateHasNewLineArray(int startingLine, int lineCount, Layout layout, String text) {
boolean[] hasNewLineArray = new boolean[lineCount];
toCountLinesArray = new boolean[lineCount];
realLines = new int[lineCount];
if(TextUtils.isEmpty(text))
return;
int i;
// for every line on the edittext
for (i = 0; i < lineCount; i++) {
// check if this line contains "\n"
//hasNewLineArray[i] = text.substring(layout.getLineStart(i), layout.getLineEnd(i)).endsWith("\n");
hasNewLineArray[i] = text.charAt(layout.getLineEnd(i) - 1) == '\n';
// if true
if (hasNewLineArray[i]) {
int j = i - 1;
while (j > -1 && !hasNewLineArray[j]) {
j--;
}
toCountLinesArray[j + 1] = true;
}
}
int realLine = startingLine; // the first line is not 0, is 1. We start counting from 1
for (i = 0; i < toCountLinesArray.length; i++) {
if (toCountLinesArray[i]) {
realLine++;
}
realLines[i] = realLine;
}
}
/**
* Gets the line from the index of the letter in the text
*
* @param index
* @param lineCount
* @param layout
* @return
*/
public static int getLineFromIndex(int index, int lineCount, Layout layout) {
int line;
int currentIndex = 0;
for (line = 0; line < lineCount; line++) {
currentIndex += layout.getLineEnd(line) - layout.getLineStart(line);
if (currentIndex > index) {
break;
}
}
return line;
}
public int firstReadLine() {
return realLines[0];
}
public int lastReadLine() {
return realLines[realLines.length - 1];
}
public int fakeLineFromRealLine(int realLine) {
int i;
int fakeLine = 0;
for (i = 0; i < realLines.length; i++) {
if (realLine == realLines[i]) {
fakeLine = i;
break;
}
}
return fakeLine;
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import android.text.Layout;
import android.text.TextUtils;
import android.widget.ScrollView;
public class LineUtils {
private boolean[] toCountLinesArray;
private int[] realLines;
public boolean[] getToCountLinesArray() {
return toCountLinesArray;
}
public int[] getRealLines() {
return realLines;
}
public static int getYAtLine(ScrollView scrollView, int lineCount, int line) {
return scrollView.getChildAt(0).getHeight() / lineCount * line;
}
public static int getFirstVisibleLine(ScrollView scrollView, int childHeight, int lineCount) throws ArithmeticException {
int line = (scrollView.getScrollY() * lineCount) / childHeight;
if (line < 0) line = 0;
return line;
}
public static int getLastVisibleLine(ScrollView scrollView, int childHeight, int lineCount, int deviceHeight) {
int line = ((scrollView.getScrollY() + deviceHeight) * lineCount) / childHeight;
if (line > lineCount) line = lineCount;
return line;
}
public void updateHasNewLineArray(int startingLine, int lineCount, Layout layout, String text) {
boolean[] hasNewLineArray = new boolean[lineCount];
toCountLinesArray = new boolean[lineCount];
realLines = new int[lineCount];
if(TextUtils.isEmpty(text)) {
toCountLinesArray[0] = false;
realLines[0] = 1;
return;
}
int i;
// for every line on the edittext
for (i = 0; i < lineCount; i++) {
// check if this line contains "\n"
//hasNewLineArray[i] = text.substring(layout.getLineStart(i), layout.getLineEnd(i)).endsWith("\n");
hasNewLineArray[i] = text.charAt(layout.getLineEnd(i) - 1) == '\n';
// if true
if (hasNewLineArray[i]) {
int j = i - 1;
while (j > -1 && !hasNewLineArray[j]) {
j--;
}
toCountLinesArray[j + 1] = true;
}
}
int realLine = startingLine; // the first line is not 0, is 1. We start counting from 1
for (i = 0; i < toCountLinesArray.length; i++) {
if (toCountLinesArray[i]) {
realLine++;
}
realLines[i] = realLine;
}
}
/**
* Gets the line from the index of the letter in the text
*
* @param index
* @param lineCount
* @param layout
* @return
*/
public static int getLineFromIndex(int index, int lineCount, Layout layout) {
int line;
int currentIndex = 0;
for (line = 0; line < lineCount; line++) {
currentIndex += layout.getLineEnd(line) - layout.getLineStart(line);
if (currentIndex > index) {
break;
}
}
return line;
}
public int firstReadLine() {
return realLines[0];
}
public int lastReadLine() {
return realLines[realLines.length - 1];
}
public int fakeLineFromRealLine(int realLine) {
int i;
int fakeLine = 0;
for (i = 0; i < realLines.length; i++) {
if (realLine == realLines[i]) {
fakeLine = i;
break;
}
}
return fakeLine;
}
}

View File

@@ -1,183 +1,185 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import android.content.Context;
import android.support.annotation.Nullable;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.LinkedList;
import java.util.List;
import sharedcode.turboeditor.preferences.PreferenceHelper;
public class PageSystem {
private List<String> pages;
private int[] startingLines;
private int currentPage = 0;
private PageSystemInterface pageSystemInterface;
public PageSystem(Context context, PageSystemInterface pageSystemInterface, String text, @Nullable File file) {
final int charForPage = 15000;
final int MAX_KBs_WITHOUT_PAGE_SYSTEM = 50;
this.pageSystemInterface = pageSystemInterface;
pages = new LinkedList<>();
final boolean dimensionOverLimit;
if(file != null && file.exists() && file.isFile())
dimensionOverLimit = FileUtils.sizeOf(file) >= MAX_KBs_WITHOUT_PAGE_SYSTEM * FileUtils.ONE_KB;
else
dimensionOverLimit = false;
int i = 0;
int to;
int nextIndexOfReturn;
final int textLength = text.length();
boolean pageSystemEnabled = PreferenceHelper.getSplitText(context);
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();
pages.add(text.substring(i, to));
i = to + 1;
}
if (i == 0)
pages.add("");
} else {
pages.add(text);
}
startingLines = new int[pages.size()];
setStartingLines();
}
public int getStartingLine() {
return startingLines[currentPage];
}
public String getCurrentPageText() {
return pages.get(currentPage);
}
public String getTextOfNextPages(boolean includeCurrent, int nOfPages) {
StringBuilder stringBuilder = new StringBuilder();
int i;
for (i = includeCurrent ? 0 : 1; i < nOfPages; i++) {
if (pages.size() > (currentPage + i)) {
stringBuilder.append(pages.get(currentPage + 1));
}
}
return stringBuilder.toString();
}
public void savePage(String currentText) {
pages.set(currentPage, currentText);
}
public void nextPage() {
if (!canReadNextPage()) return;
goToPage(currentPage + 1);
}
public void prevPage() {
if (!canReadPrevPage()) return;
goToPage(currentPage - 1);
}
public void goToPage(int page) {
if (page >= pages.size()) page = pages.size() - 1;
if (page < 0) page = 0;
boolean shouldUpdateLines = page > currentPage && canReadNextPage();
if (shouldUpdateLines) {
String text = getCurrentPageText();
int nOfNewLineNow = (text.length() - text.replace("\n", "").length()) + 1; // normally the last line is not counted so we have to add 1
int nOfNewLineBefore = startingLines[currentPage + 1] - startingLines[currentPage];
int difference = nOfNewLineNow - nOfNewLineBefore;
updateStartingLines(currentPage + 1, difference);
}
currentPage = page;
pageSystemInterface.onPageChanged(page);
}
public void setStartingLines() {
int i;
int startingLine;
int nOfNewLines;
String text;
startingLines[0] = 0;
for (i = 1; i < pages.size(); i++) {
text = pages.get(i - 1);
nOfNewLines = text.length() - text.replace("\n", "").length() + 1;
startingLine = startingLines[i - 1] + nOfNewLines;
startingLines[i] = startingLine;
}
}
public void updateStartingLines(int fromPage, int difference) {
if (difference == 0)
return;
int i;
if (fromPage < 1) fromPage = 1;
for (i = fromPage; i < pages.size(); i++) {
startingLines[i] += difference;
}
}
public int getMaxPage() {
return pages.size() - 1;
}
public int getCurrentPage() {
return currentPage;
}
public String getAllText(String currentPageText) {
pages.set(currentPage, currentPageText);
int i;
StringBuilder allText = new StringBuilder();
for (i = 0; i < pages.size(); i++) {
allText.append(pages.get(i)).append("\n");
}
return allText.toString();
}
public boolean canReadNextPage() {
return currentPage < pages.size() - 1;
}
public boolean canReadPrevPage() {
return currentPage >= 1;
}
public interface PageSystemInterface {
void onPageChanged(int page);
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import android.content.Context;
import android.support.annotation.Nullable;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.LinkedList;
import java.util.List;
import sharedcode.turboeditor.preferences.PreferenceHelper;
public class PageSystem {
private List<String> pages;
private int[] startingLines;
private int currentPage = 0;
private PageSystemInterface pageSystemInterface;
public PageSystem(Context context, PageSystemInterface pageSystemInterface, String text, @Nullable File file) {
final int charForPage = 15000;
final int MAX_KBs_WITHOUT_PAGE_SYSTEM = 50;
this.pageSystemInterface = pageSystemInterface;
pages = new LinkedList<>();
final boolean dimensionOverLimit;
if(file != null && file.exists() && file.isFile())
dimensionOverLimit = FileUtils.sizeOf(file) >= MAX_KBs_WITHOUT_PAGE_SYSTEM * FileUtils.ONE_KB;
else
dimensionOverLimit = false;
int i = 0;
int to;
int nextIndexOfReturn;
final int textLength = text.length();
boolean pageSystemEnabled = PreferenceHelper.getSplitText(context);
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();
pages.add(text.substring(i, to));
i = to + 1;
}
if (i == 0)
pages.add("");
} else {
pages.add(text);
}
startingLines = new int[pages.size()];
setStartingLines();
}
public int getStartingLine() {
return startingLines[currentPage];
}
public String getCurrentPageText() {
return pages.get(currentPage);
}
public String getTextOfNextPages(boolean includeCurrent, int nOfPages) {
StringBuilder stringBuilder = new StringBuilder();
int i;
for (i = includeCurrent ? 0 : 1; i < nOfPages; i++) {
if (pages.size() > (currentPage + i)) {
stringBuilder.append(pages.get(currentPage + 1));
}
}
return stringBuilder.toString();
}
public void savePage(String currentText) {
pages.set(currentPage, currentText);
}
public void nextPage() {
if (!canReadNextPage()) return;
goToPage(currentPage + 1);
}
public void prevPage() {
if (!canReadPrevPage()) return;
goToPage(currentPage - 1);
}
public void goToPage(int page) {
if (page >= pages.size()) page = pages.size() - 1;
if (page < 0) page = 0;
boolean shouldUpdateLines = page > currentPage && canReadNextPage();
if (shouldUpdateLines) {
String text = getCurrentPageText();
int nOfNewLineNow = (text.length() - text.replace("\n", "").length()) + 1; // normally the last line is not counted so we have to add 1
int nOfNewLineBefore = startingLines[currentPage + 1] - startingLines[currentPage];
int difference = nOfNewLineNow - nOfNewLineBefore;
updateStartingLines(currentPage + 1, difference);
}
currentPage = page;
pageSystemInterface.onPageChanged(page);
}
public void setStartingLines() {
int i;
int startingLine;
int nOfNewLines;
String text;
startingLines[0] = 0;
for (i = 1; i < pages.size(); i++) {
text = pages.get(i - 1);
nOfNewLines = text.length() - text.replace("\n", "").length() + 1;
startingLine = startingLines[i - 1] + nOfNewLines;
startingLines[i] = startingLine;
}
}
public void updateStartingLines(int fromPage, int difference) {
if (difference == 0)
return;
int i;
if (fromPage < 1) fromPage = 1;
for (i = fromPage; i < pages.size(); i++) {
startingLines[i] += difference;
}
}
public int getMaxPage() {
return pages.size() - 1;
}
public int getCurrentPage() {
return currentPage;
}
public String getAllText(String currentPageText) {
pages.set(currentPage, currentPageText);
int i;
StringBuilder allText = new StringBuilder();
for (i = 0; i < pages.size(); i++) {
allText.append(pages.get(i));
if(i < pages.size() - 1)
allText.append("\n");
}
return allText.toString();
}
public boolean canReadNextPage() {
return currentPage < pages.size() - 1;
}
public boolean canReadPrevPage() {
return currentPage >= 1;
}
public interface PageSystemInterface {
void onPageChanged(int page);
}
}

View File

@@ -1,134 +1,134 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import android.content.Context;
import android.os.Handler;
import android.view.View;
import com.faizmalkani.floatingactionbutton.FloatingActionButton;
import sharedcode.turboeditor.R;
public class PageSystemButtons {
private static final int TIME_TO_SHOW_FABS = 2000;
final Handler handler = new Handler();
final Runnable runnable = new Runnable() {
@Override
public void run() {
PageSystemButtons.this.next.setVisibility(View.GONE);
PageSystemButtons.this.prev.setVisibility(View.GONE);
}
};
FloatingActionButton prev, next;
PageButtonsInterface pageButtonsInterface;
public PageSystemButtons(Context context, final PageButtonsInterface pageButtonsInterface, FloatingActionButton prev, FloatingActionButton next) {
this.prev = prev;
this.next = next;
this.pageButtonsInterface = pageButtonsInterface;
this.next.setColor(context.getResources().getColor(R.color.fab_light));
this.next.setDrawable(context.getResources().getDrawable(R.drawable.ic_keyboard_arrow_right));
this.prev.setColor(context.getResources().getColor(R.color.fab_light));
this.prev.setDrawable(context.getResources().getDrawable(R.drawable.ic_keyboard_arrow_left));
if (pageButtonsInterface.canReadNextPage())
next.setVisibility(View.VISIBLE);
if (pageButtonsInterface.canReadPrevPage())
prev.setVisibility(View.VISIBLE);
this.next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pageButtonsInterface.nextPageClicked();
}
});
this.next.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
pageButtonsInterface.pageSystemButtonLongClicked();
return true;
}
});
this.prev.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pageButtonsInterface.prevPageClicked();
}
});
this.prev.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
pageButtonsInterface.pageSystemButtonLongClicked();
return true;
}
});
}
public void updateVisibility(boolean autoHide) {
if (pageButtonsInterface.canReadNextPage())
PageSystemButtons.this.next.setVisibility(View.VISIBLE);
else
PageSystemButtons.this.next.setVisibility(View.GONE);
if (pageButtonsInterface.canReadPrevPage())
PageSystemButtons.this.prev.setVisibility(View.VISIBLE);
else
PageSystemButtons.this.prev.setVisibility(View.GONE);
/*if(pageButtonsInterface.hasNext())
next.showFab();
else
next.hideFab();
if(pageButtonsInterface.hasPrev())
prev.showFab();
else
prev.hideFab();*/
if (autoHide) {
handler.removeCallbacks(runnable);
handler.postDelayed(runnable, TIME_TO_SHOW_FABS);
} else {
handler.removeCallbacks(runnable);
}
}
public interface PageButtonsInterface {
public void nextPageClicked();
public void prevPageClicked();
public void pageSystemButtonLongClicked();
public boolean canReadNextPage();
public boolean canReadPrevPage();
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import android.content.Context;
import android.os.Handler;
import android.view.View;
import com.faizmalkani.floatingactionbutton.FloatingActionButton;
import sharedcode.turboeditor.R;
public class PageSystemButtons {
private static final int TIME_TO_SHOW_FABS = 2000;
final Handler handler = new Handler();
final Runnable runnable = new Runnable() {
@Override
public void run() {
PageSystemButtons.this.next.setVisibility(View.GONE);
PageSystemButtons.this.prev.setVisibility(View.GONE);
}
};
FloatingActionButton prev, next;
PageButtonsInterface pageButtonsInterface;
public PageSystemButtons(Context context, final PageButtonsInterface pageButtonsInterface, FloatingActionButton prev, FloatingActionButton next) {
this.prev = prev;
this.next = next;
this.pageButtonsInterface = pageButtonsInterface;
this.next.setColor(context.getResources().getColor(R.color.fab_light));
this.next.setDrawable(context.getResources().getDrawable(R.drawable.ic_keyboard_arrow_right));
this.prev.setColor(context.getResources().getColor(R.color.fab_light));
this.prev.setDrawable(context.getResources().getDrawable(R.drawable.ic_keyboard_arrow_left));
if (pageButtonsInterface.canReadNextPage())
next.setVisibility(View.VISIBLE);
if (pageButtonsInterface.canReadPrevPage())
prev.setVisibility(View.VISIBLE);
this.next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pageButtonsInterface.nextPageClicked();
}
});
this.next.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
pageButtonsInterface.pageSystemButtonLongClicked();
return true;
}
});
this.prev.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
pageButtonsInterface.prevPageClicked();
}
});
this.prev.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
pageButtonsInterface.pageSystemButtonLongClicked();
return true;
}
});
}
public void updateVisibility(boolean autoHide) {
if (pageButtonsInterface.canReadNextPage())
PageSystemButtons.this.next.setVisibility(View.VISIBLE);
else
PageSystemButtons.this.next.setVisibility(View.GONE);
if (pageButtonsInterface.canReadPrevPage())
PageSystemButtons.this.prev.setVisibility(View.VISIBLE);
else
PageSystemButtons.this.prev.setVisibility(View.GONE);
/*if(pageButtonsInterface.hasNext())
next.showFab();
else
next.hideFab();
if(pageButtonsInterface.hasPrev())
prev.showFab();
else
prev.hideFab();*/
if (autoHide) {
handler.removeCallbacks(runnable);
handler.postDelayed(runnable, TIME_TO_SHOW_FABS);
} else {
handler.removeCallbacks(runnable);
}
}
public interface PageButtonsInterface {
public void nextPageClicked();
public void prevPageClicked();
public void pageSystemButtonLongClicked();
public boolean canReadNextPage();
public boolean canReadPrevPage();
}
}

View File

@@ -1,92 +1,92 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import java.util.regex.Pattern;
public class Patterns {
/*
public static final int COLOR_NUMBER = 0xffff6600;
public static final int COLOR_KEYWORD = 0xff2f6f9f;
public static final int COLOR_ATTR = 0xff4f9fcf;
public static final int COLOR_ATTR_VALUE = 0xffd44950;
public static final int COLOR_STRING = 0xffd44950;
public static final int COLOR_COMMENT = 0xff999999;
*/
// Strings
public static final Pattern GENERAL_STRINGS = Pattern.compile("\"(.*?)\"|'(.*?)'");
public static final Pattern HTML_OPEN_TAGS = Pattern.compile(
"<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>");
public static final Pattern HTML_CLOSE_TAGS = Pattern.compile(
"</([A-Za-z][A-Za-z0-9]*)\\b[^>]*>");
public static final Pattern HTML_ATTRS = Pattern.compile(
"(\\S+)=[\"']?((?:.(?![\"']?\\s+(?:\\S+)=|[>\"']))+.)[\"']?");
//static final Pattern CSS_STYLE_NAME= Pattern.compile(
// "[ \\t\\n\\r\\f](.+?)\\{([^\\)]+)\\}");
public static final Pattern CSS_ATTRS = Pattern.compile(
"(.+?):(.+?);");
public static final Pattern CSS_ATTR_VALUE = Pattern.compile(
":[ \t](.+?);");
public static final Pattern NUMBERS = Pattern.compile(
"(\\b(\\d*[.]?\\d+)\\b)");
//public static final Pattern CSS_NUMBERS = Pattern.compile(
// "/^auto$|^[+-]?[0-9]+\\.?([0-9]+)?(px|em|ex|%|in|cm|mm|pt|pc)?$/ig");
public static final Pattern SYMBOLS = Pattern.compile(
"(!|,|\\(|\\)|\\+|\\-|\\*|<|>|=|\\.|\\?|;|\\{|\\}|\\[|\\])");
public static final Pattern NUMBERS_OR_SYMBOLS = Pattern.compile(NUMBERS.pattern()+"|"+SYMBOLS.pattern());
public static final Pattern GENERAL_KEYWORDS = Pattern.compile(
"\\b(alignas|alignof|and|and_eq|asm|auto|bitand|bitorbool|break|case|catch|char|"
+ "char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype"
+ "|default|delete|do|double|dynamic_cast|echo|else|enum|explicit|export|extern|"
+ "false|float|for|friend|function|goto|if|inline|int|mutable|namespace|new|noexcept|"
+ "not|not_eq|null|nullptr|operator|or|or_eq|private|protected|public|register|"
+ "reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast"
+ "|struct|switch|template|this|thread_local|throw|true|try|typedef|typeid|typename|undefined"
+ "|union|unsigned|using|var|virtual|void|volatile|wchar_t|while|xor|xor_eq|)\\b", Pattern.CASE_INSENSITIVE);
public static final Pattern PY_KEYWORDS = Pattern.compile(
"\\b(int|float|long|complex|str|unicode|list|tuple|bytearray|buffer|xrange|set|frozenset|dict|bool)|(True|False|None|self|NotImplemented|Ellipsis|__debug__|__file__)|(and|del|from|not|while|as|elif|global|or|with|assert|else|if|pass|yield|break|except|import|print|class|exec|in|raise|continue|finally|is|return|def|for|lambda|try)|(ArithmeticError|AssertionError|AttributeError|BaseException|DeprecationWarning|EnvironmentError|EOFError|Exception|FloatingPointError|FutureWarning|GeneratorExit|IOError|ImportError|ImportWarning|IndexError|KeyError|KeyboardInterrupt|LookupError|MemoryError|NameError|NotImplementedError|OSError|OverflowError|PendingDeprecationWarning|ReferenceError|RuntimeError|RuntimeWarning|StandardError|StopIteration|SyntaxError|SyntaxWarning|SystemError|SystemExit|TypeError|UnboundLocalError|UserWarning|UnicodeError|UnicodeWarning|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ValueError|Warning|WindowsError|ZeroDivisionError)\\b", Pattern.CASE_INSENSITIVE);
public static final Pattern LUA_KEYWORDS = Pattern.compile(
"@[A-Za-z0-9_\\.]*|\\b(local|global|boolean|number|userdata)\\b|\\b(true|false|nil)\\b|\\b(return|then|while|and|break|do|else|elseif|end|for|function|if|in|not|or|repeat|until|thread|table)\\b" +
"|(?i)\\b(editsetText|editText|inkey|touch|system.exit|system.expCall|system.getAppPath|system.getCardMnt|system.getSec|system.impCallActionSend|system.impCallActionView|system.setrun|system.setScreen|system.version|El_Psy_Congroo|canvas.drawCircle|canvas.drawCls|canvas.drawLine|canvas.drawRect|canvas.getBmpSize|canvas.getColor|canvas.getg|canvas.getviewSize|canvas.loadBmp|canvas.putCircle|canvas.putCls|canvas.putflush|canvas.putg|canvas.putLine|canvas.putRect|canvas.putrotg|canvas.putWork|canvas.saveBmp|canvas.setMainBmp|canvas.setWorkBmp|canvas.workCls|canvas.workflush|color|canvas.drawText|canvas.drawTextBox|canvas.drawTextCenter|canvas.drawTextRotate|canvas.putText|canvas.putTextBox|canvas.putTextRotate|http.addHeader|http.addParam|http.clrHeader|http.clrParam|http.get|http.post|http.setContentType|http.setPostFile|http.status|dialog|item.add|item.check|item.clear|item.list|item.radio|toast|sensor.getAccel|sensor.setdevAccel|sensor.setdevMagnet|sensor.setdevOrient|sensor.getGdirection|sensor.getMagnet|sensor.getOrient|sound.beep|sound.isPlay|sound.pause|sound.restart|sound.setSoundFile|sound.start|sound.stop|zip.addFile|zip.exec|zip.status|sock.close|sock.connectOpen|sock.getAddress|sock.listenOpen|sock.recv|sock.send|sprite.clear|sprite.define|sprite.init|sprite.move|sprite.put)\\b" +
"|(?i)\\b(assert|collectgarbage|coroutine.create|coroutine.resume|coroutine.running|coroutine.status|coroutine.wrap|coroutine.yield|debug.debug|debug.getfenv|debug.gethook|debug.getinfo|debug.getlocal|debug.getmetatable|debug.getregistry|debug.getupvalue|debug.setfenv|debug.sethook|debug.setlocal|debug.setmetatable|debug.setupvalue|debug.traceback|dofile|error|file:close|file:flush|file:lines|file:read|file:seek|file:setvbuf|file:write|getfenv|getmetatable|io.close|io.flush|io.input|io.lines|io.open|io.output|io.popen|io.read|io.tmpfile|io.type|io.write|ipairs|load|loadfile|loadstring|math.abs|math.acos|math.asin|math.atan2|math.atan|math.ceil|math.cosh|math.cos|math.deg|math.exp|math.floor|math.fmod|math.frexp|math.ldexp|math.log10|math.log|math.max|math.min|math.modf|math.pow|math.rad|math.random|math.randomseed|math.sinh|math.sin|math.sqrt|math.tanh|math.tan|module|next|os.clock|os.date|os.difftime|os.execute|os.exit|os.getenv|os.remove|os.rename|os.setlocale|os.time|os.tmpname|package.cpath|package.loaded|package.loadlib|package.path|package.preload|package.seeal|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string.byte|string.char|string.dump|string.find|string.format|string.gmatch|string.gsub|string.len|string.lower|string.match|string.rep|string.reverse|string.sub|string.upper|table.concat|table.insert|table.maxn|table.remove|table.sort|tonumber|tostring|type|unpack|xpcall)\\b"
);
public static final Pattern PHP_VARIABLES = Pattern.compile("\\$\\s*(\\w+)");
// Comments
public static final Pattern XML_COMMENTS = Pattern.compile("(?s)<!--.*?-->");
public static final Pattern GENERAL_COMMENTS = Pattern.compile(
"/\\*(?:.|[\\n\\r])*?\\*/|(?<!:)//.*|#.*");
// same as GENERAL_COMMENTS but without -> //
public static final Pattern GENERAL_COMMENTS_NO_SLASH = Pattern.compile(
"/\\*(?:.|[\\n\\r])*?\\*/|#.*");
public static final Pattern SQL_KEYWORDS = Pattern.compile(
"\\b(ADD|EXCEPT|PERCENT|ALL|EXEC|PLAN|ALTER|EXECUTE|PRECISION|AND|EXISTS|PRIMARY|ANY|EXIT|PRINT|AS|FETCH|PROC|ASC|FILE|PROCEDURE|AUTHORIZATION|FILLFACTOR|PUBLIC|BACKUP|FOR|RAISERROR|BEGIN|FOREIGN|READ|BETWEEN|FREETEXT|READTEXT|BREAK|FREETEXTTABLE|RECONFIGURE|BROWSE|FROM|REFERENCES|BULK|FULL|REPLICATION|BY|FUNCTION|RESTORE|CASCADE|GOTO|RESTRICT|CASE|GRANT|RETURN|CHECK|GROUP|REVOKE|CHECKPOINT|HAVING|RIGHT|CLOSE|HOLDLOCK|ROLLBACK|CLUSTERED|IDENTITY|ROWCOUNT|COALESCE|IDENTITY_INSERT|ROWGUIDCOL|COLLATE|IDENTITYCOL|RULE|COLUMN|IF|SAVE|COMMIT|IN|SCHEMA|COMPUTE|INDEX|SELECT|CONSTRAINT|INNER|SESSION_USER|CONTAINS|INSERT|SET|CONTAINSTABLE|INTERSECT|SETUSER|CONTINUE|INTO|SHUTDOWN|CONVERT|IS|SOME|CREATE|JOIN|STATISTICS|CROSS|KEY|SYSTEM_USER|CURRENT|KILL|TABLE|CURRENT_DATE|LEFT|TEXTSIZE|CURRENT_TIME|LIKE|THEN|CURRENT_TIMESTAMP|LINENO|TO|CURRENT_USER|LOAD|TOP|CURSOR|NATIONAL|TRAN|DATABASE|NOCHECK|TRANSACTION|DBCC|NONCLUSTERED|TRIGGER|DEALLOCATE|NOT|TRUNCATE|DECLARE|NULL|TSEQUAL|DEFAULT|NULLIF|UNION|DELETE|OF|UNIQUE|DENY|OFF|UPDATE|DESC|OFFSETS|UPDATETEXT|DISK|ON|USE|DISTINCT|OPEN|USER|DISTRIBUTED|OPENDATASOURCE|VALUES|DOUBLE|OPENQUERY|VARYING|DROP|OPENROWSET|VIEW|DUMMY|OPENXML|WAITFOR|DUMP|OPTION|WHEN|ELSE|OR|WHERE|END|ORDER|WHILE|ERRLVL|OUTER|WITH|ESCAPE|OVER|WRITETEXT)\\b", Pattern.CASE_INSENSITIVE);
public static final Pattern LINK = android.util.Patterns.WEB_URL;
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import java.util.regex.Pattern;
public class Patterns {
/*
public static final int COLOR_NUMBER = 0xffff6600;
public static final int COLOR_KEYWORD = 0xff2f6f9f;
public static final int COLOR_ATTR = 0xff4f9fcf;
public static final int COLOR_ATTR_VALUE = 0xffd44950;
public static final int COLOR_STRING = 0xffd44950;
public static final int COLOR_COMMENT = 0xff999999;
*/
// Strings
public static final Pattern GENERAL_STRINGS = Pattern.compile("\"(.*?)\"|'(.*?)'");
public static final Pattern HTML_OPEN_TAGS = Pattern.compile(
"<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>");
public static final Pattern HTML_CLOSE_TAGS = Pattern.compile(
"</([A-Za-z][A-Za-z0-9]*)\\b[^>]*>");
public static final Pattern HTML_ATTRS = Pattern.compile(
"(\\S+)=[\"']?((?:.(?![\"']?\\s+(?:\\S+)=|[>\"']))+.)[\"']?");
//static final Pattern CSS_STYLE_NAME= Pattern.compile(
// "[ \\t\\n\\r\\f](.+?)\\{([^\\)]+)\\}");
public static final Pattern CSS_ATTRS = Pattern.compile(
"(.+?):(.+?);");
public static final Pattern CSS_ATTR_VALUE = Pattern.compile(
":[ \t](.+?);");
public static final Pattern NUMBERS = Pattern.compile(
"(\\b(\\d*[.]?\\d+)\\b)");
//public static final Pattern CSS_NUMBERS = Pattern.compile(
// "/^auto$|^[+-]?[0-9]+\\.?([0-9]+)?(px|em|ex|%|in|cm|mm|pt|pc)?$/ig");
public static final Pattern SYMBOLS = Pattern.compile(
"(!|,|\\(|\\)|\\+|\\-|\\*|<|>|=|\\.|\\?|;|\\{|\\}|\\[|\\])");
public static final Pattern NUMBERS_OR_SYMBOLS = Pattern.compile(NUMBERS.pattern()+"|"+SYMBOLS.pattern());
public static final Pattern GENERAL_KEYWORDS = Pattern.compile(
"\\b(alignas|alignof|and|and_eq|asm|auto|bitand|bitorbool|break|case|catch|char|"
+ "char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype"
+ "|default|delete|do|double|dynamic_cast|echo|else|enum|explicit|export|extern|"
+ "false|float|for|friend|function|goto|if|inline|int|mutable|namespace|new|noexcept|"
+ "not|not_eq|null|nullptr|operator|or|or_eq|private|protected|public|register|"
+ "reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast"
+ "|struct|switch|template|this|thread_local|throw|true|try|typedef|typeid|typename|undefined"
+ "|union|unsigned|using|var|virtual|void|volatile|wchar_t|while|xor|xor_eq|)\\b", Pattern.CASE_INSENSITIVE);
public static final Pattern PY_KEYWORDS = Pattern.compile(
"\\b(int|float|long|complex|str|unicode|list|tuple|bytearray|buffer|xrange|set|frozenset|dict|bool)|(True|False|None|self|NotImplemented|Ellipsis|__debug__|__file__)|(and|del|from|not|while|as|elif|global|or|with|assert|else|if|pass|yield|break|except|import|print|class|exec|in|raise|continue|finally|is|return|def|for|lambda|try)|(ArithmeticError|AssertionError|AttributeError|BaseException|DeprecationWarning|EnvironmentError|EOFError|Exception|FloatingPointError|FutureWarning|GeneratorExit|IOError|ImportError|ImportWarning|IndexError|KeyError|KeyboardInterrupt|LookupError|MemoryError|NameError|NotImplementedError|OSError|OverflowError|PendingDeprecationWarning|ReferenceError|RuntimeError|RuntimeWarning|StandardError|StopIteration|SyntaxError|SyntaxWarning|SystemError|SystemExit|TypeError|UnboundLocalError|UserWarning|UnicodeError|UnicodeWarning|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ValueError|Warning|WindowsError|ZeroDivisionError)\\b", Pattern.CASE_INSENSITIVE);
public static final Pattern LUA_KEYWORDS = Pattern.compile(
"@[A-Za-z0-9_\\.]*|\\b(local|global|boolean|number|userdata)\\b|\\b(true|false|nil)\\b|\\b(return|then|while|and|break|do|else|elseif|end|for|function|if|in|not|or|repeat|until|thread|table)\\b" +
"|(?i)\\b(editsetText|editText|inkey|touch|system.exit|system.expCall|system.getAppPath|system.getCardMnt|system.getSec|system.impCallActionSend|system.impCallActionView|system.setrun|system.setScreen|system.version|El_Psy_Congroo|canvas.drawCircle|canvas.drawCls|canvas.drawLine|canvas.drawRect|canvas.getBmpSize|canvas.getColor|canvas.getg|canvas.getviewSize|canvas.loadBmp|canvas.putCircle|canvas.putCls|canvas.putflush|canvas.putg|canvas.putLine|canvas.putRect|canvas.putrotg|canvas.putWork|canvas.saveBmp|canvas.setMainBmp|canvas.setWorkBmp|canvas.workCls|canvas.workflush|color|canvas.drawText|canvas.drawTextBox|canvas.drawTextCenter|canvas.drawTextRotate|canvas.putText|canvas.putTextBox|canvas.putTextRotate|http.addHeader|http.addParam|http.clrHeader|http.clrParam|http.get|http.post|http.setContentType|http.setPostFile|http.status|dialog|item.add|item.check|item.clear|item.list|item.radio|toast|sensor.getAccel|sensor.setdevAccel|sensor.setdevMagnet|sensor.setdevOrient|sensor.getGdirection|sensor.getMagnet|sensor.getOrient|sound.beep|sound.isPlay|sound.pause|sound.restart|sound.setSoundFile|sound.start|sound.stop|zip.addFile|zip.exec|zip.status|sock.close|sock.connectOpen|sock.getAddress|sock.listenOpen|sock.recv|sock.send|sprite.clear|sprite.define|sprite.init|sprite.move|sprite.put)\\b" +
"|(?i)\\b(assert|collectgarbage|coroutine.create|coroutine.resume|coroutine.running|coroutine.status|coroutine.wrap|coroutine.yield|debug.debug|debug.getfenv|debug.gethook|debug.getinfo|debug.getlocal|debug.getmetatable|debug.getregistry|debug.getupvalue|debug.setfenv|debug.sethook|debug.setlocal|debug.setmetatable|debug.setupvalue|debug.traceback|dofile|error|file:close|file:flush|file:lines|file:read|file:seek|file:setvbuf|file:write|getfenv|getmetatable|io.close|io.flush|io.input|io.lines|io.open|io.output|io.popen|io.read|io.tmpfile|io.type|io.write|ipairs|load|loadfile|loadstring|math.abs|math.acos|math.asin|math.atan2|math.atan|math.ceil|math.cosh|math.cos|math.deg|math.exp|math.floor|math.fmod|math.frexp|math.ldexp|math.log10|math.log|math.max|math.min|math.modf|math.pow|math.rad|math.random|math.randomseed|math.sinh|math.sin|math.sqrt|math.tanh|math.tan|module|next|os.clock|os.date|os.difftime|os.execute|os.exit|os.getenv|os.remove|os.rename|os.setlocale|os.time|os.tmpname|package.cpath|package.loaded|package.loadlib|package.path|package.preload|package.seeal|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string.byte|string.char|string.dump|string.find|string.format|string.gmatch|string.gsub|string.len|string.lower|string.match|string.rep|string.reverse|string.sub|string.upper|table.concat|table.insert|table.maxn|table.remove|table.sort|tonumber|tostring|type|unpack|xpcall)\\b"
);
public static final Pattern PHP_VARIABLES = Pattern.compile("\\$\\s*(\\w+)");
// Comments
public static final Pattern XML_COMMENTS = Pattern.compile("(?s)<!--.*?-->");
public static final Pattern GENERAL_COMMENTS = Pattern.compile(
"/\\*(?:.|[\\n\\r])*?\\*/|(?<!:)//.*|#.*");
// same as GENERAL_COMMENTS but without -> //
public static final Pattern GENERAL_COMMENTS_NO_SLASH = Pattern.compile(
"/\\*(?:.|[\\n\\r])*?\\*/|#.*");
public static final Pattern SQL_KEYWORDS = Pattern.compile(
"\\b(ADD|EXCEPT|PERCENT|ALL|EXEC|PLAN|ALTER|EXECUTE|PRECISION|AND|EXISTS|PRIMARY|ANY|EXIT|PRINT|AS|FETCH|PROC|ASC|FILE|PROCEDURE|AUTHORIZATION|FILLFACTOR|PUBLIC|BACKUP|FOR|RAISERROR|BEGIN|FOREIGN|READ|BETWEEN|FREETEXT|READTEXT|BREAK|FREETEXTTABLE|RECONFIGURE|BROWSE|FROM|REFERENCES|BULK|FULL|REPLICATION|BY|FUNCTION|RESTORE|CASCADE|GOTO|RESTRICT|CASE|GRANT|RETURN|CHECK|GROUP|REVOKE|CHECKPOINT|HAVING|RIGHT|CLOSE|HOLDLOCK|ROLLBACK|CLUSTERED|IDENTITY|ROWCOUNT|COALESCE|IDENTITY_INSERT|ROWGUIDCOL|COLLATE|IDENTITYCOL|RULE|COLUMN|IF|SAVE|COMMIT|IN|SCHEMA|COMPUTE|INDEX|SELECT|CONSTRAINT|INNER|SESSION_USER|CONTAINS|INSERT|SET|CONTAINSTABLE|INTERSECT|SETUSER|CONTINUE|INTO|SHUTDOWN|CONVERT|IS|SOME|CREATE|JOIN|STATISTICS|CROSS|KEY|SYSTEM_USER|CURRENT|KILL|TABLE|CURRENT_DATE|LEFT|TEXTSIZE|CURRENT_TIME|LIKE|THEN|CURRENT_TIMESTAMP|LINENO|TO|CURRENT_USER|LOAD|TOP|CURSOR|NATIONAL|TRAN|DATABASE|NOCHECK|TRANSACTION|DBCC|NONCLUSTERED|TRIGGER|DEALLOCATE|NOT|TRUNCATE|DECLARE|NULL|TSEQUAL|DEFAULT|NULLIF|UNION|DELETE|OF|UNIQUE|DENY|OFF|UPDATE|DESC|OFFSETS|UPDATETEXT|DISK|ON|USE|DISTINCT|OPEN|USER|DISTRIBUTED|OPENDATASOURCE|VALUES|DOUBLE|OPENQUERY|VARYING|DROP|OPENROWSET|VIEW|DUMMY|OPENXML|WAITFOR|DUMP|OPTION|WHEN|ELSE|OR|WHERE|END|ORDER|WHILE|ERRLVL|OUTER|WITH|ESCAPE|OVER|WRITETEXT)\\b", Pattern.CASE_INSENSITIVE);
public static final Pattern LINK = android.util.Patterns.WEB_URL;
}

View File

@@ -1,63 +1,63 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import java.util.LinkedList;
public class SearchResult {
// list of index
public LinkedList<Integer> foundIndex;
public int textLength;
public boolean isReplace;
public String textToReplace;
public int index;
public SearchResult(LinkedList<Integer> foundIndex, int textLength, boolean isReplace, String textToReplace) {
this.foundIndex = foundIndex;
this.textLength = textLength;
this.isReplace = isReplace;
this.textToReplace = textToReplace;
}
public void doneReplace() {
foundIndex.remove(index);
int i;
for (i = index; i < foundIndex.size(); i++) {
foundIndex.set(i, foundIndex.get(i) + textToReplace.length() - textLength);
}
index--; // an element was removed so we decrease the index
}
public int numberOfResults() {
return foundIndex.size();
}
public boolean hasNext() {
return index < foundIndex.size() - 1;
}
public boolean hasPrevious() {
return index > 0;
}
public boolean canReplaceSomething() {
return isReplace && foundIndex.size() > 0;
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.texteditor;
import java.util.LinkedList;
public class SearchResult {
// list of index
public LinkedList<Integer> foundIndex;
public int textLength;
public boolean isReplace;
public String textToReplace;
public int index;
public SearchResult(LinkedList<Integer> foundIndex, int textLength, boolean isReplace, String textToReplace) {
this.foundIndex = foundIndex;
this.textLength = textLength;
this.isReplace = isReplace;
this.textToReplace = textToReplace;
}
public void doneReplace() {
foundIndex.remove(index);
int i;
for (i = index; i < foundIndex.size(); i++) {
foundIndex.set(i, foundIndex.get(i) + textToReplace.length() - textLength);
}
index--; // an element was removed so we decrease the index
}
public int numberOfResults() {
return foundIndex.size();
}
public boolean hasNext() {
return index < foundIndex.size() - 1;
}
public boolean hasPrevious() {
return index > 0;
}
public boolean canReplaceSomething() {
return isReplace && foundIndex.size() > 0;
}
}

View File

@@ -1,208 +1,208 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.annotation.SuppressLint;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
public class AccessStorageApi {
public static Bitmap loadPrescaledBitmap(String filename) throws IOException {
// Facebook image size
final int IMAGE_MAX_SIZE = 630;
File file = null;
FileInputStream fis;
BitmapFactory.Options opts;
int resizeScale;
Bitmap bmp;
file = new File(filename);
// This bit determines only the width/height of the bitmap without loading the contents
opts = new BitmapFactory.Options();
opts.inJustDecodeBounds = true;
fis = new FileInputStream(file);
BitmapFactory.decodeStream(fis, null, opts);
fis.close();
// Find the correct scale value. It should be a power of 2
resizeScale = 1;
if (opts.outHeight > IMAGE_MAX_SIZE || opts.outWidth > IMAGE_MAX_SIZE) {
resizeScale = (int) Math.pow(2, (int) Math.round(Math.log(IMAGE_MAX_SIZE / (double) Math.max(opts.outHeight, opts.outWidth)) / Math.log(0.5)));
}
// Load pre-scaled bitmap
opts = new BitmapFactory.Options();
opts.inSampleSize = resizeScale;
fis = new FileInputStream(file);
bmp = BitmapFactory.decodeStream(fis, null, opts);
fis.close();
return bmp;
}
/**
* Get a file path from a Uri. This will get the the path for Storage Access
* Framework Documents, as well as the _data field for the MediaStore and
* other file-based ContentProviders.
*
* @param context The context.
* @param uri The Uri to query.
* @author paulburke
*/
@SuppressLint("NewApi")
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
if ("primary".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
}
// TODO handle non-primary volumes
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
final Uri contentUri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
else if (isMediaDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
Uri contentUri = null;
if ("image".equals(type)) {
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if ("video".equals(type)) {
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if ("audio".equals(type)) {
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
final String selection = "_id=?";
final String[] selectionArgs = new String[]{
split[1]
};
return getDataColumn(context, contentUri, selection, selectionArgs);
}
}
// MediaStore (and general)
else if ("content".equalsIgnoreCase(uri.getScheme())) {
return getDataColumn(context, uri, null, null);
}
// File
else if ("file".equalsIgnoreCase(uri.getScheme())) {
return uri.getPath();
}
return null;
}
/**
* Get the value of the data column for this Uri. This is useful for
* MediaStore Uris, and other file-based ContentProviders.
*
* @param context The context.
* @param uri The Uri to query.
* @param selection (Optional) Filter used in the query.
* @param selectionArgs (Optional) Selection arguments used in the query.
* @return The value of the _data column, which is typically a file path.
*/
public static String getDataColumn(Context context, Uri uri, String selection,
String[] selectionArgs) {
Cursor cursor = null;
final String column = "_data";
final String[] projection = {
column
};
try {
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
null);
if (cursor != null && cursor.moveToFirst()) {
final int column_index = cursor.getColumnIndexOrThrow(column);
return cursor.getString(column_index);
}
} finally {
if (cursor != null)
cursor.close();
}
return null;
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is ExternalStorageProvider.
*/
public static boolean isExternalStorageDocument(Uri uri) {
return "com.android.externalstorage.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is DownloadsProvider.
*/
public static boolean isDownloadsDocument(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is MediaProvider.
*/
public static boolean isMediaDocument(Uri uri) {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.annotation.SuppressLint;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
public class AccessStorageApi {
public static Bitmap loadPrescaledBitmap(String filename) throws IOException {
// Facebook image size
final int IMAGE_MAX_SIZE = 630;
File file = null;
FileInputStream fis;
BitmapFactory.Options opts;
int resizeScale;
Bitmap bmp;
file = new File(filename);
// This bit determines only the width/height of the bitmap without loading the contents
opts = new BitmapFactory.Options();
opts.inJustDecodeBounds = true;
fis = new FileInputStream(file);
BitmapFactory.decodeStream(fis, null, opts);
fis.close();
// Find the correct scale value. It should be a power of 2
resizeScale = 1;
if (opts.outHeight > IMAGE_MAX_SIZE || opts.outWidth > IMAGE_MAX_SIZE) {
resizeScale = (int) Math.pow(2, (int) Math.round(Math.log(IMAGE_MAX_SIZE / (double) Math.max(opts.outHeight, opts.outWidth)) / Math.log(0.5)));
}
// Load pre-scaled bitmap
opts = new BitmapFactory.Options();
opts.inSampleSize = resizeScale;
fis = new FileInputStream(file);
bmp = BitmapFactory.decodeStream(fis, null, opts);
fis.close();
return bmp;
}
/**
* Get a file path from a Uri. This will get the the path for Storage Access
* Framework Documents, as well as the _data field for the MediaStore and
* other file-based ContentProviders.
*
* @param context The context.
* @param uri The Uri to query.
* @author paulburke
*/
@SuppressLint("NewApi")
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
if ("primary".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
}
// TODO handle non-primary volumes
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
final Uri contentUri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
else if (isMediaDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
Uri contentUri = null;
if ("image".equals(type)) {
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if ("video".equals(type)) {
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if ("audio".equals(type)) {
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
final String selection = "_id=?";
final String[] selectionArgs = new String[]{
split[1]
};
return getDataColumn(context, contentUri, selection, selectionArgs);
}
}
// MediaStore (and general)
else if ("content".equalsIgnoreCase(uri.getScheme())) {
return getDataColumn(context, uri, null, null);
}
// File
else if ("file".equalsIgnoreCase(uri.getScheme())) {
return uri.getPath();
}
return null;
}
/**
* Get the value of the data column for this Uri. This is useful for
* MediaStore Uris, and other file-based ContentProviders.
*
* @param context The context.
* @param uri The Uri to query.
* @param selection (Optional) Filter used in the query.
* @param selectionArgs (Optional) Selection arguments used in the query.
* @return The value of the _data column, which is typically a file path.
*/
public static String getDataColumn(Context context, Uri uri, String selection,
String[] selectionArgs) {
Cursor cursor = null;
final String column = "_data";
final String[] projection = {
column
};
try {
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
null);
if (cursor != null && cursor.moveToFirst()) {
final int column_index = cursor.getColumnIndexOrThrow(column);
return cursor.getString(column_index);
}
} finally {
if (cursor != null)
cursor.close();
}
return null;
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is ExternalStorageProvider.
*/
public static boolean isExternalStorageDocument(Uri uri) {
return "com.android.externalstorage.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is DownloadsProvider.
*/
public static boolean isDownloadsDocument(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is MediaProvider.
*/
public static boolean isMediaDocument(Uri uri) {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
}

View File

@@ -1,138 +1,138 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;/*
* The Alphanum Algorithm is an improved sorting algorithm for strings
* containing numbers. Instead of sorting numbers in ASCII order like
* a standard sort, this algorithm sorts numbers in numeric order.
*
* The Alphanum Algorithm is discussed at http://www.DaveKoelle.com
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
import java.util.Comparator;
/**
* This is an updated version with enhancements made by Daniel Migowski, Andre Bogus, and David
* Koelle
* <p/>
* To convert to use Templates (Java 1.5+): - Change "implements Comparator" to "implements
* Comparator<String>" - Change "compare(Object o1, Object o2)" to "compare(String s1, String s2)" -
* Remove the type checking and casting in compare().
* <p/>
* To use this class: Use the static "sort" method from the java.util.Collections class:
* Collections.sort(your list, new AlphanumComparator());
*/
public class AlphanumComparator implements Comparator {
private boolean isDigit(char ch) {
return ch >= 48 && ch <= 57;
}
/**
* Length of string is passed in for improved efficiency (only need to calculate it once) *
*/
private String getChunk(String s, int slength, int marker) {
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c)) {
while (marker < slength) {
c = s.charAt(marker);
if (!isDigit(c)) {
break;
}
chunk.append(c);
marker++;
}
} else {
while (marker < slength) {
c = s.charAt(marker);
if (isDigit(c)) {
break;
}
chunk.append(c);
marker++;
}
}
return chunk.toString();
}
public String getTheString(Object obj) {
return (String) obj;
}
public int compare(Object o1, Object o2) {
String s1 = getTheString(o1);
String s2 = getTheString(o2);
int thisMarker = 0;
int thatMarker = 0;
int s1Length = s1.length();
int s2Length = s2.length();
while (thisMarker < s1Length && thatMarker < s2Length) {
String thisChunk = getChunk(s1, s1Length, thisMarker);
thisMarker += thisChunk.length();
String thatChunk = getChunk(s2, s2Length, thatMarker);
thatMarker += thatChunk.length();
// If both chunks contain numeric characters, sort them numerically
int result = 0;
if (isDigit(thisChunk.charAt(0)) && isDigit(thatChunk.charAt(0))) {
// Simple chunk comparison by length.
int thisChunkLength = thisChunk.length();
result = thisChunkLength - thatChunk.length();
// If equal, the first different number counts
if (result == 0) {
for (int i = 0; i < thisChunkLength; i++) {
result = thisChunk.charAt(i) - thatChunk.charAt(i);
if (result != 0) {
return result;
}
}
}
} else {
result = thisChunk.compareTo(thatChunk);
}
if (result != 0) {
return result;
}
}
return s1Length - s2Length;
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;/*
* The Alphanum Algorithm is an improved sorting algorithm for strings
* containing numbers. Instead of sorting numbers in ASCII order like
* a standard sort, this algorithm sorts numbers in numeric order.
*
* The Alphanum Algorithm is discussed at http://www.DaveKoelle.com
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
import java.util.Comparator;
/**
* This is an updated version with enhancements made by Daniel Migowski, Andre Bogus, and David
* Koelle
* <p/>
* To convert to use Templates (Java 1.5+): - Change "implements Comparator" to "implements
* Comparator<String>" - Change "compare(Object o1, Object o2)" to "compare(String s1, String s2)" -
* Remove the type checking and casting in compare().
* <p/>
* To use this class: Use the static "sort" method from the java.util.Collections class:
* Collections.sort(your list, new AlphanumComparator());
*/
public class AlphanumComparator implements Comparator {
private boolean isDigit(char ch) {
return ch >= 48 && ch <= 57;
}
/**
* Length of string is passed in for improved efficiency (only need to calculate it once) *
*/
private String getChunk(String s, int slength, int marker) {
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c)) {
while (marker < slength) {
c = s.charAt(marker);
if (!isDigit(c)) {
break;
}
chunk.append(c);
marker++;
}
} else {
while (marker < slength) {
c = s.charAt(marker);
if (isDigit(c)) {
break;
}
chunk.append(c);
marker++;
}
}
return chunk.toString();
}
public String getTheString(Object obj) {
return (String) obj;
}
public int compare(Object o1, Object o2) {
String s1 = getTheString(o1);
String s2 = getTheString(o2);
int thisMarker = 0;
int thatMarker = 0;
int s1Length = s1.length();
int s2Length = s2.length();
while (thisMarker < s1Length && thatMarker < s2Length) {
String thisChunk = getChunk(s1, s1Length, thisMarker);
thisMarker += thisChunk.length();
String thatChunk = getChunk(s2, s2Length, thatMarker);
thatMarker += thatChunk.length();
// If both chunks contain numeric characters, sort them numerically
int result = 0;
if (isDigit(thisChunk.charAt(0)) && isDigit(thatChunk.charAt(0))) {
// Simple chunk comparison by length.
int thisChunkLength = thisChunk.length();
result = thisChunkLength - thatChunk.length();
// If equal, the first different number counts
if (result == 0) {
for (int i = 0; i < thisChunkLength; i++) {
result = thisChunk.charAt(i) - thatChunk.charAt(i);
if (result != 0) {
return result;
}
}
}
} else {
result = thisChunk.compareTo(thatChunk);
}
if (result != 0) {
return result;
}
}
return s1Length - s2Length;
}
}

View File

@@ -1,52 +1,52 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityOptionsCompat;
import android.view.View;
public class AnimationUtils {
public static Bundle getScaleBundle(View view) {
return ActivityOptionsCompat.makeScaleUpAnimation(
view, 0, 0, view.getWidth(), view.getHeight()).toBundle();
}
public static void startActivityWithScale(@NonNull Activity startActivity, @NonNull Intent subActivity, @NonNull boolean forResult, @Nullable int code, @NonNull View view) {
if(forResult){
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN)
startActivity.startActivityForResult(subActivity, code, AnimationUtils.getScaleBundle
(view));
else
startActivity.startActivityForResult(subActivity, code);
}
else {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN)
startActivity.startActivity(subActivity, AnimationUtils.getScaleBundle
(view));
else
startActivity.startActivity(subActivity);
}
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityOptionsCompat;
import android.view.View;
public class AnimationUtils {
public static Bundle getScaleBundle(View view) {
return ActivityOptionsCompat.makeScaleUpAnimation(
view, 0, 0, view.getWidth(), view.getHeight()).toBundle();
}
public static void startActivityWithScale(@NonNull Activity startActivity, @NonNull Intent subActivity, @NonNull boolean forResult, @Nullable int code, @NonNull View view) {
if(forResult){
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN)
startActivity.startActivityForResult(subActivity, code, AnimationUtils.getScaleBundle
(view));
else
startActivity.startActivityForResult(subActivity, code);
}
else {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN)
startActivity.startActivity(subActivity, AnimationUtils.getScaleBundle
(view));
else
startActivity.startActivity(subActivity);
}
}
}

View File

@@ -1,42 +1,42 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
public class AppInfoHelper {
public static String getApplicationName(final Context context) {
final ApplicationInfo applicationInfo = context.getApplicationInfo();
return context.getString(applicationInfo.labelRes);
}
public static String getCurrentVersion(final Context context) {
try {
final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(),
0);
return packageInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
return "";
}
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
public class AppInfoHelper {
public static String getApplicationName(final Context context) {
final ApplicationInfo applicationInfo = context.getApplicationInfo();
return context.getString(applicationInfo.labelRes);
}
public static String getCurrentVersion(final Context context) {
try {
final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(),
0);
return packageInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
return "";
}
}
}

View File

@@ -1,115 +1,115 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import java.io.File;
import java.util.List;
public class EventBusEvents {
public static class CannotOpenAFile {
}
public static class NewFileToOpen {
private final File file;
private final String fileText;
public NewFileToOpen(File file) {
this.file = file;
this.fileText = "";
}
public NewFileToOpen(String fileText) {
this.file = new File("");
this.fileText = fileText;
}
public File getFile() {
return file;
}
public String getFileText() {
return fileText;
}
}
public static class AFileIsSelected {
private final String path;
public AFileIsSelected(String path) {
this.path = path;
}
public String getPath() {
return path;
}
}
public static class APreferenceValueWasChanged {
private Type type;
private List<Type> types;
public APreferenceValueWasChanged(Type type) {
this.type = type;
}
public APreferenceValueWasChanged(List<Type> types) {
this.types = types;
}
public boolean hasType(Type value) {
if (type != null) {
return value == type;
} else {
return types.contains(value);
}
}
public enum Type {
FONT_SIZE, ENCODING, SYNTAX, WRAP_CONTENT, MONOSPACE, LINE_NUMERS, THEME_CHANGE, TEXT_SUGGESTIONS, READ_ONLY,
}
}
public static class SaveAFile {
}
public static class SavedAFile {
private final String path;
public SavedAFile(String path) {
this.path = path;
}
public String getPath() {
return path;
}
}
public static class ClosedAFile {
}
public static class InvalideTheMenu {
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import java.io.File;
import java.util.List;
public class EventBusEvents {
public static class CannotOpenAFile {
}
public static class NewFileToOpen {
private final File file;
private final String fileText;
public NewFileToOpen(File file) {
this.file = file;
this.fileText = "";
}
public NewFileToOpen(String fileText) {
this.file = new File("");
this.fileText = fileText;
}
public File getFile() {
return file;
}
public String getFileText() {
return fileText;
}
}
public static class AFileIsSelected {
private final String path;
public AFileIsSelected(String path) {
this.path = path;
}
public String getPath() {
return path;
}
}
public static class APreferenceValueWasChanged {
private Type type;
private List<Type> types;
public APreferenceValueWasChanged(Type type) {
this.type = type;
}
public APreferenceValueWasChanged(List<Type> types) {
this.types = types;
}
public boolean hasType(Type value) {
if (type != null) {
return value == type;
} else {
return types.contains(value);
}
}
public enum Type {
FONT_SIZE, ENCODING, SYNTAX, WRAP_CONTENT, MONOSPACE, LINE_NUMERS, THEME_CHANGE, TEXT_SUGGESTIONS, READ_ONLY,
}
}
public static class SaveAFile {
}
public static class SavedAFile {
private final String path;
public SavedAFile(String path) {
this.path = path;
}
public String getPath() {
return path;
}
}
public static class ClosedAFile {
}
public static class InvalideTheMenu {
}
}

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
public interface IHomeActivity {
public abstract boolean showInterstitial();
}

View File

@@ -1,57 +1,57 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
public class MimeTypes {
public static final String[] MIME_TEXT = {
"ajx", "am", "asa", "asc", "asp", "aspx", "awk", "bat", "c", "cdf", "cf", "cfg", "cfm", "cgi", "cnf", "conf",
"cc", "cpp", "css", "csv", "ctl", "dat", "dhtml", "diz", "file", "forward", "grp", "h", "hh", "hpp", "hqx", "hta", "htaccess",
"htc", "htm", "html", "htpasswd", "htt", "htx", "in", "inc", "info", "ini", "ink", "java", "js", "jsp", "key", "latex", "log",
"logfile", "m3u", "m4", "m4a", "mak", "map", "md", "markdown", "model", "msg", "nfo", "nsi", "info", "old", "pas", "patch", "perl",
"php", "php2", "php3", "php4", "php5", "php6", "phtml", "pix", "pl", "pm", "po", "pwd", "py", "qmail", "rb", "rbl", "rbw",
"readme", "reg", "rss", "rtf", "ruby", "session", "setup", "sh", "shtm", "shtml", "sql", "ssh", "stm", "style", "svg", "tcl",
"tex", "text", "threads", "tmpl", "tpl", "txt", "ubb", "vbs", "xhtml", "xml", "xrc", "xsl"
};
public static final String[] MIME_CODE = {
"cs", "php", "js", "java", "py", "rb", "aspx", "cshtml", "vbhtml", "go", "c", "h", "cc", "cpp", "hh", "hpp", "pl", "pm", "t", "pod",
"m", "f", "for", "f90", "f95", "asp", "json", "wiki", "lua", "r"
};
public static final String[] MIME_HTML = {
"htm", "html", "xhtml"
};
public static final String[] MIME_PICTURE = {
"bmp", "eps", "png", "jpeg", "jpg", "ico", "gif", "tiff", "webp"
};
public static final String[] MIME_MUSIC = {
"aac", "flac", "mp3", "mpga", "oga", "ogg", "opus", "webma", "wav"
};
public static final String[] MIME_VIDEO = {
"avi", "mp4", "mkv", "wmw", "ogv", "webm"
};
public static final String[] MIME_ARCHIVE = {
"7z", "arj", "bz2", "gz", "rar", "tar", "tgz", "zip", "xz"
};
public static final String[] MIME_SQL = {
"sql", "mdf", "ndf", "ldf"
};
public static final String[] MIME_MARKDOWN = {
"md", "mdown", "markdown",
};
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
public class MimeTypes {
public static final String[] MIME_TEXT = {
"ajx", "am", "asa", "asc", "asp", "aspx", "awk", "bat", "c", "cdf", "cf", "cfg", "cfm", "cgi", "cnf", "conf",
"cc", "cpp", "css", "csv", "ctl", "dat", "dhtml", "diz", "file", "forward", "grp", "h", "hh", "hpp", "hqx", "hta", "htaccess",
"htc", "htm", "html", "htpasswd", "htt", "htx", "in", "inc", "info", "ini", "ink", "java", "js", "jsp", "key", "latex", "log",
"logfile", "m3u", "m4", "m4a", "mak", "map", "md", "markdown", "model", "msg", "nfo", "nsi", "info", "old", "pas", "patch", "perl",
"php", "php2", "php3", "php4", "php5", "php6", "phtml", "pix", "pl", "pm", "po", "pwd", "py", "qmail", "rb", "rbl", "rbw",
"readme", "reg", "rss", "rtf", "ruby", "session", "setup", "sh", "shtm", "shtml", "sql", "ssh", "stm", "style", "svg", "tcl",
"tex", "text", "threads", "tmpl", "tpl", "txt", "ubb", "vbs", "xhtml", "xml", "xrc", "xsl"
};
public static final String[] MIME_CODE = {
"cs", "php", "js", "java", "py", "rb", "aspx", "cshtml", "vbhtml", "go", "c", "h", "cc", "cpp", "hh", "hpp", "pl", "pm", "t", "pod",
"m", "f", "for", "f90", "f95", "asp", "json", "wiki", "lua", "r"
};
public static final String[] MIME_HTML = {
"htm", "html", "xhtml"
};
public static final String[] MIME_PICTURE = {
"bmp", "eps", "png", "jpeg", "jpg", "ico", "gif", "tiff", "webp"
};
public static final String[] MIME_MUSIC = {
"aac", "flac", "mp3", "mpga", "oga", "ogg", "opus", "webma", "wav"
};
public static final String[] MIME_VIDEO = {
"avi", "mp4", "mkv", "wmw", "ogv", "webm"
};
public static final String[] MIME_ARCHIVE = {
"7z", "arj", "bz2", "gz", "rar", "tar", "tgz", "zip", "xz"
};
public static final String[] MIME_SQL = {
"sql", "mdf", "ndf", "ldf"
};
public static final String[] MIME_MARKDOWN = {
"md", "mdown", "markdown",
};
}

View File

@@ -1,56 +1,56 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
public final class PixelDipConverter {
private PixelDipConverter() {
}
/**
* This method convets dp unit to equivalent device specific value in pixels.
*
* @param dp A value in dp(Device independent pixels) unit. Which we need to convert into pixels
* @param context Context to get resources and device specific display metrics
* @return A float value to represent Pixels equivalent to dp according to device
*/
public static float convertDpToPixel(final float dp, final Context context) {
final Resources resources = context.getResources();
final DisplayMetrics metrics = resources.getDisplayMetrics();
return dp * metrics.densityDpi / 160f;
}
/**
* This method converts device specific pixels to device independent pixels.
*
* @param px A value in px (pixels) unit. Which we need to convert into db
* @param context Context to get resources and device specific display metrics
* @return A float value to represent db equivalent to px value
*/
public static float convertPixelsToDp(final float px, final Context context) {
final Resources resources = context.getResources();
final DisplayMetrics metrics = resources.getDisplayMetrics();
return px / (metrics.densityDpi / 160f);
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
public final class PixelDipConverter {
private PixelDipConverter() {
}
/**
* This method convets dp unit to equivalent device specific value in pixels.
*
* @param dp A value in dp(Device independent pixels) unit. Which we need to convert into pixels
* @param context Context to get resources and device specific display metrics
* @return A float value to represent Pixels equivalent to dp according to device
*/
public static float convertDpToPixel(final float dp, final Context context) {
final Resources resources = context.getResources();
final DisplayMetrics metrics = resources.getDisplayMetrics();
return dp * metrics.densityDpi / 160f;
}
/**
* This method converts device specific pixels to device independent pixels.
*
* @param px A value in px (pixels) unit. Which we need to convert into db
* @param context Context to get resources and device specific display metrics
* @return A float value to represent db equivalent to px value
*/
public static float convertPixelsToDp(final float px, final Context context) {
final Resources resources = context.getResources();
final DisplayMetrics metrics = resources.getDisplayMetrics();
return px / (metrics.densityDpi / 160f);
}
}

View File

@@ -1,44 +1,44 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.content.Context;
import sharedcode.turboeditor.preferences.PreferenceHelper;
public class ProCheckUtils {
public static boolean isPro(Context context, boolean includeDonations) {
String packageName = context.getPackageName();
if (Build.FOR_AMAZON)
return true;
else if (packageName.equals("com.maskyn.fileeditorpro"))
return true;
else if (includeDonations && PreferenceHelper.hasDonated(context))
return true;
else
return false;
}
public static boolean isPro(Context context) {
return isPro(context, true);
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.content.Context;
import sharedcode.turboeditor.preferences.PreferenceHelper;
public class ProCheckUtils {
public static boolean isPro(Context context, boolean includeDonations) {
String packageName = context.getPackageName();
if (Build.FOR_AMAZON)
return true;
else if (packageName.equals("com.maskyn.fileeditorpro"))
return true;
else if (includeDonations && PreferenceHelper.hasDonated(context))
return true;
else
return false;
}
public static boolean isPro(Context context) {
return isPro(context, true);
}
}

View File

@@ -1,55 +1,55 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.app.Activity;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.preferences.PreferenceHelper;
public class ThemeUtils {
public static void setTheme(Activity activity){
boolean light = PreferenceHelper.getLightTheme(activity);
if (light) {
activity.setTheme(R.style.AppThemeBaseLight);
} else {
activity.setTheme(R.style.AppThemeBaseDark);
}
}
public static void setPreferenceTheme(Activity activity){
boolean light = PreferenceHelper.getLightTheme(activity);
if (light) {
activity.setTheme(R.style.PreferenceLight);
} else {
activity.setTheme(R.style.PreferenceDark);
}
}
public static void setWindowsBackground(Activity activity) {
boolean whiteTheme = PreferenceHelper.getLightTheme(activity);
if (whiteTheme) {
activity.getWindow().setBackgroundDrawableResource(R.color.window_background_light);
} else {
activity.getWindow().setBackgroundDrawableResource(R.color.window_background);
}
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util;
import android.app.Activity;
import sharedcode.turboeditor.R;
import sharedcode.turboeditor.preferences.PreferenceHelper;
public class ThemeUtils {
public static void setTheme(Activity activity){
boolean light = PreferenceHelper.getLightTheme(activity);
if (light) {
activity.setTheme(R.style.AppThemeBaseLight);
} else {
activity.setTheme(R.style.AppThemeBaseDark);
}
}
public static void setPreferenceTheme(Activity activity){
boolean light = PreferenceHelper.getLightTheme(activity);
if (light) {
activity.setTheme(R.style.PreferenceLight);
} else {
activity.setTheme(R.style.PreferenceDark);
}
}
public static void setWindowsBackground(Activity activity) {
boolean whiteTheme = PreferenceHelper.getLightTheme(activity);
if (whiteTheme) {
activity.getWindow().setBackgroundDrawableResource(R.color.window_background_light);
} else {
activity.getWindow().setBackgroundDrawableResource(R.color.window_background);
}
}
}

View File

@@ -1,290 +1,290 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.app.Activity;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.view.WindowManager;
/**
* Helper for controlling the visibility of the System UI across the various API levels. To use
* this API, instantiate an instance of this class with the required level. The level specifies the
* extent to which the System UI's visibility is changed when you call {@link #hide()}
* or {@link #toggle()}.
*/
public final class SystemUiHelper {
/**
* In this level, the helper will toggle low profile mode.
*/
public static final int LEVEL_LOW_PROFILE = 0;
/**
* In this level, the helper will toggle the visibility of the status bar.
* If there is a navigation bar, it will toggle low profile mode.
*/
public static final int LEVEL_HIDE_STATUS_BAR = 1;
/**
* In this level, the helper will toggle the visibility of the navigation bar
* (if present and if possible) and status bar. In cases where the navigation
* bar is present but cannot be hidden, it will toggle low profile mode.
*/
public static final int LEVEL_LEAN_BACK = 2;
/**
* In this level, the helper will toggle the visibility of the navigation bar
* (if present and if possible) and status bar, in an immersive mode. This means that the app
* will continue to receive all touch events. The user can reveal the system bars with an
* inward swipe along the region where the system bars normally appear.
*
* <p>The {@link #FLAG_IMMERSIVE_STICKY} flag can be used to control how the system bars are
* displayed.
*/
public static final int LEVEL_IMMERSIVE = 3;
/**
* When this flag is set, the
* {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN}
* flag will be set on older devices, making the status bar "float" on top
* of the activity layout. This is most useful when there are no controls at
* the top of the activity layout.
* <p>
* This flag isn't used on newer devices because the <a
* href="http://developer.android.com/design/patterns/actionbar.html">action
* bar</a>, the most important structural element of an Android app, should
* be visible and not obscured by the system UI.
*/
public static final int FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES = 0x1;
/**
* Used with {@link #LEVEL_IMMERSIVE}. When this flag is set, an inward swipe in the system
* bars areas will cause the system bars to temporarily appear in a semi-transparent state,
* but no flags are cleared, and your system UI visibility change listeners are not triggered.
* The bars automatically hide again after a short delay, or if the user interacts with the
* middle of the screen.
*/
public static final int FLAG_IMMERSIVE_STICKY = 0x2;
private static final String LOG_TAG = SystemUiHelper.class.getSimpleName();
private final SystemUiHelperImpl mImpl;
private final Handler mHandler;
private final Runnable mHideRunnable;
/**
* Construct a new SystemUiHelper.
*
* @param activity The Activity who's system UI should be changed
* @param level The level of hiding. Should be either {@link #LEVEL_LOW_PROFILE},
* {@link #LEVEL_HIDE_STATUS_BAR}, {@link #LEVEL_LEAN_BACK} or
* {@link #LEVEL_IMMERSIVE}
* @param flags Additional options. See {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES} and
* {@link #FLAG_IMMERSIVE_STICKY}
*/
public SystemUiHelper(Activity activity, int level, int flags) {
this(activity, level, flags, null);
}
/**
* Construct a new SystemUiHelper.
*
* @param activity The Activity who's system UI should be changed
* @param level The level of hiding. Should be either {@link #LEVEL_LOW_PROFILE},
* {@link #LEVEL_HIDE_STATUS_BAR}, {@link #LEVEL_LEAN_BACK} or
* {@link #LEVEL_IMMERSIVE}
* @param flags Additional options. See {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES} and
* {@link #FLAG_IMMERSIVE_STICKY}
* @param listener A listener which is called when the system visibility is changed
*/
public SystemUiHelper(Activity activity, int level, int flags,
OnVisibilityChangeListener listener) {
mHandler = new Handler(Looper.getMainLooper());
mHideRunnable = new HideRunnable();
// Create impl
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mImpl = new SystemUiHelperImplKK(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mImpl = new SystemUiHelperImplJB(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
mImpl = new SystemUiHelperImplICS(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mImpl = new SystemUiHelperImplHC(activity, level, flags, listener);
} else {
mImpl = new SystemUiHelperImplBase(activity, level, flags, listener);
}
}
/**
* @return true if the system UI is currently showing. What this means depends on the mode this
* {@link android.example.android.systemuivis.SystemUiHelper} was instantiated with.
*/
public boolean isShowing() {
return mImpl.isShowing();
}
/**
* Show the system UI. What this means depends on the mode this {@link android.example.android.systemuivis.SystemUiHelper} was
* instantiated with.
*
* <p>Any currently queued delayed hide requests will be removed.
*/
public void show() {
// Ensure that any currently queued hide calls are removed
removeQueuedRunnables();
mImpl.show();
}
/**
* Hide the system UI. What this means depends on the mode this {@link android.example.android.systemuivis.SystemUiHelper} was
* instantiated with.
*
* <p>Any currently queued delayed hide requests will be removed.
*/
public void hide() {
// Ensure that any currently queued hide calls are removed
removeQueuedRunnables();
mImpl.hide();
}
/**
* Request that the system UI is hidden after a delay.
*
* <p>Any currently queued delayed hide requests will be removed.
*
* @param delayMillis The delay (in milliseconds) until the Runnable
* will be executed.
*/
public void delayHide(long delayMillis) {
// Ensure that any currently queued hide calls are removed
removeQueuedRunnables();
mHandler.postDelayed(mHideRunnable, delayMillis);
}
/**
* Toggle whether the system UI is displayed.
*/
public void toggle() {
if (mImpl.isShowing()) {
mImpl.hide();
} else {
mImpl.show();
}
}
private void removeQueuedRunnables() {
// Ensure that any currently queued hide calls are removed
mHandler.removeCallbacks(mHideRunnable);
}
/**
* A callback interface used to listen for system UI visibility changes.
*/
public interface OnVisibilityChangeListener {
/**
* Called when the system UI visibility has changed.
*
* @param visible True if the system UI is visible.
*/
public void onVisibilityChange(boolean visible);
}
static abstract class SystemUiHelperImpl {
final Activity mActivity;
final int mLevel;
final int mFlags;
final OnVisibilityChangeListener mOnVisibilityChangeListener;
boolean mIsShowing = true;
SystemUiHelperImpl(Activity activity, int level, int flags,
OnVisibilityChangeListener onVisibilityChangeListener) {
mActivity = activity;
mLevel = level;
mFlags = flags;
mOnVisibilityChangeListener = onVisibilityChangeListener;
}
abstract void show();
abstract void hide();
boolean isShowing() {
return mIsShowing;
}
void setIsShowing(boolean isShowing) {
mIsShowing = isShowing;
if (mOnVisibilityChangeListener != null) {
mOnVisibilityChangeListener.onVisibilityChange(mIsShowing);
}
}
}
/**
* Base implementation. Used on API level 10 and below.
*/
static class SystemUiHelperImplBase extends SystemUiHelperImpl {
SystemUiHelperImplBase(Activity activity, int level, int flags,
OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
if ((mFlags & SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES) != 0) {
mActivity.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
}
@Override
void show() {
if (mLevel > SystemUiHelper.LEVEL_LOW_PROFILE) {
mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(true);
}
}
@Override
void hide() {
if (mLevel > SystemUiHelper.LEVEL_LOW_PROFILE) {
mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(false);
}
}
}
private class HideRunnable implements Runnable {
@Override
public void run() {
hide();
}
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.app.Activity;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.view.WindowManager;
/**
* Helper for controlling the visibility of the System UI across the various API levels. To use
* this API, instantiate an instance of this class with the required level. The level specifies the
* extent to which the System UI's visibility is changed when you call {@link #hide()}
* or {@link #toggle()}.
*/
public final class SystemUiHelper {
/**
* In this level, the helper will toggle low profile mode.
*/
public static final int LEVEL_LOW_PROFILE = 0;
/**
* In this level, the helper will toggle the visibility of the status bar.
* If there is a navigation bar, it will toggle low profile mode.
*/
public static final int LEVEL_HIDE_STATUS_BAR = 1;
/**
* In this level, the helper will toggle the visibility of the navigation bar
* (if present and if possible) and status bar. In cases where the navigation
* bar is present but cannot be hidden, it will toggle low profile mode.
*/
public static final int LEVEL_LEAN_BACK = 2;
/**
* In this level, the helper will toggle the visibility of the navigation bar
* (if present and if possible) and status bar, in an immersive mode. This means that the app
* will continue to receive all touch events. The user can reveal the system bars with an
* inward swipe along the region where the system bars normally appear.
*
* <p>The {@link #FLAG_IMMERSIVE_STICKY} flag can be used to control how the system bars are
* displayed.
*/
public static final int LEVEL_IMMERSIVE = 3;
/**
* When this flag is set, the
* {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN}
* flag will be set on older devices, making the status bar "float" on top
* of the activity layout. This is most useful when there are no controls at
* the top of the activity layout.
* <p>
* This flag isn't used on newer devices because the <a
* href="http://developer.android.com/design/patterns/actionbar.html">action
* bar</a>, the most important structural element of an Android app, should
* be visible and not obscured by the system UI.
*/
public static final int FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES = 0x1;
/**
* Used with {@link #LEVEL_IMMERSIVE}. When this flag is set, an inward swipe in the system
* bars areas will cause the system bars to temporarily appear in a semi-transparent state,
* but no flags are cleared, and your system UI visibility change listeners are not triggered.
* The bars automatically hide again after a short delay, or if the user interacts with the
* middle of the screen.
*/
public static final int FLAG_IMMERSIVE_STICKY = 0x2;
private static final String LOG_TAG = SystemUiHelper.class.getSimpleName();
private final SystemUiHelperImpl mImpl;
private final Handler mHandler;
private final Runnable mHideRunnable;
/**
* Construct a new SystemUiHelper.
*
* @param activity The Activity who's system UI should be changed
* @param level The level of hiding. Should be either {@link #LEVEL_LOW_PROFILE},
* {@link #LEVEL_HIDE_STATUS_BAR}, {@link #LEVEL_LEAN_BACK} or
* {@link #LEVEL_IMMERSIVE}
* @param flags Additional options. See {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES} and
* {@link #FLAG_IMMERSIVE_STICKY}
*/
public SystemUiHelper(Activity activity, int level, int flags) {
this(activity, level, flags, null);
}
/**
* Construct a new SystemUiHelper.
*
* @param activity The Activity who's system UI should be changed
* @param level The level of hiding. Should be either {@link #LEVEL_LOW_PROFILE},
* {@link #LEVEL_HIDE_STATUS_BAR}, {@link #LEVEL_LEAN_BACK} or
* {@link #LEVEL_IMMERSIVE}
* @param flags Additional options. See {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES} and
* {@link #FLAG_IMMERSIVE_STICKY}
* @param listener A listener which is called when the system visibility is changed
*/
public SystemUiHelper(Activity activity, int level, int flags,
OnVisibilityChangeListener listener) {
mHandler = new Handler(Looper.getMainLooper());
mHideRunnable = new HideRunnable();
// Create impl
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mImpl = new SystemUiHelperImplKK(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mImpl = new SystemUiHelperImplJB(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
mImpl = new SystemUiHelperImplICS(activity, level, flags, listener);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mImpl = new SystemUiHelperImplHC(activity, level, flags, listener);
} else {
mImpl = new SystemUiHelperImplBase(activity, level, flags, listener);
}
}
/**
* @return true if the system UI is currently showing. What this means depends on the mode this
* {@link android.example.android.systemuivis.SystemUiHelper} was instantiated with.
*/
public boolean isShowing() {
return mImpl.isShowing();
}
/**
* Show the system UI. What this means depends on the mode this {@link android.example.android.systemuivis.SystemUiHelper} was
* instantiated with.
*
* <p>Any currently queued delayed hide requests will be removed.
*/
public void show() {
// Ensure that any currently queued hide calls are removed
removeQueuedRunnables();
mImpl.show();
}
/**
* Hide the system UI. What this means depends on the mode this {@link android.example.android.systemuivis.SystemUiHelper} was
* instantiated with.
*
* <p>Any currently queued delayed hide requests will be removed.
*/
public void hide() {
// Ensure that any currently queued hide calls are removed
removeQueuedRunnables();
mImpl.hide();
}
/**
* Request that the system UI is hidden after a delay.
*
* <p>Any currently queued delayed hide requests will be removed.
*
* @param delayMillis The delay (in milliseconds) until the Runnable
* will be executed.
*/
public void delayHide(long delayMillis) {
// Ensure that any currently queued hide calls are removed
removeQueuedRunnables();
mHandler.postDelayed(mHideRunnable, delayMillis);
}
/**
* Toggle whether the system UI is displayed.
*/
public void toggle() {
if (mImpl.isShowing()) {
mImpl.hide();
} else {
mImpl.show();
}
}
private void removeQueuedRunnables() {
// Ensure that any currently queued hide calls are removed
mHandler.removeCallbacks(mHideRunnable);
}
/**
* A callback interface used to listen for system UI visibility changes.
*/
public interface OnVisibilityChangeListener {
/**
* Called when the system UI visibility has changed.
*
* @param visible True if the system UI is visible.
*/
public void onVisibilityChange(boolean visible);
}
static abstract class SystemUiHelperImpl {
final Activity mActivity;
final int mLevel;
final int mFlags;
final OnVisibilityChangeListener mOnVisibilityChangeListener;
boolean mIsShowing = true;
SystemUiHelperImpl(Activity activity, int level, int flags,
OnVisibilityChangeListener onVisibilityChangeListener) {
mActivity = activity;
mLevel = level;
mFlags = flags;
mOnVisibilityChangeListener = onVisibilityChangeListener;
}
abstract void show();
abstract void hide();
boolean isShowing() {
return mIsShowing;
}
void setIsShowing(boolean isShowing) {
mIsShowing = isShowing;
if (mOnVisibilityChangeListener != null) {
mOnVisibilityChangeListener.onVisibilityChange(mIsShowing);
}
}
}
/**
* Base implementation. Used on API level 10 and below.
*/
static class SystemUiHelperImplBase extends SystemUiHelperImpl {
SystemUiHelperImplBase(Activity activity, int level, int flags,
OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
if ((mFlags & SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES) != 0) {
mActivity.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
}
@Override
void show() {
if (mLevel > SystemUiHelper.LEVEL_LOW_PROFILE) {
mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(true);
}
}
@Override
void hide() {
if (mLevel > SystemUiHelper.LEVEL_LOW_PROFILE) {
mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(false);
}
}
}
private class HideRunnable implements Runnable {
@Override
public void run() {
hide();
}
}
}

View File

@@ -1,94 +1,94 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.app.Activity;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.WindowManager;
class SystemUiHelperImplHC extends SystemUiHelper.SystemUiHelperImpl
implements View.OnSystemUiVisibilityChangeListener {
final View mDecorView;
SystemUiHelperImplHC(Activity activity, int level, int flags,
SystemUiHelper.OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
mDecorView = activity.getWindow().getDecorView();
mDecorView.setOnSystemUiVisibilityChangeListener(this);
}
@Override
void show() {
mDecorView.setSystemUiVisibility(createShowFlags());
}
@Override
void hide() {
mDecorView.setSystemUiVisibility(createHideFlags());
}
@Override
public final void onSystemUiVisibilityChange(int visibility) {
if ((visibility & createTestFlags()) != 0) {
onSystemUiHidden();
} else {
onSystemUiShown();
}
}
protected void onSystemUiShown() {
ActionBar ab = ((ActionBarActivity) mActivity).getSupportActionBar();
if (ab != null) {
ab.show();
}
mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(true);
}
protected void onSystemUiHidden() {
ActionBar ab = ((ActionBarActivity) mActivity).getSupportActionBar();
if (ab != null) {
ab.hide();
}
mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(false);
}
protected int createShowFlags() {
return View.STATUS_BAR_VISIBLE;
}
protected int createHideFlags() {
return View.STATUS_BAR_HIDDEN;
}
protected int createTestFlags() {
return View.STATUS_BAR_HIDDEN;
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.app.Activity;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.WindowManager;
class SystemUiHelperImplHC extends SystemUiHelper.SystemUiHelperImpl
implements View.OnSystemUiVisibilityChangeListener {
final View mDecorView;
SystemUiHelperImplHC(Activity activity, int level, int flags,
SystemUiHelper.OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
mDecorView = activity.getWindow().getDecorView();
mDecorView.setOnSystemUiVisibilityChangeListener(this);
}
@Override
void show() {
mDecorView.setSystemUiVisibility(createShowFlags());
}
@Override
void hide() {
mDecorView.setSystemUiVisibility(createHideFlags());
}
@Override
public final void onSystemUiVisibilityChange(int visibility) {
if ((visibility & createTestFlags()) != 0) {
onSystemUiHidden();
} else {
onSystemUiShown();
}
}
protected void onSystemUiShown() {
ActionBar ab = ((ActionBarActivity) mActivity).getSupportActionBar();
if (ab != null) {
ab.show();
}
mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(true);
}
protected void onSystemUiHidden() {
ActionBar ab = ((ActionBarActivity) mActivity).getSupportActionBar();
if (ab != null) {
ab.hide();
}
mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(false);
}
protected int createShowFlags() {
return View.STATUS_BAR_VISIBLE;
}
protected int createHideFlags() {
return View.STATUS_BAR_HIDDEN;
}
protected int createTestFlags() {
return View.STATUS_BAR_HIDDEN;
}
}

View File

@@ -1,60 +1,60 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.view.View;
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
class SystemUiHelperImplICS extends SystemUiHelperImplHC {
SystemUiHelperImplICS(Activity activity, int level, int flags,
SystemUiHelper.OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
}
@Override
protected int createShowFlags() {
return View.SYSTEM_UI_FLAG_VISIBLE;
}
@Override
protected int createTestFlags() {
if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
// Intentionally override test flags.
return View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
return View.SYSTEM_UI_FLAG_LOW_PROFILE;
}
@Override
protected int createHideFlags() {
int flag = View.SYSTEM_UI_FLAG_LOW_PROFILE;
if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
flag |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
return flag;
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.view.View;
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
class SystemUiHelperImplICS extends SystemUiHelperImplHC {
SystemUiHelperImplICS(Activity activity, int level, int flags,
SystemUiHelper.OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
}
@Override
protected int createShowFlags() {
return View.SYSTEM_UI_FLAG_VISIBLE;
}
@Override
protected int createTestFlags() {
if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
// Intentionally override test flags.
return View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
return View.SYSTEM_UI_FLAG_LOW_PROFILE;
}
@Override
protected int createHideFlags() {
int flag = View.SYSTEM_UI_FLAG_LOW_PROFILE;
if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
flag |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
return flag;
}
}

View File

@@ -1,93 +1,93 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.Activity;
import android.os.Build;
import android.view.View;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
class SystemUiHelperImplJB extends SystemUiHelperImplICS {
SystemUiHelperImplJB(Activity activity, int level, int flags,
SystemUiHelper.OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
}
@Override
protected int createShowFlags() {
int flag = super.createShowFlags();
if (mLevel >= SystemUiHelper.LEVEL_HIDE_STATUS_BAR) {
flag |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
flag |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
}
}
return flag;
}
@Override
protected int createHideFlags() {
int flag = super.createHideFlags();
if (mLevel >= SystemUiHelper.LEVEL_HIDE_STATUS_BAR) {
flag |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_FULLSCREEN;
if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
flag |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
}
}
return flag;
}
@Override
protected void onSystemUiShown() {
if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
// Manually show the action bar when in low profile mode.
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.show();
}
}
setIsShowing(false);
}
@Override
protected void onSystemUiHidden() {
if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
// Manually hide the action bar when in low profile mode.
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.hide();
}
}
setIsShowing(true);
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.Activity;
import android.os.Build;
import android.view.View;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
class SystemUiHelperImplJB extends SystemUiHelperImplICS {
SystemUiHelperImplJB(Activity activity, int level, int flags,
SystemUiHelper.OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
}
@Override
protected int createShowFlags() {
int flag = super.createShowFlags();
if (mLevel >= SystemUiHelper.LEVEL_HIDE_STATUS_BAR) {
flag |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
flag |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
}
}
return flag;
}
@Override
protected int createHideFlags() {
int flag = super.createHideFlags();
if (mLevel >= SystemUiHelper.LEVEL_HIDE_STATUS_BAR) {
flag |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_FULLSCREEN;
if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
flag |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
}
}
return flag;
}
@Override
protected void onSystemUiShown() {
if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
// Manually show the action bar when in low profile mode.
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.show();
}
}
setIsShowing(false);
}
@Override
protected void onSystemUiHidden() {
if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
// Manually hide the action bar when in low profile mode.
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.hide();
}
}
setIsShowing(true);
}
}

View File

@@ -1,53 +1,53 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.view.View;
@TargetApi(Build.VERSION_CODES.KITKAT)
class SystemUiHelperImplKK extends SystemUiHelperImplJB {
SystemUiHelperImplKK(Activity activity, int level, int flags,
SystemUiHelper.OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
}
@Override
protected int createHideFlags() {
int flag = super.createHideFlags();
if (mLevel == SystemUiHelper.LEVEL_IMMERSIVE) {
// If the client requested immersive mode, and we're on Android 4.4
// or later, add relevant flags. Applying HIDE_NAVIGATION without
// IMMERSIVE prevents the activity from accepting all touch events,
// so we only do this on Android 4.4 and later (where IMMERSIVE is
// present).
flag |= ((mFlags & SystemUiHelper.FLAG_IMMERSIVE_STICKY) != 0)
? View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
: View.SYSTEM_UI_FLAG_IMMERSIVE;
}
return flag;
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.util.systemui;
import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.view.View;
@TargetApi(Build.VERSION_CODES.KITKAT)
class SystemUiHelperImplKK extends SystemUiHelperImplJB {
SystemUiHelperImplKK(Activity activity, int level, int flags,
SystemUiHelper.OnVisibilityChangeListener onVisibilityChangeListener) {
super(activity, level, flags, onVisibilityChangeListener);
}
@Override
protected int createHideFlags() {
int flag = super.createHideFlags();
if (mLevel == SystemUiHelper.LEVEL_IMMERSIVE) {
// If the client requested immersive mode, and we're on Android 4.4
// or later, add relevant flags. Applying HIDE_NAVIGATION without
// IMMERSIVE prevents the activity from accepting all touch events,
// so we only do this on Android 4.4 and later (where IMMERSIVE is
// present).
flag |= ((mFlags & SystemUiHelper.FLAG_IMMERSIVE_STICKY) != 0)
? View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
: View.SYSTEM_UI_FLAG_IMMERSIVE;
}
return flag;
}
}

View File

@@ -1,49 +1,49 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.views;
import android.content.Context;
import android.support.v4.widget.DrawerLayout;
import android.util.AttributeSet;
import android.view.KeyEvent;
public class CustomDrawerLayout extends DrawerLayout{
public CustomDrawerLayout(Context context) {
super(context);
}
public CustomDrawerLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return false;
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
return false;
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.views;
import android.content.Context;
import android.support.v4.widget.DrawerLayout;
import android.util.AttributeSet;
import android.view.KeyEvent;
public class CustomDrawerLayout extends DrawerLayout{
public CustomDrawerLayout(Context context) {
super(context);
}
public CustomDrawerLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return false;
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
return false;
}
}

View File

@@ -1,84 +1,84 @@
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.views;
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
public class GoodScrollView extends ScrollView {
public ScrollInterface scrollInterface;
int lastY;
boolean listenerEnabled = true;
public GoodScrollView(Context context) {
super(context);
}
public GoodScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public GoodScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public void setScrollInterface(ScrollInterface scrollInterface) {
this.scrollInterface = scrollInterface;
}
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
if (scrollInterface == null || !listenerEnabled) return;
if (Math.abs(lastY - t) > 100) {
lastY = t;
scrollInterface.onScrollChanged(l, t, oldl, oldt);
}
}
public boolean hasReachedBottom() {
View firstChild = getChildAt(getChildCount() - 1);
int diff = (firstChild.getBottom() - (getHeight() + getScrollY() + firstChild.getTop()));// Calculate the scrolldiff
return diff <= 0;
}
public void tempDisableListener(int mills) {
listenerEnabled = false;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
listenerEnabled = true;
}
}, mills);
}
public interface ScrollInterface {
public void onScrollChanged(int l, int t, int oldl, int oldt);
}
}
/*
* Copyright (C) 2014 Vlad Mihalachi
*
* This file is part of Turbo Editor.
*
* Turbo Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Turbo Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package sharedcode.turboeditor.views;
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
public class GoodScrollView extends ScrollView {
public ScrollInterface scrollInterface;
int lastY;
boolean listenerEnabled = true;
public GoodScrollView(Context context) {
super(context);
}
public GoodScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public GoodScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public void setScrollInterface(ScrollInterface scrollInterface) {
this.scrollInterface = scrollInterface;
}
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
if (scrollInterface == null || !listenerEnabled) return;
if (Math.abs(lastY - t) > 100) {
lastY = t;
scrollInterface.onScrollChanged(l, t, oldl, oldt);
}
}
public boolean hasReachedBottom() {
View firstChild = getChildAt(getChildCount() - 1);
int diff = (firstChild.getBottom() - (getHeight() + getScrollY() + firstChild.getTop()));// Calculate the scrolldiff
return diff <= 0;
}
public void tempDisableListener(int mills) {
listenerEnabled = false;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
listenerEnabled = true;
}
}, mills);
}
public interface ScrollInterface {
public void onScrollChanged(int l, int t, int oldl, int oldt);
}
}

View File

@@ -1,353 +1,353 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar"/>
<sharedcode.turboeditor.views.CustomDrawerLayout
android:id="@id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="@dimen/text_size_mega_title"
android:fontFamily="sans-serif-light"
android:text="@string/open_a_file"
android:background="@null"
android:textColor="@android:color/secondary_text_dark"
android:id="@id/no_file_opened_messagge"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@id/text_editor"
android:visibility="gone">
<sharedcode.turboeditor.views.GoodScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:fillViewport="true"
android:id="@id/vertical_scroll"
android:background="@null">
<HorizontalScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:scrollbars="horizontal"
android:fillViewport="true"
android:id="@id/horizontal_scroll"
android:background="@null">
<view
class="sharedcode.turboeditor.activity.MainActivity$Editor"
android:id="@id/editor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:bufferType="spannable"
android:textCursorDrawable="@null"
android:cursorVisible="true"
android:gravity="top|start"
android:singleLine="false"
android:background="@null"
android:text=""
android:textIsSelectable="true" />
</HorizontalScrollView>
</sharedcode.turboeditor.views.GoodScrollView>
<com.faizmalkani.floatingactionbutton.FloatingActionButton
android:id="@+id/fabNext"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="invisible"/>
<com.faizmalkani.floatingactionbutton.FloatingActionButton
android:id="@+id/fabPrev"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="16dp"
android:layout_marginRight="100dp"
android:layout_marginEnd="90dp"
android:visibility="invisible"/>
</FrameLayout>
<RelativeLayout
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:background="@color/navigation_drawer_background_inverted"
android:id="@id/drawer_files"
android:layout_gravity="start"
>
<ListView
android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="none"
android:cacheColorHint="@android:color/transparent"
android:layout_above="@id/drawer_buttons"
android:divider="@color/divider"
android:listSelector="?selectableItemBackground"
android:choiceMode="singleChoice"
android:background="@null"
/>
<TextView
android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/text_size_mega_title"
android:fontFamily="sans-serif-light"
android:text="@string/recent_files"
android:textColor="@android:color/secondary_text_dark"
android:layout_above="@id/drawer_buttons" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="192dp"
android:id="@id/drawer_buttons"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<View
android:background="@color/divider_inverted"
android:layout_width="match_parent"
android:layout_height="@dimen/line_dimension"/>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/new_file"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:clickable="true"
android:onClick="CreateFile"
android:background="?selectableItemBackground"/>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/open_a_file"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:clickable="true"
android:onClick="OpenFile"
android:background="?selectableItemBackground"/>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/preferenze"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:clickable="true"
android:onClick="OpenSettings"
android:background="?selectableItemBackground"/>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/info"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:clickable="true"
android:onClick="OpenInfo"
android:background="?selectableItemBackground"/>
<!--<RelativeLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:clickable="true"
android:gravity="center_vertical"
android:onClick="OpenFile"
android:background="@drawable/item_background_holo_dark"
android:layout_toLeftOf="@+id/ic_add_dark"
>
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/ic_file_dark"
android:paddingStart="16dp"
android:paddingLeft="16dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/open_a_file"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textAllCaps="true"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
</LinearLayout>
<View
android:background="@color/divider_inverted"
android:layout_width="@dimen/line_dimension"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/ic_add_dark"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"/>
<ImageView
android:id="@+id/ic_add_dark"
android:layout_width="64dp"
android:layout_height="match_parent"
android:src="@drawable/ic_add_dark"
android:padding="14dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:onClick="CreateFile"
android:background="@drawable/item_background_holo_dark"
/>
</RelativeLayout>
<View
android:background="@color/divider_inverted"
android:layout_width="match_parent"
android:layout_height="@dimen/line_dimension"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:clickable="true"
android:gravity="center_vertical"
android:onClick="OpenSettings"
android:background="@drawable/item_background_holo_dark"
android:layout_toLeftOf="@+id/ic_info_dark"
>
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/ic_settings_dark"
android:paddingStart="16dp"
android:paddingLeft="16dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/preferenze"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textAllCaps="true"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
</LinearLayout>
<View
android:background="@color/divider_inverted"
android:layout_width="@dimen/line_dimension"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/ic_info_dark"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"/>
<ImageView
android:id="@+id/ic_info_dark"
android:layout_width="64dp"
android:layout_height="match_parent"
android:src="@drawable/ic_info_dark"
android:padding="14dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:onClick="OpenInfo"
android:background="@drawable/item_background_holo_dark"
/>
</RelativeLayout>-->
</LinearLayout>
</RelativeLayout>
<fragment android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:name="sharedcode.turboeditor.preferences.SettingsFragment"
android:id="@id/drawer_settings"
android:layout_gravity="end"/>
</sharedcode.turboeditor.views.CustomDrawerLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar"/>
<sharedcode.turboeditor.views.CustomDrawerLayout
android:id="@id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="@dimen/text_size_mega_title"
android:fontFamily="sans-serif-light"
android:text="@string/open_a_file"
android:background="@null"
android:textColor="@android:color/secondary_text_dark"
android:id="@id/no_file_opened_messagge"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@id/text_editor"
android:visibility="gone">
<sharedcode.turboeditor.views.GoodScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:fillViewport="true"
android:id="@id/vertical_scroll"
android:background="@null">
<HorizontalScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:scrollbars="horizontal"
android:fillViewport="true"
android:id="@id/horizontal_scroll"
android:background="@null">
<view
class="sharedcode.turboeditor.activity.MainActivity$Editor"
android:id="@id/editor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:bufferType="spannable"
android:textCursorDrawable="@null"
android:cursorVisible="true"
android:gravity="top|start"
android:singleLine="false"
android:background="@null"
android:text=""
android:textIsSelectable="true" />
</HorizontalScrollView>
</sharedcode.turboeditor.views.GoodScrollView>
<com.faizmalkani.floatingactionbutton.FloatingActionButton
android:id="@+id/fabNext"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="invisible"/>
<com.faizmalkani.floatingactionbutton.FloatingActionButton
android:id="@+id/fabPrev"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="16dp"
android:layout_marginRight="100dp"
android:layout_marginEnd="90dp"
android:visibility="invisible"/>
</FrameLayout>
<RelativeLayout
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:background="@color/navigation_drawer_background_inverted"
android:id="@id/drawer_files"
android:layout_gravity="start"
>
<ListView
android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="none"
android:cacheColorHint="@android:color/transparent"
android:layout_above="@id/drawer_buttons"
android:divider="@color/divider"
android:listSelector="?selectableItemBackground"
android:choiceMode="singleChoice"
android:background="@null"
/>
<TextView
android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/text_size_mega_title"
android:fontFamily="sans-serif-light"
android:text="@string/recent_files"
android:textColor="@android:color/secondary_text_dark"
android:layout_above="@id/drawer_buttons" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="192dp"
android:id="@id/drawer_buttons"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<View
android:background="@color/divider_inverted"
android:layout_width="match_parent"
android:layout_height="@dimen/line_dimension"/>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/new_file"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:clickable="true"
android:onClick="CreateFile"
android:background="?selectableItemBackground"/>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/open_a_file"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:clickable="true"
android:onClick="OpenFile"
android:background="?selectableItemBackground"/>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/preferenze"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:clickable="true"
android:onClick="OpenSettings"
android:background="?selectableItemBackground"/>
<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/info"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:clickable="true"
android:onClick="OpenInfo"
android:background="?selectableItemBackground"/>
<!--<RelativeLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:clickable="true"
android:gravity="center_vertical"
android:onClick="OpenFile"
android:background="@drawable/item_background_holo_dark"
android:layout_toLeftOf="@+id/ic_add_dark"
>
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/ic_file_dark"
android:paddingStart="16dp"
android:paddingLeft="16dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/open_a_file"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textAllCaps="true"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
</LinearLayout>
<View
android:background="@color/divider_inverted"
android:layout_width="@dimen/line_dimension"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/ic_add_dark"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"/>
<ImageView
android:id="@+id/ic_add_dark"
android:layout_width="64dp"
android:layout_height="match_parent"
android:src="@drawable/ic_add_dark"
android:padding="14dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:onClick="CreateFile"
android:background="@drawable/item_background_holo_dark"
/>
</RelativeLayout>
<View
android:background="@color/divider_inverted"
android:layout_width="match_parent"
android:layout_height="@dimen/line_dimension"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="52dp"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:clickable="true"
android:gravity="center_vertical"
android:onClick="OpenSettings"
android:background="@drawable/item_background_holo_dark"
android:layout_toLeftOf="@+id/ic_info_dark"
>
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@drawable/ic_settings_dark"
android:paddingStart="16dp"
android:paddingLeft="16dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/preferenze"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:textSize="12sp"
android:textAllCaps="true"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
</LinearLayout>
<View
android:background="@color/divider_inverted"
android:layout_width="@dimen/line_dimension"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/ic_info_dark"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"/>
<ImageView
android:id="@+id/ic_info_dark"
android:layout_width="64dp"
android:layout_height="match_parent"
android:src="@drawable/ic_info_dark"
android:padding="14dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:onClick="OpenInfo"
android:background="@drawable/item_background_holo_dark"
/>
</RelativeLayout>-->
</LinearLayout>
</RelativeLayout>
<fragment android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:name="sharedcode.turboeditor.preferences.SettingsFragment"
android:id="@id/drawer_settings"
android:layout_gravity="end"/>
</sharedcode.turboeditor.views.CustomDrawerLayout>
</LinearLayout>

View File

@@ -1,31 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:cacheColorHint="@null"
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:smoothScrollbar="true"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"/>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:cacheColorHint="@null"
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:smoothScrollbar="true"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"/>

View File

@@ -1,60 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<include layout="@layout/toolbar"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:cacheColorHint="@null"
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:smoothScrollbar="true"
android:listSelector="?selectableItemBackground"
android:divider="@null"
android:layout_marginLeft="@dimen/list_horizontal_margin"
android:layout_marginRight="@dimen/list_horizontal_margin"
android:layout_marginStart="@dimen/list_horizontal_margin"
android:layout_marginEnd="@dimen/list_horizontal_margin"/>
<com.faizmalkani.floatingactionbutton.FloatingActionButton
android:id="@+id/fabbutton"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"/>
</FrameLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<include layout="@layout/toolbar"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:cacheColorHint="@null"
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:smoothScrollbar="true"
android:listSelector="?selectableItemBackground"
android:divider="@null"
android:layout_marginLeft="@dimen/list_horizontal_margin"
android:layout_marginRight="@dimen/list_horizontal_margin"
android:layout_marginStart="@dimen/list_horizontal_margin"
android:layout_marginEnd="@dimen/list_horizontal_margin"/>
<com.faizmalkani.floatingactionbutton.FloatingActionButton
android:id="@+id/fabbutton"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"/>
</FrameLayout>
</LinearLayout>

View File

@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<view xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:chg="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="it.gmariotti.changelibs.library.view.ChangeLogListView"
android:id="@+id/view"
android:layout_gravity="center"
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<view xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:chg="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="it.gmariotti.changelibs.library.view.ChangeLogListView"
android:id="@+id/view"
android:layout_gravity="center"
/>

View File

@@ -1,46 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<android.support.v7.widget.SwitchCompat
android:id="@android:id/checkbox"
android:layout_width="match_parent"
android:layout_height="56dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/enable_autoencoding"
android:textSize="12sp"
android:textColor="@color/textColor"
android:textAllCaps="true"/>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:choiceMode="singleChoice"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<android.support.v7.widget.SwitchCompat
android:id="@android:id/checkbox"
android:layout_width="match_parent"
android:layout_height="56dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/enable_autoencoding"
android:textSize="12sp"
android:textColor="@color/textColor"
android:textAllCaps="true"/>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:choiceMode="singleChoice"/>
</LinearLayout>

View File

@@ -1,37 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="10dp">
<EditText
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/edit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text"
android:imeOptions="actionDone"
android:padding="10dp"
/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="10dp">
<EditText
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/edit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text"
android:imeOptions="actionDone"
android:padding="10dp"
/>
</LinearLayout>

View File

@@ -1,32 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View File

@@ -1,77 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="10dp">
<EditText
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="@id/text_to_find"
android:hint="@string/text_to_find"
android:padding="5dp"
android:textSize="12sp"
android:inputType="textNoSuggestions|textFilter|textVisiblePassword"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/regular_expression"
android:id="@id/regex_check"
android:layout_weight="1"
android:singleLine="true"
android:textSize="12sp"
android:textAllCaps="true"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/match_case"
android:id="@id/match_case_check"
android:layout_weight="1"
android:singleLine="true"
android:textSize="12sp"
android:textAllCaps="true"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/replace"
android:id="@id/replace_check"
android:layout_weight="1"
android:singleLine="true"
android:textSize="12sp"
android:textAllCaps="true"/>
<EditText
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="@id/text_to_replace"
android:hint="@string/text_to_replace"
android:visibility="gone"
android:padding="5dp"
android:textSize="12sp"
android:inputType="textNoSuggestions|textFilter"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="10dp">
<EditText
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="@id/text_to_find"
android:hint="@string/text_to_find"
android:padding="5dp"
android:textSize="12sp"
android:inputType="textNoSuggestions|textFilter|textVisiblePassword"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/regular_expression"
android:id="@id/regex_check"
android:layout_weight="1"
android:singleLine="true"
android:textSize="12sp"
android:textAllCaps="true"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/match_case"
android:id="@id/match_case_check"
android:layout_weight="1"
android:singleLine="true"
android:textSize="12sp"
android:textAllCaps="true"/>
<CheckBox
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/replace"
android:id="@id/replace_check"
android:layout_weight="1"
android:singleLine="true"
android:textSize="12sp"
android:textAllCaps="true"/>
<EditText
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="@id/text_to_replace"
android:hint="@string/text_to_replace"
android:visibility="gone"
android:padding="5dp"
android:textSize="12sp"
android:inputType="textNoSuggestions|textFilter"/>
</LinearLayout>

View File

@@ -1,61 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:hint="@string/name"
android:padding="5dp"
android:textSize="12sp"
android:textAllCaps="true"
android:gravity="bottom"/>
<EditText
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="@android:id/text1"
android:hint="@string/name"
android:padding="5dp"
android:textSize="12sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:hint="@string/folder"
android:padding="5dp"
android:textSize="12sp"
android:textAllCaps="true"
android:gravity="bottom"/>
<EditText
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="@android:id/text2"
android:hint="@string/folder"
android:padding="5dp"
android:textSize="12sp"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:hint="@string/name"
android:padding="5dp"
android:textSize="12sp"
android:textAllCaps="true"
android:gravity="bottom"/>
<EditText
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="@android:id/text1"
android:hint="@string/name"
android:padding="5dp"
android:textSize="12sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:hint="@string/folder"
android:padding="5dp"
android:textSize="12sp"
android:textAllCaps="true"
android:gravity="bottom"/>
<EditText
android:layout_width="match_parent"
android:layout_height="56dp"
android:id="@android:id/text2"
android:hint="@string/folder"
android:padding="5dp"
android:textSize="12sp"/>
</LinearLayout>

View File

@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<NumberPicker
android:id="@android:id/input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dialog_edittext_margin"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<NumberPicker
android:id="@android:id/input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dialog_edittext_margin"/>
</LinearLayout>

View File

@@ -1,27 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:id="@android:id/list"
>
</ListView>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:id="@android:id/list"
>
</ListView>

View File

@@ -1,267 +1,267 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<ScrollView
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/navigation_drawer_background_inverted"
android:paddingTop="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@id/drawer_buttons"
android:orientation="vertical"
>
<TextView
android:id="@id/drawer_button_go_pro"
android:layout_width="match_parent"
android:layout_height="72dp"
android:text="@string/donation_action"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:textSize="12sp"
android:clickable="true"
android:background="?selectableItemBackground"
android:textColor="@color/indigo"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/line_numbers"
android:textSize="12sp"
android:id="@id/switch_line_numbers"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/menu_syntax_highlight"
android:textSize="12sp"
android:id="@id/switch_syntax"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/wrap_content"
android:textSize="12sp"
android:id="@id/switch_wrap_content"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/use_monospace"
android:textSize="12sp"
android:id="@id/switch_monospace"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/read_only"
android:textSize="12sp"
android:id="@id/switch_read_only"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<TextView
android:id="@id/drawer_button_font_size"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/font_size"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:textSize="12sp"
android:clickable="true"
android:background="?selectableItemBackground"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<TextView
android:id="@id/drawer_button_extra_options"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/extra_options"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:textSize="12sp"
android:clickable="true"
android:background="?selectableItemBackground"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:drawableRight="@drawable/abc_spinner_mtrl_am_alpha"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/other_options"
android:visibility="gone"
android:orientation="vertical">
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/light_theme"
android:textSize="12sp"
android:id="@id/switch_light_theme"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/keyboard_suggestions_and_swipe"
android:textSize="12sp"
android:id="@id/switch_suggestions_active"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/auto_save"
android:textSize="12sp"
android:id="@id/switch_auto_save"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<TextView
android:id="@id/drawer_button_encoding"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/codifica"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:textSize="12sp"
android:clickable="true"
android:background="?selectableItemBackground"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/ignore_back_button"
android:textSize="12sp"
android:id="@id/switch_ignore_backbutton"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/split_text_if_too_long"
android:textSize="12sp"
android:id="@id/switch_page_system"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/send_error_reports"
android:textSize="12sp"
android:id="@id/switch_send_error_reports"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<ScrollView
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/navigation_drawer_background_inverted"
android:paddingTop="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@id/drawer_buttons"
android:orientation="vertical"
>
<TextView
android:id="@id/drawer_button_go_pro"
android:layout_width="match_parent"
android:layout_height="72dp"
android:text="@string/donation_action"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:textSize="12sp"
android:clickable="true"
android:background="?selectableItemBackground"
android:textColor="@color/indigo"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/line_numbers"
android:textSize="12sp"
android:id="@id/switch_line_numbers"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/menu_syntax_highlight"
android:textSize="12sp"
android:id="@id/switch_syntax"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/wrap_content"
android:textSize="12sp"
android:id="@id/switch_wrap_content"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/use_monospace"
android:textSize="12sp"
android:id="@id/switch_monospace"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/read_only"
android:textSize="12sp"
android:id="@id/switch_read_only"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<TextView
android:id="@id/drawer_button_font_size"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/font_size"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:textSize="12sp"
android:clickable="true"
android:background="?selectableItemBackground"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<TextView
android:id="@id/drawer_button_extra_options"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/extra_options"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:textSize="12sp"
android:clickable="true"
android:background="?selectableItemBackground"
android:textColor="@color/navigation_drawer_button_text_color_inverted"
android:drawableRight="@drawable/abc_spinner_mtrl_am_alpha"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/other_options"
android:visibility="gone"
android:orientation="vertical">
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/light_theme"
android:textSize="12sp"
android:id="@id/switch_light_theme"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/keyboard_suggestions_and_swipe"
android:textSize="12sp"
android:id="@id/switch_suggestions_active"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/auto_save"
android:textSize="12sp"
android:id="@id/switch_auto_save"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<TextView
android:id="@id/drawer_button_encoding"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/codifica"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:textSize="12sp"
android:clickable="true"
android:background="?selectableItemBackground"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/ignore_back_button"
android:textSize="12sp"
android:id="@id/switch_ignore_backbutton"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/split_text_if_too_long"
android:textSize="12sp"
android:id="@id/switch_page_system"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<android.support.v7.widget.SwitchCompat
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="@string/send_error_reports"
android:textSize="12sp"
android:id="@id/switch_send_error_reports"
android:layout_gravity="center_horizontal"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -1,49 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
android:layout_height="64dp"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:gravity="center_vertical" >
<TextView
android:id="@android:id/text1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:textSize="16sp"
android:paddingStart="16dp"
android:paddingEnd="8dp"
android:paddingLeft="16dp"
android:paddingRight="8dp"
android:maxLines="1"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<ImageView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:id="@id/button_remove_from_list"
android:src="@drawable/ic_close_dark"
android:padding="15dp"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
android:layout_height="64dp"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:gravity="center_vertical" >
<TextView
android:id="@android:id/text1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:textSize="16sp"
android:paddingStart="16dp"
android:paddingEnd="8dp"
android:paddingLeft="16dp"
android:paddingRight="8dp"
android:maxLines="1"
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
<ImageView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:id="@id/button_remove_from_list"
android:src="@drawable/ic_close_dark"
android:padding="15dp"/>
</LinearLayout>

View File

@@ -1,61 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|start"
android:minHeight="72dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:id="@android:id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@color/file_folder"/>
<TextView
android:id="@android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="15sp"
android:ellipsize="end"
android:paddingStart="56dp"
android:paddingLeft="56dp"
android:text="FILE NAME"/>
<TextView
android:id="@android:id/text2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignBottom="@android:id/icon"
android:maxLines="1"
android:textSize="14sp"
android:enabled="false"
android:ellipsize="end"
android:paddingStart="56dp"
android:paddingLeft="56dp"
android:text="DETAIL 1"/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|start"
android:minHeight="72dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:id="@android:id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@color/file_folder"/>
<TextView
android:id="@android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="15sp"
android:ellipsize="end"
android:paddingStart="56dp"
android:paddingLeft="56dp"
android:text="FILE NAME"/>
<TextView
android:id="@android:id/text2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignBottom="@android:id/icon"
android:maxLines="1"
android:textSize="14sp"
android:enabled="false"
android:ellipsize="end"
android:paddingStart="56dp"
android:paddingLeft="56dp"
android:text="DETAIL 1"/>
</RelativeLayout>

View File

@@ -1,32 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="56dp"
android:textSize="12sp"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
/>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="56dp"
android:textSize="12sp"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
/>

View File

@@ -1,58 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|start"
android:minHeight="72dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<TextView
android:id="@android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="15sp"
android:ellipsize="end"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:text="FILE NAME"/>
<TextView
android:id="@android:id/text2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:maxLines="2"
android:textSize="14sp"
android:enabled="false"
android:ellipsize="end"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:text="DETAIL 1"
android:layout_below="@android:id/text1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|start"
android:minHeight="72dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<TextView
android:id="@android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="15sp"
android:ellipsize="end"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:text="FILE NAME"/>
<TextView
android:id="@android:id/text2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:maxLines="2"
android:textSize="14sp"
android:enabled="false"
android:ellipsize="end"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:text="DETAIL 1"
android:layout_below="@android:id/text1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>

View File

@@ -1,31 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_awesome_toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_awesome_toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>

View File

@@ -1,47 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@id/im_select_folder"
app:showAsAction="ifRoom"
android:title="@string/seleziona">
</item>
<item
android:id="@id/im_set_as_working_folder"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_bookmark_outline"
android:title="@string/set_as_working_folder">
</item>
<item
android:id="@id/im_is_working_folder"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_bookmark"
android:title="@string/is_the_working_folder">
</item>
<item
android:id="@id/im_search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom|collapseActionView"
android:icon="@drawable/ic_action_search"
android:title="@string/find">
</item>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@id/im_select_folder"
app:showAsAction="ifRoom"
android:title="@string/seleziona">
</item>
<item
android:id="@id/im_set_as_working_folder"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_bookmark_outline"
android:title="@string/set_as_working_folder">
</item>
<item
android:id="@id/im_is_working_folder"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_bookmark"
android:title="@string/is_the_working_folder">
</item>
<item
android:id="@id/im_search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom|collapseActionView"
android:icon="@drawable/ic_action_search"
android:title="@string/find">
</item>
</menu>

View File

@@ -1,71 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@id/im_save"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_save"
android:title="@string/salva"/>
<item
android:id="@id/im_undo"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_undo"
android:title="@string/testo_indietro"
/>
<item
android:id="@id/im_redo"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_redo"
android:title="@string/testo_rifai"
/>
<item
android:id="@id/im_search"
app:showAsAction="never"
android:title="@string/find"
/>
<item
android:id="@id/im_goto_line"
app:showAsAction="never"
android:title="@string/goto_line"
/>
<item
android:id="@id/im_view_it_on_browser"
app:showAsAction="never"
android:title="@string/view_it_on_the_web"
/>
<item
android:id="@id/im_share"
app:showAsAction="never"
android:title="@string/share"
app:actionProviderClass="android.support.v7.widget.ShareActionProvider"
/>
<item
android:id="@id/im_info"
app:showAsAction="never"
android:title="@string/info"
/>
<item
android:id="@id/im_donate"
app:showAsAction="never"
android:title="@string/donation_action"
/>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@id/im_save"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_save"
android:title="@string/salva"/>
<item
android:id="@id/im_undo"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_undo"
android:title="@string/testo_indietro"
/>
<item
android:id="@id/im_redo"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_redo"
android:title="@string/testo_rifai"
/>
<item
android:id="@id/im_search"
app:showAsAction="never"
android:title="@string/find"
/>
<item
android:id="@id/im_goto_line"
app:showAsAction="never"
android:title="@string/goto_line"
/>
<item
android:id="@id/im_view_it_on_browser"
app:showAsAction="never"
android:title="@string/view_it_on_the_web"
/>
<item
android:id="@id/im_share"
app:showAsAction="never"
android:title="@string/share"
app:actionProviderClass="android.support.v7.widget.ShareActionProvider"
/>
<item
android:id="@id/im_info"
app:showAsAction="never"
android:title="@string/info"
/>
<item
android:id="@id/im_donate"
app:showAsAction="never"
android:title="@string/donation_action"
/>
</menu>

View File

@@ -1,58 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!--<item
android:id="@+id/menu_search"
android:actionViewClass="android.widget.SearchView"
app:showAsAction="ifRoom"
android:actionLayout="@layout/my_search_view"
android:icon="@drawable/ic_action_search"
android:title="@string/search">
</item>-->
<item
android:id="@id/im_cancel"
app:showAsAction="always"
android:title="@android:string/cancel">
</item>
<item
android:id="@id/im_previous_item"
app:showAsAction="always"
android:title="@string/previous">
</item>
<item
android:id="@id/im_next_item"
app:showAsAction="always"
android:title="@string/next">
</item>
<item
android:id="@id/im_replace"
app:showAsAction="always"
android:title="@string/replace">
</item>
<!--<item
android:id="@id/im_cancel"
android:icon="@drawable/ic_action_close"
android:title="@app:tring/cancel"
app:showAsAction="always">
</item>-->
</menu>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!--<item
android:id="@+id/menu_search"
android:actionViewClass="android.widget.SearchView"
app:showAsAction="ifRoom"
android:actionLayout="@layout/my_search_view"
android:icon="@drawable/ic_action_search"
android:title="@string/search">
</item>-->
<item
android:id="@id/im_cancel"
app:showAsAction="always"
android:title="@android:string/cancel">
</item>
<item
android:id="@id/im_previous_item"
app:showAsAction="always"
android:title="@string/previous">
</item>
<item
android:id="@id/im_next_item"
app:showAsAction="always"
android:title="@string/next">
</item>
<item
android:id="@id/im_replace"
app:showAsAction="always"
android:title="@string/replace">
</item>
<!--<item
android:id="@id/im_cancel"
android:icon="@drawable/ic_action_close"
android:title="@app:tring/cancel"
app:showAsAction="always">
</item>-->
</menu>

View File

@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@id/im_new_file"
android:title="@string/file"
app:showAsAction="ifRoom"/>
<item
android:id="@id/im_new_folder"
android:title="@string/folder"
app:showAsAction="ifRoom"/>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@id/im_new_file"
android:title="@string/file"
app:showAsAction="ifRoom"/>
<item
android:id="@id/im_new_folder"
android:title="@string/folder"
app:showAsAction="ifRoom"/>
</menu>

View File

@@ -1,168 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<changelog bulletedList="true">
<changelogversion versionName="1.13.1" changeDate="Oct 30, 2014">
<changelogtext>Manly bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.13" changeDate="Oct 25, 2014">
<changelogtext>Turbo Editor is a free and open source app. Now you can show your appreciation and support development by donating :)</changelogtext>
<changelogtext>New visual changes to make the app more "Material"</changelogtext>
<changelogtext>New save dialog when you are about to close a file</changelogtext>
<changelogtext>Many enchantments and fixes</changelogtext>
<changelogtext>Have feedback? Please use xda or the email. Thanks!</changelogtext>
</changelogversion>
<changelogversion versionName="1.12" changeDate="Oct 9, 2014">
<changelogtext>Many enchantments and fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.11" changeDate="Sep 30, 2014">
<changelogtext>[b]New! [/b]Important improvements to the syntax highlight</changelogtext>
<changelogtext>[b]New! [/b]Donation option in the about screen. Help to make Turbo Editor a better software! :)</changelogtext>
<changelogtext>[b]New! [/b]Setting to disable the "page system"</changelogtext>
<changelogtext>[b]New! [/b]Setting to ignore the back button</changelogtext>
<changelogtext>Fixed an issue related to cut/copy/past buttons</changelogtext>
<changelogtext>Other enchantments and fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.10" changeDate="Sep 17, 2014">
<changelogtext>[b]New! [/b]Go To Line feature</changelogtext>
<changelogtext>Now the syntax highlight updates when scrolling</changelogtext>
<changelogtext>Other enchantments and fixs</changelogtext>
</changelogversion>
<changelogversion versionName="1.9" changeDate="Sep 12, 2014">
<changelogtext>[b]New! [/b]Create empty files with just one click</changelogtext>
<changelogtext>[b]New! [/b]Read only mode</changelogtext>
<changelogtext>[b]New! [/b]Autosave function, to save files when the app loses focus</changelogtext>
<changelogtext>[b]New! [/b]Share the text from other apps to Turbo Editor</changelogtext>
<changelogtext>[b]New! [/b]Style changes</changelogtext>
<changelogtext>Other enchantments and fixs</changelogtext>
</changelogversion>
<changelogversion versionName="1.8" changeDate="Sep 8, 2014">
<changelogtext>[b]New! [/b]Now you can open Very Big Files</changelogtext>
<changelogtext>[b]New! [/b]Better support for python and lua</changelogtext>
<changelogtext>Other enchantments and fixs</changelogtext>
</changelogversion>
<changelogversion versionName="1.7" changeDate="Sep 1, 2014">
<changelogtext>[b]New! [/b]Find and Replace function</changelogtext>
<changelogtext>[b]New! [/b]Find with Regular Expression</changelogtext>
<changelogtext>[b]New! [/b]Right to Left support</changelogtext>
<changelogtext>[b]New! [/b]About screen</changelogtext>
<changelogtext>If a file was modified the app now asks to save the changes</changelogtext>
<changelogtext>Fixed an issue with the undo function</changelogtext>
<changelogtext>New animations</changelogtext>
<changelogtext>Other enchantments</changelogtext>
</changelogversion>
<changelogversion versionName="1.6" changeDate="Aug 22, 2014">
<changelogtext>[b]New! [/b]Floating action button in the "Open a file" screen</changelogtext>
<changelogtext>[b]New! [/b]Set as working folder action in the "Open a file" screen</changelogtext>
<changelogtext>In the info/about screen added a link to the XDA thread</changelogtext>
<changelogtext>New menu icon for overflow</changelogtext>
<changelogtext>Updated the translations</changelogtext>
<changelogtext>Other enchantments</changelogtext>
</changelogversion>
<changelogversion versionName="1.5" changeDate="Aug 15, 2014">
<changelogtext>[b]New! [/b]Added root features!</changelogtext>
<changelogtext>[b]New! [/b]Open hidden files</changelogtext>
<changelogtext>[b]New! [/b]GB2312 encoding</changelogtext>
<changelogtext>Other enchantments</changelogtext>
</changelogversion>
<changelogversion versionName="1.4" changeDate="Aug 14, 2014">
<changelogtext>[b]New [/b] encoding dialog. There you can also enable/disable the auto encoding.</changelogtext>
<changelogtext>Added support to SQL and MATLAB</changelogtext>
<changelogtext>The font size dialog now shows the current font size</changelogtext>
<changelogtext>The background of the screens changes in relation to the selected theme</changelogtext>
<changelogtext>[b]Info[/b] The internet permission is used to show an Interstitial. The ad will be shown [b]at max once per day[/b].</changelogtext>
</changelogversion>
<changelogversion versionName="1.3" changeDate="Aug 11, 2014">
<changelogtext>[b]New![/b] Now you can search text inside the app!</changelogtext>
</changelogversion>
<changelogversion versionName="1.2.5" changeDate="Aug 9, 2014">
<changelogtext>Now you can share the file!</changelogtext>
<changelogtext>Fixed many issues related to the keyboards</changelogtext>
<changelogtext>Added an option to activate suggestions and swipe functionality</changelogtext>
</changelogversion>
<changelogversion versionName="1.2.4" changeDate="Aug 4, 2014">
<changelogtext>Fixed a Runtime Error, sorry :)</changelogtext>
</changelogversion>
<changelogversion versionName="1.2.3" changeDate="Aug 4, 2014">
<changelogtext>Save, Undo and Redo actions are visible only when needed</changelogtext>
<changelogtext>[b]new![/b] Save with CTRL + S</changelogtext>
<changelogtext>More left space on the line numbers and changed their color</changelogtext>
<changelogtext>PHP variables now are highlight correctly</changelogtext>
<changelogtext>JS syntax highlight fixes</changelogtext>
<changelogtext>Fixed a bug with numbers inserted by certain keyboards</changelogtext>
<changelogtext>Updated translations</changelogtext>
</changelogversion>
<changelogversion versionName="1.2" changeDate="Aug 2, 2014">
<changelogtext>[b]NOTE[/b] Syntax highlighting is updated when the cursor position changes</changelogtext>
<changelogtext>[b]SPECIAL NOTE[/b] If you like the app please rate it, but if you have some issue please tell me about them on the Google Plus Community, on the XDA thread or on Github :)</changelogtext>
<changelogtext>Now you can choose between light and dark theme</changelogtext>
<changelogtext>Fixed some issues with hard keyboards</changelogtext>
<changelogtext>Changed the size of line numbers to make them more readable</changelogtext>
<changelogtext>Increased file size limit</changelogtext>
<changelogtext>Optimized syntax color algorithm</changelogtext>
<changelogtext>Now you can create a new file without having to save it first</changelogtext>
<changelogtext>Bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.1" changeDate="July 30, 2014">
<changelogtext>Now you can both wrap the text and view the line numbers</changelogtext>
<changelogtext>Optimized the line numbers algorithm</changelogtext>
<changelogtext>Clicking the X in the navigation drawer also closes the file</changelogtext>
<changelogtext>Menu titles corrected</changelogtext>
<changelogtext>Now list updates if a new folder is added</changelogtext>
<changelogtext>Resized the navigation drawer so it's not fullscreen on smaller devices</changelogtext>
<changelogtext>Now you can open files up to 50 kb. Be careful, you may experience crashes if you open files that are too big.</changelogtext>
<changelogtext>Minor fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.0.3" changeDate="July 29, 2014">
<changelogtext>New Icons optimized for all the devices</changelogtext>
<changelogtext>Updated translations</changelogtext>
<changelogtext>Bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.0.2" changeDate="July 28, 2014">
<changelogtext>Bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.0.1" changeDate="July 28, 2014">
<changelogtext>Bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.0" changeDate="July 28, 2014">
<changelogtext>First Version</changelogtext>
</changelogversion>
</changelog>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<changelog bulletedList="true">
<changelogversion versionName="1.13.1" changeDate="Oct 30, 2014">
<changelogtext>Manly bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.13" changeDate="Oct 25, 2014">
<changelogtext>Turbo Editor is a free and open source app. Now you can show your appreciation and support development by donating :)</changelogtext>
<changelogtext>New visual changes to make the app more "Material"</changelogtext>
<changelogtext>New save dialog when you are about to close a file</changelogtext>
<changelogtext>Many enchantments and fixes</changelogtext>
<changelogtext>Have feedback? Please use xda or the email. Thanks!</changelogtext>
</changelogversion>
<changelogversion versionName="1.12" changeDate="Oct 9, 2014">
<changelogtext>Many enchantments and fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.11" changeDate="Sep 30, 2014">
<changelogtext>[b]New! [/b]Important improvements to the syntax highlight</changelogtext>
<changelogtext>[b]New! [/b]Donation option in the about screen. Help to make Turbo Editor a better software! :)</changelogtext>
<changelogtext>[b]New! [/b]Setting to disable the "page system"</changelogtext>
<changelogtext>[b]New! [/b]Setting to ignore the back button</changelogtext>
<changelogtext>Fixed an issue related to cut/copy/past buttons</changelogtext>
<changelogtext>Other enchantments and fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.10" changeDate="Sep 17, 2014">
<changelogtext>[b]New! [/b]Go To Line feature</changelogtext>
<changelogtext>Now the syntax highlight updates when scrolling</changelogtext>
<changelogtext>Other enchantments and fixs</changelogtext>
</changelogversion>
<changelogversion versionName="1.9" changeDate="Sep 12, 2014">
<changelogtext>[b]New! [/b]Create empty files with just one click</changelogtext>
<changelogtext>[b]New! [/b]Read only mode</changelogtext>
<changelogtext>[b]New! [/b]Autosave function, to save files when the app loses focus</changelogtext>
<changelogtext>[b]New! [/b]Share the text from other apps to Turbo Editor</changelogtext>
<changelogtext>[b]New! [/b]Style changes</changelogtext>
<changelogtext>Other enchantments and fixs</changelogtext>
</changelogversion>
<changelogversion versionName="1.8" changeDate="Sep 8, 2014">
<changelogtext>[b]New! [/b]Now you can open Very Big Files</changelogtext>
<changelogtext>[b]New! [/b]Better support for python and lua</changelogtext>
<changelogtext>Other enchantments and fixs</changelogtext>
</changelogversion>
<changelogversion versionName="1.7" changeDate="Sep 1, 2014">
<changelogtext>[b]New! [/b]Find and Replace function</changelogtext>
<changelogtext>[b]New! [/b]Find with Regular Expression</changelogtext>
<changelogtext>[b]New! [/b]Right to Left support</changelogtext>
<changelogtext>[b]New! [/b]About screen</changelogtext>
<changelogtext>If a file was modified the app now asks to save the changes</changelogtext>
<changelogtext>Fixed an issue with the undo function</changelogtext>
<changelogtext>New animations</changelogtext>
<changelogtext>Other enchantments</changelogtext>
</changelogversion>
<changelogversion versionName="1.6" changeDate="Aug 22, 2014">
<changelogtext>[b]New! [/b]Floating action button in the "Open a file" screen</changelogtext>
<changelogtext>[b]New! [/b]Set as working folder action in the "Open a file" screen</changelogtext>
<changelogtext>In the info/about screen added a link to the XDA thread</changelogtext>
<changelogtext>New menu icon for overflow</changelogtext>
<changelogtext>Updated the translations</changelogtext>
<changelogtext>Other enchantments</changelogtext>
</changelogversion>
<changelogversion versionName="1.5" changeDate="Aug 15, 2014">
<changelogtext>[b]New! [/b]Added root features!</changelogtext>
<changelogtext>[b]New! [/b]Open hidden files</changelogtext>
<changelogtext>[b]New! [/b]GB2312 encoding</changelogtext>
<changelogtext>Other enchantments</changelogtext>
</changelogversion>
<changelogversion versionName="1.4" changeDate="Aug 14, 2014">
<changelogtext>[b]New [/b] encoding dialog. There you can also enable/disable the auto encoding.</changelogtext>
<changelogtext>Added support to SQL and MATLAB</changelogtext>
<changelogtext>The font size dialog now shows the current font size</changelogtext>
<changelogtext>The background of the screens changes in relation to the selected theme</changelogtext>
<changelogtext>[b]Info[/b] The internet permission is used to show an Interstitial. The ad will be shown [b]at max once per day[/b].</changelogtext>
</changelogversion>
<changelogversion versionName="1.3" changeDate="Aug 11, 2014">
<changelogtext>[b]New![/b] Now you can search text inside the app!</changelogtext>
</changelogversion>
<changelogversion versionName="1.2.5" changeDate="Aug 9, 2014">
<changelogtext>Now you can share the file!</changelogtext>
<changelogtext>Fixed many issues related to the keyboards</changelogtext>
<changelogtext>Added an option to activate suggestions and swipe functionality</changelogtext>
</changelogversion>
<changelogversion versionName="1.2.4" changeDate="Aug 4, 2014">
<changelogtext>Fixed a Runtime Error, sorry :)</changelogtext>
</changelogversion>
<changelogversion versionName="1.2.3" changeDate="Aug 4, 2014">
<changelogtext>Save, Undo and Redo actions are visible only when needed</changelogtext>
<changelogtext>[b]new![/b] Save with CTRL + S</changelogtext>
<changelogtext>More left space on the line numbers and changed their color</changelogtext>
<changelogtext>PHP variables now are highlight correctly</changelogtext>
<changelogtext>JS syntax highlight fixes</changelogtext>
<changelogtext>Fixed a bug with numbers inserted by certain keyboards</changelogtext>
<changelogtext>Updated translations</changelogtext>
</changelogversion>
<changelogversion versionName="1.2" changeDate="Aug 2, 2014">
<changelogtext>[b]NOTE[/b] Syntax highlighting is updated when the cursor position changes</changelogtext>
<changelogtext>[b]SPECIAL NOTE[/b] If you like the app please rate it, but if you have some issue please tell me about them on the Google Plus Community, on the XDA thread or on Github :)</changelogtext>
<changelogtext>Now you can choose between light and dark theme</changelogtext>
<changelogtext>Fixed some issues with hard keyboards</changelogtext>
<changelogtext>Changed the size of line numbers to make them more readable</changelogtext>
<changelogtext>Increased file size limit</changelogtext>
<changelogtext>Optimized syntax color algorithm</changelogtext>
<changelogtext>Now you can create a new file without having to save it first</changelogtext>
<changelogtext>Bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.1" changeDate="July 30, 2014">
<changelogtext>Now you can both wrap the text and view the line numbers</changelogtext>
<changelogtext>Optimized the line numbers algorithm</changelogtext>
<changelogtext>Clicking the X in the navigation drawer also closes the file</changelogtext>
<changelogtext>Menu titles corrected</changelogtext>
<changelogtext>Now list updates if a new folder is added</changelogtext>
<changelogtext>Resized the navigation drawer so it's not fullscreen on smaller devices</changelogtext>
<changelogtext>Now you can open files up to 50 kb. Be careful, you may experience crashes if you open files that are too big.</changelogtext>
<changelogtext>Minor fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.0.3" changeDate="July 29, 2014">
<changelogtext>New Icons optimized for all the devices</changelogtext>
<changelogtext>Updated translations</changelogtext>
<changelogtext>Bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.0.2" changeDate="July 28, 2014">
<changelogtext>Bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.0.1" changeDate="July 28, 2014">
<changelogtext>Bug fixes</changelogtext>
</changelogversion>
<changelogversion versionName="1.0" changeDate="July 28, 2014">
<changelogtext>First Version</changelogtext>
</changelogversion>
</changelog>

View File

@@ -1,153 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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="aggiungi_account">Nueva cuenta</string>
<string name="attiva">Activo</string>
<string name="cancella">Borrar</string>
<string name="cancellazione">Borrando archivos&#8230;</string>
<string name="caricamento">Subiendo&#8230;</string>
<string name="cartella_locale_corrente">Carpeta local actual</string>
<string name="chiave_privata">Llave privada</string>
<string name="chiaro">Claro</string>
<string name="codifica">Codificación</string>
<string name="condividi">Compartir</string>
<string name="crea_cartella_locale">Nueva carpeta local</string>
<string name="crea_cartella_remota">Nueva capeta remota</string>
<string name="crea_file_remoto">Nuevo archivo remoto</string>
<string name="new_local_file">Nuevo archivo local</string>
<string name="disconneti">Desconectar</string>
<string name="default_local_folder">Carpeta local por defecto</string>
<string name="dove_scaricare">Donde descargar?</string>
<string name="download">Descargar</string>
<string name="download_completato">Descarga completa</string>
<string name="duplicate">Duplicar</string>
<string name="fatto">Finalizado</string>
<string name="home">Inicio</string>
<string name="host">Servidor</string>
<string name="info">Información</string>
<string name="locale">Local</string>
<string name="log_in">Identificandote&#8230;</string>
<string name="modifica">Editar</string>
<string name="muovi">Mover</string>
<string name="nascondi">Oculto</string>
<string name="nome_app">Turbo Client</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="nome_utente">Nombre de usuario</string>
<string name="passiva">Pasivo</string>
<string name="passphrase">Contraseña</string>
<string name="password">Contraseña</string>
<string name="password_summary">Dejelo en blanco para rellenarlo en cada sesion</string>
<string name="porta">Puerto</string>
<string name="preferenze">Preferencias</string>
<string name="remoto">Remoto</string>
<string name="riavva_per_tema">Para cambiar el tema, reinicie la aplicacion</string>
<string name="rinomina">Renombra</string>
<string name="root">Carpeta remota predeterminada</string>
<string name="salva">Guardar</string>
<string name="scuro">Oscuro</string>
<string name="seleziona">Seleccionar</string>
<string name="seleziona_account">Selecciona una cuenta</string>
<string name="sicuro">¿Estás seguro?</string>
<string name="something_failed">Algo salio mal</string>
<string name="skip_same_file">No transferir el mismo archivo</string>
<string name="tema_app">Tema de la aplicación</string>
<string name="tipo_connessione">Tipo de conexión</string>
<string name="tipo_protocollo">Tipo de protocolo</string>
<string name="un_altra_cartella">Otra carpeta</string>
<string name="use_passphrase">Usa una contraseña</string>
<string name="upload">Cargar</string>
<string name="upload_completato">Subida finalizada</string>
<string name="what_to_do">Que desea hacer?</string>
<string name="menu_syntax_highlight">Resalto de sintaxis</string>
<string name="testo_indietro">Deshacer</string>
<string name="testo_rifai">Rehacer</string>
<string name="sync">Sincronizar</string>
<string name="remote_folder_to_sync">Carpeta remota para sincronziar</string>
<string name="local_folder_to_sync">Carpeta local para sincronizar</string>
<string name="vota">Vota</string>
<string name="inapp_unavailable">No se puede contactar con Google Play</string>
<string name="inapp_description">Apoyar el desarrollo de otras características.</string>
<string name="upgrade_premium">Actualizar a Premium</string>
<string name="upgrade_premium_summary">Actualizar a Premium y apoyar el desarrollo de Turbo Client!</string>
<string name="download_unlocked_version">Descargar version desbloqueada</string>
<string name="inapp_second_description">¿Que es Turbo Client? ¿Vale la pena? Fije su precio! </string>
<string name="inapp_first_description">Actualice para desbloquear estas caracteristicas:</string>
<string name="inapp_item_openandeditfiles">Poder para abrir y modificar cualquier tipo de archivo.</string>
<string name="inapp_item_backup_service">Servicio de copia de seguridad de copia de seguridad y restaurar sus datos de forma segura. </string>
<string name="inapp_unlock_features">Desbloquear caracteristicas Premium</string>
<string name="inapp_seconditem_description">Le gusta esta aplicacion!</string>
<string name="inapp_thirditem_description">Me gusta esta aplicacion!</string>
<string name="backup_accounts">Copia de seguridad de las cuentas</string>
<string name="restore_accounts">Restaruar cuentas</string>
<string name="share_accounts">Copia de seguridad y compartir las cuentas</string>
<string name="importing_accounts">Importortando cuentas&#8230;</string>
<string name="exporting_accounts">Exportando las cuentas...</string>
<string name="backup_not_found">No se encontraron copias de seguridad</string>
<string name="err_cant_open_the_file">No se puede abrir el archivo</string>
<string name="err_temp_folder_doesnt_exist">La carpeta temporal no existe</string>
<string name="err_occured">Se a producido un error</string>
<string name="ui_ux">Interfaz de usuario</string>
<string name="remove">Remover</string>
<string name="modification_date">Fecha de modificacion</string>
<string name="name">Nombre</string>
<string name="size">Tamaño</string>
<string name="sort">Ordenar</string>
<string name="open">Abrir</string>
<string name="file_modified">El archivo %1$s fue modificado, deseas subirlo?</string>
<string name="file_saved_with_success">El archivo %1$s se guardo correctamente!</string>
<string name="create_new_account">Crear una cuenta nueva</string>
<string name="create_new_account_to_start">Crear una nueva cuenta para comenzar.</string>
<string name="type">Tipo</string>
<string name="send_feedback">Enviar Comentarios</string>
<string name="copy_url">Copiar URL</string>
<string name="cut">Cortar</string>
<string name="paste">Pegar</string>
<string name="advanced">Avanzado</string>
<string name="auto">Automatico</string>
<string name="bytes">Bytes</string>
<string name="unit_measurement_for_file_size">Unidad de medida para el tamaño del archivo</string>
<string name="open_source_license">Licencia de codigo abierto</string>
<string name="open_source_license_summary">Ver licencia de codigo abierto</string>
<string name="open_a_file">Abrir un archivo</string>
<string name="open_this_time_only">Abrir solo esta vez</string>
<string name="change_list_type">Cambiar tipo de lista</string>
<string name="use_monospace">Usar monoespacio</string>
<string name="recent_files">Archivos recientes</string>
<string name="font_size">Tamaño de la fuente</string>
<string name="connection_name">Nombre de la conexion</string>
<string name="line_numbers">Numero de linea</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file_size_is_too_big">The file size is too big</string>
<string name="search">Search</string>
<string name="add">Add</string>
<string name="file">File</string>
<string name="folder">Carpeta</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Goto Line</string>
<string name="find">Find</string>
<string name="find_and_replace">Find and Replace</string>
<string name="root_permission">Root Permission</string>
<string name="share">Compartir</string>
<string name="text_suggestions">Text Suggestions</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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="aggiungi_account">Nueva cuenta</string>
<string name="attiva">Activo</string>
<string name="cancella">Borrar</string>
<string name="cancellazione">Borrando archivos&#8230;</string>
<string name="caricamento">Subiendo&#8230;</string>
<string name="cartella_locale_corrente">Carpeta local actual</string>
<string name="chiave_privata">Llave privada</string>
<string name="chiaro">Claro</string>
<string name="codifica">Codificación</string>
<string name="condividi">Compartir</string>
<string name="crea_cartella_locale">Nueva carpeta local</string>
<string name="crea_cartella_remota">Nueva capeta remota</string>
<string name="crea_file_remoto">Nuevo archivo remoto</string>
<string name="new_local_file">Nuevo archivo local</string>
<string name="disconneti">Desconectar</string>
<string name="default_local_folder">Carpeta local por defecto</string>
<string name="dove_scaricare">Donde descargar?</string>
<string name="download">Descargar</string>
<string name="download_completato">Descarga completa</string>
<string name="duplicate">Duplicar</string>
<string name="fatto">Finalizado</string>
<string name="home">Inicio</string>
<string name="host">Servidor</string>
<string name="info">Información</string>
<string name="locale">Local</string>
<string name="log_in">Identificandote&#8230;</string>
<string name="modifica">Editar</string>
<string name="muovi">Mover</string>
<string name="nascondi">Oculto</string>
<string name="nome_app">Turbo Client</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="nome_utente">Nombre de usuario</string>
<string name="passiva">Pasivo</string>
<string name="passphrase">Contraseña</string>
<string name="password">Contraseña</string>
<string name="password_summary">Dejelo en blanco para rellenarlo en cada sesion</string>
<string name="porta">Puerto</string>
<string name="preferenze">Preferencias</string>
<string name="remoto">Remoto</string>
<string name="riavva_per_tema">Para cambiar el tema, reinicie la aplicacion</string>
<string name="rinomina">Renombra</string>
<string name="root">Carpeta remota predeterminada</string>
<string name="salva">Guardar</string>
<string name="scuro">Oscuro</string>
<string name="seleziona">Seleccionar</string>
<string name="seleziona_account">Selecciona una cuenta</string>
<string name="sicuro">¿Estás seguro?</string>
<string name="something_failed">Algo salio mal</string>
<string name="skip_same_file">No transferir el mismo archivo</string>
<string name="tema_app">Tema de la aplicación</string>
<string name="tipo_connessione">Tipo de conexión</string>
<string name="tipo_protocollo">Tipo de protocolo</string>
<string name="un_altra_cartella">Otra carpeta</string>
<string name="use_passphrase">Usa una contraseña</string>
<string name="upload">Cargar</string>
<string name="upload_completato">Subida finalizada</string>
<string name="what_to_do">Que desea hacer?</string>
<string name="menu_syntax_highlight">Resalto de sintaxis</string>
<string name="testo_indietro">Deshacer</string>
<string name="testo_rifai">Rehacer</string>
<string name="sync">Sincronizar</string>
<string name="remote_folder_to_sync">Carpeta remota para sincronziar</string>
<string name="local_folder_to_sync">Carpeta local para sincronizar</string>
<string name="vota">Vota</string>
<string name="inapp_unavailable">No se puede contactar con Google Play</string>
<string name="inapp_description">Apoyar el desarrollo de otras características.</string>
<string name="upgrade_premium">Actualizar a Premium</string>
<string name="upgrade_premium_summary">Actualizar a Premium y apoyar el desarrollo de Turbo Client!</string>
<string name="download_unlocked_version">Descargar version desbloqueada</string>
<string name="inapp_second_description">¿Que es Turbo Client? ¿Vale la pena? Fije su precio! </string>
<string name="inapp_first_description">Actualice para desbloquear estas caracteristicas:</string>
<string name="inapp_item_openandeditfiles">Poder para abrir y modificar cualquier tipo de archivo.</string>
<string name="inapp_item_backup_service">Servicio de copia de seguridad de copia de seguridad y restaurar sus datos de forma segura. </string>
<string name="inapp_unlock_features">Desbloquear caracteristicas Premium</string>
<string name="inapp_seconditem_description">Le gusta esta aplicacion!</string>
<string name="inapp_thirditem_description">Me gusta esta aplicacion!</string>
<string name="backup_accounts">Copia de seguridad de las cuentas</string>
<string name="restore_accounts">Restaruar cuentas</string>
<string name="share_accounts">Copia de seguridad y compartir las cuentas</string>
<string name="importing_accounts">Importortando cuentas&#8230;</string>
<string name="exporting_accounts">Exportando las cuentas...</string>
<string name="backup_not_found">No se encontraron copias de seguridad</string>
<string name="err_cant_open_the_file">No se puede abrir el archivo</string>
<string name="err_temp_folder_doesnt_exist">La carpeta temporal no existe</string>
<string name="err_occured">Se a producido un error</string>
<string name="ui_ux">Interfaz de usuario</string>
<string name="remove">Remover</string>
<string name="modification_date">Fecha de modificacion</string>
<string name="name">Nombre</string>
<string name="size">Tamaño</string>
<string name="sort">Ordenar</string>
<string name="open">Abrir</string>
<string name="file_modified">El archivo %1$s fue modificado, deseas subirlo?</string>
<string name="file_saved_with_success">El archivo %1$s se guardo correctamente!</string>
<string name="create_new_account">Crear una cuenta nueva</string>
<string name="create_new_account_to_start">Crear una nueva cuenta para comenzar.</string>
<string name="type">Tipo</string>
<string name="send_feedback">Enviar Comentarios</string>
<string name="copy_url">Copiar URL</string>
<string name="cut">Cortar</string>
<string name="paste">Pegar</string>
<string name="advanced">Avanzado</string>
<string name="auto">Automatico</string>
<string name="bytes">Bytes</string>
<string name="unit_measurement_for_file_size">Unidad de medida para el tamaño del archivo</string>
<string name="open_source_license">Licencia de codigo abierto</string>
<string name="open_source_license_summary">Ver licencia de codigo abierto</string>
<string name="open_a_file">Abrir un archivo</string>
<string name="open_this_time_only">Abrir solo esta vez</string>
<string name="change_list_type">Cambiar tipo de lista</string>
<string name="use_monospace">Usar monoespacio</string>
<string name="recent_files">Archivos recientes</string>
<string name="font_size">Tamaño de la fuente</string>
<string name="connection_name">Nombre de la conexion</string>
<string name="line_numbers">Numero de linea</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file_size_is_too_big">The file size is too big</string>
<string name="search">Search</string>
<string name="add">Add</string>
<string name="file">File</string>
<string name="folder">Carpeta</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Goto Line</string>
<string name="find">Find</string>
<string name="find_and_replace">Find and Replace</string>
<string name="root_permission">Root Permission</string>
<string name="share">Compartir</string>
<string name="text_suggestions">Text Suggestions</string>
</resources>

View File

@@ -1,153 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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="aggiungi_account">Akaun Baru</string>
<string name="attiva">Aktif</string>
<string name="cancella">Buang</string>
<string name="cancellazione">Menghapus fail...</string>
<string name="caricamento">Memproses...</string>
<string name="cartella_locale_corrente">Folder local sekarang</string>
<string name="chiave_privata">Kata kunci Private</string>
<string name="chiaro">Terang</string>
<string name="codifica">Pengekodan</string>
<string name="condividi">Kongsi</string>
<string name="crea_cartella_locale">New local folder</string>
<string name="crea_cartella_remota">New remote folder</string>
<string name="crea_file_remoto">New remote file</string>
<string name="new_local_file">New local file</string>
<string name="disconneti">Putuskan sambungan</string>
<string name="default_local_folder">Folder local asal</string>
<string name="dove_scaricare">Muat turun ke?</string>
<string name="download">Muat turun</string>
<string name="download_completato">Muat turun selesai</string>
<string name="duplicate">Fail sudah wujud</string>
<string name="fatto">Selesai</string>
<string name="home">Home</string>
<string name="host">Host</string>
<string name="info">Maklumat</string>
<string name="locale">Local</string>
<string name="log_in">Melog masuk...</string>
<string name="modifica">Edit</string>
<string name="muovi">Alih</string>
<string name="nascondi">Sembunyikan</string>
<string name="nome_app">Turbo Client</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="nome_utente">Kata Pengguna</string>
<string name="passiva">Pasif</string>
<string name="passphrase">Kata Laluan</string>
<string name="password">Kata Kunci</string>
<string name="password_summary">Biarkan kosong untuk ditanya setiap sesi</string>
<string name="porta">Port</string>
<string name="preferenze">Pilihan</string>
<string name="remoto">Remote</string>
<string name="riavva_per_tema">Untuk mengubah tema, tutup dan buka semula aplikasi</string>
<string name="rinomina">Edit nama</string>
<string name="root">root</string>
<string name="salva">Simpan</string>
<string name="scuro">Gelap</string>
<string name="seleziona">Pilih</string>
<string name="seleziona_account">Pilih akaun</string>
<string name="sicuro">Anda pasti?</string>
<string name="something_failed">Something failed</string>
<string name="skip_same_file">Do not transfer same file</string>
<string name="tema_app">Tema aplikasi</string>
<string name="tipo_connessione">Jenis sambungan</string>
<string name="tipo_protocollo">Jenis protokol</string>
<string name="un_altra_cartella">Folder lain</string>
<string name="use_passphrase">Guna kata laluan</string>
<string name="upload">Muat naik</string>
<string name="upload_completato">Muat naik selesai</string>
<string name="what_to_do">What do you want to do?</string>
<string name="menu_syntax_highlight">Syntax highlight</string>
<string name="testo_indietro">Batal edit</string>
<string name="testo_rifai">Buat semula edit</string>
<string name="sync">Sinkronisasi</string>
<string name="remote_folder_to_sync">Sinkronisasikan folder remote</string>
<string name="local_folder_to_sync">Sinkronisasi folder local</string>
<string name="vota">Undi</string>
<string name="inapp_unavailable">Tidak dapat berhubung dengan Google Play</string>
<string name="inapp_description">Sokong pembinaan ciri-ciri hebat yang lain.</string>
<string name="upgrade_premium">Naik taraf kepada Premium</string>
<string name="upgrade_premium_summary">Menaiktaraf kepada Premium dan sokong perkembangan Turbo Client!</string>
<string name="download_unlocked_version">Download unlocked version</string>
<string name="inapp_second_description">Apakah nilai Turbo Client pada anda? Berikan harga anda! </string>
<string name="inapp_first_description">Naiktaraf untuk mendapat akses kepada ciri-ciri ini:</string>
<string name="inapp_item_openandeditfiles">Membaca dan mengubahsuai apa-apa jenis fail.</string>
<string name="inapp_item_backup_service">Menyimpan dan mengambil semula data anda dengan selamat. </string>
<string name="inapp_unlock_features">Akses ciri-ciri Premium</string>
<string name="inapp_seconditem_description">Saya sangat suka aplikasi ini!</string>
<string name="inapp_thirditem_description">Saya suka aplikasi ini!</string>
<string name="backup_accounts">Backup akaun</string>
<string name="restore_accounts">Kembalikan akaun</string>
<string name="share_accounts">Backup dan kongsi akaun</string>
<string name="importing_accounts">Mengimport akaun&#8230;</string>
<string name="exporting_accounts">Mengeksport akaun...</string>
<string name="backup_not_found">No backups found</string>
<string name="err_cant_open_the_file">Tidak dapat membuka fail</string>
<string name="err_temp_folder_doesnt_exist">Temporary folder does not exist</string>
<string name="err_occured">An error occurred</string>
<string name="ui_ux">antara muka pengguna</string>
<string name="remove">Hapus</string>
<string name="modification_date">Tarikh pengubahsuaian</string>
<string name="name">Nama</string>
<string name="size">Saiz</string>
<string name="sort">Susun</string>
<string name="open">Buka</string>
<string name="file_modified">Fail %1$s telah berubah. Adakah anda mahu memuat naik?</string>
<string name="file_saved_with_success">The file %1$s was saved with success!</string>
<string name="create_new_account">Cipta akaun baru</string>
<string name="create_new_account_to_start">Create a new account to start.</string>
<string name="type">Jenis</string>
<string name="send_feedback">Send feedback</string>
<string name="copy_url">Copy URL</string>
<string name="cut">Cut</string>
<string name="paste">paste</string>
<string name="advanced">Advanced</string>
<string name="auto">Auto</string>
<string name="bytes">Bytes</string>
<string name="unit_measurement_for_file_size">Unit of measurement for file size</string>
<string name="open_source_license">Open Source licenses</string>
<string name="open_source_license_summary">Show open source licenses</string>
<string name="open_a_file">Open a file</string>
<string name="open_this_time_only">Open this time only</string>
<string name="change_list_type">Change the list type</string>
<string name="use_monospace">Use monospace</string>
<string name="recent_files">Recent files</string>
<string name="font_size">Font size</string>
<string name="connection_name">Connection Name</string>
<string name="line_numbers">Line Numbers</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file_size_is_too_big">The file size is too big</string>
<string name="search">Search</string>
<string name="add">Add</string>
<string name="file">File</string>
<string name="folder">Folder</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Goto Line</string>
<string name="find">Find</string>
<string name="find_and_replace">Find and Replace</string>
<string name="root_permission">Root Permission</string>
<string name="share">Kongsi</string>
<string name="text_suggestions">Text Suggestions</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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="aggiungi_account">Akaun Baru</string>
<string name="attiva">Aktif</string>
<string name="cancella">Buang</string>
<string name="cancellazione">Menghapus fail...</string>
<string name="caricamento">Memproses...</string>
<string name="cartella_locale_corrente">Folder local sekarang</string>
<string name="chiave_privata">Kata kunci Private</string>
<string name="chiaro">Terang</string>
<string name="codifica">Pengekodan</string>
<string name="condividi">Kongsi</string>
<string name="crea_cartella_locale">New local folder</string>
<string name="crea_cartella_remota">New remote folder</string>
<string name="crea_file_remoto">New remote file</string>
<string name="new_local_file">New local file</string>
<string name="disconneti">Putuskan sambungan</string>
<string name="default_local_folder">Folder local asal</string>
<string name="dove_scaricare">Muat turun ke?</string>
<string name="download">Muat turun</string>
<string name="download_completato">Muat turun selesai</string>
<string name="duplicate">Fail sudah wujud</string>
<string name="fatto">Selesai</string>
<string name="home">Home</string>
<string name="host">Host</string>
<string name="info">Maklumat</string>
<string name="locale">Local</string>
<string name="log_in">Melog masuk...</string>
<string name="modifica">Edit</string>
<string name="muovi">Alih</string>
<string name="nascondi">Sembunyikan</string>
<string name="nome_app">Turbo Client</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="nome_utente">Kata Pengguna</string>
<string name="passiva">Pasif</string>
<string name="passphrase">Kata Laluan</string>
<string name="password">Kata Kunci</string>
<string name="password_summary">Biarkan kosong untuk ditanya setiap sesi</string>
<string name="porta">Port</string>
<string name="preferenze">Pilihan</string>
<string name="remoto">Remote</string>
<string name="riavva_per_tema">Untuk mengubah tema, tutup dan buka semula aplikasi</string>
<string name="rinomina">Edit nama</string>
<string name="root">root</string>
<string name="salva">Simpan</string>
<string name="scuro">Gelap</string>
<string name="seleziona">Pilih</string>
<string name="seleziona_account">Pilih akaun</string>
<string name="sicuro">Anda pasti?</string>
<string name="something_failed">Something failed</string>
<string name="skip_same_file">Do not transfer same file</string>
<string name="tema_app">Tema aplikasi</string>
<string name="tipo_connessione">Jenis sambungan</string>
<string name="tipo_protocollo">Jenis protokol</string>
<string name="un_altra_cartella">Folder lain</string>
<string name="use_passphrase">Guna kata laluan</string>
<string name="upload">Muat naik</string>
<string name="upload_completato">Muat naik selesai</string>
<string name="what_to_do">What do you want to do?</string>
<string name="menu_syntax_highlight">Syntax highlight</string>
<string name="testo_indietro">Batal edit</string>
<string name="testo_rifai">Buat semula edit</string>
<string name="sync">Sinkronisasi</string>
<string name="remote_folder_to_sync">Sinkronisasikan folder remote</string>
<string name="local_folder_to_sync">Sinkronisasi folder local</string>
<string name="vota">Undi</string>
<string name="inapp_unavailable">Tidak dapat berhubung dengan Google Play</string>
<string name="inapp_description">Sokong pembinaan ciri-ciri hebat yang lain.</string>
<string name="upgrade_premium">Naik taraf kepada Premium</string>
<string name="upgrade_premium_summary">Menaiktaraf kepada Premium dan sokong perkembangan Turbo Client!</string>
<string name="download_unlocked_version">Download unlocked version</string>
<string name="inapp_second_description">Apakah nilai Turbo Client pada anda? Berikan harga anda! </string>
<string name="inapp_first_description">Naiktaraf untuk mendapat akses kepada ciri-ciri ini:</string>
<string name="inapp_item_openandeditfiles">Membaca dan mengubahsuai apa-apa jenis fail.</string>
<string name="inapp_item_backup_service">Menyimpan dan mengambil semula data anda dengan selamat. </string>
<string name="inapp_unlock_features">Akses ciri-ciri Premium</string>
<string name="inapp_seconditem_description">Saya sangat suka aplikasi ini!</string>
<string name="inapp_thirditem_description">Saya suka aplikasi ini!</string>
<string name="backup_accounts">Backup akaun</string>
<string name="restore_accounts">Kembalikan akaun</string>
<string name="share_accounts">Backup dan kongsi akaun</string>
<string name="importing_accounts">Mengimport akaun&#8230;</string>
<string name="exporting_accounts">Mengeksport akaun...</string>
<string name="backup_not_found">No backups found</string>
<string name="err_cant_open_the_file">Tidak dapat membuka fail</string>
<string name="err_temp_folder_doesnt_exist">Temporary folder does not exist</string>
<string name="err_occured">An error occurred</string>
<string name="ui_ux">antara muka pengguna</string>
<string name="remove">Hapus</string>
<string name="modification_date">Tarikh pengubahsuaian</string>
<string name="name">Nama</string>
<string name="size">Saiz</string>
<string name="sort">Susun</string>
<string name="open">Buka</string>
<string name="file_modified">Fail %1$s telah berubah. Adakah anda mahu memuat naik?</string>
<string name="file_saved_with_success">The file %1$s was saved with success!</string>
<string name="create_new_account">Cipta akaun baru</string>
<string name="create_new_account_to_start">Create a new account to start.</string>
<string name="type">Jenis</string>
<string name="send_feedback">Send feedback</string>
<string name="copy_url">Copy URL</string>
<string name="cut">Cut</string>
<string name="paste">paste</string>
<string name="advanced">Advanced</string>
<string name="auto">Auto</string>
<string name="bytes">Bytes</string>
<string name="unit_measurement_for_file_size">Unit of measurement for file size</string>
<string name="open_source_license">Open Source licenses</string>
<string name="open_source_license_summary">Show open source licenses</string>
<string name="open_a_file">Open a file</string>
<string name="open_this_time_only">Open this time only</string>
<string name="change_list_type">Change the list type</string>
<string name="use_monospace">Use monospace</string>
<string name="recent_files">Recent files</string>
<string name="font_size">Font size</string>
<string name="connection_name">Connection Name</string>
<string name="line_numbers">Line Numbers</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file_size_is_too_big">The file size is too big</string>
<string name="search">Search</string>
<string name="add">Add</string>
<string name="file">File</string>
<string name="folder">Folder</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Goto Line</string>
<string name="find">Find</string>
<string name="find_and_replace">Find and Replace</string>
<string name="root_permission">Root Permission</string>
<string name="share">Kongsi</string>
<string name="text_suggestions">Text Suggestions</string>
</resources>

View File

@@ -1,153 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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="aggiungi_account">Nový účet</string>
<string name="attiva">Aktívne</string>
<string name="cancella">Vymazať</string>
<string name="cancellazione">Mažem súbory&#8230;</string>
<string name="caricamento">Načítavanie&#8230;</string>
<string name="cartella_locale_corrente">Aktuálna miestna zložka</string>
<string name="chiave_privata">Súkromný kľúč</string>
<string name="chiaro">Svetlá</string>
<string name="codifica">Kódovanie</string>
<string name="condividi">Zdieľať</string>
<string name="crea_cartella_locale">Nový lokálny súbor</string>
<string name="crea_cartella_remota">Nový vzdialený priečinok</string>
<string name="crea_file_remoto">New remote file</string>
<string name="new_local_file">New local file</string>
<string name="disconneti">Odpojiť sa</string>
<string name="default_local_folder">Predvol. miestna zložka</string>
<string name="dove_scaricare">Kde oi chcete stiahnuť?</string>
<string name="download">Stiahnuť</string>
<string name="download_completato">Sťahovanie dokončené</string>
<string name="duplicate">Duplikát</string>
<string name="fatto">Hotovo</string>
<string name="home">Domov</string>
<string name="host">Hosť</string>
<string name="info">Info</string>
<string name="locale">Lokálny</string>
<string name="log_in">Prihlasujem sa&#8230;</string>
<string name="modifica">Upraviť</string>
<string name="muovi">Presunúť</string>
<string name="nascondi">Schovať</string>
<string name="nome_app">Turbo Klient</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="nome_utente">Užív. meno</string>
<string name="passiva">Pasívny</string>
<string name="passphrase">Heslo</string>
<string name="password">Heslo</string>
<string name="password_summary">Ponechajte prázdne, pre výzvu pri každej relácii</string>
<string name="porta">Port</string>
<string name="preferenze">Predvoľby</string>
<string name="remoto">vzdialený</string>
<string name="riavva_per_tema">Pre zmenu témy, reštartujte aplikáciu</string>
<string name="rinomina">Premenovať</string>
<string name="root">Root</string>
<string name="salva">Uložiť</string>
<string name="scuro">Tmavá</string>
<string name="seleziona">Vybrať</string>
<string name="seleziona_account">Vyberte účet</string>
<string name="sicuro">Ste si istý?</string>
<string name="something_failed">Niečo zlyhalo</string>
<string name="skip_same_file">Nepresúvajte rovnaký súbor</string>
<string name="tema_app">Téma</string>
<string name="tipo_connessione">Typ pripojenia</string>
<string name="tipo_protocollo">Typ protokolu</string>
<string name="un_altra_cartella">Ďalšia zložka</string>
<string name="use_passphrase">Napíš heslo</string>
<string name="upload">Nahrať</string>
<string name="upload_completato">Nahrávanie dokončené</string>
<string name="what_to_do">Čo chceš robiť?</string>
<string name="menu_syntax_highlight">Syntax highlight</string>
<string name="testo_indietro">Vrátiť späť</string>
<string name="testo_rifai">Prerobiť</string>
<string name="sync">Synchronizovať</string>
<string name="remote_folder_to_sync">Vzdial. zložka na synchronizáciu</string>
<string name="local_folder_to_sync">Miestna zložka na synchronizáciu</string>
<string name="vota">Ohodnotiť</string>
<string name="inapp_unavailable">Nemožno kontaktovať Google Play</string>
<string name="inapp_description">Podpor rozvoj ďalších skvelých funkcií.</string>
<string name="upgrade_premium">Vylepšiť na Premium</string>
<string name="upgrade_premium_summary">Vylepši na Premium a podpor tým vývoj Turbo klienta!</string>
<string name="download_unlocked_version">Stiahnuť odomknutú verziu</string>
<string name="inapp_second_description">Čo pre teba Turbo klient znamená? Stanov si vlastnú cenu! </string>
<string name="inapp_first_description">Vylepši na Premium, pre odomknutie týchto funkcií:</string>
<string name="inapp_item_openandeditfiles">Power to open and modify any type of file.</string>
<string name="inapp_item_backup_service">Backup service to backup and restore your data safely. </string>
<string name="inapp_unlock_features">Unlock the Premium features</string>
<string name="inapp_seconditem_description">I really like this app!</string>
<string name="inapp_thirditem_description">I love this app!</string>
<string name="backup_accounts">Backup the accounts</string>
<string name="restore_accounts">Restore the accounts</string>
<string name="share_accounts">Backup and share the accounts</string>
<string name="importing_accounts">Importing the accounts&#8230;</string>
<string name="exporting_accounts">Exporting the accounts...</string>
<string name="backup_not_found">No backups found</string>
<string name="err_cant_open_the_file">Cannot open the file</string>
<string name="err_temp_folder_doesnt_exist">Temporary folder does not exist</string>
<string name="err_occured">An error occurred</string>
<string name="ui_ux">Ui</string>
<string name="remove">Remove</string>
<string name="modification_date">Modification date</string>
<string name="name">Name</string>
<string name="size">Size</string>
<string name="sort">Sort</string>
<string name="open">Open</string>
<string name="file_modified">The file %1$s was modified, do you want to upload it?</string>
<string name="file_saved_with_success">The file %1$s was saved with success!</string>
<string name="create_new_account">Create a new account</string>
<string name="create_new_account_to_start">Create a new account to start.</string>
<string name="type">Type</string>
<string name="send_feedback">Send feedback</string>
<string name="copy_url">Copy URL</string>
<string name="cut">Cut</string>
<string name="paste">paste</string>
<string name="advanced">Advanced</string>
<string name="auto">Auto</string>
<string name="bytes">Bytes</string>
<string name="unit_measurement_for_file_size">Unit of measurement for file size</string>
<string name="open_source_license">Open Source licenses</string>
<string name="open_source_license_summary">Show open source licenses</string>
<string name="open_a_file">Open a file</string>
<string name="open_this_time_only">Open this time only</string>
<string name="change_list_type">Change the list type</string>
<string name="use_monospace">Use monospace</string>
<string name="recent_files">Recent files</string>
<string name="font_size">Font size</string>
<string name="connection_name">Connection Name</string>
<string name="line_numbers">Line Numbers</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file_size_is_too_big">The file size is too big</string>
<string name="search">Search</string>
<string name="add">Add</string>
<string name="file">File</string>
<string name="folder">Folder</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Goto Line</string>
<string name="find">Find</string>
<string name="find_and_replace">Find and Replace</string>
<string name="root_permission">Root Permission</string>
<string name="share">Zdieľať</string>
<string name="text_suggestions">Text Suggestions</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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="aggiungi_account">Nový účet</string>
<string name="attiva">Aktívne</string>
<string name="cancella">Vymazať</string>
<string name="cancellazione">Mažem súbory&#8230;</string>
<string name="caricamento">Načítavanie&#8230;</string>
<string name="cartella_locale_corrente">Aktuálna miestna zložka</string>
<string name="chiave_privata">Súkromný kľúč</string>
<string name="chiaro">Svetlá</string>
<string name="codifica">Kódovanie</string>
<string name="condividi">Zdieľať</string>
<string name="crea_cartella_locale">Nový lokálny súbor</string>
<string name="crea_cartella_remota">Nový vzdialený priečinok</string>
<string name="crea_file_remoto">New remote file</string>
<string name="new_local_file">New local file</string>
<string name="disconneti">Odpojiť sa</string>
<string name="default_local_folder">Predvol. miestna zložka</string>
<string name="dove_scaricare">Kde oi chcete stiahnuť?</string>
<string name="download">Stiahnuť</string>
<string name="download_completato">Sťahovanie dokončené</string>
<string name="duplicate">Duplikát</string>
<string name="fatto">Hotovo</string>
<string name="home">Domov</string>
<string name="host">Hosť</string>
<string name="info">Info</string>
<string name="locale">Lokálny</string>
<string name="log_in">Prihlasujem sa&#8230;</string>
<string name="modifica">Upraviť</string>
<string name="muovi">Presunúť</string>
<string name="nascondi">Schovať</string>
<string name="nome_app">Turbo Klient</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="nome_utente">Užív. meno</string>
<string name="passiva">Pasívny</string>
<string name="passphrase">Heslo</string>
<string name="password">Heslo</string>
<string name="password_summary">Ponechajte prázdne, pre výzvu pri každej relácii</string>
<string name="porta">Port</string>
<string name="preferenze">Predvoľby</string>
<string name="remoto">vzdialený</string>
<string name="riavva_per_tema">Pre zmenu témy, reštartujte aplikáciu</string>
<string name="rinomina">Premenovať</string>
<string name="root">Root</string>
<string name="salva">Uložiť</string>
<string name="scuro">Tmavá</string>
<string name="seleziona">Vybrať</string>
<string name="seleziona_account">Vyberte účet</string>
<string name="sicuro">Ste si istý?</string>
<string name="something_failed">Niečo zlyhalo</string>
<string name="skip_same_file">Nepresúvajte rovnaký súbor</string>
<string name="tema_app">Téma</string>
<string name="tipo_connessione">Typ pripojenia</string>
<string name="tipo_protocollo">Typ protokolu</string>
<string name="un_altra_cartella">Ďalšia zložka</string>
<string name="use_passphrase">Napíš heslo</string>
<string name="upload">Nahrať</string>
<string name="upload_completato">Nahrávanie dokončené</string>
<string name="what_to_do">Čo chceš robiť?</string>
<string name="menu_syntax_highlight">Syntax highlight</string>
<string name="testo_indietro">Vrátiť späť</string>
<string name="testo_rifai">Prerobiť</string>
<string name="sync">Synchronizovať</string>
<string name="remote_folder_to_sync">Vzdial. zložka na synchronizáciu</string>
<string name="local_folder_to_sync">Miestna zložka na synchronizáciu</string>
<string name="vota">Ohodnotiť</string>
<string name="inapp_unavailable">Nemožno kontaktovať Google Play</string>
<string name="inapp_description">Podpor rozvoj ďalších skvelých funkcií.</string>
<string name="upgrade_premium">Vylepšiť na Premium</string>
<string name="upgrade_premium_summary">Vylepši na Premium a podpor tým vývoj Turbo klienta!</string>
<string name="download_unlocked_version">Stiahnuť odomknutú verziu</string>
<string name="inapp_second_description">Čo pre teba Turbo klient znamená? Stanov si vlastnú cenu! </string>
<string name="inapp_first_description">Vylepši na Premium, pre odomknutie týchto funkcií:</string>
<string name="inapp_item_openandeditfiles">Power to open and modify any type of file.</string>
<string name="inapp_item_backup_service">Backup service to backup and restore your data safely. </string>
<string name="inapp_unlock_features">Unlock the Premium features</string>
<string name="inapp_seconditem_description">I really like this app!</string>
<string name="inapp_thirditem_description">I love this app!</string>
<string name="backup_accounts">Backup the accounts</string>
<string name="restore_accounts">Restore the accounts</string>
<string name="share_accounts">Backup and share the accounts</string>
<string name="importing_accounts">Importing the accounts&#8230;</string>
<string name="exporting_accounts">Exporting the accounts...</string>
<string name="backup_not_found">No backups found</string>
<string name="err_cant_open_the_file">Cannot open the file</string>
<string name="err_temp_folder_doesnt_exist">Temporary folder does not exist</string>
<string name="err_occured">An error occurred</string>
<string name="ui_ux">Ui</string>
<string name="remove">Remove</string>
<string name="modification_date">Modification date</string>
<string name="name">Name</string>
<string name="size">Size</string>
<string name="sort">Sort</string>
<string name="open">Open</string>
<string name="file_modified">The file %1$s was modified, do you want to upload it?</string>
<string name="file_saved_with_success">The file %1$s was saved with success!</string>
<string name="create_new_account">Create a new account</string>
<string name="create_new_account_to_start">Create a new account to start.</string>
<string name="type">Type</string>
<string name="send_feedback">Send feedback</string>
<string name="copy_url">Copy URL</string>
<string name="cut">Cut</string>
<string name="paste">paste</string>
<string name="advanced">Advanced</string>
<string name="auto">Auto</string>
<string name="bytes">Bytes</string>
<string name="unit_measurement_for_file_size">Unit of measurement for file size</string>
<string name="open_source_license">Open Source licenses</string>
<string name="open_source_license_summary">Show open source licenses</string>
<string name="open_a_file">Open a file</string>
<string name="open_this_time_only">Open this time only</string>
<string name="change_list_type">Change the list type</string>
<string name="use_monospace">Use monospace</string>
<string name="recent_files">Recent files</string>
<string name="font_size">Font size</string>
<string name="connection_name">Connection Name</string>
<string name="line_numbers">Line Numbers</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file_size_is_too_big">The file size is too big</string>
<string name="search">Search</string>
<string name="add">Add</string>
<string name="file">File</string>
<string name="folder">Folder</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Goto Line</string>
<string name="find">Find</string>
<string name="find_and_replace">Find and Replace</string>
<string name="root_permission">Root Permission</string>
<string name="share">Zdieľať</string>
<string name="text_suggestions">Text Suggestions</string>
</resources>

View File

@@ -1,40 +1,40 @@
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">64dp</dimen>
<dimen name="list_horizontal_margin">64dp</dimen>
<!-- Per the design guidelines, navigation drawers should be between 240dp and 320dp:
https://developer.android.com/design/patterns/navigation-drawer.html -->
<dimen name="navigation_drawer_width">320dp</dimen>
<dimen name="dialog_edittext_margin">10dp</dimen>
<dimen name="dialog_button_padding">10dp</dimen>
<dimen name="line_dimension">1dp</dimen>
<dimen name="item_drawer_list_padding">16dp</dimen>
<dimen name="item_drawer_list_height">72dp</dimen>
<dimen name="icon_dimension">50dp</dimen>
<dimen name="icon_padding">10dp</dimen>
<dimen name="item_file_list_height">72dp</dimen>
<dimen name="minimum_padding">2dp</dimen>
<dimen name="text_size_mega_title">25sp</dimen>
<dimen name="text_size_title">16sp</dimen>
<dimen name="text_size_subtitle">14sp</dimen>
</resources>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">64dp</dimen>
<dimen name="list_horizontal_margin">64dp</dimen>
<!-- Per the design guidelines, navigation drawers should be between 240dp and 320dp:
https://developer.android.com/design/patterns/navigation-drawer.html -->
<dimen name="navigation_drawer_width">320dp</dimen>
<dimen name="dialog_edittext_margin">10dp</dimen>
<dimen name="dialog_button_padding">10dp</dimen>
<dimen name="line_dimension">1dp</dimen>
<dimen name="item_drawer_list_padding">16dp</dimen>
<dimen name="item_drawer_list_height">72dp</dimen>
<dimen name="icon_dimension">50dp</dimen>
<dimen name="icon_padding">10dp</dimen>
<dimen name="item_file_list_height">72dp</dimen>
<dimen name="minimum_padding">2dp</dimen>
<dimen name="text_size_mega_title">25sp</dimen>
<dimen name="text_size_title">16sp</dimen>
<dimen name="text_size_subtitle">14sp</dimen>
</resources>

View File

@@ -1,153 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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="aggiungi_account">New account</string>
<string name="attiva">主動模式</string>
<string name="cancella">刪除</string>
<string name="cancellazione">刪除檔案中&#8230;</string>
<string name="caricamento">載入中&#8230;</string>
<string name="cartella_locale_corrente">本機資料夾</string>
<string name="chiave_privata">密鑰</string>
<string name="chiaro">明亮色系</string>
<string name="codifica">編碼</string>
<string name="condividi">Share</string>
<string name="crea_cartella_locale">New local folder</string>
<string name="crea_cartella_remota">New remote folder</string>
<string name="crea_file_remoto">New remote file</string>
<string name="new_local_file">New local file</string>
<string name="disconneti">中斷連線</string>
<string name="default_local_folder">預設本機資料夾</string>
<string name="dove_scaricare">Where to download?</string>
<string name="download">下載</string>
<string name="download_completato">Download completed</string>
<string name="duplicate">Duplicate</string>
<string name="fatto">Done</string>
<string name="home">Home</string>
<string name="host">主機</string>
<string name="info">內容</string>
<string name="locale">Local</string>
<string name="log_in">正在登入&#8230;</string>
<string name="modifica">Edit</string>
<string name="muovi">移動</string>
<string name="nascondi">Hide</string>
<string name="nome_app">Turbo Client</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="nome_utente">帳戶</string>
<string name="passiva">被動模式</string>
<string name="passphrase">Passphrase</string>
<string name="password">密碼</string>
<string name="password_summary">Leave it empty to prompt for it every session</string>
<string name="porta">連接埠</string>
<string name="preferenze">選項</string>
<string name="remoto">Remote</string>
<string name="riavva_per_tema">To change the theme, restart the application</string>
<string name="rinomina">重新命名</string>
<string name="root">預設遠端資料夾</string>
<string name="salva">儲存</string>
<string name="scuro">暗色系</string>
<string name="seleziona">選取</string>
<string name="seleziona_account">請選擇帳戶</string>
<string name="sicuro">確定繼續?</string>
<string name="something_failed">Something failed</string>
<string name="skip_same_file">Do not transfer same file</string>
<string name="tema_app">佈景主題</string>
<string name="tipo_connessione">連接類型</string>
<string name="tipo_protocollo">協定類型</string>
<string name="un_altra_cartella">另一個資料夾</string>
<string name="use_passphrase">使用 Passphrase</string>
<string name="upload">上載</string>
<string name="upload_completato">Upload completed</string>
<string name="what_to_do">What do you want to do?</string>
<string name="menu_syntax_highlight">Syntax highlight</string>
<string name="testo_indietro">復原</string>
<string name="testo_rifai">重做</string>
<string name="sync">同步</string>
<string name="remote_folder_to_sync">同步的遠端資料夾</string>
<string name="local_folder_to_sync">同步的本機資料夾</string>
<string name="vota">評分</string>
<string name="inapp_unavailable">Cannot contact Google Play</string>
<string name="inapp_description">Support the development of other great features.</string>
<string name="upgrade_premium">Upgrade to Premium</string>
<string name="upgrade_premium_summary">Upgrade to Premium and support the development of Turbo Client!</string>
<string name="download_unlocked_version">Download unlocked version</string>
<string name="inapp_second_description">What is Turbo Client worth to you? Set your price! </string>
<string name="inapp_first_description">Upgrade to unlock this features:</string>
<string name="inapp_item_openandeditfiles">Power to open and modify any type of file.</string>
<string name="inapp_item_backup_service">Backup service to backup and restore your data safely. </string>
<string name="inapp_unlock_features">Unlock the Premium features</string>
<string name="inapp_seconditem_description">I really like this app!</string>
<string name="inapp_thirditem_description">I love this app!</string>
<string name="backup_accounts">Backup the accounts</string>
<string name="restore_accounts">Restore the accounts</string>
<string name="share_accounts">Backup and share the accounts</string>
<string name="importing_accounts">Importing the accounts&#8230;</string>
<string name="exporting_accounts">Exporting the accounts...</string>
<string name="backup_not_found">No backups found</string>
<string name="err_cant_open_the_file">Cannot open the file</string>
<string name="err_temp_folder_doesnt_exist">Temporary folder does not exist</string>
<string name="err_occured">An error occurred</string>
<string name="ui_ux">Ui</string>
<string name="remove">Remove</string>
<string name="modification_date">Modification date</string>
<string name="name">Name</string>
<string name="size">Size</string>
<string name="sort">Sort</string>
<string name="open">Open</string>
<string name="file_modified">The file %1$s was modified, do you want to upload it?</string>
<string name="file_saved_with_success">The file %1$s was saved with success!</string>
<string name="create_new_account">Create a new account</string>
<string name="create_new_account_to_start">Create a new account to start.</string>
<string name="type">Type</string>
<string name="send_feedback">Send feedback</string>
<string name="copy_url">Copy URL</string>
<string name="cut">Cut</string>
<string name="paste">paste</string>
<string name="advanced">Advanced</string>
<string name="auto">Auto</string>
<string name="bytes">Bytes</string>
<string name="unit_measurement_for_file_size">Unit of measurement for file size</string>
<string name="open_source_license">Open Source licenses</string>
<string name="open_source_license_summary">Show open source licenses</string>
<string name="open_a_file">Open a file</string>
<string name="open_this_time_only">Open this time only</string>
<string name="change_list_type">Change the list type</string>
<string name="use_monospace">Use monospace</string>
<string name="recent_files">Recent files</string>
<string name="font_size">Font size</string>
<string name="connection_name">Connection Name</string>
<string name="line_numbers">Line Numbers</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file_size_is_too_big">The file size is too big</string>
<string name="search">Search</string>
<string name="add">Add</string>
<string name="file">File</string>
<string name="folder">Folder</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Goto Line</string>
<string name="find">Find</string>
<string name="find_and_replace">Find and Replace</string>
<string name="root_permission">Root Permission</string>
<string name="share">Share</string>
<string name="text_suggestions">Text Suggestions</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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="aggiungi_account">New account</string>
<string name="attiva">主動模式</string>
<string name="cancella">刪除</string>
<string name="cancellazione">刪除檔案中&#8230;</string>
<string name="caricamento">載入中&#8230;</string>
<string name="cartella_locale_corrente">本機資料夾</string>
<string name="chiave_privata">密鑰</string>
<string name="chiaro">明亮色系</string>
<string name="codifica">編碼</string>
<string name="condividi">Share</string>
<string name="crea_cartella_locale">New local folder</string>
<string name="crea_cartella_remota">New remote folder</string>
<string name="crea_file_remoto">New remote file</string>
<string name="new_local_file">New local file</string>
<string name="disconneti">中斷連線</string>
<string name="default_local_folder">預設本機資料夾</string>
<string name="dove_scaricare">Where to download?</string>
<string name="download">下載</string>
<string name="download_completato">Download completed</string>
<string name="duplicate">Duplicate</string>
<string name="fatto">Done</string>
<string name="home">Home</string>
<string name="host">主機</string>
<string name="info">內容</string>
<string name="locale">Local</string>
<string name="log_in">正在登入&#8230;</string>
<string name="modifica">Edit</string>
<string name="muovi">移動</string>
<string name="nascondi">Hide</string>
<string name="nome_app">Turbo Client</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="nome_utente">帳戶</string>
<string name="passiva">被動模式</string>
<string name="passphrase">Passphrase</string>
<string name="password">密碼</string>
<string name="password_summary">Leave it empty to prompt for it every session</string>
<string name="porta">連接埠</string>
<string name="preferenze">選項</string>
<string name="remoto">Remote</string>
<string name="riavva_per_tema">To change the theme, restart the application</string>
<string name="rinomina">重新命名</string>
<string name="root">預設遠端資料夾</string>
<string name="salva">儲存</string>
<string name="scuro">暗色系</string>
<string name="seleziona">選取</string>
<string name="seleziona_account">請選擇帳戶</string>
<string name="sicuro">確定繼續?</string>
<string name="something_failed">Something failed</string>
<string name="skip_same_file">Do not transfer same file</string>
<string name="tema_app">佈景主題</string>
<string name="tipo_connessione">連接類型</string>
<string name="tipo_protocollo">協定類型</string>
<string name="un_altra_cartella">另一個資料夾</string>
<string name="use_passphrase">使用 Passphrase</string>
<string name="upload">上載</string>
<string name="upload_completato">Upload completed</string>
<string name="what_to_do">What do you want to do?</string>
<string name="menu_syntax_highlight">Syntax highlight</string>
<string name="testo_indietro">復原</string>
<string name="testo_rifai">重做</string>
<string name="sync">同步</string>
<string name="remote_folder_to_sync">同步的遠端資料夾</string>
<string name="local_folder_to_sync">同步的本機資料夾</string>
<string name="vota">評分</string>
<string name="inapp_unavailable">Cannot contact Google Play</string>
<string name="inapp_description">Support the development of other great features.</string>
<string name="upgrade_premium">Upgrade to Premium</string>
<string name="upgrade_premium_summary">Upgrade to Premium and support the development of Turbo Client!</string>
<string name="download_unlocked_version">Download unlocked version</string>
<string name="inapp_second_description">What is Turbo Client worth to you? Set your price! </string>
<string name="inapp_first_description">Upgrade to unlock this features:</string>
<string name="inapp_item_openandeditfiles">Power to open and modify any type of file.</string>
<string name="inapp_item_backup_service">Backup service to backup and restore your data safely. </string>
<string name="inapp_unlock_features">Unlock the Premium features</string>
<string name="inapp_seconditem_description">I really like this app!</string>
<string name="inapp_thirditem_description">I love this app!</string>
<string name="backup_accounts">Backup the accounts</string>
<string name="restore_accounts">Restore the accounts</string>
<string name="share_accounts">Backup and share the accounts</string>
<string name="importing_accounts">Importing the accounts&#8230;</string>
<string name="exporting_accounts">Exporting the accounts...</string>
<string name="backup_not_found">No backups found</string>
<string name="err_cant_open_the_file">Cannot open the file</string>
<string name="err_temp_folder_doesnt_exist">Temporary folder does not exist</string>
<string name="err_occured">An error occurred</string>
<string name="ui_ux">Ui</string>
<string name="remove">Remove</string>
<string name="modification_date">Modification date</string>
<string name="name">Name</string>
<string name="size">Size</string>
<string name="sort">Sort</string>
<string name="open">Open</string>
<string name="file_modified">The file %1$s was modified, do you want to upload it?</string>
<string name="file_saved_with_success">The file %1$s was saved with success!</string>
<string name="create_new_account">Create a new account</string>
<string name="create_new_account_to_start">Create a new account to start.</string>
<string name="type">Type</string>
<string name="send_feedback">Send feedback</string>
<string name="copy_url">Copy URL</string>
<string name="cut">Cut</string>
<string name="paste">paste</string>
<string name="advanced">Advanced</string>
<string name="auto">Auto</string>
<string name="bytes">Bytes</string>
<string name="unit_measurement_for_file_size">Unit of measurement for file size</string>
<string name="open_source_license">Open Source licenses</string>
<string name="open_source_license_summary">Show open source licenses</string>
<string name="open_a_file">Open a file</string>
<string name="open_this_time_only">Open this time only</string>
<string name="change_list_type">Change the list type</string>
<string name="use_monospace">Use monospace</string>
<string name="recent_files">Recent files</string>
<string name="font_size">Font size</string>
<string name="connection_name">Connection Name</string>
<string name="line_numbers">Line Numbers</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file_size_is_too_big">The file size is too big</string>
<string name="search">Search</string>
<string name="add">Add</string>
<string name="file">File</string>
<string name="folder">Folder</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Goto Line</string>
<string name="find">Find</string>
<string name="find_and_replace">Find and Replace</string>
<string name="root_permission">Root Permission</string>
<string name="share">Share</string>
<string name="text_suggestions">Text Suggestions</string>
</resources>

View File

@@ -1,61 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<string-array name="open_source_libs">
<item>ChangeLog Library</item>
<item>EventBus</item>
<item>commons-io</item>
<item>RootCommands</item>
<item>Floating Action Button</item>
</string-array>
<string-array name="encodings">
<item>ISO-2022-JP</item>
<item>ISO-2022-CN</item>
<item>ISO-2022-KR</item>
<item>ISO-8859-5</item>
<item>ISO-8859-7</item>
<item>ISO-8859-8</item>
<item>BIG5</item>
<item>GB18030</item>
<item>EUC-JP</item>
<item>EUC-KR</item>
<item>EUC-TW</item>
<item>SHIFT_JIS</item>
<item>IBM855</item>
<item>IBM866</item>
<item>KOI8-R</item>
<item>MACCYRILLIC</item>
<item>WINDOWS-1251</item>
<item>WINDOWS-1252</item>
<item>WINDOWS-1253</item>
<item>WINDOWS-1255</item>
<item>UTF-8</item>
<item>UTF-16BE</item>
<item>UTF-16LE</item>
<item>UTF-32BE</item>
<item>UTF-32LE</item>
<item>GB2312</item>
<item>HZ-GB-2312</item>
<item>X-ISO-10646-UCS-4-3412</item>
<item>X-ISO-10646-UCS-4-2143</item>
</string-array>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<string-array name="open_source_libs">
<item>ChangeLog Library</item>
<item>EventBus</item>
<item>commons-io</item>
<item>RootCommands</item>
<item>Floating Action Button</item>
</string-array>
<string-array name="encodings">
<item>ISO-2022-JP</item>
<item>ISO-2022-CN</item>
<item>ISO-2022-KR</item>
<item>ISO-8859-5</item>
<item>ISO-8859-7</item>
<item>ISO-8859-8</item>
<item>BIG5</item>
<item>GB18030</item>
<item>EUC-JP</item>
<item>EUC-KR</item>
<item>EUC-TW</item>
<item>SHIFT_JIS</item>
<item>IBM855</item>
<item>IBM866</item>
<item>KOI8-R</item>
<item>MACCYRILLIC</item>
<item>WINDOWS-1251</item>
<item>WINDOWS-1252</item>
<item>WINDOWS-1253</item>
<item>WINDOWS-1255</item>
<item>UTF-8</item>
<item>UTF-16BE</item>
<item>UTF-16LE</item>
<item>UTF-32BE</item>
<item>UTF-32LE</item>
<item>GB2312</item>
<item>HZ-GB-2312</item>
<item>X-ISO-10646-UCS-4-3412</item>
<item>X-ISO-10646-UCS-4-2143</item>
</string-array>
</resources>

View File

@@ -1,29 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<declare-styleable name="Theme">
<!-- Dialog styles -->
<attr name="textAppearanceDialogTitle" format="reference"/>
<attr name="textAppearanceDialogMessage" format="reference"/>
<attr name="textAppearanceDialogInfo" format="reference"/>
</declare-styleable>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<declare-styleable name="Theme">
<!-- Dialog styles -->
<attr name="textAppearanceDialogTitle" format="reference"/>
<attr name="textAppearanceDialogMessage" format="reference"/>
<attr name="textAppearanceDialogInfo" format="reference"/>
</declare-styleable>
</resources>

View File

@@ -1,69 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<color name="window_background">#212121</color> <!--ffffff-->
<color name="window_background_light">#ffffff</color> <!--ffffff-->
<color name="textColor">#ffffffff</color> <!-- ff191919 -->
<color name="textColorInverted">#ff212121</color> <!-- ff191919 -->
<color name="divider">#e5e5e5</color> <!-- ff191919 -->
<color name="divider_inverted">#ff2a2a2a</color> <!-- ff191919 -->
<!-- action bar background color -->
<color name="actionbar_background">#212121</color> <!-- 5677fc-->
<!-- navigation drawer background color -->
<color name="navigation_drawer_background">#ffffff</color>
<color name="navigation_drawer_background_inverted">#212121</color>
<color name="navigation_drawer_button">#f7f7f7</color>
<color name="navigation_drawer_button_inverted">#212121</color>
<color name="navigation_drawer_button_text_color">#666666</color>
<color name="navigation_drawer_button_text_color_inverted">#ffffffff</color>
<color name="fab_light">#ffffff</color>
<color name="fab_dark">#f7f7f7</color>
<!-- colors used as file icons -->
<color name="file_folder">#ffbb33</color>
<color name="file_code">#00a569</color>
<color name="file_html">#00a569</color>
<color name="file_text">#717171</color>
<color name="file_archive">#aa66cc</color>
<color name="file_media_music">#ff4444</color>
<color name="file_media_picture">#33b5e5</color>
<color name="file_media_video">#ff00607d</color>
<color name="syntax_number">#ffff6600</color>
<color name="syntax_keyword">#ff2f6f9f</color>
<color name="syntax_attr">#ff4f9fcf</color>
<color name="syntax_attr_value">#ffd44950</color>
<color name="syntax_string">#ffd44950</color>
<color name="syntax_variable">#ff009688</color>
<color name="syntax_comment">#ff999999</color>
<color name="item_selected">#40969696</color>
<color name="gradient_start">#50000000</color>
<color name="gradient_light_start">#30000000</color>
<color name="donation_normal">#b6cc45</color>
<color name="donation_purchased">#DFED47</color>
<color name="indigo">#607d8b</color>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<color name="window_background">#212121</color> <!--ffffff-->
<color name="window_background_light">#ffffff</color> <!--ffffff-->
<color name="textColor">#ffffffff</color> <!-- ff191919 -->
<color name="textColorInverted">#ff212121</color> <!-- ff191919 -->
<color name="divider">#e5e5e5</color> <!-- ff191919 -->
<color name="divider_inverted">#ff2a2a2a</color> <!-- ff191919 -->
<!-- action bar background color -->
<color name="actionbar_background">#212121</color> <!-- 5677fc-->
<!-- navigation drawer background color -->
<color name="navigation_drawer_background">#ffffff</color>
<color name="navigation_drawer_background_inverted">#212121</color>
<color name="navigation_drawer_button">#f7f7f7</color>
<color name="navigation_drawer_button_inverted">#212121</color>
<color name="navigation_drawer_button_text_color">#666666</color>
<color name="navigation_drawer_button_text_color_inverted">#ffffffff</color>
<color name="fab_light">#ffffff</color>
<color name="fab_dark">#f7f7f7</color>
<!-- colors used as file icons -->
<color name="file_folder">#ffbb33</color>
<color name="file_code">#00a569</color>
<color name="file_html">#00a569</color>
<color name="file_text">#717171</color>
<color name="file_archive">#aa66cc</color>
<color name="file_media_music">#ff4444</color>
<color name="file_media_picture">#33b5e5</color>
<color name="file_media_video">#ff00607d</color>
<color name="syntax_number">#ffff6600</color>
<color name="syntax_keyword">#ff2f6f9f</color>
<color name="syntax_attr">#ff4f9fcf</color>
<color name="syntax_attr_value">#ffd44950</color>
<color name="syntax_string">#ffd44950</color>
<color name="syntax_variable">#ff009688</color>
<color name="syntax_comment">#ff999999</color>
<color name="item_selected">#40969696</color>
<color name="gradient_start">#50000000</color>
<color name="gradient_light_start">#30000000</color>
<color name="donation_normal">#b6cc45</color>
<color name="donation_purchased">#DFED47</color>
<color name="indigo">#607d8b</color>
</resources>

View File

@@ -1,43 +1,43 @@
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="list_horizontal_margin">0dp</dimen>
<!-- Per the design guidelines, navigation drawers should be between 240dp and 320dp:
https://developer.android.com/design/patterns/navigation-drawer.html -->
<dimen name="navigation_drawer_width">300dp</dimen>
<dimen name="dialog_edittext_margin">10dp</dimen>
<dimen name="dialog_button_padding">10dp</dimen>
<dimen name="line_dimension">1dp</dimen>
<dimen name="item_drawer_list_padding">16dp</dimen>
<dimen name="item_drawer_list_height">72dp</dimen>
<dimen name="icon_dimension">50dp</dimen>
<dimen name="icon_padding">10dp</dimen>
<dimen name="item_file_list_height">72dp</dimen>
<dimen name="minimum_padding">2dp</dimen>
<dimen name="text_size_mega_title">25sp</dimen>
<dimen name="text_size_title">16sp</dimen>
<dimen name="text_size_subtitle">14sp</dimen>
<dimen name="action_bar_height">56dp</dimen>
</resources>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="list_horizontal_margin">0dp</dimen>
<!-- Per the design guidelines, navigation drawers should be between 240dp and 320dp:
https://developer.android.com/design/patterns/navigation-drawer.html -->
<dimen name="navigation_drawer_width">300dp</dimen>
<dimen name="dialog_edittext_margin">10dp</dimen>
<dimen name="dialog_button_padding">10dp</dimen>
<dimen name="line_dimension">1dp</dimen>
<dimen name="item_drawer_list_padding">16dp</dimen>
<dimen name="item_drawer_list_height">72dp</dimen>
<dimen name="icon_dimension">50dp</dimen>
<dimen name="icon_padding">10dp</dimen>
<dimen name="item_file_list_height">72dp</dimen>
<dimen name="minimum_padding">2dp</dimen>
<dimen name="text_size_mega_title">25sp</dimen>
<dimen name="text_size_title">16sp</dimen>
<dimen name="text_size_subtitle">14sp</dimen>
<dimen name="action_bar_height">56dp</dimen>
</resources>

View File

@@ -1,88 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<!-- menu item ids -->
<item type="id" name="im_undo"/>
<item type="id" name="im_redo"/>
<item type="id" name="im_editor"/>
<item type="id" name="im_remove"/>
<item type="id" name="im_open"/>
<item type="id" name="im_info"/>
<item type="id" name="im_button"/>
<item type="id" name="im_save"/>
<item type="id" name="im_share"/>
<item type="id" name="im_editor_encoding"/>
<item type="id" name="im_line_numbers"/>
<item type="id" name="im_syntax_highlight"/>
<item type="id" name="im_use_monospace"/>
<item type="id" name="im_new_file"/>
<item type="id" name="im_new_folder"/>
<item type="id" name="im_text_size"/>
<item type="id" name="im_view_it_on_browser"/>
<item type="id" name="im_goto_line"/>
<item type="id" name="im_search"/>
<item type="id" name="im_print"/>
<item type="id" name="im_cancel"/>
<item type="id" name="im_next_item"/>
<item type="id" name="im_previous_item"/>
<item type="id" name="im_is_working_folder"/>
<item type="id" name="im_set_as_working_folder"/>
<item type="id" name="im_replace"/>
<item type="id" name="im_next_page"/>
<item type="id" name="im_prev_page"/>
<item type="id" name="im_donate"/>
<!-- layout item ids -->
<item type="id" name="drawer_layout"/>
<item type="id" name="editor"/>
<item type="id" name="vertical_scroll"/>
<item type="id" name="horizontal_scroll"/>
<item type="id" name="drawer_buttons"/>
<item type="id" name="drawer_files"/>
<item type="id" name="drawer_settings"/>
<item type="id" name="button_remove_from_list"/>
<item type="id" name="text_editor"/>
<item type="id" name="no_file_opened_messagge"/>
<item type="id" name="regex_check"/>
<item type="id" name="replace_check"/>
<item type="id" name="match_case_check"/>
<item type="id" name="text_to_find"/>
<item type="id" name="text_to_replace"/>
<!-- switch -->
<item type="id" name="switch_line_numbers"/>
<item type="id" name="switch_syntax"/>
<item type="id" name="switch_wrap_content"/>
<item type="id" name="switch_monospace"/>
<item type="id" name="switch_light_theme"/>
<item type="id" name="switch_suggestions_active"/>
<item type="id" name="switch_auto_save"/>
<item type="id" name="switch_read_only"/>
<item type="id" name="drawer_button_extra_options"/>
<item type="id" name="switch_ignore_backbutton"/>
<item type="id" name="switch_page_system"/>
<item type="id" name="switch_send_error_reports"/>
<item type="id" name="drawer_button_go_pro"/>
<item type="id" name="drawer_button_encoding"/>
<item type="id" name="drawer_button_font_size"/>
<item name="im_select_folder" type="id" />
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<!-- menu item ids -->
<item type="id" name="im_undo"/>
<item type="id" name="im_redo"/>
<item type="id" name="im_editor"/>
<item type="id" name="im_remove"/>
<item type="id" name="im_open"/>
<item type="id" name="im_info"/>
<item type="id" name="im_button"/>
<item type="id" name="im_save"/>
<item type="id" name="im_share"/>
<item type="id" name="im_editor_encoding"/>
<item type="id" name="im_line_numbers"/>
<item type="id" name="im_syntax_highlight"/>
<item type="id" name="im_use_monospace"/>
<item type="id" name="im_new_file"/>
<item type="id" name="im_new_folder"/>
<item type="id" name="im_text_size"/>
<item type="id" name="im_view_it_on_browser"/>
<item type="id" name="im_goto_line"/>
<item type="id" name="im_search"/>
<item type="id" name="im_print"/>
<item type="id" name="im_cancel"/>
<item type="id" name="im_next_item"/>
<item type="id" name="im_previous_item"/>
<item type="id" name="im_is_working_folder"/>
<item type="id" name="im_set_as_working_folder"/>
<item type="id" name="im_replace"/>
<item type="id" name="im_next_page"/>
<item type="id" name="im_prev_page"/>
<item type="id" name="im_donate"/>
<!-- layout item ids -->
<item type="id" name="drawer_layout"/>
<item type="id" name="editor"/>
<item type="id" name="vertical_scroll"/>
<item type="id" name="horizontal_scroll"/>
<item type="id" name="drawer_buttons"/>
<item type="id" name="drawer_files"/>
<item type="id" name="drawer_settings"/>
<item type="id" name="button_remove_from_list"/>
<item type="id" name="text_editor"/>
<item type="id" name="no_file_opened_messagge"/>
<item type="id" name="regex_check"/>
<item type="id" name="replace_check"/>
<item type="id" name="match_case_check"/>
<item type="id" name="text_to_find"/>
<item type="id" name="text_to_replace"/>
<!-- switch -->
<item type="id" name="switch_line_numbers"/>
<item type="id" name="switch_syntax"/>
<item type="id" name="switch_wrap_content"/>
<item type="id" name="switch_monospace"/>
<item type="id" name="switch_light_theme"/>
<item type="id" name="switch_suggestions_active"/>
<item type="id" name="switch_auto_save"/>
<item type="id" name="switch_read_only"/>
<item type="id" name="drawer_button_extra_options"/>
<item type="id" name="switch_ignore_backbutton"/>
<item type="id" name="switch_page_system"/>
<item type="id" name="switch_send_error_reports"/>
<item type="id" name="drawer_button_go_pro"/>
<item type="id" name="drawer_button_encoding"/>
<item type="id" name="drawer_button_font_size"/>
<item name="im_select_folder" type="id" />
</resources>

View File

@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<integer name="editor_max_file_size">4194304</integer>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<integer name="editor_max_file_size">4194304</integer>
</resources>

View File

@@ -1,75 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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.net-->
<resources>
<string name="use_monospace">Use monospace</string>
<string name="recent_files">Recent files</string>
<string name="font_size">Font size</string>
<string name="connection_name">Connection Name</string>
<string name="line_numbers">Line Numbers</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file">File</string>
<string name="folder">Folder</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Go to Line…</string>
<string name="goto_page">Go to Page…</string>
<string name="find">Find</string>
<string name="replace">Replace</string>
<string name="share">Share</string>
<string name="keyboard_suggestions_and_swipe">Keyboard suggestions and Swipe</string>
<string name="enable_autoencoding">Auto-Encoding</string>
<string name="set_as_working_folder">Set as the working folder</string>
<string name="is_the_working_folder">This is the working folder</string>
<string name="save_changes">Do you want to save the changes to the file %s?</string>
<string name="regular_expression">Regular Expression</string>
<string name="text_to_find">Text to find</string>
<string name="text_to_replace">Text to replace</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="please_wait">Please wait…</string>
<string name="occurrences_found">%s occurrences was found</string>
<string name="app_version_new">v%s</string>
<string name="translate_the_app">Translate</string>
<string name="changelog">Changelog</string>
<string name="match_case">Match case</string>
<string name="long_click_for_more_options">Long click for more options</string>
<string name="auto_save">Auto save</string>
<string name="read_only">Read only</string>
<string name="send_error_reports">Send error reports</string>
<string name="extra_options">Extra options</string>
<string name="split_text_if_too_long">Split the text if too long</string>
<string name="ignore_back_button">Ignore back button</string>
<string name="codifica">Encoding</string>
<string name="condividi">Share</string>
<string name="info">Info</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="preferenze">Preferences</string>
<string name="salva">Save</string>
<string name="menu_syntax_highlight">Syntax highlight</string>
<string name="testo_indietro">Undo</string>
<string name="testo_rifai">Redo</string>
<string name="open">Open</string>
<string name="file_saved_with_success">The file %1$s was saved with success!</string>
<string name="open_a_file">Open a file</string>
<string name="no">No</string>
<string name="new_file">New file</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ 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.net-->
<resources>
<string name="use_monospace">Use monospace</string>
<string name="recent_files">Recent files</string>
<string name="font_size">Font size</string>
<string name="connection_name">Connection Name</string>
<string name="line_numbers">Line Numbers</string>
<string name="wrap_content">Wrap content</string>
<string name="view_it_on_the_web">View it on the web</string>
<string name="file">File</string>
<string name="folder">Folder</string>
<string name="light_theme">Light Theme</string>
<string name="goto_line">Go to Line…</string>
<string name="goto_page">Go to Page…</string>
<string name="find">Find</string>
<string name="replace">Replace</string>
<string name="share">Share</string>
<string name="keyboard_suggestions_and_swipe">Keyboard suggestions and Swipe</string>
<string name="enable_autoencoding">Auto-Encoding</string>
<string name="set_as_working_folder">Set as the working folder</string>
<string name="is_the_working_folder">This is the working folder</string>
<string name="save_changes">Do you want to save the changes to the file %s?</string>
<string name="regular_expression">Regular Expression</string>
<string name="text_to_find">Text to find</string>
<string name="text_to_replace">Text to replace</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="please_wait">Please wait…</string>
<string name="occurrences_found">%s occurrences was found</string>
<string name="app_version_new">v%s</string>
<string name="translate_the_app">Translate</string>
<string name="changelog">Changelog</string>
<string name="match_case">Match case</string>
<string name="long_click_for_more_options">Long click for more options</string>
<string name="auto_save">Auto save</string>
<string name="read_only">Read only</string>
<string name="send_error_reports">Send error reports</string>
<string name="extra_options">Extra options</string>
<string name="split_text_if_too_long">Split the text if too long</string>
<string name="ignore_back_button">Ignore back button</string>
<string name="codifica">Encoding</string>
<string name="condividi">Share</string>
<string name="info">Info</string>
<string name="nome_app_turbo_editor">Turbo Editor</string>
<string name="preferenze">Preferences</string>
<string name="salva">Save</string>
<string name="menu_syntax_highlight">Syntax highlight</string>
<string name="testo_indietro">Undo</string>
<string name="testo_rifai">Redo</string>
<string name="open">Open</string>
<string name="file_saved_with_success">The file %1$s was saved with success!</string>
<string name="open_a_file">Open a file</string>
<string name="no">No</string>
<string name="new_file">New file</string>
</resources>

View File

@@ -1,87 +1,87 @@
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<style name="AppThemeBaseDark" parent="Theme.AppCompat.NoActionBar">
<!-- Dialog -->
<item name="textAppearanceDialogTitle">@style/TextAppearance.Dialog.Title</item>
<item name="textAppearanceDialogMessage">@style/TextAppearance.Dialog.Message</item>
<item name="textAppearanceDialogInfo">@style/TextAppearance.Dialog.Info</item>
<item name="android:windowBackground">@color/window_background</item>
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/actionbar_background</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/actionbar_background</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/accent_material_dark</item>
</style>
<style name="AppThemeBaseLight" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Dialog -->
<item name="textAppearanceDialogTitle">@style/TextAppearance.Dialog.Title</item>
<item name="textAppearanceDialogMessage">@style/TextAppearance.Dialog.Message</item>
<item name="textAppearanceDialogInfo">@style/TextAppearance.Dialog.Info</item>
<item name="android:windowBackground">@color/window_background_light</item>
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/actionbar_background</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/actionbar_background</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/accent_material_dark</item>
</style>
<style name="AppThemeEditorDark" parent="AppThemeBaseDark">
<item name="android:windowBackground">@null</item>
</style>
<style name="PreferenceDark" parent="android:Theme.Holo">
</style>
<style name="PreferenceLight" parent="android:Theme.Holo.Light">
</style>
<style name="TextAppearance.Dialog.Title" parent="android:TextAppearance.Holo.Large">
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textSize">24sp</item>
</style>
<style name="TextAppearance.Dialog.Message" parent="android:TextAppearance.Holo.Small">
<item name="android:lineSpacingMultiplier">1.2</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:textSize">16sp</item>
</style>
<style name="TextAppearance.Dialog.Info" parent="android:TextAppearance.Holo.Small">
<item name="android:fontFamily">sans-serif-condensed</item>
</style>
</resources>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<style name="AppThemeBaseDark" parent="Theme.AppCompat.NoActionBar">
<!-- Dialog -->
<item name="textAppearanceDialogTitle">@style/TextAppearance.Dialog.Title</item>
<item name="textAppearanceDialogMessage">@style/TextAppearance.Dialog.Message</item>
<item name="textAppearanceDialogInfo">@style/TextAppearance.Dialog.Info</item>
<item name="android:windowBackground">@color/window_background</item>
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/actionbar_background</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/actionbar_background</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/accent_material_dark</item>
</style>
<style name="AppThemeBaseLight" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Dialog -->
<item name="textAppearanceDialogTitle">@style/TextAppearance.Dialog.Title</item>
<item name="textAppearanceDialogMessage">@style/TextAppearance.Dialog.Message</item>
<item name="textAppearanceDialogInfo">@style/TextAppearance.Dialog.Info</item>
<item name="android:windowBackground">@color/window_background_light</item>
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/actionbar_background</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">@color/actionbar_background</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">@color/accent_material_dark</item>
</style>
<style name="AppThemeEditorDark" parent="AppThemeBaseDark">
<item name="android:windowBackground">@null</item>
</style>
<style name="PreferenceDark" parent="android:Theme.Holo">
</style>
<style name="PreferenceLight" parent="android:Theme.Holo.Light">
</style>
<style name="TextAppearance.Dialog.Title" parent="android:TextAppearance.Holo.Large">
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textSize">24sp</item>
</style>
<style name="TextAppearance.Dialog.Message" parent="android:TextAppearance.Holo.Small">
<item name="android:lineSpacingMultiplier">1.2</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:textSize">16sp</item>
</style>
<style name="TextAppearance.Dialog.Info" parent="android:TextAppearance.Holo.Small">
<item name="android:fontFamily">sans-serif-condensed</item>
</style>
</resources>

View File

@@ -1,69 +1,69 @@
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:key="light_theme"
android:title="@string/light_theme"
android:defaultValue="false" />
<CheckBoxPreference
android:key="suggestion_active"
android:title="@string/keyboard_suggestions_and_swipe"
android:defaultValue="false" />
<CheckBoxPreference
android:key="auto_save"
android:title="@string/auto_save"
android:defaultValue="false" />
<CheckBoxPreference
android:key="autoencoding"
android:title="@string/enable_autoencoding"
android:defaultValue="true" />
<!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
dismiss it. -->
<!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
<ListPreference
android:key="editor_encoding"
android:title="@string/codifica"
android:defaultValue="UTF-8"
android:entries="@array/encodings"
android:entryValues="@array/encodings"
android:negativeButtonText="@null"
android:positiveButtonText="@null" />
<CheckBoxPreference
android:key="ignore_back_button"
android:title="@string/ignore_back_button"
android:defaultValue="false"/>
<CheckBoxPreference
android:key="page_system_active"
android:title="@string/split_text_if_too_long"
android:defaultValue="true"/>
<CheckBoxPreference
android:key="send_error_reports"
android:title="@string/send_error_reports"
android:defaultValue="true" />
</PreferenceScreen>
<!--
~ Copyright (C) 2014 Vlad Mihalachi
~
~ This file is part of Turbo Editor.
~
~ Turbo Editor is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Turbo Editor is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:key="light_theme"
android:title="@string/light_theme"
android:defaultValue="false" />
<CheckBoxPreference
android:key="suggestion_active"
android:title="@string/keyboard_suggestions_and_swipe"
android:defaultValue="false" />
<CheckBoxPreference
android:key="auto_save"
android:title="@string/auto_save"
android:defaultValue="false" />
<CheckBoxPreference
android:key="autoencoding"
android:title="@string/enable_autoencoding"
android:defaultValue="true" />
<!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
dismiss it. -->
<!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
<ListPreference
android:key="editor_encoding"
android:title="@string/codifica"
android:defaultValue="UTF-8"
android:entries="@array/encodings"
android:entryValues="@array/encodings"
android:negativeButtonText="@null"
android:positiveButtonText="@null" />
<CheckBoxPreference
android:key="ignore_back_button"
android:title="@string/ignore_back_button"
android:defaultValue="false"/>
<CheckBoxPreference
android:key="page_system_active"
android:title="@string/split_text_if_too_long"
android:defaultValue="true"/>
<CheckBoxPreference
android:key="send_error_reports"
android:title="@string/send_error_reports"
android:defaultValue="true" />
</PreferenceScreen>