Skip to content

Commit

Permalink
updates dali to v0.3.0
Browse files Browse the repository at this point in the history
updates to renderscript 20
updates publish script
adds debugview
  • Loading branch information
patrickfav committed Jan 21, 2017
1 parent 88156c7 commit c545195
Show file tree
Hide file tree
Showing 12 changed files with 220 additions and 198 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Releases

## v0.3.0
* first version in jcenter
* updates renderscriptTargetApi to 20
* updates target sdk and build tools to 25
* adds debug view in app

## v0.2.0
initial release
7 changes: 4 additions & 3 deletions DaliTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
}

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
Expand All @@ -42,7 +42,8 @@ android {
dependencies {
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.squareup.picasso:picasso:2.5.+'
compile 'com.squareup.picasso:picasso:2.5.2'

compile 'at.favre.lib:dali:0.2'
compile 'at.favre.lib:dali:0.3.0'
compile 'at.favre.lib.hood:hood-extended:0.2.3'
}
4 changes: 3 additions & 1 deletion DaliTestApp/proguard-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
#}

-keep public **.BuildConfig {public static *;}
24 changes: 14 additions & 10 deletions DaliTestApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.favre.app.dalitest" >
<manifest package="at.favre.app.dalitest"
xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".DaliTestApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name=".DaliTestApplication"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme">
<activity
android:name=".activity.MainMenuActivity"
android:label="@string/app_name" >
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<activity android:name=".activity.GenericActivity"
android:windowSoftInputMode="stateHidden"/>
<activity
android:name=".activity.GenericActivity"
android:windowSoftInputMode="stateHidden"/>
<activity android:name=".activity.NavigationDrawerActivity"/>
<activity
android:name=".activity.DebugActivity"
android:label="Debug View"
android:theme="@style/HoodThemeDark"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package at.favre.app.dalitest.activity;

import android.support.annotation.NonNull;

import at.favre.app.dalitest.BuildConfig;
import at.favre.lib.hood.extended.PopHoodActivity;
import at.favre.lib.hood.interfaces.Page;
import at.favre.lib.hood.interfaces.Pages;
import at.favre.lib.hood.util.defaults.DefaultProperties;

public class DebugActivity extends PopHoodActivity {
@NonNull
@Override
public Pages getPageData(@NonNull Pages emptyPages) {
Page page = emptyPages.addNewPage();
page.add(DefaultProperties.createSectionBasicDeviceInfo());
page.add(DefaultProperties.createDetailedDeviceInfo(this));
page.add(DefaultProperties.createSectionAppVersionInfoFromBuildConfig(BuildConfig.class));
page.add(DefaultProperties.createSectionAppVersionInfoFromBuildConfig(at.favre.lib.dali.BuildConfig.class).removeHeader());


return emptyPages;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@

import at.favre.app.dalitest.R;
import at.favre.lib.dali.Dali;
import at.favre.lib.hood.Hood;
import at.favre.lib.hood.interfaces.actions.ManagerControl;


public class MainMenuActivity extends AppCompatActivity {
private ManagerControl control;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -22,42 +25,57 @@ protected void onCreate(Bundle savedInstanceState) {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

findViewById(R.id.btn_blur1).setOnClickListener(new StartActivityListener(this,0));
findViewById(R.id.btn_liveblur1).setOnClickListener(new StartActivityListener(this,1));
findViewById(R.id.btn_animation1).setOnClickListener(new StartActivityListener(this,2));
findViewById(R.id.btn_viewblur).setOnClickListener(new StartActivityListener(this,3));
findViewById(R.id.btn_blur2).setOnClickListener(new StartActivityListener(this,4));
findViewById(R.id.btn_blur_misc).setOnClickListener(new StartActivityListener(this,5));
findViewById(R.id.btn_navdrawer).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainMenuActivity.this,NavigationDrawerActivity.class));
}
});

findViewById(R.id.btn_clear_cache).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Dali.resetAndSetNewConfig(MainMenuActivity.this,new Dali.Config());
Dali.setDebugMode(true);
}
});
findViewById(R.id.btn_blur1).setOnClickListener(new StartActivityListener(this, 0));
findViewById(R.id.btn_liveblur1).setOnClickListener(new StartActivityListener(this, 1));
findViewById(R.id.btn_animation1).setOnClickListener(new StartActivityListener(this, 2));
findViewById(R.id.btn_viewblur).setOnClickListener(new StartActivityListener(this, 3));
findViewById(R.id.btn_blur2).setOnClickListener(new StartActivityListener(this, 4));
findViewById(R.id.btn_blur_misc).setOnClickListener(new StartActivityListener(this, 5));
findViewById(R.id.btn_navdrawer).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainMenuActivity.this, NavigationDrawerActivity.class));
}
});

