-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
85 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters