Skip to content

Commit

Permalink
- update build.gradle.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mycoola committed Sep 25, 2018
1 parent 1a3a8fc commit 9b18ba2
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 29 deletions.
13 changes: 6 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ android {
}

dependencies {
def room_version = "1.1.1"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':liband')
implementation 'com.android.support:support-v4:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
testImplementation "android.arch.persistence.room:testing:$room_version"
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
testImplementation "android.arch.persistence.room:testing:1.1.1"
}
repositories {
mavenCentral()
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.libandexample">

<uses-permission-sdk-23 android:name="android.permission.CAMERA" />
<uses-permission-sdk-23 android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name="com.liband.App"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:fullBackupContent="@xml/backup_descriptor">
<activity android:name=".MainActivity">
android:theme="@style/AppTheme">
<activity android:name=".Main2Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

</manifest>
45 changes: 45 additions & 0 deletions app/src/main/java/com/libandexample/Main2Activity.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,62 @@
package com.libandexample;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.liband.utils.Utils;

import java.io.File;

public class Main2Activity extends AppCompatActivity {
ImageView imageView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);

Button button = findViewById(R.id.button);
imageView = findViewById(R.id.imageView);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent("com.intsig.camscanner.ACTION_SCAN");
// Or content uri picked from gallery

Uri uri = Uri.fromFile(new File(Environment.getExternalStorageDirectory().getPath() + "/source.jpg"));
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.putExtra("scanned_image", Environment.getExternalStorageDirectory().getPath() + "/source.jpg");
// intent.putExtra("pdf_path", Environment.getExternalStorageDirectory().getPath() + "/source.jpg");
// intent.putExtra("org_image", Environment.getExternalStorageDirectory().getPath() + "/source.jpg");
startActivityForResult(intent, 100);
}
});
}

@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 100) {
int responseCode = data.getIntExtra("RESULT_OK", -1);
if (requestCode == Activity.RESULT_OK) {
Bitmap imageBitmap = (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(imageBitmap);
} else if (resultCode == Activity.RESULT_FIRST_USER) {
// Fail
} else if (resultCode == Activity.RESULT_CANCELED) {
// User canceled
}
}
}
}
16 changes: 15 additions & 1 deletion app/src/main/res/layout/activity_main2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<Button
android:id="@+id/button"
android:layout_width="142dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
Expand All @@ -17,4 +17,18 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button"
app:srcCompat="@drawable/empty_image" />
</android.support.constraint.ConstraintLayout>
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.61'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jun 18 23:26:57 EET 2018
#Tue Sep 25 16:54:41 EET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
21 changes: 10 additions & 11 deletions liband/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ android {
}

dependencies {
def room_version = "1.1.1"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-v4:28.0.0-rc02'
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-vector-drawable:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand All @@ -40,12 +39,12 @@ dependencies {
implementation 'com.squareup.okhttp:okhttp:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.61"
implementation 'com.intuit.ssp:ssp-android:1.0.5'
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
testImplementation "android.arch.persistence.room:testing:$room_version"
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
testImplementation "android.arch.persistence.room:testing:1.1.1"
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
}
Expand Down

0 comments on commit 9b18ba2

Please sign in to comment.