mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-08 11:47:36 +00:00
Compare commits
100
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b67887d4a6 | ||
|
|
fa299bef21 | ||
|
|
b3fe7b08e3 | ||
|
|
16c93dc9a3 | ||
|
|
25ae68219f | ||
|
|
5c45ebffe3 | ||
|
|
e763c229e9 | ||
|
|
1fae335355 | ||
|
|
3572fce1cf | ||
|
|
6622bd2fc0 | ||
|
|
6d0173039f | ||
|
|
914279a582 | ||
|
|
38fe16609b | ||
|
|
cd92fcbc04 | ||
|
|
cf012daddf | ||
|
|
8a0c1e962d | ||
|
|
4483af5c38 | ||
|
|
fe404e44dc | ||
|
|
ce6e76f37f | ||
|
|
777c75477d | ||
|
|
89b12cf10a | ||
|
|
6a8b0f2e21 | ||
|
|
1c38f889a9 | ||
|
|
a879b8bb16 | ||
|
|
185b3b899c | ||
|
|
b2a96c30d9 | ||
|
|
5c28a0852d | ||
|
|
51fbcb1852 | ||
|
|
44e45c0c9d | ||
|
|
29da95e67d | ||
|
|
5565bc0d91 | ||
|
|
3a7b28e330 | ||
|
|
ad3e8946de | ||
|
|
c5c1a16282 | ||
|
|
c82050b931 | ||
|
|
2cfdcec70b | ||
|
|
472ecd2e41 | ||
|
|
b311b55455 | ||
|
|
562e46f058 | ||
|
|
4776656f95 | ||
|
|
b83085d32a | ||
|
|
49e8a6e6bb | ||
|
|
cfde0b1e91 | ||
|
|
5ec12658ef | ||
|
|
c0d56ec3c0 | ||
|
|
1a2e705906 | ||
|
|
a62b882fe7 | ||
|
|
3e7ceb774e | ||
|
|
ad4f8a9aec | ||
|
|
2b8c0fbadf | ||
|
|
c7a387df3d | ||
|
|
732f047ff7 | ||
|
|
bbeba2b733 | ||
|
|
83d2d0af02 | ||
|
|
3518464716 | ||
|
|
f9247e9114 | ||
|
|
be610059cf | ||
|
|
b12c689d4e | ||
|
|
55ae0b541a | ||
|
|
f74abd11fc | ||
|
|
8817c62ed3 | ||
|
|
d5616d63b6 | ||
|
|
9cbf6f9d56 | ||
|
|
ad66688bf9 | ||
|
|
b5281443bf | ||
|
|
c616edf9f7 | ||
|
|
aa4f8360dc | ||
|
|
99dea6d6f6 | ||
|
|
b3dcaefede | ||
|
|
9ec45096ba | ||
|
|
a3edcf845a | ||
|
|
48de3f9a8d | ||
|
|
979a3f8ee7 | ||
|
|
9c79e02cc8 | ||
|
|
3db91fb937 | ||
|
|
e9f2a6b711 | ||
|
|
955c0122cf | ||
|
|
d5f3d36d23 | ||
|
|
2c74fa3339 | ||
|
|
e3220910f5 | ||
|
|
8e97dd6972 | ||
|
|
0bf6b3fa1a | ||
|
|
6ac0599f4c | ||
|
|
f14b9accee | ||
|
|
da2ff27391 | ||
|
|
60d13ac9a9 | ||
|
|
011cac925a | ||
|
|
4d0412e5bd | ||
|
|
be30ce2c62 | ||
|
|
3c6541607c | ||
|
|
be80e42dc5 | ||
|
|
031a1d2810 | ||
|
|
ccbbb45f39 | ||
|
|
13b53c62ec | ||
|
|
8c83c7adcf | ||
|
|
5617dacfe7 | ||
|
|
ed9e20ede3 | ||
|
|
b7f91b593e | ||
|
|
4a39c5c525 | ||
|
|
fc716df189 |
No files matched your search
@@ -2,11 +2,6 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<uses-feature
|
|
||||||
android:name="android.hardware.camera"
|
|
||||||
android:required="false" />
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
@@ -27,16 +22,6 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<provider
|
|
||||||
android:name="androidx.core.content.FileProvider"
|
|
||||||
android:authorities="one.nem.lacerta.provider"
|
|
||||||
android:exported="false"
|
|
||||||
android:grantUriPermissions="true">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
||||||
android:resource="@xml/file_paths" />
|
|
||||||
</provider>
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<paths>
|
|
||||||
<cache-path name="cache" path="." />
|
|
||||||
</paths>
|
|
||||||
@@ -34,7 +34,4 @@ dependencies {
|
|||||||
androidTestImplementation libs.androidx.test.espresso.core
|
androidTestImplementation libs.androidx.test.espresso.core
|
||||||
|
|
||||||
implementation 'com.websitebeaver:documentscanner:1.0.0'
|
implementation 'com.websitebeaver:documentscanner:1.0.0'
|
||||||
|
|
||||||
implementation project(':shared:ui')
|
|
||||||
implementation project(':model')
|
|
||||||
}
|
}
|
||||||
-55
@@ -1,55 +0,0 @@
|
|||||||
package one.nem.lacerta.component.scanner;
|
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class CaptureResultAdapter extends RecyclerView.Adapter<CaptureResultAdapter.ViewHolder> {
|
|
||||||
private final ArrayList<CapturedData> results;
|
|
||||||
|
|
||||||
public CaptureResultAdapter(ArrayList<CapturedData> results) {
|
|
||||||
this.results = results;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CaptureResultAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_scanner_component_manager_stub, parent, false);
|
|
||||||
return new CaptureResultAdapter.ViewHolder(view);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(CaptureResultAdapter.ViewHolder holder, int position) {
|
|
||||||
CapturedData result = results.get(position);
|
|
||||||
holder.textViewPath.setText(result.getPath());
|
|
||||||
holder.textViewResolutionHeight.setText(result.getResolutionHeight());
|
|
||||||
holder.textViewResolutionWidth.setText(result.getResolutionWidth());
|
|
||||||
holder.imageView.setImageBitmap(result.getBitmap());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return results.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
public TextView textViewPath;
|
|
||||||
public TextView textViewResolutionHeight;
|
|
||||||
public TextView textViewResolutionWidth;
|
|
||||||
public ImageView imageView;
|
|
||||||
|
|
||||||
public ViewHolder(View view) {
|
|
||||||
super(view);
|
|
||||||
textViewPath = view.findViewById(R.id.textViewPath);
|
|
||||||
textViewResolutionHeight = view.findViewById(R.id.textViewResHeight);
|
|
||||||
textViewResolutionWidth = view.findViewById(R.id.textViewResWidth);
|
|
||||||
imageView = view.findViewById(R.id.imageViewResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package one.nem.lacerta.component.scanner;
|
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
|
|
||||||
public class CapturedData {
|
|
||||||
|
|
||||||
private String path;
|
|
||||||
private String resolutionHeight;
|
|
||||||
private String resolutionWidth;
|
|
||||||
private String size;
|
|
||||||
private Bitmap bitmap;
|
|
||||||
|
|
||||||
// Constructor
|
|
||||||
|
|
||||||
public CapturedData(String path, String resolutionHeight, String resolutionWidth, String size, Bitmap bitmap) {
|
|
||||||
this.path = path;
|
|
||||||
this.resolutionHeight = resolutionHeight;
|
|
||||||
this.resolutionWidth = resolutionWidth;
|
|
||||||
this.size = size;
|
|
||||||
this.bitmap = bitmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Getters
|
|
||||||
|
|
||||||
public String getPath() {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getResolutionHeight() {
|
|
||||||
return resolutionHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getResolutionWidth() {
|
|
||||||
return resolutionWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSize() {
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Bitmap getBitmap() {
|
|
||||||
return bitmap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-144
@@ -1,144 +0,0 @@
|
|||||||
package one.nem.lacerta.component.scanner;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import androidx.activity.result.ActivityResultLauncher;
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts;
|
|
||||||
import androidx.core.content.FileProvider;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.provider.MediaStore;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A simple {@link Fragment} subclass.
|
|
||||||
* Use the {@link ScannerDataManagerStubFragment#newInstance} factory method to
|
|
||||||
* create an instance of this fragment.
|
|
||||||
*/
|
|
||||||
public class ScannerDataManagerStubFragment extends Fragment {
|
|
||||||
|
|
||||||
// TODO-rca: 時間があったらcacheを使うようにする?
|
|
||||||
|
|
||||||
// Results
|
|
||||||
private ArrayList<CapturedData> results = new ArrayList<>();
|
|
||||||
|
|
||||||
private Uri photoURI;
|
|
||||||
|
|
||||||
private final ActivityResultLauncher<Intent> cameraLauncher = registerForActivityResult(
|
|
||||||
new ActivityResultContracts.StartActivityForResult(),
|
|
||||||
result -> {
|
|
||||||
if (result.getResultCode() == Activity.RESULT_OK) {
|
|
||||||
try {
|
|
||||||
if (getActivity() == null) {
|
|
||||||
Log.d("ScannerDataManagerStubFragment", "getActivity() is null");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (photoURI == null) {
|
|
||||||
Log.d("ScannerDataManagerStubFragment", "photoURI is null");
|
|
||||||
Toast.makeText(getActivity(), "photoURI is null", Toast.LENGTH_LONG).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Bitmap imageBitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), photoURI);
|
|
||||||
results.add(new CapturedData("Placeholder", Integer.toString(imageBitmap.getHeight()), Integer.toString(imageBitmap.getWidth()), "Placeholder", imageBitmap));
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.e("ScannerDataManagerStubFragment", "Error occurred while reading the file", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
public ScannerDataManagerStubFragment() {
|
|
||||||
// Required empty public constructor
|
|
||||||
}
|
|
||||||
// TODO: Rename and change types and number of parameters
|
|
||||||
public static ScannerDataManagerStubFragment newInstance() {
|
|
||||||
ScannerDataManagerStubFragment fragment = new ScannerDataManagerStubFragment();
|
|
||||||
Bundle args = new Bundle();
|
|
||||||
fragment.setArguments(args);
|
|
||||||
return fragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
||||||
Bundle savedInstanceState) {
|
|
||||||
// Inflate the layout for this fragment
|
|
||||||
return inflater.inflate(R.layout.fragment_scanner_data_manager_stub, container, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
|
|
||||||
view.findViewById(R.id.button_call_camera).setOnClickListener(v -> {
|
|
||||||
Log.d("ScannerDataManagerStubFragment", "button_call_camera clicked");
|
|
||||||
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
|
||||||
if (takePictureIntent.resolveActivity(getActivity().getPackageManager()) != null) {
|
|
||||||
File photoFile = null;
|
|
||||||
try {
|
|
||||||
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US).format(new Date());
|
|
||||||
String imageFileName = "JPEG_" + timeStamp + "_";
|
|
||||||
File storageDir = getActivity().getExternalFilesDir(Environment.DIRECTORY_PICTURES);
|
|
||||||
photoFile = File.createTempFile(imageFileName, ".jpg", storageDir);
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Log.e("ScannerDataManagerStubFragment", "Error occurred while creating the file", ex);
|
|
||||||
}
|
|
||||||
if (photoFile != null) {
|
|
||||||
photoURI = FileProvider.getUriForFile(getActivity(), "one.nem.lacerta.provider", photoFile);
|
|
||||||
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
|
|
||||||
cameraLauncher.launch(takePictureIntent);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Log.d("ScannerDataManagerStubFragment", "photoFile is null");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Log.d("ScannerDataManagerStubFragment", "camera not available");
|
|
||||||
}
|
|
||||||
updateResults();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
Log.d("ScannerDataManagerStubFragment", "onResume");
|
|
||||||
updateResults();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateResults() {
|
|
||||||
Log.d("ScannerDataManagerStubFragment", "updateResults");
|
|
||||||
|
|
||||||
// TODO-rca: エラーハンドリング
|
|
||||||
RecyclerView recyclerView = getView().findViewById(R.id.result_recycler_view);
|
|
||||||
|
|
||||||
recyclerView.setLayoutManager(new androidx.recyclerview.widget.LinearLayoutManager(getContext()));
|
|
||||||
recyclerView.setAdapter(new CaptureResultAdapter(this.results));
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+75
@@ -0,0 +1,75 @@
|
|||||||
|
package one.nem.lacerta.component.scanner;
|
||||||
|
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.constraintlayout.utils.widget.ImageFilterView;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.websitebeaver.documentscanner.DocumentScanner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple {@link Fragment} subclass.
|
||||||
|
* Use the {@link ScannerScanFragment#newInstance} factory method to
|
||||||
|
* create an instance of this fragment.
|
||||||
|
*/
|
||||||
|
public class ScannerScanFragment extends Fragment {
|
||||||
|
|
||||||
|
// TODO: Rename parameter arguments, choose names that match
|
||||||
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||||
|
// private static final String MAX_SCAN_COUNT = "max_scan_count"; // 規定値
|
||||||
|
|
||||||
|
// TODO: Rename and change types of parameters
|
||||||
|
private String mParam1;
|
||||||
|
|
||||||
|
|
||||||
|
public ScannerScanFragment() {
|
||||||
|
// Required empty public constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ScannerScanFragment newInstance(String param1) {
|
||||||
|
ScannerScanFragment fragment = new ScannerScanFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
// args.putString(MAX_SCAN_COUNT, param1);
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments() != null) {
|
||||||
|
// mParam1 = getArguments().getString(MAX_SCAN_COUNT);
|
||||||
|
// scan(Integer.parseInt(mParam1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public DocumentScanner getDocumentScanner() {
|
||||||
|
return new DocumentScanner(
|
||||||
|
this,
|
||||||
|
(croppedImageResults) -> {
|
||||||
|
// display the first cropped image
|
||||||
|
croppedImageView.setImageBitmap(
|
||||||
|
BitmapFactory.decodeFile(croppedImageResults.get(0))
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
(errorMessage) -> {
|
||||||
|
// an error happened
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
() -> {
|
||||||
|
// user canceled document scan
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+64
@@ -0,0 +1,64 @@
|
|||||||
|
package one.nem.lacerta.component.scanner;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple {@link Fragment} subclass.
|
||||||
|
* Use the {@link ScannerScanResultFragment#newInstance} factory method to
|
||||||
|
* create an instance of this fragment.
|
||||||
|
*/
|
||||||
|
public class ScannerScanResultFragment extends Fragment {
|
||||||
|
|
||||||
|
// TODO: Rename parameter arguments, choose names that match
|
||||||
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||||
|
private static final String ARG_PARAM1 = "param1";
|
||||||
|
private static final String ARG_PARAM2 = "param2";
|
||||||
|
|
||||||
|
// TODO: Rename and change types of parameters
|
||||||
|
private String mParam1;
|
||||||
|
private String mParam2;
|
||||||
|
|
||||||
|
public ScannerScanResultFragment() {
|
||||||
|
// Required empty public constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this factory method to create a new instance of
|
||||||
|
* this fragment using the provided parameters.
|
||||||
|
*
|
||||||
|
* @param param1 Parameter 1.
|
||||||
|
* @param param2 Parameter 2.
|
||||||
|
* @return A new instance of fragment ScannerScanResultFragment.
|
||||||
|
*/
|
||||||
|
// TODO: Rename and change types and number of parameters
|
||||||
|
public static ScannerScanResultFragment newInstance(String param1, String param2) {
|
||||||
|
ScannerScanResultFragment fragment = new ScannerScanResultFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putString(ARG_PARAM1, param1);
|
||||||
|
args.putString(ARG_PARAM2, param2);
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments() != null) {
|
||||||
|
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||||
|
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
// Inflate the layout for this fragment
|
||||||
|
return inflater.inflate(R.layout.fragment_scanner_scan_result, container, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:theme="@style/Theme.Lacerta"
|
|
||||||
tools:context=".ScannerDataManagerStubFragment" >
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/action_button_container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/button_call_camera"
|
|
||||||
style="@style/Widget.Material3.Button.IconButton.Filled"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="16px"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="Call camera" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/result_recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/action_button_container" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".ScannerScanFragment">
|
||||||
|
|
||||||
|
<!-- TODO: Update blank fragment layout -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/hello_blank_fragment" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".MainActivity">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||||
|
android:id="@+id/cropped_image_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/linear_layout_buttons">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_margin="12dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:text="Saturation" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/seekBar_saturation"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:max="200"
|
||||||
|
android:progress="100"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_margin="12dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:text="Contrast" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/seekBar_contrast"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:max="200"
|
||||||
|
android:progress="100"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_margin="12dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:text="Brightness" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/seekBar_brightness"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:max="200"
|
||||||
|
android:progress="100"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_margin="12dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:text="Warmth" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/seekBar_warmth"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:max="500"
|
||||||
|
android:progress="100"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_layout_buttons"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_save_image"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:insetLeft="12dp"
|
||||||
|
android:insetRight="12dp"
|
||||||
|
android:text="Save Image" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_kill_me"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:insetLeft="12dp"
|
||||||
|
android:insetRight="12dp"
|
||||||
|
android:text="Kill me" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="24px">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageViewResult"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:srcCompat="@android:drawable/presence_video_online"
|
|
||||||
android:adjustViewBounds="true"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/imageViewResult">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="2"
|
|
||||||
android:text="Resolution:"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textViewResHeight"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="Height"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textViewResWidth"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="Width"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textViewPath"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="Path"
|
|
||||||
android:textIsSelectable="false"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
@@ -62,7 +62,4 @@ dependencies {
|
|||||||
// Shared
|
// Shared
|
||||||
implementation project(':shared:ui')
|
implementation project(':shared:ui')
|
||||||
|
|
||||||
// Scanner
|
|
||||||
implementation project(':component:scanner')
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,6 @@ public class DebugMenuTopFragment extends Fragment {
|
|||||||
|
|
||||||
debugMenuListItems.add(new DebugMenuListItem("Meta Data", "View meta data", R.id.action_debugMenuTopFragment_to_debugMenuMetaDataFragment, true));
|
debugMenuListItems.add(new DebugMenuListItem("Meta Data", "View meta data", R.id.action_debugMenuTopFragment_to_debugMenuMetaDataFragment, true));
|
||||||
debugMenuListItems.add(new DebugMenuListItem("Document Tester", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuDocumentTesterTopFragment, true));
|
debugMenuListItems.add(new DebugMenuListItem("Document Tester", "placeholder", R.id.action_debugMenuTopFragment_to_debugMenuDocumentTesterTopFragment, true));
|
||||||
debugMenuListItems.add(new DebugMenuListItem("Scanner", "placeholder", R.id.action_debugMenuTopFragment_to_scannerDataManagerStubFragment, true));
|
|
||||||
|
|
||||||
DebugMenuListItemAdapter adapter = new DebugMenuListItemAdapter(debugMenuListItems);
|
DebugMenuListItemAdapter adapter = new DebugMenuListItemAdapter(debugMenuListItems);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|||||||
@@ -16,9 +16,6 @@
|
|||||||
<action
|
<action
|
||||||
android:id="@+id/action_debugMenuTopFragment_to_debugMenuDocumentTesterTopFragment"
|
android:id="@+id/action_debugMenuTopFragment_to_debugMenuDocumentTesterTopFragment"
|
||||||
app:destination="@id/debugMenuDocumentTesterTopFragment" />
|
app:destination="@id/debugMenuDocumentTesterTopFragment" />
|
||||||
<action
|
|
||||||
android:id="@+id/action_debugMenuTopFragment_to_scannerDataManagerStubFragment"
|
|
||||||
app:destination="@id/scannerDataManagerStubFragment" />
|
|
||||||
</fragment>
|
</fragment>
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/debugMenuMetaDataFragment"
|
android:id="@+id/debugMenuMetaDataFragment"
|
||||||
@@ -47,8 +44,4 @@
|
|||||||
android:name="one.nem.lacerta.feature.debug.DebugMenuDocumentTesterManageFragment"
|
android:name="one.nem.lacerta.feature.debug.DebugMenuDocumentTesterManageFragment"
|
||||||
android:label="fragment_debug_menu_document_tester_manage"
|
android:label="fragment_debug_menu_document_tester_manage"
|
||||||
tools:layout="@layout/fragment_debug_menu_document_tester_manage" />
|
tools:layout="@layout/fragment_debug_menu_document_tester_manage" />
|
||||||
<fragment
|
|
||||||
android:id="@+id/scannerDataManagerStubFragment"
|
|
||||||
android:name="one.nem.lacerta.component.scanner.ScannerDataManagerStubFragment"
|
|
||||||
android:label="ScannerDataManagerStubFragment" />
|
|
||||||
</navigation>
|
</navigation>
|
||||||
Reference in new issue
Block a user