diff --git a/app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java b/app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java index 40768b52f..d03e5162d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.annotation.Nullable; +import android.support.design.widget.FloatingActionButton; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -12,7 +13,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; -import com.github.clans.fab.FloatingActionButton; import com.topjohnwu.magisk.adapters.ModulesAdapter; import com.topjohnwu.magisk.asyncs.FlashZip; import com.topjohnwu.magisk.asyncs.LoadModules; diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/FABBehavior.java b/app/src/main/java/com/topjohnwu/magisk/utils/FABBehavior.java deleted file mode 100644 index cd9e73d60..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/utils/FABBehavior.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.topjohnwu.magisk.utils; - - -import android.content.Context; -import android.support.design.widget.CoordinatorLayout; -import android.support.design.widget.Snackbar; -import android.support.v4.view.ViewCompat; -import android.support.v4.view.ViewPropertyAnimatorCompat; -import android.util.AttributeSet; -import android.view.View; - -import com.github.clans.fab.FloatingActionMenu; - -import java.util.List; - -/** - * Created by Matteo on 08/08/2015. - * - * Floating Action Menu Behavior for Clans.FloatingActionButton - * https://github.com/Clans/FloatingActionButton/ - * - * Use this behavior as your app:layout_behavior attribute in your Floating Action Menu to use the - * FabMenu in a Coordinator Layout. - * - * Remember to use the correct namespace for the fab: - * xmlns:app="http://schemas.android.com/apk/res-auto" - */ -public class FABBehavior extends CoordinatorLayout.Behavior { - - private float mTranslationY; - - public FABBehavior(Context context, AttributeSet attrs) { - super(); - } - - @Override - public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) { - return dependency instanceof Snackbar.SnackbarLayout; - } - - @Override - public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) { - if (dependency instanceof Snackbar.SnackbarLayout) { - updateTranslation(parent, child); - } - - return false; - } - - @Override - public void onDependentViewRemoved(CoordinatorLayout parent, View child, View dependency) { - if (dependency instanceof Snackbar.SnackbarLayout) { - revertTranslation(child); - } - } - - private void updateTranslation(CoordinatorLayout parent, View child) { - float translationY = getTranslationY(parent, child); - if (translationY != mTranslationY) { - ViewPropertyAnimatorCompat anim = ViewCompat.animate(child); - anim.cancel(); - anim.translationY(translationY).setDuration(100); - mTranslationY = translationY; - } - } - - private void revertTranslation(View child) { - if (mTranslationY != 0) { - ViewPropertyAnimatorCompat anim = ViewCompat.animate(child); - anim.cancel(); - anim.translationY(0).setDuration(100); - mTranslationY = 0; - } - } - - private float getTranslationY(CoordinatorLayout parent, View child) { - float minOffset = 0.0F; - List dependencies = parent.getDependencies(child); - int i = 0; - - for (int z = dependencies.size(); i < z; ++i) { - View view = dependencies.get(i); - if (view instanceof Snackbar.SnackbarLayout && parent.doViewsOverlap(child, view)) { - minOffset = Math.min(minOffset, ViewCompat.getTranslationY(view) - (float) view.getHeight()); - } - } - - return minOffset; - } - - /** - * onStartNestedScroll and onNestedScroll will hide/show the FabMenu when a scroll is detected. - */ - @Override - public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child, - View directTargetChild, View target, int nestedScrollAxes) { - return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL || - super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, - nestedScrollAxes); - } - - @Override - public void onNestedScroll(CoordinatorLayout coordinatorLayout, View child, View target, - int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) { - super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, - dyUnconsumed); - FloatingActionMenu fabMenu = (FloatingActionMenu) child; - if (dyConsumed > 0 && !fabMenu.isMenuButtonHidden()) { - fabMenu.hideMenuButton(true); - } else if (dyConsumed < 0 && fabMenu.isMenuButtonHidden()) { - fabMenu.showMenuButton(true); - } - } -} diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/Logger.java b/app/src/main/java/com/topjohnwu/magisk/utils/Logger.java index 452e6ac4c..c095cdca2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/Logger.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/Logger.java @@ -13,28 +13,28 @@ public class Logger { } public static void error(String msg) { - Log.e(TAG, "ERROR: " + msg); + Log.e(TAG, "MANAGERERROR: " + msg); } public static void dev(String msg, Object... args) { if (MagiskManager.devLogging) { if (args.length == 1 && args[0] instanceof Throwable) { - Log.d(TAG, "DEV: " + msg, (Throwable) args[0]); + Log.d(TAG, "MANAGER: " + msg, (Throwable) args[0]); } else { - Log.d(TAG, "DEV: " + String.format(msg, args)); + Log.d(TAG, "MANAGER: " + String.format(msg, args)); } } } public static void dev(String msg) { if (MagiskManager.devLogging) { - Log.d(TAG, "DEV: " + msg); + Log.d(TAG, "MANAGER: " + msg); } } public static void shell(boolean root, String msg) { if (MagiskManager.shellLogging) { - Log.d(root ? "SU" : "SH", msg); + Log.d(TAG, root ? "MANAGERSU" : "MANAGERSH" + msg); } } } diff --git a/app/src/main/jni/zipadjust.c b/app/src/main/jni/zipadjust.c index 7ea20985b..90478fe4c 100644 --- a/app/src/main/jni/zipadjust.c +++ b/app/src/main/jni/zipadjust.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "zipadjust.h" size_t insize = 0, outsize = 0, alloc = 0; diff --git a/app/src/main/res/layout/fragment_magisk_log.xml b/app/src/main/res/layout/fragment_magisk_log.xml index 7513fff3a..290318956 100644 --- a/app/src/main/res/layout/fragment_magisk_log.xml +++ b/app/src/main/res/layout/fragment_magisk_log.xml @@ -20,8 +20,10 @@ android:id="@+id/txtLog" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:fontFamily="monospace" android:padding="8dp" - android:textIsSelectable="true"/> + android:textIsSelectable="true" + android:textSize="10sp" /> - + app:layout_behavior="@string/appbar_scrolling_view_behavior" + app:layoutManager="android.support.v7.widget.LinearLayoutManager" /> - - - - - - + android:layout_margin="@dimen/fab_padding" + android:elevation="6dp" + android:src="@drawable/ic_add" + tools:fabSize="normal" + tools:pressedTranslationZ="12dp" /> diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml new file mode 100644 index 000000000..90ae789ca --- /dev/null +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -0,0 +1,4 @@ + + + 24dp + \ No newline at end of file diff --git a/app/src/main/res/values-sw600dp-v21/styles.xml b/app/src/main/res/values-sw600dp/styles.xml similarity index 100% rename from app/src/main/res/values-sw600dp-v21/styles.xml rename to app/src/main/res/values-sw600dp/styles.xml diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 5f00251c2..8353bc277 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -11,4 +11,5 @@ 300dip 3dp 50dp + 16dp \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2738ef3e2..66f4e3a99 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:2.4.0-alpha4' + classpath 'com.android.tools.build:gradle:2.4.0-alpha6' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files