Compare commits
No commits in common. "master" and "murakumo_Mapに○を" have entirely different histories.
master
...
murakumo_M
|
@ -18,9 +18,6 @@
|
|||
android:theme="@style/Theme.Oplogy"
|
||||
tools:ignore="ExtraText"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".SettingView"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".SetUpActivity"
|
||||
android:exported="false" />
|
||||
|
@ -43,9 +40,15 @@
|
|||
android:name=".Maps"
|
||||
android:exported="false"
|
||||
android:label="@string/title_activity_maps" />
|
||||
<activity
|
||||
android:name=".TutorialActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".SubmissionActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".RootSearchActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".CreateUUID"
|
||||
android:exported="false" />
|
||||
|
|
Before Width: | Height: | Size: 367 KiB |
|
@ -21,6 +21,8 @@ public class CreateUUID {
|
|||
//firestoreに挿入処理
|
||||
InsertClassIdforFirebase insertClassIdforFirebase = new InsertClassIdforFirebase();
|
||||
insertClassIdforFirebase.insertClassId(uuidInt);
|
||||
//テスト用
|
||||
uuidInt = 328071;
|
||||
return uuidInt;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,9 +27,12 @@ public class FirestoreReception {
|
|||
//ClassIdを引数にデータの作成を行う
|
||||
public void getDocumentsByClassId(int classId) {
|
||||
myDataList.clear();
|
||||
CollectionReference collectionRef = db.collection("QuestionForm");
|
||||
|
||||
//pixel6a
|
||||
CollectionReference collectionRef = db.collection("test0711Data");
|
||||
|
||||
//xiaomi
|
||||
// CollectionReference collectionRef = db.collection("testDistinct");
|
||||
// classIdが引数のものを取得する
|
||||
collectionRef.whereEqualTo("classId", classId).get()
|
||||
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
package com.example.oplogy;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
@ -26,21 +30,30 @@ import java.util.concurrent.Executors;
|
|||
|
||||
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
|
||||
// formコピー用のURL
|
||||
private static final String URL_TO_COPY = "https://docs.google.com/forms/d/e/1FAIpQLScKI_ca01nO7die7SqZyThiqa7NB7gcucMJtiV_-sc3eZX6KQ/viewform";
|
||||
// ダイアログの宣言
|
||||
private AlertDialog alertDialog;
|
||||
// ID作成のTextViewとImageView
|
||||
private TextView creatUUID;
|
||||
private ImageView imageUuid;
|
||||
// セットアップのTextViewとImageView
|
||||
private TextView setUp;
|
||||
private ImageView imageSetup;
|
||||
// formコピー用のボタン
|
||||
private TextView formURL;
|
||||
private ImageView imageFormURL;
|
||||
// ルート作成のTextViewとImageView
|
||||
private TextView root;
|
||||
private ImageView imageRoot;
|
||||
// 提出状況のTextViewとImageView
|
||||
private TextView submission;
|
||||
private ImageView imageSubmission;
|
||||
private TextView SettingView;
|
||||
private ImageView imageSettingView;
|
||||
|
||||
//firestoreの受信関連
|
||||
private FirebaseFirestore db;
|
||||
private FirestoreReception firestoreReception;
|
||||
private FirestoreReception_classIdDatabase firestoreReception_classIdDatabase;
|
||||
|
||||
//取得するためのクラスID
|
||||
private int classId;
|
||||
|
@ -50,6 +63,24 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.main);
|
||||
// ID作成用のインテント
|
||||
creatUUID = findViewById(R.id.creatUUID);
|
||||
creatUUID.setOnClickListener(this);
|
||||
imageUuid = findViewById(R.id.imageUuid);
|
||||
imageUuid.setOnClickListener(this);
|
||||
|
||||
|
||||
// セットアップ用のインテント
|
||||
setUp = findViewById(R.id.setUp);
|
||||
setUp.setOnClickListener(this);
|
||||
imageSetup = findViewById(R.id.imageSetup);
|
||||
imageSetup.setOnClickListener(this);
|
||||
|
||||
// formコピー用のインテント
|
||||
formURL = findViewById(R.id.formURL);
|
||||
formURL.setOnClickListener(this);
|
||||
imageFormURL = findViewById(R.id.imageFormURL);
|
||||
imageFormURL.setOnClickListener(this);
|
||||
|
||||
|
||||
// ルート作成用のインテント
|
||||
|
@ -64,12 +95,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
imageSubmission = findViewById(R.id.imageSubmission);
|
||||
imageSubmission.setOnClickListener(this);
|
||||
|
||||
// 設定用のインテント
|
||||
SettingView = findViewById(R.id.setting);
|
||||
SettingView.setOnClickListener(this);
|
||||
imageSettingView = findViewById(R.id.imageSetting);
|
||||
imageSettingView.setOnClickListener(this);
|
||||
|
||||
// firestoreの受信関連
|
||||
db = FirebaseFirestore.getInstance();
|
||||
firestoreReception = new FirestoreReception();
|
||||
|
@ -96,6 +121,40 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
// クリック処理
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// ID作成のクリック処理
|
||||
if (view == creatUUID) {
|
||||
imageUuid.setImageResource(R.drawable.ischecked_uuid);
|
||||
showUUIDYesNoDialog();//UUIDを表示するかのダイアログ
|
||||
}
|
||||
if (view == imageUuid) {
|
||||
imageUuid.setImageResource(R.drawable.ischecked_uuid);
|
||||
showUUIDYesNoDialog();//UUIDを表示するかのダイアログ
|
||||
}
|
||||
// セットアップのクリック処理
|
||||
if (view == setUp) {
|
||||
imageSetup.setImageResource(R.drawable.ischecked_uuid);
|
||||
Intent toSetup = new Intent(MainActivity.this, SetUpActivity.class);
|
||||
toSetup.putExtra("classId", classId);
|
||||
startActivity(toSetup);
|
||||
finish(); // 画面遷移後元の状態に戻す
|
||||
}
|
||||
if (view == imageSetup) {
|
||||
imageSetup.setImageResource(R.drawable.ischecked_uuid);
|
||||
Intent toSetup = new Intent(MainActivity.this, SetUpActivity.class);
|
||||
startActivity(toSetup);
|
||||
finish(); // 画面遷移後元の状態に戻す
|
||||
}
|
||||
|
||||
// formコピー用のクリック処理
|
||||
if (view == formURL) {
|
||||
imageFormURL.setImageResource(R.drawable.ischecked_uuid);
|
||||
copyUrlToClipboard(URL_TO_COPY);
|
||||
}
|
||||
if (view == imageFormURL) {
|
||||
imageFormURL.setImageResource(R.drawable.ischecked_uuid);
|
||||
copyUrlToClipboard(URL_TO_COPY);
|
||||
}
|
||||
|
||||
// ルート作成のクリック処理
|
||||
if (view == root) {
|
||||
imageRoot.setImageResource(R.drawable.pin);
|
||||
|
@ -122,14 +181,76 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
startActivity(toSubmission);
|
||||
});
|
||||
}
|
||||
if (view == SettingView) {
|
||||
Intent toSettingView = new Intent(MainActivity.this, SettingView.class);
|
||||
startActivity(toSettingView);
|
||||
}
|
||||
if (view == imageSettingView) {
|
||||
Intent toSettingView = new Intent(MainActivity.this, SettingView.class);
|
||||
startActivity(toSettingView);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ID作成、表示に関する処理
|
||||
private void showUUIDYesNoDialog() {
|
||||
firestoreReception_classIdDatabase = new FirestoreReception_classIdDatabase();
|
||||
List<Integer> classIdList = firestoreReception_classIdDatabase.getAllDocumentsFromClassIdDatabase();
|
||||
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle("ID");
|
||||
builder.setMessage("あなたのIDを表示/もしくは新規で作成しますか?");
|
||||
|
||||
//作成処理
|
||||
builder.setPositiveButton("作成", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
classId = CreateUUID.generateUUID(classIdList);
|
||||
// 生成されたIDを表示するメソッド
|
||||
showClassIdDialog("生成されたID", classId);
|
||||
}
|
||||
});
|
||||
//表示処理
|
||||
builder.setNegativeButton("表示", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//roomを扱うため非同期処理
|
||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
executor.execute(() -> {
|
||||
// 現在のクラスIDを取得
|
||||
int currentClassId = getCurrentClassIdFromRoom();
|
||||
if (currentClassId == 0) {
|
||||
currentClassId = classId;
|
||||
}
|
||||
final int showDialogClassId = currentClassId;
|
||||
runOnUiThread(() -> {
|
||||
// 現在のクラスIDを表示するダイアログ
|
||||
showClassIdDialog("現在のID", showDialogClassId);
|
||||
});
|
||||
});
|
||||
executor.shutdown();
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog = builder.create();
|
||||
alertDialog.show();
|
||||
|
||||
}
|
||||
|
||||
private int getCurrentClassIdFromRoom() {
|
||||
AppDatabase db = getDatabaseInstance();
|
||||
SetUpTableDao setUpTableDao = db.setUpTableDao();
|
||||
|
||||
// 現在のクラスIDを取得
|
||||
return setUpTableDao.getClassId();
|
||||
}
|
||||
|
||||
//クラスIDを表示するダイアログ
|
||||
private void showClassIdDialog(String title, int classId) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(title);
|
||||
builder.setMessage("ID: " + classId);
|
||||
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
|
||||
|
@ -141,7 +262,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
runOnUiThread(onSetupComplete);
|
||||
} else {
|
||||
runOnUiThread(() -> {
|
||||
Toast.makeText(this, "先に設定画面で情報を入力してください", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "先にセットアップを済ませてください", Toast.LENGTH_LONG).show();
|
||||
});
|
||||
}
|
||||
}).exceptionally(ex -> {
|
||||
|
@ -152,7 +273,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
return null;
|
||||
});
|
||||
} else {
|
||||
Toast.makeText(this, "先に設定画面で情報を入力してください", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "先にIDの作成を行ってください", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,6 +302,21 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
}, executorService).whenComplete((result, throwable) -> executorService.shutdown());
|
||||
}
|
||||
|
||||
//クリップボードにURLをコピーする処理
|
||||
private void copyUrlToClipboard(String url) {
|
||||
try {
|
||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("URL", url);
|
||||
if (clipboard != null) {
|
||||
clipboard.setPrimaryClip(clip);
|
||||
Toast.makeText(this, "GoogleFormのURLをコピーしました", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, "エラー コピーできませんでした", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Toast.makeText(this, "Error copying URL: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
//ルート作成の非同期処理
|
||||
private void fetchDataAndCreateRoute() {
|
||||
|
|
14
app/src/main/java/com/example/oplogy/RootSearchActivity.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package com.example.oplogy;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class RootSearchActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.root_search);
|
||||
}
|
||||
}
|
|
@ -97,29 +97,15 @@ public class SetUpActivity extends FragmentActivity
|
|||
Button reset = findViewById(R.id.resetButton);
|
||||
|
||||
toMain.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(SetUpActivity.this, SettingView.class); //main画面へ戻る処理
|
||||
Intent intent = new Intent(SetUpActivity.this, MainActivity.class); //main画面へ戻る処理
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
setUp.setOnClickListener(view -> {
|
||||
|
||||
teacherNameString = setTeacherName.getText().toString(); //各変数に値を挿入
|
||||
startPointString = setStartPoint.getText().toString();
|
||||
firstDayString = setFirstDay.getText().toString();
|
||||
secondDayString = setSecondDay.getText().toString();
|
||||
thirdDayString = setThirdDay.getText().toString();
|
||||
startTimeString = setStartTime.getText().toString();
|
||||
endTimeString = setEndTime.getText().toString();
|
||||
startBreakTimeString = setStartBreakTime.getText().toString();
|
||||
endBreakTimeString = setEndBreakTime.getText().toString();
|
||||
|
||||
try {
|
||||
totalStudentString = Integer.parseInt(setTotalStudent.getText().toString());
|
||||
} catch (NumberFormatException e) {
|
||||
Toast.makeText(SetUpActivity.this, "記入欄にすべて入力を済ませてから押してください", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, "Teacher Name: " + teacherNameString);
|
||||
startPointString = setStartPoint.getText().toString();
|
||||
Log.d(TAG, "Start Point: " + startPointString);
|
||||
Log.d(TAG, "First Day:" + firstDayString);
|
||||
Log.d(TAG, "Second Day:" + secondDayString);
|
||||
|
@ -138,9 +124,11 @@ public class SetUpActivity extends FragmentActivity
|
|||
Log.d(TAG, "Interval Time" + intervalTimeString);
|
||||
Log.d(TAG, "Start Break Time" + startBreakTimeString);
|
||||
Log.d(TAG, "End Break Time" + endBreakTimeString);
|
||||
totalStudentString = Integer.parseInt(setTotalStudent.getText().toString()); //数値型に変更
|
||||
Log.d(TAG, "Total Student" + totalStudentString);
|
||||
Log.d(TAG, "onClick: できてるよ");
|
||||
|
||||
|
||||
// データベースへの登録処理
|
||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
|
||||
|
@ -188,6 +176,7 @@ public class SetUpActivity extends FragmentActivity
|
|||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
setFirstDay.setOnClickListener(v -> {
|
||||
|
@ -246,7 +235,6 @@ public class SetUpActivity extends FragmentActivity
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDateSet(DatePicker datePicker, int year, int month, int dayOfMonth) { //Dateを成形する
|
||||
// DatePickerDialogで選択された日付を処理する
|
||||
|
|
|
@ -1,190 +0,0 @@
|
|||
package com.example.oplogy;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.room.Room;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class SettingView extends AppCompatActivity implements View.OnClickListener {
|
||||
// formコピー用のURL
|
||||
private static final String URL_TO_COPY = "https://docs.google.com/forms/d/e/1FAIpQLScKI_ca01nO7die7SqZyThiqa7NB7gcucMJtiV_-sc3eZX6KQ/viewform";
|
||||
|
||||
private View backButton;
|
||||
private View creatUUID;
|
||||
private View imageUuid;
|
||||
private View setUp;
|
||||
private View imageSetup;
|
||||
private View formURL;
|
||||
private View imageFormURL;
|
||||
private AlertDialog alertDialog;
|
||||
private int classId;
|
||||
private FirestoreReception_classIdDatabase firestoreReception_classIdDatabase;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_setting_view);
|
||||
|
||||
// 戻るボタンの処理
|
||||
backButton = findViewById(R.id.BackMain_fromSetting);
|
||||
backButton.setOnClickListener(this);
|
||||
|
||||
// ID作成用のインテント
|
||||
creatUUID = findViewById(R.id.creatUUID);
|
||||
creatUUID.setOnClickListener(this);
|
||||
imageUuid = findViewById(R.id.imageUuid);
|
||||
imageUuid.setOnClickListener(this);
|
||||
|
||||
|
||||
// セットアップ用のインテント
|
||||
setUp = findViewById(R.id.setUp);
|
||||
setUp.setOnClickListener(this);
|
||||
imageSetup = findViewById(R.id.imageSetup);
|
||||
imageSetup.setOnClickListener(this);
|
||||
|
||||
// formコピー用のインテント
|
||||
formURL = findViewById(R.id.formURL);
|
||||
formURL.setOnClickListener(this);
|
||||
imageFormURL = findViewById(R.id.imageFormURL);
|
||||
imageFormURL.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (view == backButton) {
|
||||
Intent intent = new Intent(SettingView.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
// ID作成のクリック処理
|
||||
if (view == creatUUID) {
|
||||
showUUIDYesNoDialog();//UUIDを表示するかのダイアログ
|
||||
}
|
||||
if (view == imageUuid) {
|
||||
showUUIDYesNoDialog();//UUIDを表示するかのダイアログ
|
||||
}
|
||||
// セットアップのクリック処理
|
||||
if (view == setUp) {
|
||||
Intent toSetup = new Intent(SettingView.this, SetUpActivity.class);
|
||||
toSetup.putExtra("classId", classId);
|
||||
startActivity(toSetup);
|
||||
}
|
||||
if (view == imageSetup) {
|
||||
Intent toSetup = new Intent(SettingView.this, SetUpActivity.class);
|
||||
startActivity(toSetup);
|
||||
}
|
||||
|
||||
// formコピー用のクリック処理
|
||||
if (view == formURL) {
|
||||
copyUrlToClipboard(URL_TO_COPY);
|
||||
}
|
||||
if (view == imageFormURL) {
|
||||
copyUrlToClipboard(URL_TO_COPY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ID作成、表示に関する処理
|
||||
private void showUUIDYesNoDialog() {
|
||||
firestoreReception_classIdDatabase = new FirestoreReception_classIdDatabase();
|
||||
List<Integer> classIdList = firestoreReception_classIdDatabase.getAllDocumentsFromClassIdDatabase();
|
||||
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle("ID");
|
||||
builder.setMessage("あなたのIDを表示/もしくは新規で作成しますか?");
|
||||
|
||||
//作成処理
|
||||
builder.setPositiveButton("作成", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
classId = CreateUUID.generateUUID(classIdList);
|
||||
// 生成されたIDを表示するメソッド
|
||||
showClassIdDialog("生成されたID", classId);
|
||||
}
|
||||
});
|
||||
//表示処理
|
||||
builder.setNegativeButton("表示", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
//roomを扱うため非同期処理
|
||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
executor.execute(() -> {
|
||||
// 現在のクラスIDを取得
|
||||
int currentClassId = getCurrentClassIdFromRoom();
|
||||
if (currentClassId == 0) {
|
||||
currentClassId = classId;
|
||||
}
|
||||
final int showDialogClassId = currentClassId;
|
||||
runOnUiThread(() -> {
|
||||
// 現在のクラスIDを表示するダイアログ
|
||||
showClassIdDialog("現在のID", showDialogClassId);
|
||||
});
|
||||
});
|
||||
executor.shutdown();
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog = builder.create();
|
||||
alertDialog.show();
|
||||
|
||||
}
|
||||
|
||||
//Roomから現在のクラスIDを取得するメソッド
|
||||
private int getCurrentClassIdFromRoom() {
|
||||
AppDatabase db = getDatabaseInstance();
|
||||
SetUpTableDao setUpTableDao = db.setUpTableDao();
|
||||
|
||||
// 現在のクラスIDを取得
|
||||
return setUpTableDao.getClassId();
|
||||
}
|
||||
|
||||
//クラスIDを表示するダイアログ
|
||||
private void showClassIdDialog(String title, int classId) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(title);
|
||||
builder.setMessage("ID: " + classId);
|
||||
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
//クリップボードにURLをコピーする処理
|
||||
private void copyUrlToClipboard(String url) {
|
||||
try {
|
||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("URL", url);
|
||||
if (clipboard != null) {
|
||||
clipboard.setPrimaryClip(clip);
|
||||
Toast.makeText(this, "GoogleFormのURLをコピーしました", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, "エラー コピーできませんでした", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Toast.makeText(this, "Error copying URL: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
// データベースのインスタンスを取得するメソッド
|
||||
private AppDatabase getDatabaseInstance() {
|
||||
return Room.databaseBuilder(getApplicationContext(), AppDatabase.class, "SetUpTable").build();
|
||||
}
|
||||
|
||||
}
|
14
app/src/main/java/com/example/oplogy/TutorialActivity.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package com.example.oplogy;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class TutorialActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.tutorial);
|
||||
}
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="13"
|
||||
tools:context=".SettingView">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="2"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="10">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/BackMain_fromSetting"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="74dp"
|
||||
android:layout_weight="3"
|
||||
android:src="@drawable/back_button" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Setting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="7"
|
||||
android:padding="8dp"
|
||||
android:text="設定"
|
||||
android:textSize="40dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- ID作成のレイアウト-->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageUuid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/createid" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/creatUUID"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="ID作成"
|
||||
android:textSize="50dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- セットアップのレイアウト-->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal"
|
||||
|
||||
android:weightSum="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageSetup"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/settingsetup" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/setUp"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="家庭訪問情報"
|
||||
android:textSize="36dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- フォームのURLのレイアウト-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageFormURL"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/form" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/formURL"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="GoogleformのURL"
|
||||
android:textSize="28dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -13,36 +13,90 @@
|
|||
android:layout_weight="2" />
|
||||
|
||||
|
||||
<!-- タイトルのレイアウト-->
|
||||
|
||||
|
||||
<!-- ID作成のレイアウト-->
|
||||
<LinearLayout
|
||||
android:layout_width="400dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="4"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
android:weightSum="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageTitle"
|
||||
android:id="@+id/imageUuid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/app_icon" />
|
||||
android:src="@drawable/checked_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:id="@+id/creatUUID"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="2"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="OPLOGY"
|
||||
android:textSize="60dp"
|
||||
android:text="ID作成"
|
||||
android:textSize="50dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- セットアップのレイアウト-->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageSetup"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/checked_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/setUp"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="セットアップ"
|
||||
android:textSize="40dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- フォームのURLのレイアウト-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageFormURL"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/checked_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/formURL"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="GoogleformのURL"
|
||||
android:textSize="40dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -77,11 +131,6 @@
|
|||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
|
||||
<!-- 提出状況のレイアウト-->
|
||||
<LinearLayout
|
||||
|
@ -111,38 +160,5 @@
|
|||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
<!-- 諸々の設定のレイアウト-->
|
||||
<LinearLayout
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="3"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageSetting"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@drawable/setting" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/setting"
|
||||
android:layout_width="99dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
android:text="設定"
|
||||
android:textSize="40dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
9
app/src/main/res/layout/root_search.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?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"
|
||||
tools:context=".RootSearchActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
9
app/src/main/res/layout/tutorial.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?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"
|
||||
tools:context=".TutorialActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 982 B |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 7.6 KiB |
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
</resources>
|
|
@ -3,7 +3,7 @@
|
|||
<string name="maps_api_key">AIzaSyBqLqPm76UFpwbpU8b3oiH0wbkhosrPWpU</string>
|
||||
<string name="title_activity_maps">MapsActivity</string>
|
||||
<string name="setUp">設定</string>
|
||||
<string name="reset">データ削除</string>
|
||||
<string name="reset">リセット</string>
|
||||
<string name="teacherName">担任の名前</string>
|
||||
<string name="startPoint">開始地点</string>
|
||||
<string name="startTime">開始時刻</string>
|
||||
|
|