diff --git a/.gitmodules b/.gitmodules index 71d0927..f45d553 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "jni/xsocks"] - path = jni/xsocks - url = https://github.com/lparam/xsocks.git + path = jni/xsocks + url = https://github.com/lparam/xsocks.git + ignore = dirty diff --git a/CHANGES.md b/CHANGES.md index 2869d0c..f0e1b6d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,9 @@ -v1.1.5 (2015-5-20) +v1.1.7 (2015-5-22) +----------- +* Change: Remove snackbar action +* Change: Remove redundant code and icon + + +v1.1.6 (2015-5-20) ----------- * The first public version. diff --git a/Makefile b/Makefile index c43d34c..b8173bc 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,10 @@ all: app/src/main/jniLibs/armeabi/libsystem.so .PHONY: clean clean: + $(ANDROID_NDK_HOME)/ndk-build clean rm -rf libs rm -rf app/src/main/jniLibs + rm -rf jni/xsocks/xsocks-android-i686 rm -rf jni/xsocks/xsocks-android-armv7-a app/src/main/jniLibs/armeabi/libsystem.so: jni/system.cpp jni/Android.mk @@ -21,7 +23,7 @@ app/src/main/jniLibs/armeabi/libsystem.so: jni/system.cpp jni/Android.mk fi ;\ popd ;\ pushd jni ;\ - $(ANDROID_NDK_HOME)/ndk-build NDK_LOG=1 V=1 || exit 1 ;\ + $(ANDROID_NDK_HOME)/ndk-build NDK_LOG=1 V=0 || exit 1 ;\ popd ;\ rm -rf app/src/main/assets/x86 ;\ rm -rf app/src/main/assets/armeabi-v7a ;\ diff --git a/app/build.gradle b/app/build.gradle index e8981ee..3a6964a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'me.tatarka.retrolambda' if(file('../sign.gradle').exists()) { apply from: '../sign.gradle' } else { - ogger.error('no such file: ../sign.gradle') + logger.error('no such file: ../sign.gradle') } android { @@ -14,8 +14,8 @@ android { applicationId "io.github.xsocks" minSdkVersion 18 targetSdkVersion 22 - versionCode 116 - versionName '1.1.6' + versionCode 117 + versionName '1.1.7' } lintOptions { abortOnError true diff --git a/app/src/main/java/io/github/xsocks/ui/AboutActivity.java b/app/src/main/java/io/github/xsocks/ui/AboutActivity.java index 0aa8327..d73d807 100644 --- a/app/src/main/java/io/github/xsocks/ui/AboutActivity.java +++ b/app/src/main/java/io/github/xsocks/ui/AboutActivity.java @@ -36,16 +36,7 @@ protected void onCreate(Bundle savedInstanceState) { upArrow.setColorFilter(getResources().getColor(android.R.color.white), PorterDuff.Mode.SRC_IN); } ab.setHomeAsUpIndicator(upArrow); - - String title = getString(R.string.about); - ab.setDisplayHomeAsUpEnabled(true); - if (TextUtils.isEmpty(title)) { - ab.setDisplayShowTitleEnabled(false); - } else { - ab.setDisplayShowTitleEnabled(true); - ab.setTitle(title); - } } TextView aboutVersion = (TextView) findViewById(R.id.aboutVersion); diff --git a/app/src/main/java/io/github/xsocks/ui/MainActivity.java b/app/src/main/java/io/github/xsocks/ui/MainActivity.java index 843712a..6b7fffd 100644 --- a/app/src/main/java/io/github/xsocks/ui/MainActivity.java +++ b/app/src/main/java/io/github/xsocks/ui/MainActivity.java @@ -159,7 +159,7 @@ protected void onCreate(Bundle savedInstanceState) { } Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - toolbar.setLogo(R.drawable.ic_stat_xsocks); + toolbar.setLogo(R.drawable.ic_logo); switchButton = (Switch) toolbar.findViewById(R.id.switchButton); switchButton.setOnCheckedChangeListener(this); @@ -225,7 +225,6 @@ protected void onCreate(Bundle savedInstanceState) { .build(); result.getListView().setVerticalScrollBarEnabled(false); - toolbar.setNavigationIcon(R.drawable.ic_drawer_light); prefsFragment = new PrefsFragment(); getFragmentManager().beginTransaction().replace(R.id.content, prefsFragment).commit(); @@ -339,7 +338,7 @@ private void onStateChanged(int s, String m) { Snackbar.with(MainActivity.this) .text(String.format(getString(R.string.vpn_error), m)) .duration(Snackbar.SnackbarDuration.LENGTH_LONG) - .actionLabel(R.string.error)); + .swipeToDismiss(false)); } prefsFragment.setPreferenceEnabled(true); break; @@ -474,9 +473,9 @@ private void showAbout() { SnackbarManager.show( Snackbar.with(this) .text("There are no email applications installed.") + .textColor(Color.RED) .duration(Snackbar.SnackbarDuration.LENGTH_LONG) - .actionLabel(R.string.error) - .actionColor(Color.RED)); + .swipeToDismiss(false)); } } @@ -640,8 +639,7 @@ private boolean isTextEmpty(String s, String msg) { Snackbar.with(this) .text(msg) .duration(Snackbar.SnackbarDuration.LENGTH_LONG) - .actionLabel(R.string.error) - .actionColor(Color.RED)); + .swipeToDismiss(false)); return true; } return false; @@ -667,9 +665,7 @@ private boolean checkNumber(String key, Boolean low) { Snackbar.with(this) .text(getString(R.string.port_alert)) .duration(Snackbar.SnackbarDuration.LENGTH_LONG) - .actionLabel(R.string.error) - .swipeToDismiss(false) - .actionColor(Color.RED)); + .swipeToDismiss(false)); return false; } } catch (Exception ex) { @@ -677,7 +673,7 @@ private boolean checkNumber(String key, Boolean low) { Snackbar.with(this) .text(getString(R.string.port_alert)) .duration(Snackbar.SnackbarDuration.LENGTH_LONG) - .actionLabel(R.string.error)); + .swipeToDismiss(false)); return false; } return true; diff --git a/app/src/main/res/drawable-hdpi/ic_logo.png b/app/src/main/res/drawable-hdpi/ic_logo.png new file mode 100644 index 0000000..f09f715 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_logo.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_stat_xsocks.png b/app/src/main/res/drawable-hdpi/ic_stat_xsocks.png deleted file mode 100644 index 2a00fad..0000000 Binary files a/app/src/main/res/drawable-hdpi/ic_stat_xsocks.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_drawer_dark.png b/app/src/main/res/drawable-xhdpi/ic_drawer_dark.png deleted file mode 100644 index b16a161..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_drawer_dark.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_drawer_light.png b/app/src/main/res/drawable-xhdpi/ic_drawer_light.png deleted file mode 100644 index 92109e2..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_drawer_light.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_logo.png b/app/src/main/res/drawable-xhdpi/ic_logo.png new file mode 100644 index 0000000..6f566d6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_logo.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_xsocks.png b/app/src/main/res/drawable-xhdpi/ic_stat_xsocks.png deleted file mode 100644 index ebe7b4e..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_stat_xsocks.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_drawer_dark.png b/app/src/main/res/drawable-xxhdpi/ic_drawer_dark.png deleted file mode 100644 index 7c28385..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_drawer_dark.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_drawer_light.png b/app/src/main/res/drawable-xxhdpi/ic_drawer_light.png deleted file mode 100644 index 56060bc..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_drawer_light.png and /dev/null differ diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 02e2aa7..70cd638 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -10,8 +10,7 @@ android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:textStyle="bold" - android:title="@string/about" - android:elevation="4dp"/> + android:title="@string/about"/> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 94b6e7a..9622193 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -10,9 +10,7 @@ android:id="@id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" - android:elevation="4dp" - android:titleTextAppearance="@android:style/TextAppearance.Small.Inverse"> + android:background="?attr/colorPrimary"> - @@ -17,9 +17,11 @@ @color/primaryColorDark @color/accentColor - @color/drawer_background_light + @color/background_light - @style/DrawerArrowStyle + @color/drawer_background_light + + @style/AppTheme.DrawerArrowStyle diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 9e8ec66..074abbe 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,11 +1,11 @@ - #EEE @android:color/white - #727272 - #AAA - #DADADA - #727272 + + #727272 + #AAA + #DADADA + #727272 #4caf50 #388e3c @@ -20,12 +20,9 @@ @color/sk_material_green500 @color/sk_material_green700 - #ffeeeeee #ffe2e2e2 - + #ffeeeeee #ff6a6a6a - #4dffffff - \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 53cb802..a2ec58c 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,5 +1,10 @@ + + diff --git a/jni/xsocks b/jni/xsocks index 64aa2be..ccb1666 160000 --- a/jni/xsocks +++ b/jni/xsocks @@ -1 +1 @@ -Subproject commit 64aa2beeee0f8aa0f8865959309e64e5c7525b66 +Subproject commit ccb1666c45dc9627b9ef5c4f80eb5cb9a234a800