forked from aleyn97/LPR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_back_button.diff
58 lines (53 loc) · 1.91 KB
/
add_back_button.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
diff --git a/ocr/src/main/java/com/pcl/ocr/ui/LPRActivity.java b/ocr/src/main/java/com/pcl/ocr/ui/LPRActivity.java
index 6a4b517..c828abd 100644
--- a/ocr/src/main/java/com/pcl/ocr/ui/LPRActivity.java
+++ b/ocr/src/main/java/com/pcl/ocr/ui/LPRActivity.java
@@ -16,10 +16,14 @@ import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
+import android.view.View;
+import android.widget.Button;
+import android.view.View.OnClickListener;
+
public class LPRActivity extends AppCompatActivity {
private ScannerView scannerView;
-
+ private Button closeButton;
public static final int REQUEST_LPR_CODE = 1001;
@Override
@@ -27,6 +31,14 @@ public class LPRActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lpr);
scannerView = findViewById(R.id.scanner_view);
+ this.closeButton = (Button)this.findViewById(R.id.close);
+ this.closeButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ finish();
+ }
+ });
+
startCamera();
}
@@ -86,4 +98,4 @@ public class LPRActivity extends AppCompatActivity {
}
}
};
-}
\ No newline at end of file
+}
diff --git a/ocr/src/main/res/layout/activity_lpr.xml b/ocr/src/main/res/layout/activity_lpr.xml
index fa1f6dc..236b531 100644
--- a/ocr/src/main/res/layout/activity_lpr.xml
+++ b/ocr/src/main/res/layout/activity_lpr.xml
@@ -8,4 +8,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
-</RelativeLayout>
\ No newline at end of file
+ <Button android:id="@+id/close"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:text="Back" />
+</RelativeLayout>