findViewById(R.id.btn_clear_cache).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Dali.resetAndSetNewConfig(MainMenuActivity.this, new Dali.Config());
Dali.setDebugMode(true);
}
});

control = Hood.ext().registerShakeToOpenDebugActivity(getApplicationContext(),
DebugActivity.createIntent(this, DebugActivity.class));
}

@Override
protected void onResume() {
super.onResume();
control.start();
}

private static class StartActivityListener implements View.OnClickListener {
private int fragmentId;
private Activity activity;

private StartActivityListener(Activity ctx, int fragmentId) {
this.fragmentId = fragmentId;
this.activity = ctx;
}

@Override
public void onClick(View view) {
Intent i = new Intent(activity, GenericActivity.class);
i.putExtra(GenericActivity.FRAGMENT_ID,fragmentId);
activity.startActivity(i);
}
}
@Override
protected void onPause() {
super.onPause();
control.stop();
}

private static class StartActivityListener implements View.OnClickListener {
private int fragmentId;
private Activity activity;

private StartActivityListener(Activity ctx, int fragmentId) {
this.fragmentId = fragmentId;
this.activity = ctx;
}

@Override
public void onClick(View view) {
Intent i = new Intent(activity, GenericActivity.class);
i.putExtra(GenericActivity.FRAGMENT_ID, fragmentId);
activity.startActivity(i);
}
}
}
21 changes: 3 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,16 @@ easily extended and pretty every configuration can be changed.

*Note: This library is in prototype state and not ready for prime time. It is mostly feature complete (except for the animation module) although bugs are to be expected.*

# Usage
# Install

Add the lib as gradle dependency either by using the provided `.aar` file (see releases)
[as local dependency](http://stackoverflow.com/questions/24506648/adding-local-aar-files-to-gradle-build-using-flatdirs-is-not-working)
or use the maven dependency:
Add the following to your dependencies ([add jcenter to your repositories](https://developer.android.com/studio/build/index.html#top-level) if you haven't)

```gradle
dependencies {
compile 'at.favre.lib:dali:0.2'
compile 'at.favre.lib:dali:0.3.0'
}
```

Currently the lib is not on jcenter or maven central yet, therefore you need to add my maven repo in your root build.gradle:

```gradle
allprojects {
repositories {
jcenter()
maven {
url 'https://dl.bintray.com/patrickfav/maven/'
}
}
}
```

Then add the following to your app's build.gradle to get Renderscript to work

```gradle
Expand Down
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ plugins {
allprojects {
repositories {
jcenter()
maven {
url 'https://dl.bintray.com/patrickfav/maven/'
}
}
}

Expand Down
27 changes: 1 addition & 26 deletions dali/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
apply plugin: 'com.android.library'

ext {
bintrayRepo = 'maven'
bintrayName = 'dali'

publishedGroupId = 'at.favre.lib'
libraryName = 'Dali'
artifact = 'dali'

libraryDescription = 'Dali is an image blur library for Android. It is easy to use, fast and extensible. Dali contains several modules for either static blurring, live blurring and animations.'

siteUrl = 'https://github.com/patrickfav/Dali'
gitUrl = 'https://github.com/patrickfav/Dali.git'

libraryVersion = rootProject.ext.versionName

developerId = 'patrickfav'
developerName = 'Patrick Favre-Bulle'
developerEmail = 'patrick.favrebulle@gmail.com'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

def Properties localProps = getSigningProperties()

android {
Expand Down Expand Up @@ -69,5 +45,4 @@ dependencies {
compile 'com.android.support:recyclerview-v7:25.1.0'
}

//apply from: '../gradle/install.gradle'
//apply from: '../gradle/publish.gradle'
apply from: "$rootDir/publish.gradle"
42 changes: 0 additions & 42 deletions gradle/install.gradle

This file was deleted.

Loading

0 comments on commit c545195

Please sign in to comment.