├── .gitignore ├── .idea ├── encodings.xml ├── gradle.xml ├── misc.xml └── runConfigurations.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ayusma │ │ └── textrecognition │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ayusma │ │ │ └── textrecognition │ │ │ ├── Adapter │ │ │ └── RecyclerViewAdapter.java │ │ │ ├── CameraActivity.java │ │ │ ├── Helper │ │ │ ├── SQLiteDatabaseHelper.java │ │ │ ├── Saver.java │ │ │ └── SharedHelper.java │ │ │ ├── MainActivity.java │ │ │ ├── Operation.java │ │ │ └── TextActivity.java │ └── res │ │ ├── anim │ │ ├── push_left_in.xml │ │ └── push_left_out.xml │ │ ├── drawable-hdpi │ │ ├── delete.png │ │ ├── export.png │ │ ├── icon_camera.png │ │ ├── icon_capture.png │ │ └── icon_gallery.png │ │ ├── drawable-mdpi │ │ ├── delete.png │ │ ├── export.png │ │ ├── icon_camera.png │ │ ├── icon_capture.png │ │ └── icon_gallery.png │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xhdpi │ │ ├── delete.png │ │ ├── export.png │ │ ├── icon_camera.png │ │ ├── icon_capture.png │ │ └── icon_gallery.png │ │ ├── drawable-xxhdpi │ │ ├── delete.png │ │ ├── export.png │ │ ├── icon_camera.png │ │ ├── icon_capture.png │ │ └── icon_gallery.png │ │ ├── drawable-xxxhdpi │ │ ├── delete.png │ │ ├── export.png │ │ ├── icon_camera.png │ │ ├── icon_capture.png │ │ └── icon_gallery.png │ │ ├── drawable │ │ ├── ic_content_copy_colour_24dp.xml │ │ ├── ic_content_copy_white_24dp.xml │ │ ├── ic_flash_auto_white_24dp.xml │ │ ├── ic_flash_off_white_24dp.xml │ │ ├── ic_flash_on_white_24dp.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_save_grey_24dp.xml │ │ ├── ic_save_white_24dp.xml │ │ ├── ic_share_colour_24dp.xml │ │ ├── ic_share_white_24dp.xml │ │ ├── ripple_effect.xml │ │ └── ripple_effect_background.xml │ │ ├── layout │ │ ├── activity_camera.xml │ │ ├── activity_main.xml │ │ ├── activity_text.xml │ │ ├── loading_dialoag.xml │ │ └── recyclerview_item.xml │ │ ├── menu │ │ ├── text_activity_menu.xml │ │ └── text_activity_menu_preview.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── ayusma │ └── textrecognition │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Wojuola Ayotola 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TextRecognition 2 | This is an android app that make use of the Firebase ML Kit 3 | 4 | You can select an image from gallery or capture a new image to scan. With this app you can save the recognized text to the databse to access later,you can also copy the recognized text to the clipboard, share the recognized text, and also export the text as a .txt format to your documents folder 5 | 6 | ## Sdk Requirements 7 | * Minimum SDK Requirement - android API 21 (Lollipop) 8 | * Target SDK - android API 28 (Pie) 9 | 10 | 11 | ## Installation 12 | Clone this repository and import into android studio 13 | 14 | `git clone https://github.com/AyusmaTech/TextRecognition.git` 15 | 16 | 17 | ## Screenshots 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ## Gif 27 | 28 | 29 | 30 | 31 | 32 | ## Third-Party Dependencies 33 | 34 | [CameraKit](https://github.com/CameraKit/camerakit-android "CameraKit") 35 | 36 | [MediaPicker](https://github.com/alhazmy13/MediaPicker "MediaPicker") 37 | 38 | [ML Kit for Firebase](https://github.com/firebase/quickstart-android/tree/master/mlkit "ML Kit for Firebase") 39 | 40 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.ayusma.textrecognition" 7 | minSdkVersion 21 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(dir: 'libs', include: ['*.jar']) 23 | implementation 'androidx.appcompat:appcompat:1.0.2' 24 | implementation 'com.google.android.material:material:1.0.0' 25 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 26 | implementation 'com.google.firebase:firebase-core:17.0.0' 27 | implementation 'com.google.firebase:firebase-ml-vision:22.0.0' 28 | implementation 'com.camerakit:camerakit:1.0.0-beta3.10' 29 | implementation 'com.camerakit:jpegkit:0.1.0' 30 | implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0' 31 | implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0' 32 | implementation 'net.alhazmy13.MediaPicker:libary:2.4.4' 33 | 34 | testImplementation 'junit:junit:4.12' 35 | androidTestImplementation 'androidx.test:runner:1.1.0' 36 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 37 | } 38 | 39 | apply plugin: 'com.google.gms.google-services' 40 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -dontwarn com.google.android.gms.** 24 | -keepclasseswithmembers class com.camerakit.preview.CameraSurfaceView { 25 | native ; 26 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/ayusma/textrecognition/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition; 2 | 3 | import android.content.Context; 4 | import androidx.test.InstrumentationRegistry; 5 | import androidx.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.ayusma.textrecognition", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/ayusma/textrecognition/Adapter/RecyclerViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition.Adapter; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.DialogInterface; 6 | import android.content.Intent; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | 13 | import androidx.appcompat.app.AlertDialog; 14 | import androidx.recyclerview.widget.RecyclerView; 15 | 16 | import com.ayusma.textrecognition.Helper.Saver; 17 | import com.ayusma.textrecognition.Operation; 18 | import com.ayusma.textrecognition.R; 19 | import com.ayusma.textrecognition.TextActivity; 20 | import com.google.android.material.card.MaterialCardView; 21 | 22 | import org.jetbrains.annotations.NotNull; 23 | 24 | import java.util.List; 25 | 26 | public class RecyclerViewAdapter extends RecyclerView.Adapter { 27 | 28 | private List mData; 29 | private Operation operation; 30 | private Context mContext; 31 | 32 | public RecyclerViewAdapter(List data) { 33 | this.mData = data; 34 | 35 | } 36 | 37 | @NotNull 38 | @Override 39 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 40 | mContext = parent.getContext(); 41 | operation = new Operation(mContext); 42 | LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); 43 | View listItem = layoutInflater.inflate(R.layout.recyclerview_item, parent, false); 44 | return new ViewHolder(listItem); 45 | } 46 | 47 | @Override 48 | public void onBindViewHolder(final ViewHolder holder, final int position) { 49 | final String myListData = mData.get(position).getText(); 50 | holder.preview_text.setText(mData.get(position).getText()); 51 | holder.preview_id.setText(String.valueOf(mData.get(position).getId())); 52 | holder.cardView.setOnClickListener(new View.OnClickListener() { 53 | @Override 54 | public void onClick(View view) { 55 | String text = operation.getSavedText(position + 1); 56 | Intent intent = new Intent(mContext, TextActivity.class); 57 | intent.putExtra("Text", text); 58 | mContext.startActivity(intent); 59 | Activity activity = (Activity)mContext; 60 | activity.overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); 61 | 62 | 63 | } 64 | }); 65 | 66 | holder.copy.setOnClickListener(new View.OnClickListener() { 67 | @Override 68 | public void onClick(View view) { 69 | String text = operation.getSavedText(position + 1); 70 | operation.copy(text); 71 | } 72 | }); 73 | 74 | holder.share.setOnClickListener(new View.OnClickListener() { 75 | @Override 76 | public void onClick(View view) { 77 | String text = operation.getSavedText(position + 1); 78 | operation.share(text); 79 | } 80 | }); 81 | 82 | holder.export.setOnClickListener(new View.OnClickListener() { 83 | @Override 84 | public void onClick(View view) { 85 | final AlertDialog.Builder builder = new AlertDialog.Builder(mContext); 86 | builder.setTitle(R.string.txt_export); 87 | builder.setMessage(R.string.export_confirmation); 88 | 89 | builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { 90 | @Override 91 | public void onClick(DialogInterface dialogInterface, int i) { 92 | String text = operation.getSavedText(position + 1); 93 | operation.export(text, position + 1); 94 | } 95 | }).setNegativeButton(R.string.no,null).show(); 96 | 97 | 98 | } 99 | }); 100 | 101 | holder.delete.setOnClickListener(new View.OnClickListener() { 102 | @Override 103 | public void onClick(View view) { 104 | final AlertDialog.Builder builder = new AlertDialog.Builder(mContext); 105 | builder.setTitle(R.string.delete); 106 | builder.setMessage(R.string.delete_confirmation); 107 | 108 | builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { 109 | @Override 110 | public void onClick(DialogInterface dialogInterface, int i) { 111 | operation.delete(mData.get(position)); 112 | mData.remove(position); 113 | notifyItemRemoved(position); 114 | notifyItemRangeChanged(position,mData.size()); 115 | } 116 | }).setNegativeButton(R.string.no,null).show(); 117 | 118 | 119 | 120 | } 121 | }); 122 | 123 | 124 | } 125 | 126 | 127 | 128 | 129 | @Override 130 | public int getItemCount() { 131 | return mData.size(); 132 | } 133 | 134 | public static class ViewHolder extends RecyclerView.ViewHolder { 135 | public TextView preview_id, preview_text; 136 | public MaterialCardView cardView; 137 | public ImageView copy, export, share, delete; 138 | 139 | 140 | public ViewHolder(View itemView) { 141 | super(itemView); 142 | this.preview_text = itemView.findViewById(R.id.preview_text); 143 | this.preview_id = itemView.findViewById(R.id.preview_id); 144 | this.cardView = itemView.findViewById(R.id.card_view); 145 | this.copy = itemView.findViewById(R.id.icon_copy); 146 | this.delete = itemView.findViewById(R.id.icon_delete); 147 | this.export = itemView.findViewById(R.id.icon_export); 148 | this.share = itemView.findViewById(R.id.icon_share); 149 | 150 | 151 | } 152 | 153 | 154 | } 155 | 156 | 157 | } 158 | 159 | -------------------------------------------------------------------------------- /app/src/main/java/com/ayusma/textrecognition/CameraActivity.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.appcompat.app.AlertDialog; 5 | import androidx.appcompat.app.AppCompatActivity; 6 | 7 | import android.content.Context; 8 | import android.content.DialogInterface; 9 | import android.content.Intent; 10 | import android.content.pm.PackageManager; 11 | import android.graphics.Bitmap; 12 | import android.graphics.BitmapFactory; 13 | import android.media.AudioManager; 14 | import android.media.MediaActionSound; 15 | import android.os.Bundle; 16 | import android.view.View; 17 | import android.view.WindowManager; 18 | import android.widget.ImageView; 19 | import android.widget.Toast; 20 | 21 | import com.ayusma.textrecognition.Helper.SharedHelper; 22 | import com.camerakit.CameraKit; 23 | import com.camerakit.CameraKitView; 24 | import com.google.android.gms.tasks.OnFailureListener; 25 | import com.google.android.gms.tasks.OnSuccessListener; 26 | import com.google.android.material.floatingactionbutton.FloatingActionButton; 27 | import com.google.firebase.ml.vision.FirebaseVision; 28 | import com.google.firebase.ml.vision.common.FirebaseVisionImage; 29 | import com.google.firebase.ml.vision.document.FirebaseVisionDocumentText; 30 | import com.google.firebase.ml.vision.document.FirebaseVisionDocumentTextRecognizer; 31 | 32 | import java.util.Objects; 33 | 34 | public class CameraActivity extends AppCompatActivity implements View.OnClickListener { 35 | private CameraKitView cameraKitView; 36 | private ImageView btn_capture, btn_flashlight; 37 | private String flashMode = ""; 38 | private AlertDialog dialog; 39 | private Context mContext; 40 | 41 | 42 | @Override 43 | protected void onCreate(Bundle savedInstanceState) { 44 | super.onCreate(savedInstanceState); 45 | setContentView(R.layout.activity_camera); 46 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 47 | WindowManager.LayoutParams.FLAG_FULLSCREEN); 48 | Objects.requireNonNull(getSupportActionBar()).hide(); 49 | mContext = this; 50 | 51 | cameraKitView = findViewById(R.id.camera); 52 | btn_capture = findViewById(R.id.btn_capture); 53 | btn_flashlight = findViewById(R.id.btn_flashlight); 54 | cameraKitView.requestPermissions(this); 55 | 56 | 57 | flashMode = SharedHelper.getKey(this, "flashMode"); 58 | 59 | if (flashMode.isEmpty() || flashMode.equals("off")) { 60 | flashMode = "off"; 61 | flash("off"); 62 | } 63 | 64 | flash(flashMode); 65 | 66 | btn_flashlight.setOnClickListener(this); 67 | btn_capture.setOnClickListener(this); 68 | 69 | 70 | AlertDialog.Builder builder = new AlertDialog.Builder(this); 71 | builder.setCancelable(false); 72 | builder.setTitle(R.string.processing); 73 | builder.setView(R.layout.loading_dialoag); 74 | dialog = builder.create(); 75 | 76 | 77 | } 78 | 79 | 80 | public void flash(String mode) { 81 | switch (mode) { 82 | case "off": 83 | cameraKitView.setFlash(CameraKit.FLASH_OFF); 84 | btn_flashlight.setImageDrawable(getDrawable(R.drawable.ic_flash_off_white_24dp)); 85 | break; 86 | case "on": 87 | cameraKitView.setFlash(CameraKit.FLASH_ON); 88 | btn_flashlight.setImageDrawable(getDrawable(R.drawable.ic_flash_on_white_24dp)); 89 | break; 90 | case "auto": 91 | cameraKitView.setFlash(CameraKit.FLASH_AUTO); 92 | btn_flashlight.setImageDrawable(getDrawable(R.drawable.ic_flash_auto_white_24dp)); 93 | break; 94 | } 95 | 96 | } 97 | 98 | 99 | @Override 100 | protected void onStart() { 101 | super.onStart(); 102 | cameraKitView.onStart(); 103 | } 104 | 105 | @Override 106 | protected void onResume() { 107 | super.onResume(); 108 | cameraKitView.onResume(); 109 | } 110 | 111 | @Override 112 | protected void onPause() { 113 | cameraKitView.onPause(); 114 | super.onPause(); 115 | } 116 | 117 | @Override 118 | protected void onStop() { 119 | cameraKitView.onStop(); 120 | super.onStop(); 121 | } 122 | 123 | @Override 124 | public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { 125 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); 126 | if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_DENIED) { 127 | Toast.makeText(this, "You must allow permission to use the camera", Toast.LENGTH_SHORT).show(); 128 | finish(); 129 | } 130 | 131 | cameraKitView.onRequestPermissionsResult(requestCode, permissions, grantResults); 132 | } 133 | 134 | 135 | @Override 136 | public void onClick(View view) { 137 | if (view == btn_capture) { 138 | cameraKitView.captureImage(new CameraKitView.ImageCallback() { 139 | @Override 140 | public void onImage(CameraKitView cameraKitView, final byte[] capturedImage) { 141 | // capturedImage contains the image from the CameraKitView. 142 | captureSound(); 143 | BitmapFactory.Options opts = new BitmapFactory.Options(); 144 | Bitmap bitmap = BitmapFactory.decodeByteArray(capturedImage, 0, capturedImage.length, opts); 145 | FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap); 146 | imageProcessor(image); 147 | dialog.show(); 148 | cameraKitView.onStop(); 149 | 150 | 151 | } 152 | }); 153 | 154 | } else if (view == btn_flashlight) { 155 | switch (flashMode) { 156 | case "off": 157 | flashMode = "on"; 158 | flash("on"); 159 | SharedHelper.putKey(this, "flashMode", "on"); 160 | break; 161 | case "on": 162 | flashMode = "auto"; 163 | flash("auto"); 164 | SharedHelper.putKey(this, "flashMode", "auto"); 165 | break; 166 | case "auto": 167 | flashMode = "off"; 168 | flash("off"); 169 | SharedHelper.putKey(this, "flashMode", "off"); 170 | break; 171 | } 172 | 173 | 174 | } 175 | } 176 | 177 | public void imageProcessor(FirebaseVisionImage image) { 178 | FirebaseVisionDocumentTextRecognizer detector = FirebaseVision.getInstance() 179 | .getCloudDocumentTextRecognizer(); 180 | 181 | detector.processImage(image) 182 | .addOnSuccessListener(new OnSuccessListener() { 183 | @Override 184 | public void onSuccess(FirebaseVisionDocumentText result) { 185 | dialog.dismiss(); 186 | Intent intent = new Intent(CameraActivity.this, TextActivity.class); 187 | intent.putExtra("result", result.getText()); 188 | startActivity(intent); 189 | overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); 190 | finish(); 191 | 192 | } 193 | }) 194 | .addOnFailureListener(new OnFailureListener() { 195 | @Override 196 | public void onFailure(@NonNull Exception e) { 197 | dialog.dismiss(); 198 | AlertDialog.Builder builder = new AlertDialog.Builder(mContext); 199 | builder.setTitle("Processing Failed"); 200 | builder.setMessage(e.getLocalizedMessage()); 201 | 202 | builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { 203 | @Override 204 | public void onClick(DialogInterface dialogInterface, int i) { 205 | cameraKitView.onStart(); 206 | cameraKitView.onResume(); 207 | } 208 | }).show(); 209 | } 210 | }); 211 | 212 | } 213 | 214 | public void captureSound(){ 215 | AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE); 216 | switch( audio.getRingerMode() ){ 217 | case AudioManager.RINGER_MODE_NORMAL: 218 | MediaActionSound sound = new MediaActionSound(); 219 | sound.play(MediaActionSound.SHUTTER_CLICK); 220 | break; 221 | case AudioManager.RINGER_MODE_SILENT: 222 | break; 223 | case AudioManager.RINGER_MODE_VIBRATE: 224 | break; 225 | } 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /app/src/main/java/com/ayusma/textrecognition/Helper/SQLiteDatabaseHelper.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition.Helper; 2 | 3 | import android.content.ContentValues; 4 | import android.content.Context; 5 | import android.database.Cursor; 6 | import android.database.sqlite.SQLiteDatabase; 7 | import android.database.sqlite.SQLiteOpenHelper; 8 | 9 | import java.util.LinkedList; 10 | import java.util.List; 11 | import java.util.Objects; 12 | 13 | public class SQLiteDatabaseHelper extends SQLiteOpenHelper { 14 | private static final int DATABASE_VERSION = 1; 15 | private static final String DATABASE_NAME = "RecognizedTextDB"; 16 | private static final String TABLE_NAME = "SavedText"; 17 | private static final String KEY_ID = "id"; 18 | private static final String KEY_TEXT = "text"; 19 | private static final String[] COLUMNS = {KEY_ID, KEY_TEXT}; 20 | 21 | public SQLiteDatabaseHelper(Context context) { 22 | super(context, DATABASE_NAME, null, DATABASE_VERSION); 23 | } 24 | 25 | 26 | @Override 27 | public void onCreate(SQLiteDatabase db) { 28 | db.execSQL("CREATE TABLE " + TABLE_NAME + " (" 29 | + KEY_ID +" INTEGER primary key , " 30 | + KEY_TEXT +" TEXT);"); 31 | 32 | } 33 | 34 | @Override 35 | public void onUpgrade(SQLiteDatabase db, int i, int i1) { 36 | db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); 37 | this.onCreate(db); 38 | 39 | } 40 | 41 | public void delete(Saver saver) { 42 | // Get reference to writable DB 43 | SQLiteDatabase db = this.getWritableDatabase(); 44 | db.delete(TABLE_NAME, "id = ?", new String[]{String.valueOf(saver.getId())}); 45 | db.close(); 46 | } 47 | 48 | public Saver getSavedText(int id) { 49 | SQLiteDatabase db = this.getReadableDatabase(); 50 | Cursor cursor = db.query(TABLE_NAME, // a. table 51 | COLUMNS, // b. column names 52 | " id = ?", // c. selections 53 | new String[]{String.valueOf(id)}, // d. selections args 54 | null, // e. group by 55 | null, // f. having 56 | null, // g. order by 57 | null); // h. limit 58 | 59 | if (cursor != null) 60 | cursor.moveToFirst(); 61 | 62 | Saver saver = new Saver(); 63 | saver.setId(Integer.parseInt(Objects.requireNonNull(cursor).getString(0))); 64 | saver.setText(cursor.getString(1)); 65 | 66 | 67 | return saver; 68 | } 69 | 70 | public List getAllSavedText() { 71 | 72 | List saver = new LinkedList(); 73 | String query = "SELECT * FROM " + TABLE_NAME; 74 | SQLiteDatabase db = this.getWritableDatabase(); 75 | Cursor cursor = db.rawQuery(query, null); 76 | Saver saved = null; 77 | 78 | if (cursor.moveToFirst()) { 79 | do { 80 | saved = new Saver(); 81 | saved.setId(Integer.parseInt(cursor.getString(0))); 82 | saved.setText(cursor.getString(1)); 83 | saver.add(saved); 84 | } while (cursor.moveToNext()); 85 | } 86 | 87 | return saver; 88 | } 89 | 90 | public void addText(String text) { 91 | SQLiteDatabase db = this.getWritableDatabase(); 92 | ContentValues values = new ContentValues(); 93 | values.put(KEY_TEXT, text); 94 | // insert 95 | db.insert(TABLE_NAME, null, values); 96 | db.close(); 97 | 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /app/src/main/java/com/ayusma/textrecognition/Helper/Saver.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition.Helper; 2 | 3 | public class Saver { 4 | 5 | public Saver() { 6 | } 7 | 8 | 9 | public Saver(int id, String text) { 10 | this.id = id; 11 | this.text = text; 12 | } 13 | 14 | public int getId() { 15 | return id; 16 | } 17 | 18 | public String getText() { 19 | return text; 20 | } 21 | 22 | private int id; 23 | private String text; 24 | 25 | 26 | public void setId(int id) { 27 | this.id = id; 28 | } 29 | 30 | public void setText(String text) { 31 | this.text = text; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/ayusma/textrecognition/Helper/SharedHelper.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition.Helper; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | public class SharedHelper { 7 | 8 | public static SharedPreferences sharedPreferences; 9 | public static SharedPreferences.Editor editor; 10 | 11 | public static void putKey(Context context, String Key, String Value) { 12 | sharedPreferences = context.getSharedPreferences("Cache", Context.MODE_PRIVATE); 13 | editor = sharedPreferences.edit(); 14 | editor.putString(Key, Value); 15 | editor.apply(); 16 | 17 | } 18 | 19 | public static String getKey(Context contextGetKey, String Key) { 20 | sharedPreferences = contextGetKey.getSharedPreferences("Cache", Context.MODE_PRIVATE); 21 | String Value = sharedPreferences.getString(Key, ""); 22 | return Value; 23 | 24 | } 25 | 26 | public static void clearSharedPreferences(Context context) 27 | { 28 | sharedPreferences = context.getSharedPreferences("Cache", Context.MODE_PRIVATE); 29 | sharedPreferences.edit().clear().apply(); 30 | } 31 | 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/ayusma/textrecognition/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | import androidx.appcompat.app.AlertDialog; 6 | import androidx.appcompat.app.AppCompatActivity; 7 | import androidx.recyclerview.widget.LinearLayoutManager; 8 | import androidx.recyclerview.widget.RecyclerView; 9 | 10 | import android.content.Context; 11 | import android.content.DialogInterface; 12 | import android.content.Intent; 13 | import android.content.pm.PackageManager; 14 | import android.graphics.Bitmap; 15 | import android.graphics.BitmapFactory; 16 | import android.os.Bundle; 17 | import android.view.View; 18 | import android.widget.TextView; 19 | import android.widget.Toast; 20 | 21 | import com.ayusma.textrecognition.Adapter.RecyclerViewAdapter; 22 | import com.google.android.gms.tasks.OnFailureListener; 23 | import com.google.android.gms.tasks.OnSuccessListener; 24 | import com.google.android.material.floatingactionbutton.FloatingActionButton; 25 | import com.google.firebase.ml.vision.FirebaseVision; 26 | import com.google.firebase.ml.vision.common.FirebaseVisionImage; 27 | import com.google.firebase.ml.vision.document.FirebaseVisionDocumentText; 28 | import com.google.firebase.ml.vision.document.FirebaseVisionDocumentTextRecognizer; 29 | 30 | import net.alhazmy13.mediapicker.Image.ImagePicker; 31 | 32 | import java.util.List; 33 | 34 | import static com.ayusma.textrecognition.Operation.MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE; 35 | 36 | 37 | public class MainActivity extends AppCompatActivity { 38 | 39 | private RecyclerView recyclerView; 40 | private TextView textView; 41 | private FloatingActionButton fab_camera,fab_gallery; 42 | private Operation operation; 43 | private Context mContext; 44 | private AlertDialog dialog; 45 | 46 | 47 | @Override 48 | protected void onCreate(Bundle savedInstanceState) { 49 | super.onCreate(savedInstanceState); 50 | setContentView(R.layout.activity_main); 51 | 52 | operation = new Operation(this); 53 | mContext=this; 54 | 55 | recyclerView = findViewById(R.id.recycler_view); 56 | textView = findViewById(R.id.no_saved_text); 57 | fab_camera = findViewById(R.id.camera_floatingActionButton); 58 | fab_gallery = findViewById(R.id.gallery_floatingActionButton); 59 | 60 | fab_camera.setOnClickListener(new View.OnClickListener() { 61 | @Override 62 | public void onClick(View view) { 63 | startActivity(new Intent(getApplicationContext(), CameraActivity.class)); 64 | overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); 65 | 66 | } 67 | }); 68 | fab_gallery.setOnClickListener(new View.OnClickListener() { 69 | @Override 70 | public void onClick(View view) { 71 | new ImagePicker.Builder(MainActivity.this) 72 | .mode(ImagePicker.Mode.GALLERY) 73 | .compressLevel(ImagePicker.ComperesLevel.NONE) 74 | .directory(ImagePicker.Directory.DEFAULT) 75 | .allowMultipleImages(false) 76 | .build(); 77 | } 78 | }); 79 | 80 | 81 | RecyclerViewAdapter recyclerViewAdapter = new RecyclerViewAdapter(operation.getAllSavedText()); 82 | recyclerView.setLayoutManager(new LinearLayoutManager(this)); 83 | if (recyclerViewAdapter.getItemCount() == 0) { 84 | textView.setVisibility(View.VISIBLE); 85 | } else { 86 | recyclerView.setAdapter(recyclerViewAdapter); 87 | } 88 | 89 | AlertDialog.Builder builder = new AlertDialog.Builder(this); 90 | builder.setCancelable(false); 91 | builder.setTitle(R.string.processing); 92 | builder.setView(R.layout.loading_dialoag); 93 | dialog = builder.create(); 94 | 95 | 96 | } 97 | 98 | @Override 99 | public void onRequestPermissionsResult(int requestCode, 100 | String[] permissions, int[] grantResults) { 101 | if (requestCode == MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE) { 102 | if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { 103 | operation.export(operation.getSavedText(MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE), 0); 104 | 105 | } else { 106 | Toast.makeText(this, R.string.enable_text_permission, Toast.LENGTH_SHORT).show(); 107 | } 108 | } 109 | 110 | 111 | } 112 | 113 | @Override 114 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { 115 | super.onActivityResult(requestCode, resultCode, data); 116 | if (requestCode == ImagePicker.IMAGE_PICKER_REQUEST_CODE && resultCode == RESULT_OK) { 117 | List mPaths = data.getStringArrayListExtra(ImagePicker.EXTRA_IMAGE_PATH); 118 | String path = mPaths.get(0); 119 | BitmapFactory.Options opts = new BitmapFactory.Options(); 120 | Bitmap bitmap = BitmapFactory.decodeFile(mPaths.get(0),opts); 121 | FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap); 122 | imageProcessor(image); 123 | dialog.show(); 124 | } 125 | } 126 | 127 | public void imageProcessor(FirebaseVisionImage image) { 128 | FirebaseVisionDocumentTextRecognizer detector = FirebaseVision.getInstance() 129 | .getCloudDocumentTextRecognizer(); 130 | 131 | detector.processImage(image) 132 | .addOnSuccessListener(new OnSuccessListener() { 133 | @Override 134 | public void onSuccess(FirebaseVisionDocumentText result) { 135 | dialog.dismiss(); 136 | Intent intent = new Intent(MainActivity.this, TextActivity.class); 137 | intent.putExtra("result", result.getText()); 138 | startActivity(intent); 139 | overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); 140 | finish(); 141 | 142 | } 143 | }) 144 | .addOnFailureListener(new OnFailureListener() { 145 | @Override 146 | public void onFailure(@NonNull Exception e) { 147 | dialog.dismiss(); 148 | AlertDialog.Builder builder = new AlertDialog.Builder(mContext); 149 | builder.setTitle("Processing Failed"); 150 | builder.setMessage(e.getLocalizedMessage()); 151 | 152 | builder.setPositiveButton(R.string.ok, null).show(); 153 | } 154 | }); 155 | 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /app/src/main/java/com/ayusma/textrecognition/Operation.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition; 2 | 3 | 4 | import android.Manifest; 5 | import android.app.Activity; 6 | import android.content.ClipData; 7 | import android.content.ClipboardManager; 8 | import android.content.Context; 9 | import android.content.Intent; 10 | import android.content.pm.PackageManager; 11 | import android.os.Environment; 12 | import android.widget.Toast; 13 | 14 | import androidx.core.app.ActivityCompat; 15 | import androidx.core.content.ContextCompat; 16 | 17 | import com.ayusma.textrecognition.Helper.SQLiteDatabaseHelper; 18 | import com.ayusma.textrecognition.Helper.Saver; 19 | 20 | import java.io.File; 21 | import java.io.FileWriter; 22 | import java.io.IOException; 23 | import java.util.List; 24 | 25 | import static android.content.Context.CLIPBOARD_SERVICE; 26 | 27 | public class Operation { 28 | 29 | public static int MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE; 30 | private Context context; 31 | private SQLiteDatabaseHelper db; 32 | 33 | 34 | public Operation(Context context) { 35 | db = new SQLiteDatabaseHelper(context); 36 | this.context = context; 37 | } 38 | 39 | public void save(String text) { 40 | db.addText(text); 41 | Toast.makeText(context, "saved", Toast.LENGTH_SHORT).show(); 42 | } 43 | 44 | public void delete(Saver saver) { 45 | db.delete(saver); 46 | } 47 | 48 | public String getSavedText(int id) { 49 | return db.getSavedText(id).getText(); 50 | } 51 | 52 | public List getAllSavedText() { 53 | return db.getAllSavedText(); 54 | } 55 | 56 | public void copy(String text) { 57 | ClipboardManager clipboard = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE); 58 | ClipData clip = ClipData.newPlainText("label", text); 59 | clipboard.setPrimaryClip(clip); 60 | Toast.makeText(context, "copied", Toast.LENGTH_SHORT).show(); 61 | 62 | 63 | } 64 | 65 | public void share(String text) { 66 | Intent shareIntent = new Intent(Intent.ACTION_SEND); 67 | shareIntent.setType("text/plain"); 68 | shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Text Recognized"); 69 | shareIntent.putExtra(Intent.EXTRA_TEXT, text); 70 | context.startActivity(Intent.createChooser(shareIntent, "Share...")); 71 | } 72 | 73 | public void export(String data, int id) { 74 | writeToFile(data, id); 75 | } 76 | 77 | private void writeToFile(String data, int id) { 78 | if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) 79 | != PackageManager.PERMISSION_GRANTED) { 80 | MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = id; 81 | ActivityCompat.requestPermissions((Activity) context, 82 | new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, MY_PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE); 83 | 84 | } else { 85 | int num = 0; 86 | if (data.length() < 10) { 87 | num = 7; 88 | } 89 | else if (data.length() > 20){ 90 | num = 15; 91 | } 92 | 93 | String title = data.substring(0, num); 94 | 95 | 96 | FileWriter out = null; 97 | try { 98 | out = new FileWriter(new File(android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), title + ".txt")); 99 | } catch (IOException e) { 100 | e.printStackTrace(); 101 | } 102 | try { 103 | if (out != null) { 104 | out.write(data); 105 | out.close(); 106 | Toast.makeText(context, R.string.exported_successfully, Toast.LENGTH_SHORT).show(); 107 | 108 | } 109 | 110 | 111 | } catch (IOException e) { 112 | e.printStackTrace(); 113 | } 114 | } 115 | 116 | } 117 | 118 | 119 | } 120 | -------------------------------------------------------------------------------- /app/src/main/java/com/ayusma/textrecognition/TextActivity.java: -------------------------------------------------------------------------------- 1 | package com.ayusma.textrecognition; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.view.Menu; 8 | import android.view.MenuInflater; 9 | import android.view.MenuItem; 10 | import android.view.View; 11 | import android.widget.EditText; 12 | import android.widget.TextView; 13 | 14 | public class TextActivity extends AppCompatActivity { 15 | private String result, preview; 16 | private EditText editText; 17 | private TextView textView; 18 | private Operation op; 19 | private int click = 0; 20 | private MenuItem item; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_text); 26 | 27 | op = new Operation(this); 28 | 29 | editText = findViewById(R.id.edit_text); 30 | textView = findViewById(R.id.text_view); 31 | 32 | result = getIntent().getStringExtra("result"); 33 | preview = getIntent().getStringExtra("Text"); 34 | if (preview != null) { 35 | result = preview; 36 | textView.setVisibility(View.VISIBLE); 37 | editText.setVisibility(View.GONE); 38 | textView.setText(result); 39 | } 40 | editText.setText(result); 41 | 42 | 43 | } 44 | 45 | @Override 46 | public boolean onCreateOptionsMenu(Menu menu) { 47 | MenuInflater inflater = getMenuInflater(); 48 | item = menu.findItem(R.id.item_save); 49 | if (preview != null) { 50 | inflater.inflate(R.menu.text_activity_menu_preview, menu); 51 | } else { 52 | inflater.inflate(R.menu.text_activity_menu, menu); 53 | } 54 | 55 | 56 | return super.onCreateOptionsMenu(menu); 57 | } 58 | 59 | @Override 60 | public boolean onOptionsItemSelected(MenuItem item) { 61 | switch (item.getItemId()) { 62 | case R.id.item_save: 63 | if(click == 0){ 64 | op.save(editText.getText().toString()); 65 | item.setIcon(R.drawable.ic_save_grey_24dp); 66 | click++; 67 | } 68 | 69 | break; 70 | case R.id.item_copy: 71 | op.copy(editText.getText().toString()); 72 | 73 | 74 | break; 75 | case R.id.item_share: 76 | op.share(editText.getText().toString()); 77 | break; 78 | 79 | 80 | } 81 | 82 | return super.onOptionsItemSelected(item); 83 | } 84 | 85 | @Override 86 | public void onBackPressed() { 87 | super.onBackPressed(); 88 | if (preview == null){ 89 | startActivity(new Intent(this, MainActivity.class)); 90 | overridePendingTransition( R.anim.push_left_in,R.anim.push_left_out); 91 | finishAffinity(); 92 | } 93 | 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_left_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_left_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-hdpi/delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-hdpi/export.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-hdpi/icon_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon_capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-hdpi/icon_capture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-hdpi/icon_gallery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-mdpi/delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-mdpi/export.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-mdpi/icon_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon_capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-mdpi/icon_capture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-mdpi/icon_gallery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xhdpi/delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xhdpi/export.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xhdpi/icon_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xhdpi/icon_capture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xhdpi/icon_gallery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxhdpi/delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxhdpi/export.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxhdpi/icon_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxhdpi/icon_capture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxhdpi/icon_gallery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxxhdpi/delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxxhdpi/export.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/icon_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxxhdpi/icon_camera.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/icon_capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxxhdpi/icon_capture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/icon_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AyusmaTech/TextRecognition/89322964f267352863fed2db1ba0a649aece3caf/app/src/main/res/drawable-xxxhdpi/icon_gallery.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_content_copy_colour_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_content_copy_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_flash_auto_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_flash_off_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_flash_on_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_save_grey_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_save_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_share_colour_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_share_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ripple_effect.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ripple_effect_background.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 17 | 18 | 19 | 29 | 30 | 31 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 15 | 16 | 32 | 33 | 49 | 50 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 15 | 16 | 24 | 25 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/loading_dialoag.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recyclerview_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 18 | 19 | 31 | 32 | 33 | 43 | 44 | 51 | 57 | 63 | 69 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /app/src/main/res/menu/text_activity_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 15 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/menu/text_activity_menu_preview.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 23 | 24 | 31 | 32 | 36 | 37 | 41 | 42 | 47 | 48 | 53 | 54 | 55 | 59 | 60 | 65 | 66 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 2 | 3 | 4 | 9 | 14 |