From c37aee2751b59a737d4aa782139642a2ef3c0a27 Mon Sep 17 00:00:00 2001 From: it232115 Date: Fri, 12 Jan 2024 11:31:27 +0900 Subject: [PATCH] =?UTF-8?q?QR=E7=94=BB=E5=83=8F=E3=82=92=E7=94=9F=E6=88=90?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=95=E3=83=A9=E3=82=B0=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=B8=E3=81=AE=E7=94=BB=E5=83=8F=E9=81=B7=E7=A7=BB?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 1 - .../com/example/childguard/HomeFragment.java | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 430b05a..cbdd641 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -34,7 +34,6 @@ - \ No newline at end of file diff --git a/app/src/main/java/com/example/childguard/HomeFragment.java b/app/src/main/java/com/example/childguard/HomeFragment.java index 82a8f9c..a5ad221 100644 --- a/app/src/main/java/com/example/childguard/HomeFragment.java +++ b/app/src/main/java/com/example/childguard/HomeFragment.java @@ -1,7 +1,12 @@ package com.example.childguard; import android.content.SharedPreferences; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -9,15 +14,22 @@ import androidx.core.content.res.ResourcesCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; +import androidx.print.PrintHelper; +import android.util.AndroidRuntimeException; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.FrameLayout; +import android.widget.ImageView; import android.widget.TextView; +import com.google.zxing.BarcodeFormat; +import com.google.zxing.WriterException; +import com.journeyapps.barcodescanner.BarcodeEncoder; + /** * A simple {@link Fragment} subclass. * Use the {@link HomeFragment#newInstance} factory method to @@ -69,12 +81,20 @@ public class HomeFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment - //bluetooth設定ボタンの処理 View view=inflater.inflate(R.layout.fragment_home,container,false); MainActivity activity = (MainActivity) getActivity(); - - Button bt1=view.findViewById(R.id.Bluetooth_setup); + //QRコード印刷の処理 + Button bt1=view.findViewById(R.id.QRprinting); bt1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + replaceFragment(new QrPrintFragment()); + + } + }); + //bluetooth設定ボタンの処理 + Button bt2=view.findViewById(R.id.Bluetooth_setup); + bt2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { replaceFragment(new bluetooth_setupFragment());