Skip to content

Commit 6d0264e

Browse files
committed
Library with the native .so files from kikoso StackBlur https://github.com/kikoso/android-stackblur
0 parents  commit 6d0264e

36 files changed

Lines changed: 759 additions & 0 deletions

File tree

.gitignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Created by https://www.gitignore.io
2+
3+
### Android ###
4+
5+
# Files for the Dalvik VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# Generated files
12+
bin/
13+
gen/
14+
15+
# Gradle files
16+
.gradle/
17+
build/
18+
19+
# Local configuration file (sdk path, etc)
20+
local.properties
21+
22+
# Proguard folder generated by Eclipse
23+
proguard/
24+
25+
# Log Files
26+
*.log
27+
28+
29+
### Intellij ###
30+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
31+
32+
*.iml
33+
34+
## Directory-based project format:
35+
.idea/
36+
# if you remove the above rule, at least ignore the following:
37+
38+
# User-specific stuff:
39+
# .idea/workspace.xml
40+
# .idea/tasks.xml
41+
# .idea/dictionaries
42+
43+
# Sensitive or high-churn files:
44+
# .idea/dataSources.ids
45+
# .idea/dataSources.xml
46+
# .idea/sqlDataSources.xml
47+
# .idea/dynamic.xml
48+
# .idea/uiDesigner.xml
49+
50+
# Gradle:
51+
# .idea/gradle.xml
52+
# .idea/libraries
53+
54+
# Mongo Explorer plugin:
55+
# .idea/mongoSettings.xml
56+
57+
## File-based project format:
58+
*.ipr
59+
*.iws
60+
61+
## Plugin-specific files:
62+
63+
# IntelliJ
64+
out/
65+
66+
# mpeltonen/sbt-idea plugin
67+
.idea_modules/
68+
69+
# JIRA plugin
70+
atlassian-ide-plugin.xml
71+
72+
# Crashlytics plugin (for Android Studio and IntelliJ)
73+
com_crashlytics_export_strings.xml
74+
75+
# Ignore Gradle GUI config
76+
gradle-app.setting
77+
78+
# Mobile Tools for Java (J2ME)
79+
.mtj.tmp/
80+
81+
# Package Files #
82+
*.war
83+
*.ear
84+
85+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
86+
hs_err_pid*
87+
88+
*.DS_Store

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.1"
6+
7+
defaultConfig {
8+
applicationId "com.commit451.nativestackblur.sample"
9+
minSdkVersion 8
10+
targetSdkVersion 23
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(include: ['*.jar'], dir: 'libs')
24+
compile 'com.android.support:appcompat-v7:23.0.1'
25+
compile 'com.squareup.picasso:picasso:2.5.2'
26+
compile project(':nativestackblur')
27+
}

app/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/John/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.commit451.nativestackblur.sample;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.commit451.nativestackblur.sample" >
4+
5+
<uses-permission android:name="android.permission.INTERNET"/>
6+
7+
<application
8+
android:allowBackup="true"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:theme="@style/AppTheme" >
12+
<activity
13+
android:name=".MainActivity"
14+
android:label="@string/app_name" >
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
</intent-filter>
20+
</activity>
21+
</application>
22+
23+
</manifest>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.commit451.nativestackblur.sample;
2+
3+
import android.graphics.Bitmap;
4+
5+
import com.commit451.nativestackblur.NativeStackBlur;
6+
import com.squareup.picasso.Transformation;
7+
8+
/**
9+
* Created by John on 9/10/15.
10+
*/
11+
public class BlurTransformation implements Transformation {
12+
13+
private int mBlurRadius;
14+
15+
public BlurTransformation(int blurRadius) {
16+
mBlurRadius = blurRadius;
17+
}
18+
19+
@Override
20+
public Bitmap transform(Bitmap source) {
21+
Bitmap bm = NativeStackBlur.process(source, mBlurRadius);
22+
source.recycle();
23+
return bm;
24+
}
25+
26+
@Override
27+
public String key() {
28+
return getClass().getCanonicalName() + "-" + mBlurRadius;
29+
}
30+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.commit451.nativestackblur.sample;
2+
3+
import android.os.Bundle;
4+
import android.support.v7.app.AppCompatActivity;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
import android.widget.ImageView;
8+
9+
import com.squareup.picasso.Picasso;
10+
11+
public class MainActivity extends AppCompatActivity {
12+
13+
ImageView mImage;
14+
ImageView mBlurredImage;
15+
16+
@Override
17+
protected void onCreate(Bundle savedInstanceState) {
18+
super.onCreate(savedInstanceState);
19+
setContentView(R.layout.activity_main);
20+
mImage = (ImageView) findViewById(R.id.image);
21+
mBlurredImage = (ImageView) findViewById(R.id.blurredImage);
22+
Picasso.with(this)
23+
.load("https://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Android_robot.svg/511px-Android_robot.svg.png")
24+
.into(mImage);
25+
26+
Picasso.with(this)
27+
.load("https://upload.wikimedia.org/wikipedia/commons/thumb/d/d7/Android_robot.svg/511px-Android_robot.svg.png")
28+
.transform(new BlurTransformation(5))
29+
.into(mBlurredImage);
30+
}
31+
32+
@Override
33+
public boolean onCreateOptionsMenu(Menu menu) {
34+
// Inflate the menu; this adds items to the action bar if it is present.
35+
getMenuInflater().inflate(R.menu.menu_main, menu);
36+
return true;
37+
}
38+
39+
@Override
40+
public boolean onOptionsItemSelected(MenuItem item) {
41+
// Handle action bar item clicks here. The action bar will
42+
// automatically handle clicks on the Home/Up button, so long
43+
// as you specify a parent activity in AndroidManifest.xml.
44+
int id = item.getItemId();
45+
46+
//noinspection SimplifiableIfStatement
47+
if (id == R.id.action_settings) {
48+
return true;
49+
}
50+
51+
return super.onOptionsItemSelected(item);
52+
}
53+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:orientation="vertical"
6+
android:paddingLeft="@dimen/activity_horizontal_margin"
7+
android:paddingRight="@dimen/activity_horizontal_margin"
8+
android:paddingTop="@dimen/activity_vertical_margin"
9+
android:paddingBottom="@dimen/activity_vertical_margin"
10+
tools:context=".MainActivity">
11+
12+
<ImageView
13+
android:id="@+id/image"
14+
android:layout_width="wrap_content"
15+
android:layout_height="0dp"
16+
android:contentDescription="@null"
17+
android:layout_weight="1"/>
18+
19+
<ImageView
20+
android:id="@+id/blurredImage"
21+
android:layout_width="wrap_content"
22+
android:layout_height="0dp"
23+
android:contentDescription="@null"
24+
android:layout_weight="1"/>
25+
26+
</LinearLayout>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
tools:context=".MainActivity">
5+
<item android:id="@+id/action_settings"
6+
android:title="@string/action_settings"
7+
android:orderInCategory="100"
8+
app:showAsAction="never"/>
9+
</menu>

0 commit comments

Comments
 (0)