Compare commits
34
Commits
QR
...
itazuraboushi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2093524f72 | ||
|
|
f9c4ff6aab | ||
|
|
1d87ebaa4e | ||
|
|
12239a269f | ||
|
|
1eedc17a6c | ||
|
|
473dde00aa | ||
|
|
87aa82529c | ||
|
|
cdea661646 | ||
|
|
e1ec10e981 | ||
|
|
800095eb61 | ||
|
|
7d26985334 | ||
|
|
6fe06fbf48 | ||
|
|
8a7ab0b7a1 | ||
|
|
87c5af9f01 | ||
|
|
a69de31fa2 | ||
|
|
a81a4c07db | ||
|
|
d1ca79872e | ||
|
|
a79d0fd75b | ||
|
|
a25ed8d4d3 | ||
|
|
8f769c8e04 | ||
|
|
67df5a3ec2 | ||
|
|
c37aee2751 | ||
|
|
6759b2c831 | ||
|
|
ff05035662 | ||
|
|
277999e536 | ||
|
|
8a753ef1fe | ||
|
|
a1f3a3c1bd | ||
|
|
cd12c89081 | ||
|
|
02b4134d41 | ||
|
|
0a210c5b94 | ||
|
|
4beef55f9e | ||
|
|
46102432da | ||
|
|
ec6a94515d | ||
|
|
2eb6c6e685 |
No files matched your search
@@ -59,6 +59,7 @@ dependencies {
|
|||||||
implementation 'androidx.compose.ui:ui-graphics'
|
implementation 'androidx.compose.ui:ui-graphics'
|
||||||
implementation 'androidx.compose.ui:ui-tooling-preview'
|
implementation 'androidx.compose.ui:ui-tooling-preview'
|
||||||
implementation 'androidx.compose.material3:material3'
|
implementation 'androidx.compose.material3:material3'
|
||||||
|
implementation 'com.google.firebase:firebase-firestore:24.4.1'
|
||||||
|
|
||||||
// Import the BoM for the Firebase platform
|
// Import the BoM for the Firebase platform
|
||||||
implementation(platform("com.google.firebase:firebase-bom:32.7.0"))
|
implementation(platform("com.google.firebase:firebase-bom:32.7.0"))
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.example.childguard;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
public class Bluetooth_device_save {
|
||||||
|
SharedPreferences pref;
|
||||||
|
|
||||||
|
// public void device_save(String deviceAddress){
|
||||||
|
// pref = PreferenceManager.getDefaultSharedPreferencesName()
|
||||||
|
// SharedPreferences.Editor e=pref.edit();
|
||||||
|
// e.putString("bluetooth_device1",deviceAddress);
|
||||||
|
// e.apply();
|
||||||
|
// }
|
||||||
|
public String device_info(){
|
||||||
|
return pref.getString("bluetooth_device1","not_device");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,33 @@
|
|||||||
package com.example.childguard;
|
package com.example.childguard;
|
||||||
|
|
||||||
import static android.content.ContentValues.TAG;
|
import static android.content.ContentValues.TAG;
|
||||||
|
import static android.content.Context.MODE_PRIVATE;
|
||||||
|
|
||||||
|
import android.bluetooth.BluetoothDevice;
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
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.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.text.PrecomputedText;
|
||||||
|
import android.util.AndroidRuntimeException;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@@ -29,6 +44,7 @@ import com.google.firebase.firestore.FirebaseFirestore;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple {@link Fragment} subclass.
|
* A simple {@link Fragment} subclass.
|
||||||
@@ -86,14 +102,12 @@ public class HomeFragment extends Fragment {
|
|||||||
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
||||||
MainActivity activity = (MainActivity) getActivity();
|
MainActivity activity = (MainActivity) getActivity();
|
||||||
//共有プリファレンス全体の準備
|
//共有プリファレンス全体の準備
|
||||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
SharedPreferences sharedPreferences = getActivity().getSharedPreferences("app_situation", MODE_PRIVATE);
|
||||||
//QRコード印刷の処理
|
//QRコード印刷の処理
|
||||||
Button bt1 = view.findViewById(R.id.QRprinting);
|
Button bt1 = view.findViewById(R.id.QRprinting);
|
||||||
bt1.setOnClickListener(new View.OnClickListener() {
|
bt1.setOnClickListener(v -> {
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
//初回起動かを保存する変数
|
//初回起動かを保存する変数
|
||||||
boolean alreadySaved = preferences.getBoolean("alreadySaved", false);
|
boolean alreadySaved = sharedPreferences.getBoolean("alreadySaved", false);
|
||||||
//ボタン変数の宣言
|
//ボタン変数の宣言
|
||||||
Button parent = view.findViewById(R.id.QRprinting);
|
Button parent = view.findViewById(R.id.QRprinting);
|
||||||
Button born = view.findViewById(R.id.QRprinting);
|
Button born = view.findViewById(R.id.QRprinting);
|
||||||
@@ -125,7 +139,7 @@ public class HomeFragment extends Fragment {
|
|||||||
//成功したら
|
//成功したら
|
||||||
//documentReference.getId()でID取得
|
//documentReference.getId()でID取得
|
||||||
Log.d(TAG, "DocumentSnapshot added with ID: " + documentReference.getId());
|
Log.d(TAG, "DocumentSnapshot added with ID: " + documentReference.getId());
|
||||||
SharedPreferences.Editor e = preferences.edit();
|
SharedPreferences.Editor e = sharedPreferences.edit();
|
||||||
// キー"alreadySaved"の値をtrueにする
|
// キー"alreadySaved"の値をtrueにする
|
||||||
e.putBoolean("alreadySaved", true);
|
e.putBoolean("alreadySaved", true);
|
||||||
//確定処理
|
//確定処理
|
||||||
@@ -151,7 +165,6 @@ public class HomeFragment extends Fragment {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
//bluetooth設定ボタンの処理
|
//bluetooth設定ボタンの処理
|
||||||
Button bt2 = view.findViewById(R.id.Bluetooth_setup);
|
Button bt2 = view.findViewById(R.id.Bluetooth_setup);
|
||||||
@@ -161,29 +174,19 @@ public class HomeFragment extends Fragment {
|
|||||||
replaceFragment(new bluetooth_setupFragment());
|
replaceFragment(new bluetooth_setupFragment());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//デバック用ボタン
|
||||||
|
view.findViewById(R.id.bt_debug).setOnClickListener( v -> {
|
||||||
|
Toast.makeText(getContext(), PreferenceManager.getDefaultSharedPreferences(getContext().getApplicationContext()).getString("bluetooth_device_id", "none"), Toast.LENGTH_SHORT).show();
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
Log.d("HomeFragment", "onResume: called");
|
Log.d("HomeFragment", "onResume: called");
|
||||||
TextView situationTextView = getView().findViewById(R.id.situation);
|
Cargettingonandoff();//メソッドCargettingonandoff()を実行
|
||||||
FrameLayout situation_bg = getView().findViewById(R.id.situation_bg);
|
|
||||||
updateInCarStatus(situationTextView, situation_bg);
|
|
||||||
}
|
|
||||||
public void updateInCarStatus(TextView situationTextView, FrameLayout situation_bg) {
|
|
||||||
SharedPreferences sharedPreferences = getActivity().getSharedPreferences("default", 0);
|
|
||||||
|
|
||||||
Log.d("HomeFragment", "updateInCarStatus: " + sharedPreferences.getBoolean("inCar", false));
|
|
||||||
if (sharedPreferences.getBoolean("inCar", false)) {
|
|
||||||
situationTextView.setText("\n降車状態");
|
|
||||||
situation_bg.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.frame_style, null));
|
|
||||||
} else {
|
|
||||||
situationTextView.setText("\n乗車状態");
|
|
||||||
situation_bg.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.frame_style_orange, null));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//画面遷移メソッド
|
//画面遷移メソッド
|
||||||
@@ -199,4 +202,30 @@ public class HomeFragment extends Fragment {
|
|||||||
// フラグメントトランザクションをコミット
|
// フラグメントトランザクションをコミット
|
||||||
transaction.commit();
|
transaction.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Cargettingonandoff() {
|
||||||
|
//共有プリファレンス全体の準備
|
||||||
|
SharedPreferences sharedPreferences = getActivity().getSharedPreferences("app_situation", MODE_PRIVATE);
|
||||||
|
//車の乗り降りを管理するtrue=乗車、false=降車
|
||||||
|
Boolean zyoukouzyoutai = sharedPreferences.getBoolean("car", false);
|
||||||
|
SharedPreferences.Editor e = sharedPreferences.edit();
|
||||||
|
String get_on = "\n乗車状態";
|
||||||
|
String get_off = "\n降車状態";
|
||||||
|
TextView tv = getView().findViewById(R.id.situation);
|
||||||
|
FrameLayout fl = getView().findViewById(R.id.situation_bg);
|
||||||
|
|
||||||
|
if (zyoukouzyoutai == true) { //乗降状態の判定
|
||||||
|
//降車状態にする
|
||||||
|
fl.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.frame_style, null));
|
||||||
|
tv.setText(get_off);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//乗車状態にする
|
||||||
|
fl.setBackground(ResourcesCompat.getDrawable(getResources(), R.drawable.frame_style_orange, null));
|
||||||
|
tv.setText(get_on);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -6,45 +6,75 @@ import androidx.core.app.ActivityCompat;
|
|||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.bluetooth.BluetoothManager;
|
import android.bluetooth.BluetoothManager;
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
|
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
import com.google.firebase.firestore.DocumentReference;
|
||||||
|
import com.google.firebase.firestore.DocumentSnapshot;
|
||||||
|
import com.google.firebase.firestore.EventListener;
|
||||||
|
import com.google.firebase.firestore.FirebaseFirestore;
|
||||||
|
import com.google.firebase.firestore.FirebaseFirestoreException;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
BluetoothManager bluetoothManager;
|
BluetoothManager bluetoothManager;
|
||||||
BluetoothAdapter bluetoothAdapter;
|
BluetoothAdapter bluetoothAdapter;
|
||||||
|
|
||||||
|
public static final String TAG = "InspirationQuote";
|
||||||
|
|
||||||
|
boolean flg = false;
|
||||||
|
|
||||||
|
//↓日付を取得するやつ
|
||||||
|
public static String getNowDate() {
|
||||||
|
@SuppressLint("SimpleDateFormat") final DateFormat df = new SimpleDateFormat("yyy/MM/dd HH:mm:ss");
|
||||||
|
final Date date = new Date(System.currentTimeMillis());
|
||||||
|
return df.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
super.onStart();
|
||||||
|
|
||||||
//通知のやつ↓
|
|
||||||
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
|
||||||
|
|
||||||
NotificationChannel channel = new NotificationChannel("CHANNEL_ID", "サンプルアプリ", importance);
|
|
||||||
channel.setDescription("説明・説明 ここに通知の説明を書くことができる");
|
|
||||||
|
|
||||||
NotificationManager notificationManager = getSystemService(NotificationManager.class);
|
|
||||||
notificationManager.createNotificationChannel(channel);
|
|
||||||
//通知のやつ↑
|
|
||||||
|
|
||||||
|
|
||||||
BottomNavigationView bottomNavigationView = findViewById(R.id.nav_view);
|
BottomNavigationView bottomNavigationView = findViewById(R.id.nav_view);
|
||||||
|
|
||||||
bottomNavigationView.setOnNavigationItemSelectedListener(v -> {
|
bottomNavigationView.setOnNavigationItemSelectedListener(v ->
|
||||||
|
|
||||||
|
{
|
||||||
if (v.getItemId() == findViewById(R.id.navigation_home).getId()) {
|
if (v.getItemId() == findViewById(R.id.navigation_home).getId()) {
|
||||||
getSupportFragmentManager().beginTransaction()
|
getSupportFragmentManager().beginTransaction()
|
||||||
.replace(findViewById(R.id.fragmentContainerView).getId(), HomeFragment.newInstance("test", "tset"))
|
.replace(findViewById(R.id.fragmentContainerView).getId(), HomeFragment.newInstance("test", "tset"))
|
||||||
@@ -61,17 +91,148 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
SharedPreferences sharedPreferences = getSharedPreferences("app_situation", MODE_PRIVATE);
|
||||||
|
String IdPref = sharedPreferences.getString("ID", null);
|
||||||
|
if (IdPref == null) {
|
||||||
|
Log.d("onResume", "ID not initialized.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DocumentReference mDocRef = FirebaseFirestore.getInstance().document("users/" + IdPref);//現在の位置を取得
|
||||||
|
initNotification(mDocRef);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initNotification(DocumentReference mDocRef) {
|
||||||
|
|
||||||
|
// Init pref
|
||||||
|
SharedPreferences sharedPreferences = getSharedPreferences("app_situation",MODE_PRIVATE);
|
||||||
|
|
||||||
|
mDocRef.addSnapshotListener(this, new EventListener<DocumentSnapshot>() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(@Nullable DocumentSnapshot documentSnapshot, @Nullable FirebaseFirestoreException e) {
|
||||||
|
Log.d("nt", "イベント開始");
|
||||||
|
//共有プリファレンス 書き込みの準備
|
||||||
|
SharedPreferences.Editor E=sharedPreferences.edit();
|
||||||
|
//車の乗り降りを管理するtrue=乗車、false=降車
|
||||||
|
boolean zyoukouzyoutai = sharedPreferences.getBoolean("car", false);
|
||||||
|
if (flg && documentSnapshot != null && documentSnapshot.exists()) {
|
||||||
|
|
||||||
|
String parent = documentSnapshot.getString("parent");
|
||||||
|
Log.d("nt", "レスポンスを検知しました1");
|
||||||
|
|
||||||
|
if (parent.equals("s")) {//FireBaseの更新情報が"S"のとき=サイト上で第三者ボタンが押されたとき
|
||||||
|
if(zyoukouzyoutai==false) {//いたずら防止
|
||||||
|
//通知のやつ↓
|
||||||
|
|
||||||
|
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
||||||
|
|
||||||
|
NotificationChannel channel = new NotificationChannel("CHANNEL_ID", "通報通知", importance);
|
||||||
|
//説明・説明 ここに通知の説明を書くことができる↓
|
||||||
|
channel.setDescription("第3者からの通報を検知しました");
|
||||||
|
|
||||||
|
NotificationManager notificationManager = getSystemService(NotificationManager.class);
|
||||||
|
notificationManager.createNotificationChannel(channel);
|
||||||
|
//通知のやつ↑
|
||||||
|
Log.d("nt", "レスポンスを検知しました2");
|
||||||
|
|
||||||
|
notifyMain();
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(zyoukouzyoutai==true){//乗降状態の判定
|
||||||
|
E.putBoolean("car", false);//降車状態にする
|
||||||
|
E.apply();//確定処理
|
||||||
|
}else{
|
||||||
|
E.putBoolean("car", true);//乗車状態にする
|
||||||
|
E.apply();//確定処理
|
||||||
|
}
|
||||||
|
Log.w(TAG, "Got an exceptiion!", e);
|
||||||
|
//HomeFragmentへ遷移する
|
||||||
|
HomeFragment fragment = new HomeFragment();
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putBoolean("親",zyoukouzyoutai);
|
||||||
|
fragment.setArguments(bundle);
|
||||||
|
getSupportFragmentManager()
|
||||||
|
.beginTransaction()
|
||||||
|
.add(android.R.id.content, fragment)
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
flg = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//Bluetooth検知機能
|
||||||
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
|
intentFilter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
|
||||||
|
intentFilter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
|
||||||
|
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
Log.d("BT", "No permission to connect bluetooth devices");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Log.d("BT", "Permission to connect bluetooth devices granted");
|
||||||
|
}
|
||||||
|
registerReceiver(receiver, intentFilter);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Bluetoothの検知機能
|
||||||
|
private final BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String action = intent.getAction(); // may need to chain this to a recognizing function
|
||||||
|
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||||
|
HomeFragment homeFragment=new HomeFragment();
|
||||||
|
|
||||||
|
if (ActivityCompat.checkSelfPermission(context, android.Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
Log.d("BT", "No permission to connect bluetooth devices");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String deviceName = device.getName();
|
||||||
|
String deviceHardwareAddress = device.getAddress(); // MAC address
|
||||||
|
|
||||||
|
if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) {
|
||||||
|
//Do something if connected
|
||||||
|
Log.d("BT", "Device connected");
|
||||||
|
|
||||||
|
String registeredId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("bluetooth_device_id", "none");
|
||||||
|
|
||||||
|
Log.d("BT_Judge", "Registered: " + registeredId);
|
||||||
|
|
||||||
|
if (deviceHardwareAddress.equals(registeredId)) {
|
||||||
|
Log.d("BT_Judge", "登録済み");
|
||||||
|
} else Log.d("BT_Judge", "未登録");
|
||||||
|
|
||||||
|
} else if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) {
|
||||||
|
//Do something if disconnected
|
||||||
|
Log.d("BT", "Device disconnected");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//↓通知のやつ
|
//↓通知のやつ
|
||||||
public void notifyTest() {
|
public void notifyMain() {
|
||||||
|
//↓通知をする際に起動するバイブレーション
|
||||||
((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).vibrate(1000);
|
((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).vibrate(1000);
|
||||||
|
//↓通知の詳細設定的な奴
|
||||||
NotificationCompat.Builder builder = new NotificationCompat
|
NotificationCompat.Builder builder = new NotificationCompat
|
||||||
.Builder(this, "CHANNEL_ID")
|
.Builder(this, "CHANNEL_ID")
|
||||||
.setSmallIcon(android.R.drawable.ic_menu_info_details)
|
.setSmallIcon(android.R.drawable.ic_menu_info_details)
|
||||||
.setContentTitle("タイトル")
|
.setContentTitle("通報検知")
|
||||||
.setContentText("メッセージ・メッセージ")
|
.setContentText("子供の置き去りを検知しました。")
|
||||||
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
|
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
|
||||||
|
|
||||||
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
|
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
|
||||||
@@ -90,6 +251,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Bluetooth_setupの戻るボタン
|
//Bluetooth_setupの戻るボタン
|
||||||
public void setupBackButton(boolean enableBackButton) {
|
public void setupBackButton(boolean enableBackButton) {
|
||||||
ActionBar actionBar = getSupportActionBar();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
package com.example.childguard;
|
//package com.example.childguard;
|
||||||
|
//
|
||||||
import android.graphics.Color;
|
//import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
//import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
//import android.os.Bundle;
|
||||||
import android.widget.TextView;
|
//import android.widget.TextView;
|
||||||
|
//
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
//import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
//
|
||||||
public class QR extends AppCompatActivity {
|
//public class QR extends AppCompatActivity {
|
||||||
String get_on="乗車状態";
|
// String get_on="乗車状態";
|
||||||
String get_off ="降車状態";
|
// String get_off ="降車状態";
|
||||||
TextView tv=findViewById(R.id.situation);
|
// TextView tv=findViewById(R.id.situation);
|
||||||
@Override
|
// @Override
|
||||||
protected void onCreate(Bundle savedInstanceState){
|
// protected void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState);
|
// super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.fragment_qr);
|
// setContentView(R.layout.fragment_qr);
|
||||||
//多分いらないコード
|
// //多分いらないコード
|
||||||
// findViewById(R.id.camera).setOnClickListener(
|
// findViewById(R.id.camera).setOnClickListener(
|
||||||
// v -> {
|
// v -> {
|
||||||
// if(get_on.equals(tv.getText().toString())){
|
// if(get_on.equals(tv.getText().toString())){
|
||||||
@@ -28,6 +28,6 @@ public class QR extends AppCompatActivity {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// );
|
// );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
@@ -82,7 +82,8 @@ public class QRFragment extends Fragment {
|
|||||||
//読み取ったQRコードがChiled Guard用サイトのドメインを含むかの判定
|
//読み取ったQRコードがChiled Guard用サイトのドメインを含むかの判定
|
||||||
if(!((result.getContents()).contains("https://practicefirestore1-8808c.web.app/"))) {
|
if(!((result.getContents()).contains("https://practicefirestore1-8808c.web.app/"))) {
|
||||||
Toast.makeText(getContext(), "Chiled Guardに対応するQRコードではありません", Toast.LENGTH_LONG).show();
|
Toast.makeText(getContext(), "Chiled Guardに対応するQRコードではありません", Toast.LENGTH_LONG).show();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//URLの表示
|
//URLの表示
|
||||||
Toast.makeText(getContext(), result.getContents(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), result.getContents(), Toast.LENGTH_SHORT).show();
|
||||||
//ブラウザを起動し、URL先のサイトを開く
|
//ブラウザを起動し、URL先のサイトを開く
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.example.childguard;
|
package com.example.childguard;
|
||||||
|
|
||||||
|
import static android.content.Context.MODE_PRIVATE;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
@@ -76,9 +78,9 @@ public class QrPrintFragment extends Fragment {
|
|||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
//共有プリファレンス全体の準備
|
//共有プリファレンス全体の準備
|
||||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
SharedPreferences sharedPreferences = getActivity().getSharedPreferences("app_situation", MODE_PRIVATE);
|
||||||
//User毎のドメインを保存する
|
//User毎のドメインを保存する
|
||||||
String IdPref=preferences.getString("ID",null);
|
String IdPref=sharedPreferences.getString("ID",null);
|
||||||
// Inflate the layout for this fragment
|
// Inflate the layout for this fragment
|
||||||
View view=inflater.inflate(R.layout.fragment_qr_print, container, false);;
|
View view=inflater.inflate(R.layout.fragment_qr_print, container, false);;
|
||||||
//固定のドメイン
|
//固定のドメイン
|
||||||
@@ -90,7 +92,7 @@ public class QrPrintFragment extends Fragment {
|
|||||||
//User毎のドメイン
|
//User毎のドメイン
|
||||||
String userURL = getArguments().getString("STR_KEY");
|
String userURL = getArguments().getString("STR_KEY");
|
||||||
//キー"ID"の値をuserURLの値にする
|
//キー"ID"の値をuserURLの値にする
|
||||||
SharedPreferences.Editor e = preferences.edit();
|
SharedPreferences.Editor e = sharedPreferences.edit();
|
||||||
e.putString("ID", userURL);
|
e.putString("ID", userURL);
|
||||||
//確定処理
|
//確定処理
|
||||||
e.apply();
|
e.apply();
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.example.childguard;
|
package com.example.childguard;
|
||||||
|
|
||||||
|
import android.bluetooth.BluetoothAdapter;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -8,19 +12,26 @@ import android.widget.TextView;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ItemViewHolder> {
|
public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ItemViewHolder> {
|
||||||
|
|
||||||
ArrayList<String[]> deviceList;
|
ArrayList<String[]> deviceList;
|
||||||
|
|
||||||
|
Context applicationContext;
|
||||||
|
View parentView;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
public RecyclerAdapter(ArrayList<String[]> deviceList) {
|
public RecyclerAdapter(ArrayList<String[]> deviceList, Context applicationContext, View parentView) {
|
||||||
// Init
|
// Init
|
||||||
Log.d("RecyclerAdapter", "Constructor called");
|
Log.d("RecyclerAdapter", "Constructor called");
|
||||||
this.deviceList = deviceList;
|
this.deviceList = deviceList;
|
||||||
|
this.applicationContext = applicationContext;
|
||||||
|
this.parentView = parentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -35,7 +46,28 @@ public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ItemVi
|
|||||||
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||||
holder.textView.setText(deviceList.get(position)[0]);
|
holder.textView.setText(deviceList.get(position)[0]);
|
||||||
holder.textView.setOnClickListener( v -> {
|
holder.textView.setOnClickListener( v -> {
|
||||||
Toast.makeText(v.getContext(), deviceList.get(position)[1], Toast.LENGTH_SHORT).show();
|
|
||||||
|
// アラートダイアログを表示
|
||||||
|
new AlertDialog.Builder(v.getContext())
|
||||||
|
.setTitle("登録")
|
||||||
|
.setMessage("このデバイスを登録しますか?")
|
||||||
|
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||||
|
// OK button pressed
|
||||||
|
Toast.makeText(v.getContext(), "OK button clicked", Toast.LENGTH_SHORT).show();
|
||||||
|
//共有プリファレンスに保存
|
||||||
|
SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(this.applicationContext);
|
||||||
|
sharedPreferences.edit().putString("bluetooth_device_id", deviceList.get(position)[1]).apply();
|
||||||
|
sharedPreferences.edit().putString("bluetooth_device_name",deviceList.get(position)[0]).apply();
|
||||||
|
Toast.makeText(v.getContext(),PreferenceManager.getDefaultSharedPreferences(this.applicationContext).getString("bluetooth_device_id","none"), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
TextView textView = this.parentView.findViewById(R.id.registered_device);
|
||||||
|
textView.setText(PreferenceManager.getDefaultSharedPreferences(this.applicationContext).getString("bluetooth_device_name","none"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
|
.show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.example.childguard;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
//RecyclerView.Adapterクラスを継承
|
||||||
|
public class RecyclerAdapter2 extends RecyclerView.Adapter<ItemViewHolder> {
|
||||||
|
|
||||||
|
ArrayList<String> arrayList;
|
||||||
|
|
||||||
|
//RecyclerAdapterのコンストラクタ
|
||||||
|
public RecyclerAdapter2(ArrayList<String> arrayList, Context applicationContext) {
|
||||||
|
this.arrayList = arrayList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//新しいViewHolderを生成すると呼び出される
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
|
||||||
|
//recycler_row.xmlをactivity_main.xmlの部品にする
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.recycler_row, parent, false);
|
||||||
|
|
||||||
|
//新しいViewHolderを作成
|
||||||
|
//ItemViewHolderクラスを呼び出す
|
||||||
|
ItemViewHolder holder = new ItemViewHolder(view);
|
||||||
|
|
||||||
|
//クリックイベントを登録
|
||||||
|
holder.itemView.setOnClickListener(v -> {
|
||||||
|
//クリックされた行を取得
|
||||||
|
int position = holder.getAdapterPosition();
|
||||||
|
|
||||||
|
//クリックされた文字をトースト表示
|
||||||
|
Toast.makeText(v.getContext(), arrayList.get(position), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
//クリックされた行を削除
|
||||||
|
arrayList.remove(position);
|
||||||
|
|
||||||
|
//行が削除されたことを画面に通知
|
||||||
|
notifyItemRemoved(position);
|
||||||
|
});
|
||||||
|
|
||||||
|
//生成したViewHolderを戻す
|
||||||
|
return holder;
|
||||||
|
}
|
||||||
|
|
||||||
|
//1行分のレイアウトの詳細設定
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||||
|
//指定された位置の値を取得
|
||||||
|
holder.getTextView().setText(arrayList.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
//ArrayListのデータ件数を取得
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return arrayList.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//RecyclerView.ViewHolderクラスを継承
|
||||||
|
class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
private final TextView textView;
|
||||||
|
|
||||||
|
//ItemViewHolderのコンストラクタ
|
||||||
|
public ItemViewHolder(View view) {
|
||||||
|
super(view);
|
||||||
|
//ViewHolderのビューにテキストを定義する
|
||||||
|
textView = view.findViewById(R.id.textView1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//テキストの値を取得
|
||||||
|
public TextView getTextView() {
|
||||||
|
return textView;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.childguard;
|
package com.example.childguard;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
@@ -15,11 +16,13 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
|||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -100,9 +103,9 @@ public class bluetooth_setupFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
Set<BluetoothDevice> pairedDevices = bluetoothAdapter.getBondedDevices();
|
Set<BluetoothDevice> pairedDevices = bluetoothAdapter.getBondedDevices();
|
||||||
|
|
||||||
RecyclerView recyclerView = view.findViewById(R.id.recyclerView1);
|
RecyclerView recyclerView1 = view.findViewById(R.id.recyclerView1);
|
||||||
//RecyclerViewのサイズを固定
|
//RecyclerViewのサイズを固定
|
||||||
recyclerView.setHasFixedSize(true);
|
recyclerView1.setHasFixedSize(true);
|
||||||
|
|
||||||
//RecyclerViewに区切り線を入れる
|
//RecyclerViewに区切り線を入れる
|
||||||
// RecyclerView.ItemDecoration itemDecoration =
|
// RecyclerView.ItemDecoration itemDecoration =
|
||||||
@@ -111,7 +114,8 @@ public class bluetooth_setupFragment extends Fragment {
|
|||||||
|
|
||||||
//レイアウトマネージャを設
|
//レイアウトマネージャを設
|
||||||
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());
|
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());
|
||||||
recyclerView.setLayoutManager(layoutManager);
|
recyclerView1.setLayoutManager(layoutManager);
|
||||||
|
//recyclerView2.setLayoutManager(layoutManager);
|
||||||
|
|
||||||
//①リスト構造(String型の可変長の配列)を宣言
|
//①リスト構造(String型の可変長の配列)を宣言
|
||||||
ArrayList<String[]> arrayList = new ArrayList<>();
|
ArrayList<String[]> arrayList = new ArrayList<>();
|
||||||
@@ -134,14 +138,21 @@ public class bluetooth_setupFragment extends Fragment {
|
|||||||
Log.d("b", s[0]);
|
Log.d("b", s[0]);
|
||||||
}
|
}
|
||||||
Log.d(" ", String.valueOf(arrayList.size()));
|
Log.d(" ", String.valueOf(arrayList.size()));
|
||||||
RecyclerAdapter adapter = new RecyclerAdapter(arrayList);
|
RecyclerAdapter adapter = new RecyclerAdapter(arrayList, requireActivity().getApplicationContext(), view);
|
||||||
|
|
||||||
|
|
||||||
//④RecyclerViewとAdapterの結び付け
|
//④RecyclerViewとAdapterの結び付け
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView1.setAdapter(adapter);
|
||||||
|
TextView textView=view.findViewById(R.id.registered_device);
|
||||||
|
textView.setText(PreferenceManager.getDefaultSharedPreferences(requireActivity().getApplicationContext()).getString("bluetooth_device_name","none"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
tools:context=".MainActivity">
|
tools:context=".MainActivity"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
|||||||
@@ -6,21 +6,53 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".bluetooth_setupFragment">
|
tools:context=".bluetooth_setupFragment">
|
||||||
|
|
||||||
|
|
||||||
<!-- TODO: Update blank fragment layout -->
|
<!-- TODO: Update blank fragment layout -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="デバイス"
|
||||||
|
android:textSize="35dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:id="@+id/divider1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/black" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recyclerView1"
|
android:id="@+id/recyclerView1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:scrollbars="vertical"/>
|
android:scrollbars="vertical"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/click_device"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:text="登録デバイス"
|
||||||
|
android:textSize="35dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
/>
|
||||||
|
<View
|
||||||
|
android:id="@+id/divider2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/black"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/registered_device"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:textColor="@color/black"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -6,7 +6,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context=".HomeFragment">
|
tools:context=".HomeFragment"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
@@ -14,13 +15,16 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.0">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/situation_bg"
|
android:id="@+id/situation_bg"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -103,6 +107,16 @@
|
|||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="40dp" />
|
android:textSize="40dp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_debug"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="#778899"
|
||||||
|
android:text="Bluetooth設定"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="40dp" />
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -6,9 +6,18 @@
|
|||||||
tools:context=".NotificationFragment">
|
tools:context=".NotificationFragment">
|
||||||
|
|
||||||
<!-- TODO: Update blank fragment layout -->
|
<!-- TODO: Update blank fragment layout -->
|
||||||
<TextView
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="9"
|
||||||
|
>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:text="@string/hello_blank_fragment" />
|
android:scrollbars="vertical"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
android:id="@+id/textView1"
|
android:id="@+id/textView1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="30sp"/>
|
android:textSize="30sp"
|
||||||
|
android:textColor="@color/black"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
Reference in new issue
Block a user