diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 259ff23..a259df6 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -4,6 +4,11 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app-pro/build.gradle b/app-pro/build.gradle
index a5d7e89..60138bb 100644
--- a/app-pro/build.gradle
+++ b/app-pro/build.gradle
@@ -25,10 +25,10 @@ android {
defaultConfig {
applicationId "com.maskyn.fileeditorpro"
- minSdkVersion 14
+ minSdkVersion 10
targetSdkVersion 19
- versionCode 27
- versionName "1.11"
+ versionCode 29
+ versionName "1.12"
}
compileOptions {
diff --git a/app-pro/src/main/AndroidManifest.xml b/app-pro/src/main/AndroidManifest.xml
index 82081cd..d272756 100644
--- a/app-pro/src/main/AndroidManifest.xml
+++ b/app-pro/src/main/AndroidManifest.xml
@@ -36,7 +36,7 @@
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/nome_app_turbo_editor"
- android:hardwareAccelerated="false"
+ android:hardwareAccelerated="true"
android:largeHeap="true"
android:supportsRtl="true"
android:name="sharedcode.turboeditor.activity.MyApp"
diff --git a/app/build.gradle b/app/build.gradle
index 15ba950..5d23940 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -42,10 +42,10 @@ android {
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.maskyn.fileeditor"
- minSdkVersion 14
+ minSdkVersion 10
targetSdkVersion 19
- versionCode 27
- versionName "1.11"
+ versionCode 29
+ versionName "1.12"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8bb69d6..286bd5f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -26,6 +26,7 @@
+
-
+
+ sha1="fd9b2146c585dd1d2bebf34947ffe2dbcc017c51"/>
+ sha1="2e2f6526f3c5fb34230d14e52bdc24addb67ea9f"/>
+ sha1="2e2f6526f3c5fb34230d14e52bdc24addb67ea9f"/>
+
+
+
+
-
-
+ sha1="7bc7ded1dbd6619408b58e2184aad20bb75533d5"/>
-
diff --git a/libraries/FloatingActionButton/build.gradle b/libraries/FloatingActionButton/build.gradle
index 7da6bef..c2e997b 100644
--- a/libraries/FloatingActionButton/build.gradle
+++ b/libraries/FloatingActionButton/build.gradle
@@ -1,11 +1,11 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 19
- buildToolsVersion '19.1.0'
+ buildToolsVersion "20.0.0"
defaultConfig {
applicationId 'com.faizmalkani.floatingactionbutton'
- minSdkVersion 14
+ minSdkVersion 7
targetSdkVersion 19
versionName "1.0"
versionCode 1
@@ -25,4 +25,6 @@ android {
}
dependencies {
+ compile 'com.nineoldandroids:library:2.4.0'
+
}
\ No newline at end of file
diff --git a/libraries/FloatingActionButton/build/intermediates/bundles/debug/AndroidManifest.xml b/libraries/FloatingActionButton/build/intermediates/bundles/debug/AndroidManifest.xml
index 3851bcf..abddf56 100644
--- a/libraries/FloatingActionButton/build/intermediates/bundles/debug/AndroidManifest.xml
+++ b/libraries/FloatingActionButton/build/intermediates/bundles/debug/AndroidManifest.xml
@@ -5,7 +5,7 @@
android:versionName="1.0" >
diff --git a/libraries/FloatingActionButton/build/intermediates/bundles/debug/classes.jar b/libraries/FloatingActionButton/build/intermediates/bundles/debug/classes.jar
index 688b4d8..8470ef7 100644
Binary files a/libraries/FloatingActionButton/build/intermediates/bundles/debug/classes.jar and b/libraries/FloatingActionButton/build/intermediates/bundles/debug/classes.jar differ
diff --git a/libraries/FloatingActionButton/build/intermediates/bundles/release/AndroidManifest.xml b/libraries/FloatingActionButton/build/intermediates/bundles/release/AndroidManifest.xml
index 3851bcf..abddf56 100644
--- a/libraries/FloatingActionButton/build/intermediates/bundles/release/AndroidManifest.xml
+++ b/libraries/FloatingActionButton/build/intermediates/bundles/release/AndroidManifest.xml
@@ -5,7 +5,7 @@
android:versionName="1.0" >
diff --git a/libraries/FloatingActionButton/build/intermediates/bundles/release/classes.jar b/libraries/FloatingActionButton/build/intermediates/bundles/release/classes.jar
index 5cd1fa8..c6394fe 100644
Binary files a/libraries/FloatingActionButton/build/intermediates/bundles/release/classes.jar and b/libraries/FloatingActionButton/build/intermediates/bundles/release/classes.jar differ
diff --git a/libraries/FloatingActionButton/build/intermediates/manifests/test/debug/AndroidManifest.xml b/libraries/FloatingActionButton/build/intermediates/manifests/test/debug/AndroidManifest.xml
index ade5723..7e046b4 100644
--- a/libraries/FloatingActionButton/build/intermediates/manifests/test/debug/AndroidManifest.xml
+++ b/libraries/FloatingActionButton/build/intermediates/manifests/test/debug/AndroidManifest.xml
@@ -3,7 +3,7 @@
package="com.faizmalkani.floatingactionbutton.test" >
-
diff --git a/libraries/FloatingActionButton/src/com/faizmalkani/floatingactionbutton/DirectionScrollListener.java b/libraries/FloatingActionButton/src/com/faizmalkani/floatingactionbutton/DirectionScrollListener.java
index 526079e..4b695b0 100644
--- a/libraries/FloatingActionButton/src/com/faizmalkani/floatingactionbutton/DirectionScrollListener.java
+++ b/libraries/FloatingActionButton/src/com/faizmalkani/floatingactionbutton/DirectionScrollListener.java
@@ -1,10 +1,27 @@
-
+/*
+ * Copyright (c) 2014 SBG Apps
+ *
+ * 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.faizmalkani.floatingactionbutton;
import android.view.View;
import android.widget.AbsListView;
+/**
+ * Created by Stéphane on 09/07/2014.
+ */
class DirectionScrollListener implements AbsListView.OnScrollListener {
private static final int DIRECTION_CHANGE_THRESHOLD = 1;
@@ -34,10 +51,7 @@ class DirectionScrollListener implements AbsListView.OnScrollListener {
goingDown = firstVisibleItem > mPrevPosition;
}
if (changed && mUpdated) {
- if(goingDown)
- mFloatingActionButton.hideFab();
- else
- mFloatingActionButton.showFab();
+ mFloatingActionButton.hide(goingDown);
}
mPrevPosition = firstVisibleItem;
mPrevTop = firstViewTop;
diff --git a/libraries/FloatingActionButton/src/com/faizmalkani/floatingactionbutton/FloatingActionButton.java b/libraries/FloatingActionButton/src/com/faizmalkani/floatingactionbutton/FloatingActionButton.java
index d87cf8e..57c8018 100644
--- a/libraries/FloatingActionButton/src/com/faizmalkani/floatingactionbutton/FloatingActionButton.java
+++ b/libraries/FloatingActionButton/src/com/faizmalkani/floatingactionbutton/FloatingActionButton.java
@@ -1,9 +1,7 @@
-
-
package com.faizmalkani.floatingactionbutton;
-import android.animation.ObjectAnimator;
-import android.annotation.SuppressLint;
+
import android.content.Context;
+import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
@@ -11,135 +9,146 @@ import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
+import android.os.Build;
import android.util.AttributeSet;
-import android.util.DisplayMetrics;
import android.view.Display;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
-import android.view.animation.AccelerateInterpolator;
-import android.view.animation.DecelerateInterpolator;
+import android.view.animation.AccelerateDecelerateInterpolator;
+import android.view.animation.Interpolator;
import android.widget.AbsListView;
-public class FloatingActionButton extends View
-{
- Context _context;
- Paint mButtonPaint, mDrawablePaint;
- Bitmap mBitmap;
- int mScreenHeight;
- float currentY;
- boolean mHidden = false;
+import com.nineoldandroids.animation.ObjectAnimator;
+import com.nineoldandroids.view.ViewHelper;
- ObjectAnimator mShowAnimation;
- ObjectAnimator mHideAnimation;
+public class FloatingActionButton extends View {
- public FloatingActionButton(Context context, AttributeSet attributeSet)
- {
- super(context, attributeSet);
- _context = context;
- init(Color.WHITE);
+ private final Interpolator mInterpolator = new AccelerateDecelerateInterpolator();
+ private final Paint mButtonPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ private final Paint mDrawablePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ private Bitmap mBitmap;
+ private int mColor;
+ private boolean mHidden = false;
+ /**
+ * The FAB button's Y position when it is displayed.
+ */
+ private float mYDisplayed = -1;
+ /**
+ * The FAB button's Y position when it is hidden.
+ */
+ private float mYHidden = -1;
+
+ public FloatingActionButton(Context context) {
+ this(context, null);
}
- @SuppressLint("NewApi")
- public FloatingActionButton(Context context)
- {
- super(context);
- _context = context;
- init(Color.WHITE);
- }
-
- public void setColor(int fabColor)
- {
- init(fabColor);
- }
-
- public void setDrawable(Drawable fabDrawable)
- {
- mBitmap = ((BitmapDrawable) fabDrawable).getBitmap();
- invalidate();
+ public FloatingActionButton(Context context, AttributeSet attributeSet) {
+ this(context, attributeSet, 0);
}
- public void init(int fabColor)
- {
- setWillNotDraw(false);
- this.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
- mButtonPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
- mButtonPaint.setColor(fabColor);
+ public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+
+ TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.FloatingActionButton);
+ mColor = a.getColor(R.styleable.FloatingActionButton_color, Color.WHITE);
mButtonPaint.setStyle(Paint.Style.FILL);
- mButtonPaint.setShadowLayer(10.0f, 0.0f, 3.5f, Color.argb(100, 0, 0, 0));
- mDrawablePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
- invalidate();
+ mButtonPaint.setColor(mColor);
+ float radius, dx, dy;
+ radius = a.getFloat(R.styleable.FloatingActionButton_shadowRadius, 10.0f);
+ dx = a.getFloat(R.styleable.FloatingActionButton_shadowDx, 0.0f);
+ dy = a.getFloat(R.styleable.FloatingActionButton_shadowDy, 3.5f);
+ int color = a.getInteger(R.styleable.FloatingActionButton_shadowColor, Color.argb(100, 0, 0, 0));
+ mButtonPaint.setShadowLayer(radius, dx, dy, color);
- WindowManager mWindowManager = (WindowManager) _context.getSystemService(Context.WINDOW_SERVICE);
+ Drawable drawable = a.getDrawable(R.styleable.FloatingActionButton_drawable);
+ if (null != drawable) {
+ mBitmap = ((BitmapDrawable) drawable).getBitmap();
+ }
+ setWillNotDraw(false);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
+ setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+
+ WindowManager mWindowManager = (WindowManager)
+ context.getSystemService(Context.WINDOW_SERVICE);
Display display = mWindowManager.getDefaultDisplay();
Point size = new Point();
- display.getSize(size);
- mScreenHeight = size.y;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
+ display.getSize(size);
+ mYHidden = size.y;
+ } else mYHidden = display.getHeight();
+ }
- mShowAnimation = ObjectAnimator.ofFloat(this, "Y", currentY);
- mHideAnimation = ObjectAnimator.ofFloat(this, "Y", mScreenHeight);
+ public static int darkenColor(int color) {
+ float[] hsv = new float[3];
+ Color.colorToHSV(color, hsv);
+ hsv[2] *= 0.8f;
+ return Color.HSVToColor(hsv);
+ }
+
+ public void setColor(int color) {
+ mColor = color;
+ mButtonPaint.setColor(mColor);
+ invalidate();
+ }
+
+ public void setDrawable(Drawable drawable) {
+ mBitmap = ((BitmapDrawable) drawable).getBitmap();
+ invalidate();
}
@Override
- protected void onDraw(Canvas canvas)
- {
- setClickable(true);
- canvas.drawCircle(getWidth()/2, getHeight()/2,(float) (getWidth()/2.6), mButtonPaint);
- canvas.drawBitmap(mBitmap, (getWidth() - mBitmap.getWidth()) / 2, (getHeight() - mBitmap.getHeight()) / 2, mDrawablePaint);
+ protected void onDraw(Canvas canvas) {
+ canvas.drawCircle(getWidth() / 2, getHeight() / 2, (float) (getWidth() / 2.6), mButtonPaint);
+ if (null != mBitmap) {
+ canvas.drawBitmap(mBitmap, (getWidth() - mBitmap.getWidth()) / 2,
+ (getHeight() - mBitmap.getHeight()) / 2, mDrawablePaint);
+ }
}
@Override
- public boolean onTouchEvent(MotionEvent event)
- {
- if(event.getAction() == MotionEvent.ACTION_UP)
- {
- setAlpha(1.0f);
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ // Perform the default behavior
+ super.onLayout(changed, left, top, right, bottom);
+
+ // Store the FAB button's displayed Y position if we are not already aware of it
+ if (mYDisplayed == -1) {
+
+ mYDisplayed = ViewHelper.getY(this);
}
- else if(event.getAction() == MotionEvent.ACTION_DOWN)
- {
- setAlpha(0.6f);
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ int color;
+ if (event.getAction() == MotionEvent.ACTION_UP) {
+ color = mColor;
+ } else {
+ color = darkenColor(mColor);
}
+ mButtonPaint.setColor(color);
+ invalidate();
return super.onTouchEvent(event);
}
- public int dpToPx(int dp)
- {
- DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
- return Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));
- }
+ public void hide(boolean hide) {
+ // If the hidden state is being updated
+ if (mHidden != hide) {
- public void hideFab()
- {
- if(!mHidden && mShowAnimation != null && !mShowAnimation.isRunning())
- {
- currentY = getY();
- mHideAnimation = ObjectAnimator.ofFloat(this, "Y", mScreenHeight);
- mHideAnimation.setInterpolator(new AccelerateInterpolator());
- mHideAnimation.start();
- mHidden = true;
+ // Store the new hidden state
+ mHidden = hide;
+
+ // Animate the FAB to it's new Y position
+ ObjectAnimator animator = ObjectAnimator.ofFloat(this, "y", mHidden ? mYHidden : mYDisplayed).setDuration(500);
+ animator.setInterpolator(mInterpolator);
+ animator.start();
}
}
- public void showFab()
- {
- if(mHidden && mHideAnimation != null && !mHideAnimation.isRunning())
- {
- mShowAnimation = ObjectAnimator.ofFloat(this, "Y", currentY);
- mShowAnimation.setInterpolator(new DecelerateInterpolator());
- mShowAnimation.start();
- mHidden = false;
- }
- }
-
- public boolean isHidden(){
- return mHidden;
- }
-
public void listenTo(AbsListView listView) {
if (null != listView) {
listView.setOnScrollListener(new DirectionScrollListener(this));
}
}
-
}
\ No newline at end of file
diff --git a/libraries/RootCommands/build.gradle b/libraries/RootCommands/build.gradle
index 8814e5b..6e7dda2 100644
--- a/libraries/RootCommands/build.gradle
+++ b/libraries/RootCommands/build.gradle
@@ -20,7 +20,7 @@ android {
defaultConfig {
minSdkVersion 7
- targetSdkVersion 20
+ targetSdkVersion 19
}
}
diff --git a/libraries/sharedCode/build.gradle b/libraries/sharedCode/build.gradle
index 4eb1e85..d64dc47 100644
--- a/libraries/sharedCode/build.gradle
+++ b/libraries/sharedCode/build.gradle
@@ -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'
}
diff --git a/libraries/sharedCode/src/main/java/com/android/vending/billing/IInAppBillingService.aidl b/libraries/sharedCode/src/main/java/com/android/vending/billing/IInAppBillingService.aidl
new file mode 100644
index 0000000..2a492f7
--- /dev/null
+++ b/libraries/sharedCode/src/main/java/com/android/vending/billing/IInAppBillingService.aidl
@@ -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);
+}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/BaseHomeActivity.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/BaseHomeActivity.java
index 8d64594..6625c24 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/BaseHomeActivity.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/BaseHomeActivity.java
@@ -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
}
}
}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/PreferenceAbout.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/PreferenceAbout.java
index 954da60..ac2867a 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/PreferenceAbout.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/PreferenceAbout.java
@@ -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"),
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/SelectFileActivity.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/SelectFileActivity.java
index 9dfd338..97ef712 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/SelectFileActivity.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/activity/SelectFileActivity.java
@@ -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();
}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/adapter/AdapterDrawer.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/adapter/AdapterDrawer.java
index 957b966..9249343 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/adapter/AdapterDrawer.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/adapter/AdapterDrawer.java
@@ -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 {
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/adapter/AdapterTwoItem.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/adapter/AdapterTwoItem.java
new file mode 100644
index 0000000..06a01bc
--- /dev/null
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/adapter/AdapterTwoItem.java
@@ -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 .
+ */
+
+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 {
+
+ 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;
+ }
+}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/ChangelogDialogFragment.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/ChangelogDialogFragment.java
index 9af4197..eeef46e 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/ChangelogDialogFragment.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/ChangelogDialogFragment.java
@@ -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;
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/EditorFragment.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/EditorFragment.java
index f60e3c7..de4dcc0 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/EditorFragment.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/EditorFragment.java
@@ -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);
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/FileInfoDialogFragment.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/FileInfoDialogFragment.java
new file mode 100644
index 0000000..541f800
--- /dev/null
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/FileInfoDialogFragment.java
@@ -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 .
+ */
+
+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();
+ }
+}
\ No newline at end of file
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/NavigationDrawerListFragment.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/NavigationDrawerListFragment.java
index d45eab7..ebcee8a 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/NavigationDrawerListFragment.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/NavigationDrawerListFragment.java
@@ -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));
- }
+ }*/
}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/NoFileOpenedFragment.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/NoFileOpenedFragment.java
index 2ee48ff..dd738dc 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/NoFileOpenedFragment.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/fragment/NoFileOpenedFragment.java
@@ -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;
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/preferences/PreferenceHelper.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/preferences/PreferenceHelper.java
index 00a3a0b..23f193c 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/preferences/PreferenceHelper.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/preferences/PreferenceHelper.java
@@ -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();
- }
-
}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/AccessStorageApi.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/AccessStorageApi.java
new file mode 100644
index 0000000..7674655
--- /dev/null
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/AccessStorageApi.java
@@ -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 .
+ */
+
+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());
+ }
+
+}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/ApiHelper.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/ApiHelper.java
new file mode 100644
index 0000000..df7e17e
--- /dev/null
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/ApiHelper.java
@@ -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 .
+ */
+
+package sharedcode.turboeditor.util;
+
+import android.os.Build;
+
+public class ApiHelper {
+ public static boolean is11(){
+ return Build.VERSION.SDK_INT >= 11;
+ }
+}
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/EdittextPadding.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/EdittextPadding.java
index 530316f..d4bc9e5 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/EdittextPadding.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/util/EdittextPadding.java
@@ -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) {
diff --git a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/views/GoodScrollView.java b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/views/GoodScrollView.java
index e03e380..459fbba 100644
--- a/libraries/sharedCode/src/main/java/sharedcode/turboeditor/views/GoodScrollView.java
+++ b/libraries/sharedCode/src/main/java/sharedcode/turboeditor/views/GoodScrollView.java
@@ -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);
diff --git a/libraries/sharedCode/src/main/res/drawable-hdpi-v21/ic_drawer.png b/libraries/sharedCode/src/main/res/drawable-hdpi-v21/ic_drawer.png
new file mode 100644
index 0000000..5c2c7f1
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-hdpi-v21/ic_drawer.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-hdpi/ic_ab_overflow_compat.png b/libraries/sharedCode/src/main/res/drawable-hdpi/ic_ab_overflow_compat.png
new file mode 100644
index 0000000..e9ed46d
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-hdpi/ic_ab_overflow_compat.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-hdpi/ic_ab_up_compat.png b/libraries/sharedCode/src/main/res/drawable-hdpi/ic_ab_up_compat.png
new file mode 100644
index 0000000..0f5bd0c
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-hdpi/ic_ab_up_compat.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-hdpi/ic_drawer.png b/libraries/sharedCode/src/main/res/drawable-hdpi/ic_drawer.png
index 69b5d1f..50c6581 100644
Binary files a/libraries/sharedCode/src/main/res/drawable-hdpi/ic_drawer.png and b/libraries/sharedCode/src/main/res/drawable-hdpi/ic_drawer.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-mdpi-v21/ic_drawer.png b/libraries/sharedCode/src/main/res/drawable-mdpi-v21/ic_drawer.png
new file mode 100644
index 0000000..c912125
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-mdpi-v21/ic_drawer.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-mdpi/ic_ab_overflow_compat.png b/libraries/sharedCode/src/main/res/drawable-mdpi/ic_ab_overflow_compat.png
new file mode 100644
index 0000000..1f03dbf
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-mdpi/ic_ab_overflow_compat.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-mdpi/ic_ab_up_compat.png b/libraries/sharedCode/src/main/res/drawable-mdpi/ic_ab_up_compat.png
new file mode 100644
index 0000000..6979254
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-mdpi/ic_ab_up_compat.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-mdpi/ic_drawer.png b/libraries/sharedCode/src/main/res/drawable-mdpi/ic_drawer.png
index e89aa26..7bfb298 100644
Binary files a/libraries/sharedCode/src/main/res/drawable-mdpi/ic_drawer.png and b/libraries/sharedCode/src/main/res/drawable-mdpi/ic_drawer.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-xhdpi-v21/ic_drawer.png b/libraries/sharedCode/src/main/res/drawable-xhdpi-v21/ic_drawer.png
new file mode 100644
index 0000000..56f01f3
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-xhdpi-v21/ic_drawer.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_ab_overflow_compat.png b/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_ab_overflow_compat.png
new file mode 100644
index 0000000..0bef610
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_ab_overflow_compat.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_ab_up_compat.png b/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_ab_up_compat.png
new file mode 100644
index 0000000..4f463dc
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_ab_up_compat.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_drawer.png b/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_drawer.png
index 359dcf3..7b4a0d0 100644
Binary files a/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_drawer.png and b/libraries/sharedCode/src/main/res/drawable-xhdpi/ic_drawer.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-xxhdpi-v21/ic_drawer.png b/libraries/sharedCode/src/main/res/drawable-xxhdpi-v21/ic_drawer.png
new file mode 100644
index 0000000..1fc1d9c
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-xxhdpi-v21/ic_drawer.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_ab_overflow_compat.png b/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_ab_overflow_compat.png
new file mode 100644
index 0000000..4258a3e
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_ab_overflow_compat.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_ab_up_compat.png b/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_ab_up_compat.png
new file mode 100644
index 0000000..2e2cb0a
Binary files /dev/null and b/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_ab_up_compat.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_drawer.png b/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_drawer.png
index dde7e75..29f346b 100644
Binary files a/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_drawer.png and b/libraries/sharedCode/src/main/res/drawable-xxhdpi/ic_drawer.png differ
diff --git a/libraries/sharedCode/src/main/res/drawable/actionbar_icon_placeholder_compat.xml b/libraries/sharedCode/src/main/res/drawable/actionbar_icon_placeholder_compat.xml
new file mode 100644
index 0000000..f01519b
--- /dev/null
+++ b/libraries/sharedCode/src/main/res/drawable/actionbar_icon_placeholder_compat.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/libraries/sharedCode/src/main/res/drawable/actionbar_shadow.xml b/libraries/sharedCode/src/main/res/drawable/actionbar_shadow.xml
new file mode 100644
index 0000000..f6a4ef6
--- /dev/null
+++ b/libraries/sharedCode/src/main/res/drawable/actionbar_shadow.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/libraries/sharedCode/src/main/res/drawable/navigation_drawer_shadow.xml b/libraries/sharedCode/src/main/res/drawable/navigation_drawer_shadow.xml
new file mode 100644
index 0000000..3928c4f
--- /dev/null
+++ b/libraries/sharedCode/src/main/res/drawable/navigation_drawer_shadow.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/libraries/sharedCode/src/main/res/layout/activity_about.xml b/libraries/sharedCode/src/main/res/layout/activity_about.xml
index 607fe40..2a45a32 100644
--- a/libraries/sharedCode/src/main/res/layout/activity_about.xml
+++ b/libraries/sharedCode/src/main/res/layout/activity_about.xml
@@ -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" />
\ No newline at end of file
diff --git a/libraries/sharedCode/src/main/res/layout/dialog_fragment_file_info.xml b/libraries/sharedCode/src/main/res/layout/dialog_fragment_file_info.xml
new file mode 100644
index 0000000..a65cfa9
--- /dev/null
+++ b/libraries/sharedCode/src/main/res/layout/dialog_fragment_file_info.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
diff --git a/libraries/sharedCode/src/main/res/layout/fragment_navigation_drawer.xml b/libraries/sharedCode/src/main/res/layout/fragment_navigation_drawer.xml
index 2bf553a..c080b59 100644
--- a/libraries/sharedCode/src/main/res/layout/fragment_navigation_drawer.xml
+++ b/libraries/sharedCode/src/main/res/layout/fragment_navigation_drawer.xml
@@ -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"
/>
+ android:gravity="center_vertical" >
+ android:textColor="@color/navigation_drawer_button_text_color_inverted"
+ android:ellipsize="end"/>
+
+
+
+
+
+
+
+
+
+
diff --git a/libraries/sharedCode/src/main/res/menu/activity_select_file.xml b/libraries/sharedCode/src/main/res/menu/activity_select_file.xml
index a65cb10..25f67e6 100644
--- a/libraries/sharedCode/src/main/res/menu/activity_select_file.xml
+++ b/libraries/sharedCode/src/main/res/menu/activity_select_file.xml
@@ -18,7 +18,8 @@
~ along with this program. If not, see .
-->
-
\ No newline at end of file
diff --git a/libraries/sharedCode/src/main/res/values/dimens.xml b/libraries/sharedCode/src/main/res/values/dimens.xml
index 1c3e0cc..69dca58 100644
--- a/libraries/sharedCode/src/main/res/values/dimens.xml
+++ b/libraries/sharedCode/src/main/res/values/dimens.xml
@@ -37,4 +37,6 @@
25sp16sp14sp
+
+ 56dp
diff --git a/libraries/sharedCode/src/main/res/values/styles.xml b/libraries/sharedCode/src/main/res/values/styles.xml
index 88f88d3..03d1a68 100644
--- a/libraries/sharedCode/src/main/res/values/styles.xml
+++ b/libraries/sharedCode/src/main/res/values/styles.xml
@@ -29,49 +29,62 @@
@null@style/ActionBar.Dark@style/OverFlow
+ @dimen/action_bar_height
+ @drawable/actionbar_shadow
+ @drawable/ic_ab_up_compat
-
-
-
+
+
-
-
-