Skip to content
This repository was archived by the owner on Jul 27, 2019. It is now read-only.

Commit c2e5569

Browse files
committed
Merge pull request #7 from CreativeSDK/ash/image-editor
Ash/image editor
2 parents 6a6377a + 9757649 commit c2e5569

File tree

31 files changed

+724
-0
lines changed

31 files changed

+724
-0
lines changed

image-editor-ui/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea
5+
.DS_Store
6+
/build
7+
/captures
8+
9+
app/src/main/java/com/adobe/imageeditorui/Keys.java

image-editor-ui/app/.gitignore

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

image-editor-ui/app/build.gradle

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apply plugin: 'com.android.application'
2+
3+
/* 1) Apply the Gradle Retrolambda Plugin */
4+
apply plugin: 'me.tatarka.retrolambda'
5+
6+
android {
7+
compileSdkVersion 23
8+
buildToolsVersion "23.0.2"
9+
10+
defaultConfig {
11+
applicationId "com.adobe.imageeditorui"
12+
minSdkVersion 16 // Minimum is 16
13+
targetSdkVersion 23
14+
versionCode 1
15+
versionName "1.0"
16+
}
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
24+
/* 2) Compile for Java 1.8 or greater */
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
}
29+
30+
/* 3) Exclude duplicate licenses */
31+
packagingOptions {
32+
exclude 'META-INF/LICENSE.txt'
33+
exclude 'META-INF/LICENSE'
34+
exclude 'META-INF/NOTICE.txt'
35+
exclude 'META-INF/NOTICE'
36+
exclude 'META-INF/DEPENDENCIES'
37+
pickFirst 'AndroidManifest.xml'
38+
}
39+
}
40+
41+
dependencies {
42+
compile fileTree(dir: 'libs', include: ['*.jar'])
43+
testCompile 'junit:junit:4.12'
44+
compile 'com.android.support:appcompat-v7:23.1.1'
45+
compile 'com.android.support:design:23.1.1'
46+
47+
/* 4) Add the CSDK framework dependencies (Make sure these version numbers are correct) */
48+
compile 'com.adobe.creativesdk.foundation:auth:0.9.7'
49+
compile 'com.adobe.creativesdk:image:4.4.8'
50+
}
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/arnwine/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.adobe.imageeditorui;
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+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.adobe.imageeditorui">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme"
11+
android:name=".MainApplication">
12+
<activity
13+
android:name=".MainActivity"
14+
android:label="@string/app_name"
15+
android:theme="@style/AppTheme.NoActionBar">
16+
<intent-filter>
17+
<action android:name="android.intent.action.MAIN" />
18+
19+
<category android:name="android.intent.category.LAUNCHER" />
20+
</intent-filter>
21+
</activity>
22+
23+
<provider
24+
android:name="com.adobe.creativesdk.aviary.internal.cds.CdsProvider"
25+
android:authorities="${applicationId}.CdsProvider"
26+
android:exported="false" />
27+
28+
</application>
29+
30+
</manifest>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package com.adobe.imageeditorui;
2+
3+
import android.content.Intent;
4+
import android.net.Uri;
5+
import android.os.Bundle;
6+
import android.support.design.widget.FloatingActionButton;
7+
import android.support.design.widget.Snackbar;
8+
import android.support.v7.app.AppCompatActivity;
9+
import android.support.v7.widget.Toolbar;
10+
import android.view.Menu;
11+
import android.view.MenuItem;
12+
import android.view.View;
13+
import android.widget.ImageView;
14+
15+
import com.adobe.creativesdk.aviary.AdobeImageIntent;
16+
17+
public class MainActivity extends AppCompatActivity {
18+
19+
private ImageView mEditedImageView;
20+
21+
@Override
22+
protected void onCreate(Bundle savedInstanceState) {
23+
super.onCreate(savedInstanceState);
24+
setContentView(R.layout.activity_main);
25+
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
26+
setSupportActionBar(toolbar);
27+
28+
mEditedImageView = (ImageView) findViewById(R.id.editedImageView);
29+
30+
/* 1) Make a new Uri object (Replace this with a real image on your device) */
31+
Uri imageUri = Uri.parse("content://media/external/images/media/1248");
32+
33+
/* 2) Create a new Intent */
34+
Intent imageEditorIntent = new AdobeImageIntent.Builder(this)
35+
.setData(imageUri)
36+
.build();
37+
38+
/* 3) Start the Image Editor with request code 1 */
39+
startActivityForResult(imageEditorIntent, 1);
40+
41+
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
42+
fab.setOnClickListener(new View.OnClickListener() {
43+
@Override
44+
public void onClick(View view) {
45+
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
46+
.setAction("Action", null).show();
47+
}
48+
});
49+
}
50+
51+
/* Handle the results */
52+
@Override
53+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
54+
if (resultCode == RESULT_OK) {
55+
switch (requestCode) {
56+
57+
/* Make a case for the request code we passed to startActivityForResult() */
58+
case 1:
59+
60+
/* Show the image! */
61+
Uri editedImageUri = data.getData();
62+
mEditedImageView.setImageURI(editedImageUri);
63+
64+
break;
65+
}
66+
}
67+
}
68+
69+
70+
@Override
71+
public boolean onCreateOptionsMenu(Menu menu) {
72+
// Inflate the menu; this adds items to the action bar if it is present.
73+
getMenuInflater().inflate(R.menu.menu_main, menu);
74+
return true;
75+
}
76+
77+
@Override
78+
public boolean onOptionsItemSelected(MenuItem item) {
79+
// Handle action bar item clicks here. The action bar will
80+
// automatically handle clicks on the Home/Up button, so long
81+
// as you specify a parent activity in AndroidManifest.xml.
82+
int id = item.getItemId();
83+
84+
//noinspection SimplifiableIfStatement
85+
if (id == R.id.action_settings) {
86+
return true;
87+
}
88+
89+
return super.onOptionsItemSelected(item);
90+
}
91+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.adobe.imageeditorui;
2+
3+
import android.app.Application;
4+
5+
import com.adobe.creativesdk.aviary.IAviaryClientCredentials;
6+
import com.adobe.creativesdk.foundation.AdobeCSDKFoundation;
7+
8+
/**
9+
* Created by ash on 3/11/16.
10+
*/
11+
public class MainApplication extends Application implements IAviaryClientCredentials {
12+
13+
/* Be sure to fill in the two strings below. */
14+
private static final String CREATIVE_SDK_CLIENT_ID = Keys.CSDK_CLIENT_ID;
15+
private static final String CREATIVE_SDK_CLIENT_SECRET = Keys.CSDK_CLIENT_SECRET;
16+
17+
@Override
18+
public void onCreate() {
19+
super.onCreate();
20+
AdobeCSDKFoundation.initializeCSDKFoundation(getApplicationContext());
21+
}
22+
23+
@Override
24+
public String getClientID() {
25+
return CREATIVE_SDK_CLIENT_ID;
26+
}
27+
28+
@Override
29+
public String getClientSecret() {
30+
return CREATIVE_SDK_CLIENT_SECRET;
31+
}
32+
33+
@Override
34+
public String getBillingKey() {
35+
return ""; // Leave this blank
36+
}
37+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:fitsSystemWindows="true"
8+
tools:context="com.adobe.imageeditorui.MainActivity">
9+
10+
<android.support.design.widget.AppBarLayout
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content"
13+
android:theme="@style/AppTheme.AppBarOverlay">
14+
15+
<android.support.v7.widget.Toolbar
16+
android:id="@+id/toolbar"
17+
android:layout_width="match_parent"
18+
android:layout_height="?attr/actionBarSize"
19+
android:background="?attr/colorPrimary"
20+
app:popupTheme="@style/AppTheme.PopupOverlay" />
21+
22+
</android.support.design.widget.AppBarLayout>
23+
24+
<include layout="@layout/content_main" />
25+
26+
<android.support.design.widget.FloatingActionButton
27+
android:id="@+id/fab"
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content"
30+
android:layout_gravity="bottom|end"
31+
android:layout_margin="@dimen/fab_margin"
32+
android:src="@android:drawable/ic_dialog_email" />
33+
34+
</android.support.design.widget.CoordinatorLayout>
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+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:paddingBottom="@dimen/activity_vertical_margin"
8+
android:paddingLeft="@dimen/activity_horizontal_margin"
9+
android:paddingRight="@dimen/activity_horizontal_margin"
10+
android:paddingTop="@dimen/activity_vertical_margin"
11+
app:layout_behavior="@string/appbar_scrolling_view_behavior"
12+
tools:context="com.adobe.imageeditorui.MainActivity"
13+
tools:showIn="@layout/activity_main">
14+
15+
<ImageView
16+
android:layout_width="match_parent"
17+
android:layout_height="wrap_content"
18+
android:id="@+id/editedImageView"
19+
android:adjustViewBounds="true"
20+
android:layout_centerHorizontal="true"
21+
android:layout_centerVertical="true"/>
22+
23+
</RelativeLayout>

0 commit comments

Comments
 (0)