Version 1.12
@@ -29,7 +29,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "sharedcode.turboeditor"
|
||||
minSdkVersion 14
|
||||
minSdkVersion 10
|
||||
targetSdkVersion 19
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
@@ -54,9 +54,10 @@ dependencies {
|
||||
compile('de.greenrobot:eventbus:2.2.1') {
|
||||
exclude module: 'support-v4'
|
||||
}
|
||||
// compile 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
|
||||
// compile 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
|
||||
compile files('libs/juniversalchardet-1.0.3.jar')
|
||||
compile 'com.android.support:support-v4:20.0.0'
|
||||
compile "com.android.support:support-v4:19.0.+"
|
||||
compile 'com.github.gabrielemariotti.changeloglib:library:1.5.1'
|
||||
compile 'commons-io:commons-io:2.4'
|
||||
compile 'org.solovyev.android:checkout:0.5.1@aar'
|
||||
}
|
||||
|
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.vending.billing;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/**
|
||||
* InAppBillingService is the service that provides in-app billing version 3 and beyond.
|
||||
* This service provides the following features:
|
||||
* 1. Provides a new API to get details of in-app items published for the app including
|
||||
* price, type, title and description.
|
||||
* 2. The purchase flow is synchronous and purchase information is available immediately
|
||||
* after it completes.
|
||||
* 3. Purchase information of in-app purchases is maintained within the Google Play system
|
||||
* till the purchase is consumed.
|
||||
* 4. An API to consume a purchase of an inapp item. All purchases of one-time
|
||||
* in-app items are consumable and thereafter can be purchased again.
|
||||
* 5. An API to get current purchases of the user immediately. This will not contain any
|
||||
* consumed purchases.
|
||||
*
|
||||
* All calls will give a response code with the following possible values
|
||||
* RESULT_OK = 0 - success
|
||||
* RESULT_USER_CANCELED = 1 - user pressed back or canceled a dialog
|
||||
* RESULT_BILLING_UNAVAILABLE = 3 - this billing API version is not supported for the type requested
|
||||
* RESULT_ITEM_UNAVAILABLE = 4 - requested SKU is not available for purchase
|
||||
* RESULT_DEVELOPER_ERROR = 5 - invalid arguments provided to the API
|
||||
* RESULT_ERROR = 6 - Fatal error during the API action
|
||||
* RESULT_ITEM_ALREADY_OWNED = 7 - Failure to purchase since item is already owned
|
||||
* RESULT_ITEM_NOT_OWNED = 8 - Failure to consume since item is not owned
|
||||
*/
|
||||
interface IInAppBillingService {
|
||||
/**
|
||||
* Checks support for the requested billing API version, package and in-app type.
|
||||
* Minimum API version supported by this interface is 3.
|
||||
* @param apiVersion the billing version which the app is using
|
||||
* @param packageName the package name of the calling app
|
||||
* @param type type of the in-app item being purchased "inapp" for one-time purchases
|
||||
* and "subs" for subscription.
|
||||
* @return RESULT_OK(0) on success, corresponding result code on failures
|
||||
*/
|
||||
int isBillingSupported(int apiVersion, String packageName, String type);
|
||||
|
||||
/**
|
||||
* Provides details of a list of SKUs
|
||||
* Given a list of SKUs of a valid type in the skusBundle, this returns a bundle
|
||||
* with a list JSON strings containing the productId, price, title and description.
|
||||
* This API can be called with a maximum of 20 SKUs.
|
||||
* @param apiVersion billing API version that the Third-party is using
|
||||
* @param packageName the package name of the calling app
|
||||
* @param skusBundle bundle containing a StringArrayList of SKUs with key "ITEM_ID_LIST"
|
||||
* @return Bundle containing the following key-value pairs
|
||||
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
|
||||
* failure as listed above.
|
||||
* "DETAILS_LIST" with a StringArrayList containing purchase information
|
||||
* in JSON format similar to:
|
||||
* '{ "productId" : "exampleSku", "type" : "inapp", "price" : "$5.00",
|
||||
* "title : "Example Title", "description" : "This is an example description" }'
|
||||
*/
|
||||
Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle);
|
||||
|
||||
/**
|
||||
* Returns a pending intent to launch the purchase flow for an in-app item by providing a SKU,
|
||||
* the type, a unique purchase token and an optional developer payload.
|
||||
* @param apiVersion billing API version that the app is using
|
||||
* @param packageName package name of the calling app
|
||||
* @param sku the SKU of the in-app item as published in the developer console
|
||||
* @param type the type of the in-app item ("inapp" for one-time purchases
|
||||
* and "subs" for subscription).
|
||||
* @param developerPayload optional argument to be sent back with the purchase information
|
||||
* @return Bundle containing the following key-value pairs
|
||||
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
|
||||
* failure as listed above.
|
||||
* "BUY_INTENT" - PendingIntent to start the purchase flow
|
||||
*
|
||||
* The Pending intent should be launched with startIntentSenderForResult. When purchase flow
|
||||
* has completed, the onActivityResult() will give a resultCode of OK or CANCELED.
|
||||
* If the purchase is successful, the result data will contain the following key-value pairs
|
||||
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
|
||||
* failure as listed above.
|
||||
* "INAPP_PURCHASE_DATA" - String in JSON format similar to
|
||||
* '{"orderId":"12999763169054705758.1371079406387615",
|
||||
* "packageName":"com.example.app",
|
||||
* "productId":"exampleSku",
|
||||
* "purchaseTime":1345678900000,
|
||||
* "purchaseToken" : "122333444455555",
|
||||
* "developerPayload":"example developer payload" }'
|
||||
* "INAPP_DATA_SIGNATURE" - String containing the signature of the purchase data that
|
||||
* was signed with the private key of the developer
|
||||
* TODO: change this to app-specific keys.
|
||||
*/
|
||||
Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type,
|
||||
String developerPayload);
|
||||
|
||||
/**
|
||||
* Returns the current SKUs owned by the user of the type and package name specified along with
|
||||
* purchase information and a signature of the data to be validated.
|
||||
* This will return all SKUs that have been purchased in V3 and managed items purchased using
|
||||
* V1 and V2 that have not been consumed.
|
||||
* @param apiVersion billing API version that the app is using
|
||||
* @param packageName package name of the calling app
|
||||
* @param type the type of the in-app items being requested
|
||||
* ("inapp" for one-time purchases and "subs" for subscription).
|
||||
* @param continuationToken to be set as null for the first call, if the number of owned
|
||||
* skus are too many, a continuationToken is returned in the response bundle.
|
||||
* This method can be called again with the continuation token to get the next set of
|
||||
* owned skus.
|
||||
* @return Bundle containing the following key-value pairs
|
||||
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
|
||||
* failure as listed above.
|
||||
* "INAPP_PURCHASE_ITEM_LIST" - StringArrayList containing the list of SKUs
|
||||
* "INAPP_PURCHASE_DATA_LIST" - StringArrayList containing the purchase information
|
||||
* "INAPP_DATA_SIGNATURE_LIST"- StringArrayList containing the signatures
|
||||
* of the purchase information
|
||||
* "INAPP_CONTINUATION_TOKEN" - String containing a continuation token for the
|
||||
* next set of in-app purchases. Only set if the
|
||||
* user has more owned skus than the current list.
|
||||
*/
|
||||
Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken);
|
||||
|
||||
/**
|
||||
* Consume the last purchase of the given SKU. This will result in this item being removed
|
||||
* from all subsequent responses to getPurchases() and allow re-purchase of this item.
|
||||
* @param apiVersion billing API version that the app is using
|
||||
* @param packageName package name of the calling app
|
||||
* @param purchaseToken token in the purchase information JSON that identifies the purchase
|
||||
* to be consumed
|
||||
* @return 0 if consumption succeeded. Appropriate error values for failures.
|
||||
*/
|
||||
int consumePurchase(int apiVersion, String packageName, String purchaseToken);
|
||||
}
|
@@ -20,6 +20,7 @@
|
||||
package sharedcode.turboeditor.activity;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
@@ -46,6 +47,8 @@ import org.sufficientlysecure.rootcommands.Shell;
|
||||
import org.sufficientlysecure.rootcommands.Toolbox;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import sharedcode.turboeditor.R;
|
||||
@@ -53,6 +56,7 @@ import sharedcode.turboeditor.fragment.ChangelogDialogFragment;
|
||||
import sharedcode.turboeditor.fragment.EditorFragment;
|
||||
import sharedcode.turboeditor.fragment.NoFileOpenedFragment;
|
||||
import sharedcode.turboeditor.preferences.PreferenceHelper;
|
||||
import sharedcode.turboeditor.util.AccessStorageApi;
|
||||
import sharedcode.turboeditor.util.AppInfoHelper;
|
||||
import sharedcode.turboeditor.util.EventBusEvents;
|
||||
import sharedcode.turboeditor.util.ProCheckUtils;
|
||||
@@ -62,6 +66,8 @@ import sharedcode.turboeditor.views.CustomDrawerLayout;
|
||||
public abstract class BaseHomeActivity extends Activity {
|
||||
|
||||
private static final int SELECT_FILE_CODE = 121;
|
||||
private static final int KITKAT_OPEN_REQUEST_CODE = 41;
|
||||
|
||||
private EditText editor;
|
||||
|
||||
/*
|
||||
@@ -211,14 +217,24 @@ public abstract class BaseHomeActivity extends Activity {
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && requestCode == SELECT_FILE_CODE) {
|
||||
String path = data.getStringExtra("path");
|
||||
File file = new File(path);
|
||||
if (file.isFile() && file.exists()) {
|
||||
EventBus.getDefault().postSticky(new EventBusEvents.NewFileToOpen(new File(path)));
|
||||
} else if (file.isDirectory()) {
|
||||
|
||||
if (resultCode == RESULT_OK) {
|
||||
String path = "";
|
||||
if (requestCode == SELECT_FILE_CODE) {
|
||||
path = data.getStringExtra("path");
|
||||
}
|
||||
|
||||
if (requestCode == KITKAT_OPEN_REQUEST_CODE) {
|
||||
path = AccessStorageApi.getPath(getBaseContext(), data.getData());
|
||||
}
|
||||
|
||||
if(!path.isEmpty()){
|
||||
File file = new File(path);
|
||||
if (file.isFile() && file.exists()) {
|
||||
EventBus.getDefault().postSticky(new EventBusEvents.NewFileToOpen(new File(path)));
|
||||
EventBus.getDefault().postSticky(new EventBusEvents.AFileIsSelected(path));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +257,7 @@ public abstract class BaseHomeActivity extends Activity {
|
||||
|
||||
//region Calls from the layout
|
||||
public void OpenFile(View view) {
|
||||
|
||||
Intent subActivity = new Intent(BaseHomeActivity.this, SelectFileActivity.class);
|
||||
subActivity.putExtra("action", SelectFileActivity.Actions.SelectFile);
|
||||
Bundle scaleBundle = ActivityOptionsCompat.makeScaleUpAnimation(
|
||||
@@ -252,8 +269,8 @@ public abstract class BaseHomeActivity extends Activity {
|
||||
}
|
||||
|
||||
public void CreateFile(View view) {
|
||||
onEvent(new EventBusEvents.NewFileToOpen(""));
|
||||
onEvent(new EventBusEvents.AFileIsSelected("")); // simulate click on the list
|
||||
onEvent(new EventBusEvents.NewFileToOpen("")); // do not send the event to others
|
||||
EventBus.getDefault().post(new EventBusEvents.AFileIsSelected(""));
|
||||
}
|
||||
|
||||
public void OpenInfo(View view) {
|
||||
@@ -395,14 +412,6 @@ public abstract class BaseHomeActivity extends Activity {
|
||||
displayInterstitial();
|
||||
}
|
||||
|
||||
public void onEvent(EventBusEvents.AFileIsSelected event) {
|
||||
String name = FilenameUtils.getName(event.getPath());
|
||||
if (name.isEmpty())
|
||||
getActionBar().setTitle(R.string.nome_app_turbo_editor);
|
||||
else
|
||||
getActionBar().setTitle(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* When a file can't be opened
|
||||
* Invoked by the EditorFragment
|
||||
@@ -515,10 +524,10 @@ public abstract class BaseHomeActivity extends Activity {
|
||||
&& type != null) {
|
||||
// Post event
|
||||
EventBus.getDefault().postSticky(new EventBusEvents.NewFileToOpen(new File(intent.getData().getPath())));
|
||||
EventBus.getDefault().postSticky(new EventBusEvents.AFileIsSelected(intent.getData().getPath()));
|
||||
} else if (Intent.ACTION_SEND.equals(action) && type != null) {
|
||||
if ("text/plain".equals(type)) {
|
||||
onEvent(new EventBusEvents.NewFileToOpen(intent.getStringExtra(Intent.EXTRA_TEXT)));
|
||||
onEvent(new EventBusEvents.AFileIsSelected("")); // simulate click on the list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -20,13 +20,30 @@
|
||||
package sharedcode.turboeditor.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.vending.billing.IInAppBillingService;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.solovyev.android.checkout.ActivityCheckout;
|
||||
import org.solovyev.android.checkout.Checkout;
|
||||
import org.solovyev.android.checkout.Inventory;
|
||||
import org.solovyev.android.checkout.Products;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import sharedcode.turboeditor.R;
|
||||
import sharedcode.turboeditor.util.AppInfoHelper;
|
||||
import sharedcode.turboeditor.util.Constants;
|
||||
@@ -51,12 +68,32 @@ public class PreferenceAbout extends Activity {
|
||||
|
||||
proVersionText.setText(ProCheckUtils.isPro(getBaseContext()) ? getString(R.string.donate) : getString(R.string.pro_version));
|
||||
|
||||
Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
|
||||
serviceIntent.setPackage("com.android.vending");
|
||||
bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
|
||||
IInAppBillingService mService;
|
||||
|
||||
ServiceConnection mServiceConn = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
mService = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name,
|
||||
IBinder service) {
|
||||
mService = IInAppBillingService.Stub.asInterface(service);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
//checkout.stop();
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mService != null) {
|
||||
unbindService(mServiceConn);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenPlayStore(View view) {
|
||||
@@ -79,16 +116,47 @@ public class PreferenceAbout extends Activity {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=26VWS2TSAMUJA"))
|
||||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
} else {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.maskyn.fileeditorpro"))
|
||||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
//startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.maskyn.fileeditorpro"))
|
||||
// .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
|
||||
Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(),
|
||||
"fileeditor.proversion", "inapp", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
|
||||
|
||||
PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
|
||||
|
||||
startIntentSenderForResult(pendingIntent.getIntentSender(),
|
||||
1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0),
|
||||
Integer.valueOf(0));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == 1001) {
|
||||
int responseCode = data.getIntExtra("RESPONSE_CODE", 0);
|
||||
String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
|
||||
String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");
|
||||
|
||||
if (resultCode == RESULT_OK) {
|
||||
try {
|
||||
JSONObject jo = new JSONObject(purchaseData);
|
||||
String sku = jo.getString("productId");
|
||||
//alert("You have bought the " + sku + ". Excellent choice,
|
||||
// adventurer!");
|
||||
}
|
||||
catch (JSONException e) {
|
||||
//alert("Failed to parse purchase data.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenGithub(View view) {
|
||||
String url = "https://github.com/vmihalachi/TurboEditor";
|
||||
String url = "http://github.com/vmihalachi/TurboEditor";
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}
|
||||
@@ -118,11 +186,13 @@ public class PreferenceAbout extends Activity {
|
||||
}
|
||||
|
||||
public void OpenGooglePlusCommunity(View view) {
|
||||
String url = "https://plus.google.com/u/0/communities/111974095419108178946";
|
||||
String url = "http://plus.google.com/u/0/communities/111974095419108178946";
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*void setupClickablePreferences() {
|
||||
final Preference email = findPreference("aboutactivity_authoremail"),
|
||||
changelog = findPreference("aboutactivity_changelog"),
|
||||
|
@@ -23,14 +23,16 @@ import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.SearchView;
|
||||
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.SearchView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -64,6 +66,7 @@ public class SelectFileActivity extends Activity implements SearchView.OnQueryTe
|
||||
private boolean wantAFile = true;
|
||||
private MenuItem mSearchViewMenuItem;
|
||||
private SearchView mSearchView;
|
||||
private Filter filter;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -148,10 +151,13 @@ public class SelectFileActivity extends Activity implements SearchView.OnQueryTe
|
||||
}
|
||||
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
if(filter == null)
|
||||
return true;
|
||||
|
||||
if (TextUtils.isEmpty(newText)) {
|
||||
listView.clearTextFilter();
|
||||
filter.filter(null);
|
||||
} else {
|
||||
listView.setFilterText(newText);
|
||||
filter.filter(newText);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -206,7 +212,7 @@ public class SelectFileActivity extends Activity implements SearchView.OnQueryTe
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.activity_select_file, menu);
|
||||
mSearchViewMenuItem = menu.findItem(R.id.im_search);
|
||||
mSearchView = (SearchView) mSearchViewMenuItem.getActionView();
|
||||
mSearchView = (SearchView) MenuItemCompat.getActionView(mSearchViewMenuItem);
|
||||
mSearchView.setIconifiedByDefault(true);
|
||||
mSearchView.setOnQueryTextListener(this);
|
||||
mSearchView.setSubmitButtonEnabled(false);
|
||||
@@ -243,6 +249,9 @@ public class SelectFileActivity extends Activity implements SearchView.OnQueryTe
|
||||
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;
|
||||
@@ -276,7 +285,7 @@ public class SelectFileActivity extends Activity implements SearchView.OnQueryTe
|
||||
super.onPreExecute();
|
||||
if (mSearchView != null) {
|
||||
mSearchView.setIconified(true);
|
||||
mSearchViewMenuItem.collapseActionView();
|
||||
MenuItemCompat.collapseActionView(mSearchViewMenuItem);
|
||||
mSearchView.setQuery("", false);
|
||||
}
|
||||
|
||||
@@ -358,6 +367,7 @@ public class SelectFileActivity extends Activity implements SearchView.OnQueryTe
|
||||
boolean isRoot = currentFolder.equals("/");
|
||||
AdapterDetailedList mAdapter = new AdapterDetailedList(getBaseContext(), names, isRoot);
|
||||
listView.setAdapter(mAdapter);
|
||||
filter = mAdapter.getFilter();
|
||||
} else if (exceptionMessage != null) {
|
||||
Toast.makeText(SelectFileActivity.this, exceptionMessage, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
@@ -78,10 +78,18 @@ public class AdapterDrawer extends
|
||||
|
||||
}
|
||||
});
|
||||
if (TextUtils.equals(selectedPath, files.get(position).getAbsolutePath()))
|
||||
|
||||
if (TextUtils.equals(selectedPath, files.get(position).getAbsolutePath())) {
|
||||
hold.nameLabel.setTypeface(hold.nameLabel.getTypeface(), Typeface.BOLD);
|
||||
else
|
||||
convertView.setBackgroundColor((convertView.getResources()
|
||||
.getColor(R.color.item_selected)));
|
||||
}
|
||||
else {
|
||||
hold.nameLabel.setTypeface(hold.nameLabel.getTypeface(), Typeface.NORMAL);
|
||||
convertView.setBackgroundColor((convertView.getResources()
|
||||
.getColor(android.R.color.transparent)));
|
||||
}
|
||||
|
||||
} else {
|
||||
final ViewHolder hold = ((ViewHolder) convertView.getTag());
|
||||
final String fileName = files.get(position).getName();
|
||||
@@ -95,18 +103,23 @@ public class AdapterDrawer extends
|
||||
selectedPath = "";
|
||||
}
|
||||
});
|
||||
|
||||
if (TextUtils.equals(selectedPath, files.get(position).getAbsolutePath())) {
|
||||
hold.nameLabel.setTypeface(hold.nameLabel.getTypeface(), Typeface.BOLD);
|
||||
hold.nameLabel.setTypeface(null, Typeface.BOLD);
|
||||
convertView.setBackgroundColor((convertView.getResources()
|
||||
.getColor(R.color.item_selected)));
|
||||
}
|
||||
else {
|
||||
hold.nameLabel.setTypeface(hold.nameLabel.getTypeface(), Typeface.NORMAL);
|
||||
hold.nameLabel.setTypeface(null, Typeface.NORMAL);
|
||||
convertView.setBackgroundColor((convertView.getResources()
|
||||
.getColor(android.R.color.transparent)));
|
||||
}
|
||||
}
|
||||
return convertView;
|
||||
}
|
||||
|
||||
public void selectView(String selectedPath) {
|
||||
callbacks.ItemSelected(selectedPath);
|
||||
//callbacks.ItemSelected(selectedPath);
|
||||
this.selectedPath = selectedPath;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@@ -114,7 +127,7 @@ public class AdapterDrawer extends
|
||||
public interface Callbacks {
|
||||
void CancelItem(int position, boolean andCloseOpenedFile);
|
||||
|
||||
void ItemSelected(String path);
|
||||
//void ItemSelected(String path);
|
||||
}
|
||||
|
||||
public static class ViewHolder {
|
||||
|
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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.ArrayList;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
@@ -22,13 +22,13 @@ 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.app.FragmentManager;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import it.gmariotti.changelibs.library.view.ChangeLogListView;
|
||||
|
@@ -27,6 +27,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@@ -61,6 +62,7 @@ import com.faizmalkani.floatingactionbutton.FloatingActionButton;
|
||||
import sharedcode.turboeditor.R;
|
||||
|
||||
import sharedcode.turboeditor.preferences.SettingsFragment;
|
||||
import sharedcode.turboeditor.util.ApiHelper;
|
||||
import sharedcode.turboeditor.util.EditorInterface;
|
||||
import sharedcode.turboeditor.util.EdittextPadding;
|
||||
import sharedcode.turboeditor.util.EventBusEvents;
|
||||
@@ -108,7 +110,7 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
private PageSystemButtons pageSystemButtons;
|
||||
private String currentEncoding;
|
||||
|
||||
private static final int SYNTAX_DELAY_MILLIS_SHORT = 250;
|
||||
private static final int SYNTAX_DELAY_MILLIS_SHORT = 350;
|
||||
private static final int SYNTAX_DELAY_MILLIS_LONG = 1500;
|
||||
static final int
|
||||
ID_SELECT_ALL = android.R.id.selectAll;
|
||||
@@ -215,6 +217,7 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(!PreferenceHelper.getReadOnly(getActivity())) {
|
||||
getVerticalScrollView().tempDisableListener(1000);
|
||||
((InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE))
|
||||
.showSoftInput(mEditor, InputMethodManager.SHOW_IMPLICIT);
|
||||
}
|
||||
@@ -225,6 +228,7 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if(hasFocus && !PreferenceHelper.getReadOnly(getActivity())) {
|
||||
getVerticalScrollView().tempDisableListener(1000);
|
||||
((InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE))
|
||||
.showSoftInput(mEditor, InputMethodManager.SHOW_IMPLICIT);
|
||||
}
|
||||
@@ -243,6 +247,16 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
String name = FilenameUtils.getName(sFilePath);
|
||||
if (name.isEmpty())
|
||||
getActivity().getActionBar().setTitle("*");
|
||||
else
|
||||
getActivity().getActionBar().setTitle(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
@@ -384,8 +398,10 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
startActivity(Intent.createChooser(shareIntent, getString(R.string.share)));
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
else if (i == R.id.im_info) {
|
||||
FileInfoDialogFragment dialogFrag = FileInfoDialogFragment.newInstance(sFilePath);
|
||||
dialogFrag.setTargetFragment(EditorFragment.this, 0);
|
||||
dialogFrag.show(getFragmentManager().beginTransaction(), "dialog");
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
@@ -740,7 +756,7 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
*/
|
||||
private final EditTextChangeListener
|
||||
mChangeListener;
|
||||
private int lineCount, realLine;
|
||||
private int lineCount, realLine, startingLine;
|
||||
private LineUtils lineUtils;
|
||||
private boolean modified = true;
|
||||
/**
|
||||
@@ -770,6 +786,7 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
|
||||
this.mPaintNumbers.setAntiAlias(true);
|
||||
this.mPaintNumbers.setDither(false);
|
||||
this.mPaintNumbers.setTextAlign(Paint.Align.RIGHT);
|
||||
|
||||
// Syntax editor
|
||||
setFilters(new InputFilter[]{
|
||||
@@ -841,7 +858,7 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
|
||||
if (event.isCtrlPressed()) {
|
||||
if (ApiHelper.is11() && event.isCtrlPressed()) {
|
||||
switch (keyCode) {
|
||||
case KeyEvent.KEYCODE_A:
|
||||
return onTextContextMenuItem(ID_SELECT_ALL);
|
||||
@@ -902,7 +919,8 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
public void onDraw(final Canvas canvas) {
|
||||
|
||||
if (PreferenceHelper.getLineNumbers(getContext())) {
|
||||
if (lineCount != getLineCount()) {
|
||||
if (lineCount != getLineCount() || startingLine != editorInterface.getPageSystem().getStartingLine()) {
|
||||
startingLine = editorInterface.getPageSystem().getStartingLine();
|
||||
lineCount = getLineCount();
|
||||
|
||||
lineUtils.updateHasNewLineArray(editorInterface.getPageSystem().getStartingLine(), lineCount, getLayout(), getText().toString());
|
||||
@@ -914,6 +932,8 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
boolean[] hasNewLineArray = lineUtils.getToCountLinesArray();
|
||||
int[] realLines = lineUtils.getRealLines();
|
||||
boolean wrapContent = PreferenceHelper.getWrapContent(getContext());
|
||||
int numbersWidth = (int) (EdittextPadding.getPaddingWithLineNumbers(getContext(), PreferenceHelper.getFontSize(getContext())) * 0.8);
|
||||
int paddingTop = EdittextPadding.getPaddingTop(getContext());
|
||||
|
||||
while (i < lastLine) {
|
||||
// if last line we count it anyway
|
||||
@@ -926,8 +946,8 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
realLine = realLines[i];
|
||||
|
||||
canvas.drawText(String.valueOf(realLine),
|
||||
5, // padding left
|
||||
getLineHeight() * (i + 1),
|
||||
numbersWidth, // they all center aligned
|
||||
paddingTop + getLineHeight() * (i + 1),
|
||||
mPaintNumbers);
|
||||
}
|
||||
i++;
|
||||
@@ -1096,6 +1116,9 @@ public class EditorFragment extends Fragment implements FindTextDialogFragment.S
|
||||
firstColoredIndex = 0;
|
||||
if (end > editable.length())
|
||||
end = editable.length();
|
||||
if(firstColoredIndex > end)
|
||||
firstColoredIndex = end;
|
||||
|
||||
|
||||
CharSequence textToHighlight = editable.subSequence(firstColoredIndex, end);
|
||||
|
||||
|
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 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.fragment;
|
||||
|
||||
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.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.NumberPicker;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
import sharedcode.turboeditor.R;
|
||||
import sharedcode.turboeditor.adapter.AdapterTwoItem;
|
||||
|
||||
// ...
|
||||
public class FileInfoDialogFragment extends DialogFragment {
|
||||
|
||||
public static FileInfoDialogFragment newInstance(String filePath) {
|
||||
final FileInfoDialogFragment f = new FileInfoDialogFragment();
|
||||
final Bundle args = new Bundle();
|
||||
args.putString("filePath", filePath);
|
||||
f.setArguments(args);
|
||||
return f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
|
||||
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())
|
||||
//.setTitle(title)
|
||||
.setView(view)
|
||||
.setPositiveButton(android.R.string.ok,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}
|
||||
}
|
||||
)
|
||||
.create();
|
||||
}
|
||||
}
|
@@ -90,31 +90,30 @@ public class NavigationDrawerListFragment extends Fragment implements AdapterVie
|
||||
String filePath = savedPaths[position];
|
||||
// Send the event that a file was selected
|
||||
EventBus.getDefault().post(new EventBusEvents.NewFileToOpen(new File(filePath)));
|
||||
arrayAdapter.selectView(filePath);
|
||||
EventBus.getDefault().post(new EventBusEvents.AFileIsSelected(filePath));
|
||||
}
|
||||
|
||||
public void onEvent(EventBusEvents.AFileIsSelected event) {
|
||||
arrayAdapter.selectView(event.getPath());
|
||||
|
||||
EventBus.getDefault().removeStickyEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* When a new file is opened
|
||||
* Invoked by the main activity which receive the intent
|
||||
*
|
||||
* @param event The event called
|
||||
*/
|
||||
public void onEvent(EventBusEvents.NewFileToOpen event) {
|
||||
|
||||
// File paths saved in preferences
|
||||
String[] savedPaths = PreferenceHelper.getSavedPaths(getActivity());
|
||||
String selectedPath = event.getFile().getAbsolutePath();
|
||||
boolean pathAlreadyExist = false;
|
||||
for (String savedPath : savedPaths) {
|
||||
// We don't need to save the file path twice
|
||||
if (savedPath.equals(selectedPath)) {
|
||||
arrayAdapter.selectView(selectedPath);
|
||||
return;
|
||||
pathAlreadyExist = true;
|
||||
}
|
||||
}
|
||||
// Add the path if it wasn't added before
|
||||
addPath(selectedPath);
|
||||
|
||||
arrayAdapter.selectView(selectedPath);
|
||||
if(!pathAlreadyExist)
|
||||
addPath(selectedPath);
|
||||
|
||||
EventBus.getDefault().removeStickyEvent(event);
|
||||
}
|
||||
@@ -198,8 +197,8 @@ public class NavigationDrawerListFragment extends Fragment implements AdapterVie
|
||||
EventBus.getDefault().post(new EventBusEvents.CannotOpenAFile());
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public void ItemSelected(String path) {
|
||||
EventBus.getDefault().post(new EventBusEvents.AFileIsSelected(path));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
@@ -19,8 +19,8 @@
|
||||
|
||||
package sharedcode.turboeditor.fragment;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.os.Bundle;
|
||||
import android.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@@ -73,10 +73,6 @@ public final class PreferenceHelper {
|
||||
return getPrefs(context).getBoolean("send_error_reports", true);
|
||||
}
|
||||
|
||||
public static int getLastDayAdShowed(Context context) {
|
||||
return getPrefs(context).getInt("last_day_ad_showed", 0);
|
||||
}
|
||||
|
||||
public static String getEncoding(Context context) {
|
||||
return getPrefs(context).getString("editor_encoding", "UTF-8");
|
||||
}
|
||||
@@ -113,10 +109,6 @@ public final class PreferenceHelper {
|
||||
return getPrefs(context).getBoolean("page_system_active", true);
|
||||
}
|
||||
|
||||
public static int getNumberOfAdsRequested(Context context) {
|
||||
return getPrefs(context).getInt("number_of_ads_requested", 0);
|
||||
}
|
||||
|
||||
// Setter methods
|
||||
|
||||
public static void setUseMonospace(Context context, boolean value) {
|
||||
@@ -139,10 +131,6 @@ public final class PreferenceHelper {
|
||||
getEditor(context).putBoolean("autoencoding", value).commit();
|
||||
}
|
||||
|
||||
public static void setLastDayAdShowed(Context context, int value) {
|
||||
getEditor(context).putInt("last_day_ad_showed", value).commit();
|
||||
}
|
||||
|
||||
public static void setFontSize(Context context, int value) {
|
||||
getEditor(context).putInt("font_size", value).commit();
|
||||
}
|
||||
@@ -163,8 +151,4 @@ public final class PreferenceHelper {
|
||||
getEditor(context).putBoolean("read_only", value).commit();
|
||||
}
|
||||
|
||||
public static void setNumberOfAdsRequested(Context context, int value) {
|
||||
getEditor(context).putInt("number_of_ads_requested", value).commit();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
* 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.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
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;
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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.os.Build;
|
||||
|
||||
public class ApiHelper {
|
||||
public static boolean is11(){
|
||||
return Build.VERSION.SDK_INT >= 11;
|
||||
}
|
||||
}
|
@@ -28,7 +28,7 @@ public class EdittextPadding {
|
||||
}
|
||||
|
||||
public static int getPaddingWithLineNumbers(Context context, float fontSize) {
|
||||
return (int) PixelDipConverter.convertDpToPixel(fontSize * 1.85f, context);
|
||||
return (int) PixelDipConverter.convertDpToPixel(fontSize * 2f, context);
|
||||
}
|
||||
|
||||
public static int getPaddingTop(Context context) {
|
||||
|
@@ -20,7 +20,9 @@
|
||||
package sharedcode.turboeditor.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
@@ -28,6 +30,7 @@ public class GoodScrollView extends ScrollView {
|
||||
|
||||
public ScrollInterface scrollInterface;
|
||||
int lastY;
|
||||
boolean listenerEnabled = true;
|
||||
|
||||
public GoodScrollView(Context context) {
|
||||
super(context);
|
||||
@@ -48,9 +51,8 @@ public class GoodScrollView extends ScrollView {
|
||||
@Override
|
||||
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
|
||||
super.onScrollChanged(l, t, oldl, oldt);
|
||||
if (scrollInterface == null) return;
|
||||
|
||||
|
||||
if (scrollInterface == null || !listenerEnabled) return;
|
||||
|
||||
if (Math.abs(lastY - t) > 100) {
|
||||
lastY = t;
|
||||
@@ -66,6 +68,16 @@ public class GoodScrollView extends ScrollView {
|
||||
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);
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<size android:width="12dp" />
|
||||
<solid android:color="@android:color/transparent" />
|
||||
</shape>
|
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<size android:height="4dp" />
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@android:color/transparent"
|
||||
android:startColor="@color/gradient_start" />
|
||||
</shape>
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<size android:width="16dp" />
|
||||
<gradient
|
||||
android:endColor="@android:color/transparent"
|
||||
android:startColor="@color/gradient_light_start" />
|
||||
</shape>
|
@@ -62,7 +62,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:onClick="SendFeedback"
|
||||
android:clickable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/item_background_holo_dark"
|
||||
android:gravity="center"
|
||||
android:minWidth="200dp" />
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
android:textStyle="bold"
|
||||
android:onClick="OpenTranslatePage"
|
||||
android:clickable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/item_background_holo_dark"
|
||||
android:gravity="center"
|
||||
android:minWidth="200dp" />
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
android:textStyle="bold"
|
||||
android:onClick="GoToProVersion"
|
||||
android:clickable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/item_background_holo_dark"
|
||||
android:gravity="center"
|
||||
android:minWidth="200dp" />
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
android:id="@+id/imageView5"
|
||||
android:src="@drawable/ic_action_mail"
|
||||
android:onClick="SendMail"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/item_background_holo_dark"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<ImageView
|
||||
@@ -123,7 +123,7 @@
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/ic_action_google_play"
|
||||
android:onClick="OpenPlayStore"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/item_background_holo_dark"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<ImageView
|
||||
@@ -131,9 +131,10 @@
|
||||
android:layout_height="45dp"
|
||||
android:id="@+id/imageView4"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:src="@drawable/ic_action_gplus"
|
||||
android:onClick="OpenGooglePlusCommunity"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/item_background_holo_dark"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<ImageView
|
||||
@@ -142,7 +143,7 @@
|
||||
android:id="@+id/imageView6"
|
||||
android:src="@drawable/ic_action_github"
|
||||
android:onClick="OpenGithub"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/item_background_holo_dark"
|
||||
android:scaleType="fitCenter" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@@ -0,0 +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>
|
@@ -33,6 +33,9 @@
|
||||
android:cacheColorHint="@android:color/transparent"
|
||||
android:layout_above="@id/drawer_buttons"
|
||||
android:divider="@color/divider"
|
||||
android:listSelector="@android:color/transparent"
|
||||
android:choiceMode="singleChoice"
|
||||
android:background="@null"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
@@ -22,7 +22,7 @@
|
||||
android:layout_width="match_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
@@ -35,9 +35,8 @@
|
||||
android:paddingLeft="@dimen/item_drawer_list_padding"
|
||||
android:paddingRight="@dimen/item_drawer_list_padding"
|
||||
android:maxLines="1"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:background="?android:attr/activatedBackgroundIndicator"
|
||||
android:textColor="@color/navigation_drawer_button_text_color_inverted"/>
|
||||
android:textColor="@color/navigation_drawer_button_text_color_inverted"
|
||||
android:ellipsize="end"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
|
58
libraries/sharedCode/src/main/res/layout/item_two_lines.xml
Normal file
@@ -0,0 +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>
|
@@ -18,7 +18,8 @@
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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"
|
||||
android:showAsAction="ifRoom"
|
||||
|
@@ -18,21 +18,22 @@
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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"
|
||||
android:showAsAction="ifRoom"
|
||||
android:showAsAction="ifRoom"
|
||||
android:icon="@drawable/ic_action_save"
|
||||
android:title="@string/salva"/>
|
||||
<item
|
||||
android:id="@id/im_undo"
|
||||
android:showAsAction="ifRoom"
|
||||
android:showAsAction="ifRoom"
|
||||
android:icon="@drawable/ic_action_undo"
|
||||
android:title="@string/testo_indietro"
|
||||
/>
|
||||
<item
|
||||
android:id="@id/im_redo"
|
||||
android:showAsAction="ifRoom"
|
||||
android:showAsAction="ifRoom"
|
||||
android:icon="@drawable/ic_action_redo"
|
||||
android:title="@string/testo_rifai"
|
||||
/>
|
||||
@@ -56,38 +57,43 @@
|
||||
android:showAsAction="never"
|
||||
android:title="@string/share"
|
||||
/>
|
||||
<item
|
||||
android:id="@id/im_info"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/info"
|
||||
/>
|
||||
|
||||
<!-- <item
|
||||
android:id="@id/im_goto_line"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/goto_line"
|
||||
/>-->
|
||||
<!--<item
|
||||
android:title="@string/preferenze"
|
||||
android:showAsAction="ifRoom|withText">
|
||||
app:showAsAction="ifRoom|withText">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@id/im_line_numbers"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/line_numbers"
|
||||
android:checkable="true"/>
|
||||
<item
|
||||
android:id="@id/im_syntax_highlight"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/menu_syntax_highlight"
|
||||
android:checkable="true"/>
|
||||
<item
|
||||
android:id="@id/im_use_monospace"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/use_monospace"
|
||||
android:checkable="true"/>
|
||||
<item
|
||||
android:id="@id/im_editor_encoding"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/codifica"/>
|
||||
<item
|
||||
android:id="@id/im_text_size"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/font_size"/>
|
||||
</menu>
|
||||
</item>-->
|
||||
|
@@ -18,11 +18,12 @@
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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"
|
||||
android:showAsAction="ifRoom"
|
||||
app:showAsAction="ifRoom"
|
||||
android:actionLayout="@layout/my_search_view"
|
||||
android:icon="@drawable/ic_action_search"
|
||||
android:title="@string/search">
|
||||
@@ -52,6 +53,6 @@
|
||||
android:id="@id/im_cancel"
|
||||
android:icon="@drawable/ic_action_close"
|
||||
android:title="@android:string/cancel"
|
||||
android:showAsAction="always">
|
||||
app:showAsAction="always">
|
||||
</item>-->
|
||||
</menu>
|
||||
|
@@ -19,7 +19,8 @@
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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"
|
||||
|
@@ -20,6 +20,10 @@
|
||||
|
||||
<changelog bulletedList="true">
|
||||
|
||||
<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>
|
||||
|
@@ -54,11 +54,11 @@
|
||||
<string name="pro_version">Verze PRO</string>
|
||||
<string name="auto_save">Automatické ukládání</string>
|
||||
<string name="read_only">Jen pro čtení</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="donate">Donate</string>
|
||||
<string name="send_error_reports">Odesílat zprávy o chybách</string>
|
||||
<string name="extra_options">Další možnosti</string>
|
||||
<string name="split_text_if_too_long">Rozdělit text, pokud je příliš dlouhý</string>
|
||||
<string name="ignore_back_button">Ignorovat tlačítko zpět</string>
|
||||
<string name="donate">Podpořit</string>
|
||||
<string name="aggiungi_account">Nový účet</string>
|
||||
<string name="attiva">Aktivní</string>
|
||||
<string name="cancella">Odstranit</string>
|
||||
|
@@ -54,11 +54,11 @@
|
||||
<string name="pro_version">Pro-Version</string>
|
||||
<string name="auto_save">Automatisches Speichern</string>
|
||||
<string name="read_only">schreibgeschützt</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="donate">Donate</string>
|
||||
<string name="send_error_reports">Fehlerbericht senden</string>
|
||||
<string name="extra_options">Extraeinstellungen</string>
|
||||
<string name="split_text_if_too_long">Text teilen, wenn er zu lang ist</string>
|
||||
<string name="ignore_back_button">Zurück-Knopf ignorieren</string>
|
||||
<string name="donate">Spenden</string>
|
||||
<string name="aggiungi_account">Neues Benutzerkonto</string>
|
||||
<string name="attiva">Aktiv</string>
|
||||
<string name="cancella">Löschen</string>
|
||||
|
@@ -56,9 +56,9 @@
|
||||
<string name="read_only">Sólo lectura</string>
|
||||
<string name="send_error_reports">Envíar reporte de errores</string>
|
||||
<string name="extra_options">Opciones extra</string>
|
||||
<string name="split_text_if_too_long">Split the text if too long</string>
|
||||
<string name="split_text_if_too_long">Partir el texto si es muy largo</string>
|
||||
<string name="ignore_back_button">Ignorar el botón de regreso</string>
|
||||
<string name="donate">Donate</string>
|
||||
<string name="donate">Donar</string>
|
||||
<string name="aggiungi_account">Nueva Cuenta</string>
|
||||
<string name="attiva">Activo</string>
|
||||
<string name="cancella">Borrar</string>
|
||||
|
@@ -34,7 +34,7 @@
|
||||
<string name="find">Löydä</string>
|
||||
<string name="replace">Korvaa</string>
|
||||
<string name="share">Jaa</string>
|
||||
<string name="keyboard_suggestions_and_swipe">Näppäimistöehdotukset ja pyyhkäisy</string>
|
||||
<string name="keyboard_suggestions_and_swipe">Näppäimistön ehdotukset ja pyyhkäisy</string>
|
||||
<string name="enable_autoencoding">Automaattinen koodaus</string>
|
||||
<string name="set_as_working_folder">Määritä työkansioksi</string>
|
||||
<string name="is_the_working_folder">Tämä on työkansio</string>
|
||||
@@ -58,7 +58,7 @@
|
||||
<string name="extra_options">Lisäasetukset</string>
|
||||
<string name="split_text_if_too_long">Jaa liian pitkä teksti</string>
|
||||
<string name="ignore_back_button">Ohita Takaisin-painike</string>
|
||||
<string name="donate">Donate</string>
|
||||
<string name="donate">Lahjoita</string>
|
||||
<string name="aggiungi_account">Uusi tili</string>
|
||||
<string name="attiva">Aktiivinen</string>
|
||||
<string name="cancella">Poista</string>
|
||||
|
@@ -45,7 +45,7 @@
|
||||
<string name="next">Suivant</string>
|
||||
<string name="previous">Précédent</string>
|
||||
<string name="please_wait">Veuillez patienter…</string>
|
||||
<string name="occurrences_found">occurrences de %s ont été trouvées</string>
|
||||
<string name="occurrences_found">%s occurences ont été trouvées</string>
|
||||
<string name="app_version">Version %s</string>
|
||||
<string name="translate_the_app">Traduire</string>
|
||||
<string name="changelog">Historique des changements</string>
|
||||
@@ -55,10 +55,10 @@
|
||||
<string name="auto_save">Sauvegarde automatique</string>
|
||||
<string name="read_only">Lecture seule</string>
|
||||
<string name="send_error_reports">Envoyer les rapports d\'erreur</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="donate">Donate</string>
|
||||
<string name="extra_options">Autres options</string>
|
||||
<string name="split_text_if_too_long">Scinder le texte si trop long</string>
|
||||
<string name="ignore_back_button">Ignorer le bouton retour</string>
|
||||
<string name="donate">Faire un don</string>
|
||||
<string name="aggiungi_account">Nouveau compte</string>
|
||||
<string name="attiva">Actif</string>
|
||||
<string name="cancella">Supprimer</string>
|
||||
@@ -136,7 +136,7 @@
|
||||
<string name="inapp_seconditem_description">J\'aime vraiment cette application !</string>
|
||||
<string name="inapp_thirditem_description">J\'adore cette application !</string>
|
||||
<string name="backup_accounts">Sauvegarder les comptes</string>
|
||||
<string name="restore_accounts">Restaurer des comptes</string>
|
||||
<string name="restore_accounts">Restaurer les comptes</string>
|
||||
<string name="share_accounts">Sauvegarder et partager les comptes</string>
|
||||
<string name="importing_accounts">Importation des comptes…</string>
|
||||
<string name="exporting_accounts">Exportation des comptes...</string>
|
||||
|
@@ -55,10 +55,10 @@
|
||||
<string name="auto_save">Salvataggio automatico</string>
|
||||
<string name="read_only">Solo lettura</string>
|
||||
<string name="send_error_reports">Invia rapporti di errore</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="donate">Donate</string>
|
||||
<string name="extra_options">Altre opzioni</string>
|
||||
<string name="split_text_if_too_long">Dividi il testo se troppo lungo</string>
|
||||
<string name="ignore_back_button">Ignora il tasto indietro</string>
|
||||
<string name="donate">Dona</string>
|
||||
<string name="aggiungi_account">Nuovo account</string>
|
||||
<string name="attiva">Attiva</string>
|
||||
<string name="cancella">Cancella</string>
|
||||
|
@@ -58,7 +58,7 @@
|
||||
<string name="extra_options">追加のオプション</string>
|
||||
<string name="split_text_if_too_long">長すぎる場合にテキストを分割</string>
|
||||
<string name="ignore_back_button">戻るボタンを無視</string>
|
||||
<string name="donate">Donate</string>
|
||||
<string name="donate">寄付</string>
|
||||
<string name="aggiungi_account">新しいアカウント</string>
|
||||
<string name="attiva">アクティブ</string>
|
||||
<string name="cancella">削除</string>
|
||||
|
@@ -24,7 +24,7 @@
|
||||
<string name="recent_files">Ficheiros recentes</string>
|
||||
<string name="font_size">Tamanho da fonte</string>
|
||||
<string name="connection_name">Nome da ligação</string>
|
||||
<string name="line_numbers">Número das linha</string>
|
||||
<string name="line_numbers">Número das linhas</string>
|
||||
<string name="wrap_content">Ajustar ao ecrã</string>
|
||||
<string name="view_it_on_the_web">Ver na web</string>
|
||||
<string name="file">Ficheiro</string>
|
||||
@@ -58,7 +58,7 @@
|
||||
<string name="extra_options">Opções extra</string>
|
||||
<string name="split_text_if_too_long">Separar texto se muito longo</string>
|
||||
<string name="ignore_back_button">Ignorar botão para voltar</string>
|
||||
<string name="donate">Donate</string>
|
||||
<string name="donate">Donativos</string>
|
||||
<string name="aggiungi_account">Nova conta</string>
|
||||
<string name="attiva">Ativo</string>
|
||||
<string name="cancella">Eliminar</string>
|
||||
@@ -66,14 +66,14 @@
|
||||
<string name="caricamento">A carregar…</string>
|
||||
<string name="cartella_locale_corrente">Pasta local em utilização</string>
|
||||
<string name="chiave_privata">Chave privada</string>
|
||||
<string name="chiaro">\"Light\"</string>
|
||||
<string name="chiaro">Claro</string>
|
||||
<string name="codifica">Codificação</string>
|
||||
<string name="condividi">Partilhar</string>
|
||||
<string name="crea_cartella_locale">Nova pasta local</string>
|
||||
<string name="crea_cartella_remota">Nova pasta remota</string>
|
||||
<string name="crea_file_remoto">Novo ficheiro remoto</string>
|
||||
<string name="new_local_file">Novo ficheiro local</string>
|
||||
<string name="disconneti">Terminar sessão</string>
|
||||
<string name="disconneti">Desligar</string>
|
||||
<string name="default_local_folder">Pasta local padrão</string>
|
||||
<string name="dove_scaricare">Transferir para onde?</string>
|
||||
<string name="download">Transferir</string>
|
||||
@@ -81,16 +81,16 @@
|
||||
<string name="duplicate">Duplicar</string>
|
||||
<string name="fatto">Feito</string>
|
||||
<string name="home">Início</string>
|
||||
<string name="host">Anfitrião</string>
|
||||
<string name="host">Servidor</string>
|
||||
<string name="info">Informações</string>
|
||||
<string name="locale">Local</string>
|
||||
<string name="log_in">A iniciar sessão…</string>
|
||||
<string name="modifica">Editar</string>
|
||||
<string name="muovi">Mover</string>
|
||||
<string name="nascondi">Esconder</string>
|
||||
<string name="nascondi">Ocultar</string>
|
||||
<string name="nome_app">Turbo Client</string>
|
||||
<string name="nome_app_turbo_editor">Turbo Editor</string>
|
||||
<string name="nome_utente">Nome de Utilizador</string>
|
||||
<string name="nome_utente">Utilizador</string>
|
||||
<string name="passiva">Passivo</string>
|
||||
<string name="passphrase">Frase-chave</string>
|
||||
<string name="password">Senha</string>
|
||||
@@ -99,16 +99,16 @@
|
||||
<string name="preferenze">Preferências</string>
|
||||
<string name="remoto">Remoto</string>
|
||||
<string name="riavva_per_tema">Para mudar o tema, reinicie a aplicação</string>
|
||||
<string name="rinomina">Mudar o nome</string>
|
||||
<string name="rinomina">Mudar nome</string>
|
||||
<string name="root">Pasta remota padrão</string>
|
||||
<string name="salva">Guardar</string>
|
||||
<string name="scuro">Escuro</string>
|
||||
<string name="seleziona">Seleccionar</string>
|
||||
<string name="seleziona">Selecionar</string>
|
||||
<string name="seleziona_account">Escolha uma conta</string>
|
||||
<string name="sicuro">Tem a certeza?</string>
|
||||
<string name="something_failed">Algo falhou</string>
|
||||
<string name="skip_same_file">Não transfira o mesmo ficheiro</string>
|
||||
<string name="tema_app">Tema da Aplicação</string>
|
||||
<string name="skip_same_file">Não transferir o mesmo ficheiro</string>
|
||||
<string name="tema_app">Tema da aplicação</string>
|
||||
<string name="tipo_connessione">Tipo de ligação</string>
|
||||
<string name="tipo_protocollo">Tipo de protocolo</string>
|
||||
<string name="un_altra_cartella">Outra pasta</string>
|
||||
@@ -129,10 +129,10 @@
|
||||
<string name="upgrade_premium_summary">Adquira a versão Premium e apoie o desenvolvimento do Turbo Client!</string>
|
||||
<string name="download_unlocked_version">Transfira a versão desbloqueada</string>
|
||||
<string name="inapp_second_description">Quanto vale o Turbo Client para si? Diga o seu preço! </string>
|
||||
<string name="inapp_first_description">Atualize para a versão Premium e obtenha:</string>
|
||||
<string name="inapp_first_description">Atualize para a versão Pro e tenha:</string>
|
||||
<string name="inapp_item_openandeditfiles">Possibilidade de abrir e modificar qualquer tipo de ficheiro.</string>
|
||||
<string name="inapp_item_backup_service">Serviço de backup para guardar e restaurar os seus dados de forma segura. </string>
|
||||
<string name="inapp_unlock_features">Desbloqueie as funcionalidades Premium</string>
|
||||
<string name="inapp_unlock_features">Desbloqueie as funcionalidades Pro</string>
|
||||
<string name="inapp_seconditem_description">Eu gosto mesmo desta aplicação!</string>
|
||||
<string name="inapp_thirditem_description">Eu amo esta aplicação!</string>
|
||||
<string name="backup_accounts">Fazer backup das contas</string>
|
||||
@@ -144,7 +144,7 @@
|
||||
<string name="err_cant_open_the_file">Não é possível abrir o ficheiro</string>
|
||||
<string name="err_temp_folder_doesnt_exist">Pasta temporária não existe</string>
|
||||
<string name="err_occured">Ocorreu um erro</string>
|
||||
<string name="ui_ux">Interface do utilizador</string>
|
||||
<string name="ui_ux">UI</string>
|
||||
<string name="remove">Remover</string>
|
||||
<string name="modification_date">Data de modificação</string>
|
||||
<string name="name">Nome</string>
|
||||
|
@@ -58,7 +58,7 @@
|
||||
<string name="extra_options">Ekstra seçenekler</string>
|
||||
<string name="split_text_if_too_long">Çok uzunsa metni böl</string>
|
||||
<string name="ignore_back_button">Geri düğmesini yoksay</string>
|
||||
<string name="donate">Donate</string>
|
||||
<string name="donate">Bağış yap</string>
|
||||
<string name="aggiungi_account">Yeni hesap</string>
|
||||
<string name="attiva">Aktif</string>
|
||||
<string name="cancella">Sil</string>
|
||||
|
@@ -25,40 +25,40 @@
|
||||
<string name="font_size">字体大小</string>
|
||||
<string name="connection_name">连接名称</string>
|
||||
<string name="line_numbers">行号</string>
|
||||
<string name="wrap_content">Wrap content</string>
|
||||
<string name="wrap_content">自动换行</string>
|
||||
<string name="view_it_on_the_web">在网络上查看</string>
|
||||
<string name="file">文件</string>
|
||||
<string name="folder">文件夹</string>
|
||||
<string name="light_theme">亮色主题</string>
|
||||
<string name="goto_line">Go to Line</string>
|
||||
<string name="goto_line">转到行</string>
|
||||
<string name="find">查找</string>
|
||||
<string name="replace">Replace</string>
|
||||
<string name="replace">替换</string>
|
||||
<string name="share">分享</string>
|
||||
<string name="keyboard_suggestions_and_swipe">Keyboard suggestions and Swipe</string>
|
||||
<string name="enable_autoencoding">自动编码</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="set_as_working_folder">设为工作目录</string>
|
||||
<string name="is_the_working_folder">当前为工作目录</string>
|
||||
<string name="save_changes">你想要将所做的更改保存到文件 %s 吗?</string>
|
||||
<string name="regular_expression">正则表达式</string>
|
||||
<string name="text_to_find">要查找的文本</string>
|
||||
<string name="text_to_replace">要替换文本</string>
|
||||
<string name="next">下一个</string>
|
||||
<string name="previous">上一个</string>
|
||||
<string name="please_wait">请稍候...</string>
|
||||
<string name="occurrences_found">%s occurrences was found</string>
|
||||
<string name="app_version">Version %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="pro_version">Pro version</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="donate">Donate</string>
|
||||
<string name="app_version">版本 %s</string>
|
||||
<string name="translate_the_app">翻译</string>
|
||||
<string name="changelog">更新日志</string>
|
||||
<string name="match_case">匹配大小写</string>
|
||||
<string name="long_click_for_more_options">长按查看更多选项</string>
|
||||
<string name="pro_version">专业版</string>
|
||||
<string name="auto_save">自动保存</string>
|
||||
<string name="read_only">只读</string>
|
||||
<string name="send_error_reports">发送错误报告</string>
|
||||
<string name="extra_options">附加选项</string>
|
||||
<string name="split_text_if_too_long">长文本拆分</string>
|
||||
<string name="ignore_back_button">忽略返回按钮</string>
|
||||
<string name="donate">捐赠</string>
|
||||
<string name="aggiungi_account">新帐户</string>
|
||||
<string name="attiva">活跃</string>
|
||||
<string name="cancella">删除</string>
|
||||
|
@@ -57,4 +57,8 @@
|
||||
<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>
|
||||
</resources>
|
@@ -37,4 +37,6 @@
|
||||
<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>
|
||||
|
@@ -29,49 +29,62 @@
|
||||
<item name="android:windowBackground">@null</item>
|
||||
<item name="android:actionBarStyle">@style/ActionBar.Dark</item>
|
||||
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
|
||||
<item name="android:actionBarSize">@dimen/action_bar_height</item>
|
||||
<item name="android:windowContentOverlay">@drawable/actionbar_shadow</item>
|
||||
<item name="android:homeAsUpIndicator">@drawable/ic_ab_up_compat</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Light" parent="android:Theme.Holo.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="android:windowBackground">@color/window_background_light</item>
|
||||
<item name="android:actionBarStyle">@style/ActionBar.Dark</item>
|
||||
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
|
||||
<item name="android:actionBarSize">@dimen/action_bar_height</item>
|
||||
<item name="android:windowContentOverlay">@drawable/actionbar_shadow</item>
|
||||
<item name="android:homeAsUpIndicator">@drawable/ic_ab_up_compat</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Dark" parent="android:Theme.Holo">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="android:windowBackground">@color/window_background</item>
|
||||
<item name="android:actionBarStyle">@style/ActionBar.Dark</item>
|
||||
|
||||
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
|
||||
<item name="android:actionBarSize">@dimen/action_bar_height</item>
|
||||
<item name="android:windowContentOverlay">@drawable/actionbar_shadow</item>
|
||||
<item name="android:homeAsUpIndicator">@drawable/ic_ab_up_compat</item>
|
||||
</style>
|
||||
|
||||
<style name="ActionBar.Light" parent="android:Widget.Holo.Light.ActionBar.Solid">
|
||||
<style name="ActionBar.Light" parent="android:Widget.Holo.Light.ActionBar">
|
||||
|
||||
<item name="android:background">@color/window_background_light</item>
|
||||
<item name="android:icon">@android:color/transparent</item>
|
||||
<item name="android:icon">@drawable/actionbar_icon_placeholder_compat</item>
|
||||
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
|
||||
<item name="android:titleTextStyle">
|
||||
@style/ActionBar.TitleLight
|
||||
</item>
|
||||
<item name="android:subtitleTextStyle">
|
||||
@style/ActionBar.SubtitleLight
|
||||
</item>
|
||||
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
|
||||
</style>
|
||||
|
||||
<style name="ActionBar.Dark" parent="android:Widget.Holo.ActionBar.Solid">
|
||||
<style name="ActionBar.Dark" parent="android:Widget.Holo.ActionBar">
|
||||
|
||||
<item name="android:background">@color/window_background</item>
|
||||
<item name="android:icon">@android:color/transparent</item>
|
||||
<item name="android:icon">@drawable/actionbar_icon_placeholder_compat</item>
|
||||
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
|
||||
<item name="android:titleTextStyle">
|
||||
@style/ActionBar.TitleDark
|
||||
</item>
|
||||
<item name="android:subtitleTextStyle">
|
||||
@style/ActionBar.SubtitleDark
|
||||
</item>
|
||||
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
|
||||
</style>
|
||||
|
||||
<style name="ActionBar.TitleDark" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
|
||||
<item name="android:textColor">
|
||||
@color/textColor
|
||||
</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="ActionBar.SubtitleDark" parent="android:TextAppearance.Holo.Widget.ActionBar.Subtitle">
|
||||
@@ -80,20 +93,21 @@
|
||||
</item>
|
||||
</style>
|
||||
|
||||
<style name="ActionBar.TitleLight" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
|
||||
<style name="ActionBar.TitleLight" parent="android:TextAppearance.Holo.Widget.ActionBar.Title.Inverse">
|
||||
<item name="android:textColor">
|
||||
@color/textColorInverted
|
||||
</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="ActionBar.SubtitleLight" parent="android:TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse">
|
||||
<item name="android:textColor">
|
||||
@color/textColorInverted
|
||||
</item>
|
||||
</style>
|
||||
|
||||
<style name="ActionBar.SubtitleLight" parent="android:TextAppearance.Holo.Widget.ActionBar.Subtitle">
|
||||
<item name="android:textColor">
|
||||
@color/textColorInverted
|
||||
</item>
|
||||
</style>
|
||||
|
||||
<style name="OverFlow" parent="@android:style/Widget.Holo.ActionButton.Overflow">
|
||||
<item name="android:src">@drawable/ic_action_overflow</item>
|
||||
<style name="OverFlow" parent="android:Widget.ActionButton.Overflow">
|
||||
<item name="android:src">@drawable/ic_ab_overflow_compat</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|