diff --git a/.gitignore b/.gitignore
index 1e93b4d..46f7b61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,3 @@
-/caprice/.idea/
-/caprice/.gradle/
-/caprice/.DS_Store/
-/caprice/gradle/
-/caprice/build/
-/caprice/blur/build/
-/caprice/kit/build/
-/caprice/res/build/
-/caprice/ui/build/
-/caprice/sample/build/
-/caprice/local.properties
-/caprice/gradlew
-/caprice/gradlew.bat
-
/steady/.idea/
/steady/.gradle/
/steady/.DS_Store/
diff --git a/caprice/.gitignore b/caprice/.gitignore
index 22a91ed..11d60c7 100644
--- a/caprice/.gitignore
+++ b/caprice/.gitignore
@@ -1,11 +1,9 @@
+*.iml
+.idea
.gradle
/local.properties
-/.idea/workspace.xml
-/.idea/libraries
.DS_Store
/build
-.idea/
-*.iml
+/captures
/gradle
-gradlew
-gradlew.bat
\ No newline at end of file
+.externalNativeBuild
\ No newline at end of file
diff --git a/caprice/README.md b/caprice/README.md
deleted file mode 100644
index e99af37..0000000
--- a/caprice/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-## CAPRICE Branch
-
-This is `CAPRICE` Branch development sources files.
-
-
-License
---------
-
- Copyright 2014-2016 Qiujuer.
-
- 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.
-
diff --git a/caprice/deprecated/.gitignore b/caprice/app/.gitignore
similarity index 100%
rename from caprice/deprecated/.gitignore
rename to caprice/app/.gitignore
diff --git a/caprice/app/build.gradle b/caprice/app/build.gradle
new file mode 100644
index 0000000..8dc2ebc
--- /dev/null
+++ b/caprice/app/build.gradle
@@ -0,0 +1,37 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion ANDROID_BUILD_SDK_VERSION as int
+ buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
+
+ defaultConfig {
+ applicationId "net.qiujuer.sample.genius"
+ minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION as int
+ targetSdkVersion ANDROID_BUILD_TARGET_SDK_VERSION as int
+ versionCode rootProject.ext.versionCode
+ versionName rootProject.ext.versionName
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ compile project(':graphics')
+ compile project(':res')
+ compile project(':ui')
+ compile project(':kit-cmd')
+ compile project(':kit-reflect')
+ compile project(':kit-handler')
+ compile 'com.android.support:appcompat-v7:23.4.0'
+ compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
+ testCompile 'junit:junit:4.12'
+ androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
+ androidTestCompile 'com.android.support.test:runner:0.5'
+ androidTestCompile 'com.android.support:support-annotations:23.4.0'
+}
diff --git a/caprice/deprecated/proguard-rules.pro b/caprice/app/proguard-rules.pro
similarity index 100%
rename from caprice/deprecated/proguard-rules.pro
rename to caprice/app/proguard-rules.pro
diff --git a/caprice/app/src/androidTest/java/net/qiujuer/sample/genius/ExampleInstrumentationTest.java b/caprice/app/src/androidTest/java/net/qiujuer/sample/genius/ExampleInstrumentationTest.java
new file mode 100644
index 0000000..0774fa8
--- /dev/null
+++ b/caprice/app/src/androidTest/java/net/qiujuer/sample/genius/ExampleInstrumentationTest.java
@@ -0,0 +1,29 @@
+package net.qiujuer.sample.genius;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.MediumTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumentation test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@MediumTest
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentationTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("net.qiujuer.sample.genius", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/caprice/sample/src/main/AndroidManifest.xml b/caprice/app/src/main/AndroidManifest.xml
similarity index 57%
rename from caprice/sample/src/main/AndroidManifest.xml
rename to caprice/app/src/main/AndroidManifest.xml
index 85501bd..fe9e1f1 100644
--- a/caprice/sample/src/main/AndroidManifest.xml
+++ b/caprice/app/src/main/AndroidManifest.xml
@@ -2,22 +2,14 @@
-
-
-
-
-
-
-
-
@@ -27,11 +19,19 @@
+ android:label="@string/title_activity_blur"
+ android:theme="@style/AppTheme" />
-
+ android:label="@string/title_activity_kit"
+ android:theme="@style/AppTheme" />
+
+
\ No newline at end of file
diff --git a/caprice/sample/src/main/assets/fonts/roboto_bold.ttf b/caprice/app/src/main/assets/fonts/roboto_bold.ttf
similarity index 100%
rename from caprice/sample/src/main/assets/fonts/roboto_bold.ttf
rename to caprice/app/src/main/assets/fonts/roboto_bold.ttf
diff --git a/caprice/sample/src/main/assets/fonts/roboto_extrabold.ttf b/caprice/app/src/main/assets/fonts/roboto_extrabold.ttf
similarity index 100%
rename from caprice/sample/src/main/assets/fonts/roboto_extrabold.ttf
rename to caprice/app/src/main/assets/fonts/roboto_extrabold.ttf
diff --git a/caprice/sample/src/main/assets/fonts/roboto_extralight.ttf b/caprice/app/src/main/assets/fonts/roboto_extralight.ttf
similarity index 100%
rename from caprice/sample/src/main/assets/fonts/roboto_extralight.ttf
rename to caprice/app/src/main/assets/fonts/roboto_extralight.ttf
diff --git a/caprice/sample/src/main/assets/fonts/roboto_light.ttf b/caprice/app/src/main/assets/fonts/roboto_light.ttf
similarity index 100%
rename from caprice/sample/src/main/assets/fonts/roboto_light.ttf
rename to caprice/app/src/main/assets/fonts/roboto_light.ttf
diff --git a/caprice/sample/src/main/assets/fonts/roboto_regular.ttf b/caprice/app/src/main/assets/fonts/roboto_regular.ttf
similarity index 100%
rename from caprice/sample/src/main/assets/fonts/roboto_regular.ttf
rename to caprice/app/src/main/assets/fonts/roboto_regular.ttf
diff --git a/caprice/sample/src/main/java/net/qiujuer/sample/genius/BlurActivity.java b/caprice/app/src/main/java/net/qiujuer/sample/genius/BlurActivity.java
similarity index 64%
rename from caprice/sample/src/main/java/net/qiujuer/sample/genius/BlurActivity.java
rename to caprice/app/src/main/java/net/qiujuer/sample/genius/BlurActivity.java
index e3aa784..4b83426 100644
--- a/caprice/sample/src/main/java/net/qiujuer/sample/genius/BlurActivity.java
+++ b/caprice/app/src/main/java/net/qiujuer/sample/genius/BlurActivity.java
@@ -11,7 +11,10 @@
import android.widget.ImageView;
import android.widget.TextView;
-import net.qiujuer.genius.blur.StackBlur;
+import net.qiujuer.genius.graphics.Blur;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
public class BlurActivity extends AppCompatActivity {
@@ -42,10 +45,40 @@ protected void onResume() {
applyBlur();
}
+ private static Bitmap codec(Bitmap src, Bitmap.CompressFormat format,
+ int quality) {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ src.compress(format, quality, os);
+
+ byte[] array = os.toByteArray();
+ return BitmapFactory.decodeByteArray(array, 0, array.length);
+ }
+
+ private Bitmap compressImage(Bitmap image) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ image.compress(Bitmap.CompressFormat.PNG, 100, baos);//质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中
+ int options = 100;
+ while (baos.toByteArray().length / 1024 > 100) { //循环判断如果压缩后图片是否大于100kb,大于继续压缩
+ baos.reset();//重置baos即清空baos
+ image.compress(Bitmap.CompressFormat.JPEG, options, baos);//这里压缩options%,把压缩后的数据存放到baos中
+ options -= 10;//每次都减少10
+ }
+ ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());//把压缩后的数据baos存放到ByteArrayInputStream中
+ BitmapFactory.Options options1 = new BitmapFactory.Options();
+ options1.inPreferredConfig = Bitmap.Config.RGB_565;
+ Bitmap bitmap = BitmapFactory.decodeStream(isBm, null, options1);//把ByteArrayInputStream数据生成图片
+ return bitmap;
+ }
+
private void initBlur() {
// Find Bitmap
mBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_blur);
+ //Bitmap.Config config = mBitmap.getConfig();
+ //mBitmap = mBitmap.copy(Bitmap.Config.RGB_565, true);
+ //mBitmap = compressImage(mBitmap);
+
+
mImageJava = (ImageView) findViewById(R.id.image_blur_java);
mImageJniPixels = (ImageView) findViewById(R.id.image_blur_jni_pixels);
mImageJniBitmap = (ImageView) findViewById(R.id.image_blur_jni_bitmap);
@@ -61,6 +94,8 @@ private void initBlur() {
mCompressBitmap = Bitmap.createBitmap(mBitmap, 0, 0,
mBitmap.getWidth(), mBitmap.getHeight(), matrix, true);
+ mCompressBitmap = mCompressBitmap.copy(Bitmap.Config.RGB_565, true);
+
// Set On OnCheckedChangeListener
CheckBox checkBox = (CheckBox) findViewById(R.id.checkbox_blur_isCompress);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@@ -117,21 +152,29 @@ else if (i == 3)
// Is Compress
float radius = 20;
- Bitmap overlay = mBitmap;
+ Bitmap overlay = mBitmap.copy(mBitmap.getConfig(), true);
if (mCompress) {
radius = 3;
- overlay = mCompressBitmap;
+ overlay = mCompressBitmap.copy(mCompressBitmap.getConfig(), true);
}
- // Java
- if (i == 1)
- overlay = StackBlur.blur(overlay, (int) radius, false);
- // Bitmap JNI Native
- else if (i == 2)
- overlay = StackBlur.blurNatively(overlay, (int) radius, false);
+
+ if (i == 1) {
+ // Java
+ overlay = Blur.onStackBlurJava(overlay, (int) radius);
+ } else if (i == 2) {
// Pixels JNI Native
- else if (i == 3)
- overlay = StackBlur.blurNativelyPixels(overlay, (int) radius, false);
+ int w = overlay.getWidth();
+ int h = overlay.getHeight();
+ int[] pix = new int[w * h];
+ overlay.getPixels(pix, 0, w, 0, 0, w, h);
+ // Jni Pixels Blur
+ pix = Blur.onStackBlurPixels(pix, w, h, (int) radius);
+ overlay.setPixels(pix, 0, w, 0, 0, w, h);
+ } else if (i == 3) {
+ // Bitmap JNI Native
+ overlay = Blur.onStackBlur(overlay, (int) radius);
+ }
// Show
showDrawable(view, overlay);
diff --git a/caprice/app/src/main/java/net/qiujuer/sample/genius/BlurClipActivity.java b/caprice/app/src/main/java/net/qiujuer/sample/genius/BlurClipActivity.java
new file mode 100644
index 0000000..83ac859
--- /dev/null
+++ b/caprice/app/src/main/java/net/qiujuer/sample/genius/BlurClipActivity.java
@@ -0,0 +1,81 @@
+package net.qiujuer.sample.genius;
+
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.view.View;
+import android.widget.ImageView;
+
+import net.qiujuer.genius.graphics.Blur;
+
+public class BlurClipActivity extends AppCompatActivity {
+ private Bitmap mSrc1;
+ private Bitmap mSrc2;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_blur_clip);
+
+ try {
+ // Find Bitmap
+ Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.walkthrough);
+ mSrc1 = bitmap.copy(bitmap.getConfig(), true);
+ mSrc2 = bitmap.copy(bitmap.getConfig(), true);
+ bitmap.recycle();
+ } catch (OutOfMemoryError error) {
+ error.printStackTrace();
+ finish();
+ }
+
+ findViewById(R.id.btn_todo1).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clipBlur();
+ }
+ });
+ findViewById(R.id.btn_todo2).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ blur();
+ }
+ });
+ findViewById(R.id.btn_clear).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ clear();
+ }
+ });
+ }
+
+ private void clear() {
+ Drawable drawable = ((ImageView) findViewById(R.id.iv_show1)).getDrawable();
+ if (drawable != null && drawable instanceof BitmapDrawable) {
+ ((ImageView) findViewById(R.id.iv_show1)).setImageDrawable(null);
+ ((BitmapDrawable) drawable).getBitmap().recycle();
+ }
+ }
+
+ private void clipBlur() {
+ ((ImageView) findViewById(R.id.iv_show1)).setImageBitmap(Blur.onStackBlurClip(mSrc1, 120));
+ }
+
+ private void blur() {
+ ((ImageView) findViewById(R.id.iv_show1)).setImageBitmap(Blur.onStackBlur(mSrc2, 120));
+ }
+
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ if (mSrc1 != null && !mSrc1.isRecycled())
+ mSrc1.recycle();
+ if (mSrc2 != null && !mSrc2.isRecycled())
+ mSrc2.recycle();
+
+ System.gc();
+ }
+}
diff --git a/caprice/sample/src/main/java/net/qiujuer/sample/genius/KitActivity.java b/caprice/app/src/main/java/net/qiujuer/sample/genius/KitActivity.java
similarity index 98%
rename from caprice/sample/src/main/java/net/qiujuer/sample/genius/KitActivity.java
rename to caprice/app/src/main/java/net/qiujuer/sample/genius/KitActivity.java
index 8ceb226..51698f2 100644
--- a/caprice/sample/src/main/java/net/qiujuer/sample/genius/KitActivity.java
+++ b/caprice/app/src/main/java/net/qiujuer/sample/genius/KitActivity.java
@@ -8,7 +8,6 @@
import android.view.View;
import android.widget.TextView;
-import net.qiujuer.genius.kit.Kit;
import net.qiujuer.genius.kit.cmd.Cmd;
import net.qiujuer.genius.kit.cmd.Command;
import net.qiujuer.genius.kit.cmd.DnsResolve;
@@ -57,9 +56,9 @@ protected void onCreate(Bundle savedInstanceState) {
}
private void init() {
- Application kitApp = Kit.getApplication();
+ //Application kitApp = Kit.getApplication();
Application application = getApplication();
- showLog(TAG, "Kit.getApplication() eq getApplication() is:" + (kitApp == application));
+ //showLog(TAG, "Kit.getApplication() eq getApplication() is:" + (kitApp == application));
Cmd.init(application);
}
diff --git a/caprice/sample/src/main/java/net/qiujuer/sample/genius/MainActivity.java b/caprice/app/src/main/java/net/qiujuer/sample/genius/MainActivity.java
similarity index 92%
rename from caprice/sample/src/main/java/net/qiujuer/sample/genius/MainActivity.java
rename to caprice/app/src/main/java/net/qiujuer/sample/genius/MainActivity.java
index 5bec19c..b008b71 100644
--- a/caprice/sample/src/main/java/net/qiujuer/sample/genius/MainActivity.java
+++ b/caprice/app/src/main/java/net/qiujuer/sample/genius/MainActivity.java
@@ -5,7 +5,6 @@
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
-import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.CompoundButton;
@@ -36,18 +35,17 @@ protected void onCreate(Bundle savedInstanceState) {
findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- Log.e(MainActivity.class.getName(), "OnClickListener");
+ Toast.makeText(v.getContext(), "OnClickListener.", Toast.LENGTH_SHORT).show();
}
});
findViewById(R.id.btn).setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
- Log.e(MainActivity.class.getName(), "OnLongClickListener");
+ Toast.makeText(v.getContext(), "OnLongClickListener.", Toast.LENGTH_SHORT).show();
return false;
}
});
-
}
@Override
@@ -65,6 +63,9 @@ public boolean onMenuItemClick(MenuItem item) {
if (id == R.id.action_blur) {
Intent intent = new Intent(MainActivity.this, BlurActivity.class);
startActivity(intent);
+ } else if (id == R.id.action_blur_clip) {
+ Intent intent = new Intent(MainActivity.this, BlurClipActivity.class);
+ startActivity(intent);
} else if (id == R.id.action_kit) {
Intent intent = new Intent(MainActivity.this, KitActivity.class);
startActivity(intent);
@@ -132,7 +133,7 @@ public void onClick(View v) {
LoadingDrawable drawable = new LoadingCircleDrawable();
Resources resources = getResources();
- drawable.setBackgroundColor(resources.getColor(R.color.g_default_loading_bg));
+ drawable.setBackgroundColor(resources.getColor(R.color.g_default_base_background));
drawable.setForegroundColor(resources.getIntArray(R.array.g_default_loading_fg));
drawable.setBackgroundLineSize(2);
drawable.setForegroundLineSize(4);
diff --git a/caprice/sample/src/main/java/net/qiujuer/sample/genius/SeekBarActivity.java b/caprice/app/src/main/java/net/qiujuer/sample/genius/SeekBarActivity.java
similarity index 100%
rename from caprice/sample/src/main/java/net/qiujuer/sample/genius/SeekBarActivity.java
rename to caprice/app/src/main/java/net/qiujuer/sample/genius/SeekBarActivity.java
diff --git a/caprice/sample/src/main/res/color/m_check_box.xml b/caprice/app/src/main/res/color/m_check_box.xml
similarity index 100%
rename from caprice/sample/src/main/res/color/m_check_box.xml
rename to caprice/app/src/main/res/color/m_check_box.xml
diff --git a/caprice/sample/src/main/res/color/m_edit_view_hint.xml b/caprice/app/src/main/res/color/m_edit_view_hint.xml
similarity index 100%
rename from caprice/sample/src/main/res/color/m_edit_view_hint.xml
rename to caprice/app/src/main/res/color/m_edit_view_hint.xml
diff --git a/caprice/sample/src/main/res/color/m_edit_view_line.xml b/caprice/app/src/main/res/color/m_edit_view_line.xml
similarity index 100%
rename from caprice/sample/src/main/res/color/m_edit_view_line.xml
rename to caprice/app/src/main/res/color/m_edit_view_line.xml
diff --git a/caprice/sample/src/main/res/color/m_seek_bar_indicator_bg.xml b/caprice/app/src/main/res/color/m_seek_bar_indicator_bg.xml
similarity index 100%
rename from caprice/sample/src/main/res/color/m_seek_bar_indicator_bg.xml
rename to caprice/app/src/main/res/color/m_seek_bar_indicator_bg.xml
diff --git a/caprice/sample/src/main/res/color/m_seek_bar_ripple.xml b/caprice/app/src/main/res/color/m_seek_bar_ripple.xml
similarity index 100%
rename from caprice/sample/src/main/res/color/m_seek_bar_ripple.xml
rename to caprice/app/src/main/res/color/m_seek_bar_ripple.xml
diff --git a/caprice/sample/src/main/res/color/m_seek_bar_scrubber.xml b/caprice/app/src/main/res/color/m_seek_bar_scrubber.xml
similarity index 100%
rename from caprice/sample/src/main/res/color/m_seek_bar_scrubber.xml
rename to caprice/app/src/main/res/color/m_seek_bar_scrubber.xml
diff --git a/caprice/sample/src/main/res/color/m_seek_bar_thumb.xml b/caprice/app/src/main/res/color/m_seek_bar_thumb.xml
similarity index 100%
rename from caprice/sample/src/main/res/color/m_seek_bar_thumb.xml
rename to caprice/app/src/main/res/color/m_seek_bar_thumb.xml
diff --git a/caprice/sample/src/main/res/drawable/m_button_background.xml b/caprice/app/src/main/res/drawable/m_button_background.xml
similarity index 80%
rename from caprice/sample/src/main/res/drawable/m_button_background.xml
rename to caprice/app/src/main/res/drawable/m_button_background.xml
index 84de644..02bc670 100644
--- a/caprice/sample/src/main/res/drawable/m_button_background.xml
+++ b/caprice/app/src/main/res/drawable/m_button_background.xml
@@ -2,5 +2,5 @@
-
+
\ No newline at end of file
diff --git a/caprice/sample/src/main/res/drawable/m_ic_add.xml b/caprice/app/src/main/res/drawable/m_ic_add.xml
similarity index 100%
rename from caprice/sample/src/main/res/drawable/m_ic_add.xml
rename to caprice/app/src/main/res/drawable/m_ic_add.xml
diff --git a/caprice/sample/src/main/res/layout/activity_blur.xml b/caprice/app/src/main/res/layout/activity_blur.xml
similarity index 92%
rename from caprice/sample/src/main/res/layout/activity_blur.xml
rename to caprice/app/src/main/res/layout/activity_blur.xml
index ca220ea..bd4f4a5 100644
--- a/caprice/sample/src/main/res/layout/activity_blur.xml
+++ b/caprice/app/src/main/res/layout/activity_blur.xml
@@ -1,4 +1,5 @@
-
+ android:src="@mipmap/ic_blur"
+ app:gTouchColor="@color/amber_100" />
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/caprice/sample/src/main/res/layout/activity_kit.xml b/caprice/app/src/main/res/layout/activity_kit.xml
similarity index 85%
rename from caprice/sample/src/main/res/layout/activity_kit.xml
rename to caprice/app/src/main/res/layout/activity_kit.xml
index f30d74e..4dddbd3 100644
--- a/caprice/sample/src/main/res/layout/activity_kit.xml
+++ b/caprice/app/src/main/res/layout/activity_kit.xml
@@ -23,9 +23,9 @@
+ android:paddingBottom="@dimen/len_32"
+ android:paddingLeft="@dimen/len_12"
+ android:paddingRight="@dimen/len_12"
+ android:paddingTop="@dimen/len_56">
+ android:textSize="@dimen/len_16" />
+ app:gFont="roboto_regular.ttf" />
+ android:textSize="@dimen/len_16" />
+ android:textSize="@dimen/len_14" />
+ android:textSize="@dimen/len_14" />
+ android:textSize="@dimen/len_14" />
+ app:gTouchEffect="ripple"
+ app:gInterceptEvent="all"/>
+ android:textSize="@dimen/len_16" />
@@ -280,10 +282,10 @@
+ android:textSize="@dimen/len_16" />
+ android:textSize="@dimen/len_16" />
+ android:textSize="@dimen/len_16" />
+
+
+
+
+
+
+
+ android:layout_marginLeft="@dimen/len_4"
+ android:layout_marginRight="@dimen/len_4"
+ android:paddingBottom="@dimen/len_4"
+ android:paddingLeft="@dimen/len_4"
+ android:paddingRight="@dimen/len_4"
+ android:paddingTop="@dimen/len_4"
+ app:gBackgroundColor="@null" />
@@ -475,19 +509,20 @@
android:id="@+id/loading_progress"
android:layout_width="32dp"
android:layout_height="32dp"
- android:layout_marginLeft="@dimen/lay_4"
- android:layout_marginRight="@dimen/lay_4"
+ android:layout_marginLeft="@dimen/len_4"
+ android:layout_marginRight="@dimen/len_4"
app:gAutoRun="false"
+ app:gBackgroundColor="@color/g_default_base_backgroundLight"
app:gBackgroundLineSize="1dp"
- app:gForegroundLineSize="3dp"
- app:gProgressFloat="0.65" />
+ app:gForegroundLineSize="2dp"
+ app:gProgressFloat="0.7" />
@@ -500,20 +535,21 @@
style="@style/ToolBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingBottom="@dimen/lay_8" />
+ android:paddingBottom="@dimen/len_8" />
diff --git a/caprice/sample/src/main/res/layout/activity_seek_bar.xml b/caprice/app/src/main/res/layout/activity_seek_bar.xml
similarity index 83%
rename from caprice/sample/src/main/res/layout/activity_seek_bar.xml
rename to caprice/app/src/main/res/layout/activity_seek_bar.xml
index 8e6cbfb..00317a7 100644
--- a/caprice/sample/src/main/res/layout/activity_seek_bar.xml
+++ b/caprice/app/src/main/res/layout/activity_seek_bar.xml
@@ -15,8 +15,8 @@
android:id="@+id/tv_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/lay_36"
- android:layout_marginTop="@dimen/lay_16"
+ android:layout_marginBottom="@dimen/len_36"
+ android:layout_marginTop="@dimen/len_16"
android:gravity="center"
android:text="Min:0, Max:10, Progress:0aa"
android:textColor="@color/orange_800"
@@ -36,7 +36,7 @@
@@ -44,8 +44,8 @@
android:id="@+id/edit_min"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/lay_4"
- android:layout_marginRight="@dimen/lay_4"
+ android:layout_marginLeft="@dimen/len_4"
+ android:layout_marginRight="@dimen/len_4"
android:layout_weight="1"
android:gravity="center"
android:hint="Min"
@@ -57,8 +57,8 @@
android:id="@+id/edit_max"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/lay_4"
- android:layout_marginRight="@dimen/lay_4"
+ android:layout_marginLeft="@dimen/len_4"
+ android:layout_marginRight="@dimen/len_4"
android:layout_weight="1"
android:gravity="center"
android:hint="Max"
@@ -71,9 +71,9 @@
android:id="@+id/btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/lay_4"
- android:layout_marginRight="@dimen/lay_4"
- android:layout_marginTop="@dimen/lay_8"
+ android:layout_marginLeft="@dimen/len_4"
+ android:layout_marginRight="@dimen/len_4"
+ android:layout_marginTop="@dimen/len_8"
android:text="Change"
android:textColor="@color/white_alpha_224"
genius:gTouchEffect="ripple" />
diff --git a/caprice/sample/src/main/res/menu/menu_main.xml b/caprice/app/src/main/res/menu/menu_main.xml
similarity index 80%
rename from caprice/sample/src/main/res/menu/menu_main.xml
rename to caprice/app/src/main/res/menu/menu_main.xml
index f1c6715..ff35efd 100644
--- a/caprice/sample/src/main/res/menu/menu_main.xml
+++ b/caprice/app/src/main/res/menu/menu_main.xml
@@ -8,6 +8,11 @@
android:orderInCategory="100"
android:title="@string/action_blur"
app:showAsAction="never" />
+
- Settings
Back
Blur
+ BlurClip
Kit
SeekBar
BlurActivity
KitActivity
+ SeekBarActivity
diff --git a/caprice/sample/src/main/res/values/styles.xml b/caprice/app/src/main/res/values/styles.xml
similarity index 87%
rename from caprice/sample/src/main/res/values/styles.xml
rename to caprice/app/src/main/res/values/styles.xml
index 5ebd9e5..ad79dca 100644
--- a/caprice/sample/src/main/res/values/styles.xml
+++ b/caprice/app/src/main/res/values/styles.xml
@@ -6,11 +6,6 @@
- @color/cyan_700
- @color/cyan_500
- @null
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/caprice/ui/src/main/res/values/attrs.xml b/caprice/ui/src/main/res/values/attrs.xml
index f86293f..0f7f38b 100644
--- a/caprice/ui/src/main/res/values/attrs.xml
+++ b/caprice/ui/src/main/res/values/attrs.xml
@@ -46,6 +46,12 @@
+
+
+
+
+
+
@@ -67,6 +73,14 @@
+
+
+
+
+
+
+
+
@@ -81,6 +95,7 @@
+
@@ -162,7 +177,7 @@
-
+
@@ -181,5 +196,7 @@
+
+
diff --git a/caprice/ui/src/main/res/values/colors.xml b/caprice/ui/src/main/res/values/colors.xml
index 8cdf56e..7b785fa 100644
--- a/caprice/ui/src/main/res/values/colors.xml
+++ b/caprice/ui/src/main/res/values/colors.xml
@@ -1,38 +1,54 @@
+ #00000000
+ #4dd0e1
+ #00bcd4
+ #0097a7
+ #ffb74d
+ #ff9800
+ #f57c00
+ #e0e0e0
+ #9e9e9e
+ #616161
+ #e2e2e2
+ #bebebe
+ #979797
+ #30000000
+
+ #00bcd4
+ #f57c00
+ #20000000
+
- @color/cyan_500
- @color/cyan_500
+ @color/g_default_base_primary
+ @color/g_default_base_primary
- - @color/cyan_500
- - @color/purple_500
- - @color/blue_500
- - @color/orange_500
- - @color/pink_500
+ - #00bcd4
+ - #9c27b0
+ - #5677fc
+ - #ff9800
+ - #e91e63
-
- @color/grey_300
\ No newline at end of file
diff --git a/caprice/ui/src/main/res/values/dimens.xml b/caprice/ui/src/main/res/values/dimens.xml
index 2c6da1f..1759bb1 100644
--- a/caprice/ui/src/main/res/values/dimens.xml
+++ b/caprice/ui/src/main/res/values/dimens.xml
@@ -44,6 +44,7 @@
2dp
28dp
+ 40dp
4dp
4dp
diff --git a/caprice/ui/src/main/res/values/styles.xml b/caprice/ui/src/main/res/values/styles.xml
index 3a0bf79..7c40f1e 100644
--- a/caprice/ui/src/main/res/values/styles.xml
+++ b/caprice/ui/src/main/res/values/styles.xml
@@ -1,22 +1,21 @@
@@ -25,16 +24,10 @@
- @string/g_font_file
-
+
@@ -104,15 +97,15 @@
- @dimen/g_loading_lineSize
- @dimen/g_loading_lineSize
- - @color/g_default_loading_bg
+ - @color/g_default_background
- @array/g_default_loading_fg
- - circle
+ - circle
- true
+
\ No newline at end of file
diff --git a/caprice/ui/src/test/java/net/qiujuer/genius/ui/ExampleUnitTest.java b/caprice/ui/src/test/java/net/qiujuer/genius/ui/ExampleUnitTest.java
index 6a9963c..5aefcad 100644
--- a/caprice/ui/src/test/java/net/qiujuer/genius/ui/ExampleUnitTest.java
+++ b/caprice/ui/src/test/java/net/qiujuer/genius/ui/ExampleUnitTest.java
@@ -5,7 +5,9 @@
import static org.junit.Assert.*;
/**
- * To work on unit tests, switch the Test Artifact in the Build Variants view.
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
*/
public class ExampleUnitTest {
@Test