From 9cbf6f9d5665a06b8d03497cff8ec17336d4f264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Wed, 20 Dec 2023 12:49:43 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"Revert=20"WIP=20=E5=86=85=E9=83=A8?= =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E3=81=98=E3=82=83=E3=81=A0=E3=82=81?= =?UTF-8?q?=E3=81=9D=E3=81=86=E3=81=AA=E3=81=AE=E3=81=A7=E5=88=87=E3=82=8A?= =?UTF-8?q?=E5=87=BA=E3=81=97""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aea6ea380843027d5e9e25e5b35b5ea3ae2ca41f. --- .../scanner/CaptureResultAdapter.java | 55 +++++++++++++++++++ .../ScannerDataManagerStubFragment.java | 43 --------------- 2 files changed, 55 insertions(+), 43 deletions(-) create mode 100644 component/scanner/src/main/java/one/nem/lacerta/component/scanner/CaptureResultAdapter.java diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/CaptureResultAdapter.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/CaptureResultAdapter.java new file mode 100644 index 00000000..949e28d6 --- /dev/null +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/CaptureResultAdapter.java @@ -0,0 +1,55 @@ +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 { + private final ArrayList results; + + public CaptureResultAdapter(ArrayList 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); + } + } +} \ No newline at end of file diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java index cb02c559..921b199f 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java @@ -102,47 +102,4 @@ public class ScannerDataManagerStubFragment extends Fragment { } - public class ResultAdapter extends RecyclerView.Adapter { - private final ArrayList results; - - public ResultAdapter(ArrayList results) { - this.results = results; - } - - @Override - public ResultAdapter.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 ResultAdapter.ViewHolder(view); - } - - @Override - public void onBindViewHolder(ResultAdapter.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); - } - } - } } \ No newline at end of file