Merge pull request #4 from N-YOKU-jp/CreateUi

Create UI
This commit is contained in:
ユタ氏 2024-06-11 14:09:14 +09:00 committed by GitHub
commit 05598940a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 295 additions and 277 deletions

View File

@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "317219128586",
"project_id": "oplogy-b6971",
"storage_bucket": "oplogy-b6971.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:317219128586:android:c29583456e8fbd5f12a6f3",
"android_client_info": {
"package_name": "com.example.oplogy"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDaULi2TFHLiscR7DSZBCKS08d76Rtb49c"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@ -12,24 +12,7 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.Oplogy" android:theme="@style/Theme.Oplogy"
tools:targetApi="31"> tools:targetApi="31">
<activity
android:name=".TutorialActivity"
android:exported="false" />
<activity
android:name=".NotSubmissionActivity"
android:exported="false" />
<activity
android:name=".SubmissionActivity"
android:exported="false" />
<activity
android:name=".RootSearchActivity"
android:exported="false" />
<activity
android:name=".SetupActivity"
android:exported="false" />
<activity
android:name=".CreateUuidActivity"
android:exported="false" />
<!-- <!--
TODO: Before you run your application, you need a Google Maps API key. TODO: Before you run your application, you need a Google Maps API key.
@ -43,18 +26,33 @@
--> -->
<meta-data <meta-data
android:name="com.google.android.geo.API_KEY" android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyBQ1Ak-I2NL5TP4K59ZI0VgzKk6HNZuusw" /> android:value="YOUR_API_KEY" />
<activity <activity
android:name=".MapsActivity" android:name=".Maps"
android:exported="true" android:exported="false"
android:label="@string/title_activity_maps"> 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=".SetupActivity"
android:exported="false" />
<activity
android:name=".CreateUUID"
android:exported="false" />
<activity
android:name="com.example.oplogy.DialogFragment"
android:exported="false"
/>
<!-- <intent-filter> -->
<!-- <action android:name="android.intent.action.MAIN" /> -->
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<!-- </intent-filter> -->
</activity>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true"> android:exported="true">
@ -64,6 +62,7 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
</application> </application>
</manifest> </manifest>

View File

@ -4,11 +4,11 @@ import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle; import android.os.Bundle;
public class CreateUuidActivity extends AppCompatActivity { public class CreateUUID extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create_uuid); setContentView(R.layout.create_uuid);
} }
} }

View File

@ -1,14 +1,13 @@
package com.example.oplogy; package com.example.oplogy;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle; import android.os.Bundle;
public class NotSubmissionActivity extends AppCompatActivity { public class DialogFragment extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_not_submission); setContentView(R.layout.dialog_fragment);
} }
} }

View File

@ -1,143 +1,91 @@
package com.example.oplogy; package com.example.oplogy;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.google.firebase.firestore.FirebaseFirestore; import android.content.Intent;
import com.google.firebase.firestore.QueryDocumentSnapshot; import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity implements View.OnClickListener{ public class MainActivity extends AppCompatActivity implements View.OnClickListener{
private TextView textView;
private Button btnShow; // ID作成のTextViewとImageView
private Button btnAdd; private TextView creatUUID;
private EditText number; private ImageView imageUuid;
private EditText address; private int previousCreateUUid = 0; //元の画像のインデックス
private EditText date;
private EditText time;
private FirebaseFirestore db = FirebaseFirestore.getInstance();
Button button; // セットアップのTextViewとImageView
// TextView textView; private TextView setUp;
EditText editText; private ImageView imageSetup;
@SuppressLint("MissingInflatedId") private int previousSetUp = 0; //元の画像のインデックス
// セットアップのTextViewとImageView
private TextView root;
private ImageView imageRoot;
private int previousRoot = 0; //元の画像のインデックス
// 提出状況のTextViewとImageView
private TextView submission;
@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.main);
// ID作成用のインテント
creatUUID = findViewById(R.id.creatUUID);
creatUUID.setOnClickListener(this);
imageUuid = findViewById(R.id.imageUuid);
textView=findViewById(R.id.showText); // セットアップ用のインテント
btnShow=findViewById(R.id.btnShow); setUp = findViewById(R.id.setUp);
btnAdd=findViewById(R.id.btnAdd); setUp.setOnClickListener(this);
imageSetup = findViewById(R.id.imageSetup);
number=findViewById(R.id.editNumber); // ルート作成用のインテント
address=findViewById(R.id.editAddress); root = findViewById(R.id.root);
date=findViewById(R.id.editDate); root.setOnClickListener(this);
time=findViewById(R.id.editTime); imageRoot = findViewById(R.id.imageRoot);
// 提出状況のインテント
submission = findViewById(R.id.submission);
submission.setOnClickListener(this);
//データの追加(適当なデータを追加しています実際にはデータベースに保存したいデータを追加してください) }
findViewById(R.id.btnAdd).setOnClickListener(new View.OnClickListener() {
// クリック処理
@Override @Override
public void onClick(View v) { public void onClick(View view) {
User user = new User(number.getText().toString(), address.getText().toString(),date.getText().toString(),time.getText().toString()); // ID作成のクリック処理
if(view == creatUUID){
imageUuid.setImageResource(R.drawable.ischecked_uuid);
Intent toCreateUUID = new Intent(MainActivity.this, CreateUUID.class);
startActivity(toCreateUUID);
db.collection("users")
.add(user)
.addOnSuccessListener(documentReference -> Log.d("@FB1", "DocumentSnapshot added with ID: " + documentReference.getId()))
.addOnFailureListener(e -> Log.w("@FB1", "Error adding document", e));
} }
}); // セットアップのクリック処理
if(view == setUp){
imageSetup.setImageResource(R.drawable.ischecked_uuid);
Intent toSetup = new Intent(MainActivity.this,SetupActivity.class);
startActivity(toSetup);
btnShow.setOnClickListener(v -> {
// Read Data
// Firestoreのコレクションusersのドキュメント一覧を取得する
// 非同期で取得処理が動作する結果を受け取るために処理完了時のリスナーをセットする
db.collection("users").get().addOnCompleteListener(task -> {
String data = "";
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
Log.d("@FB1", document.getId() + "=>" + document.getData());
User user = document.toObject(User.class);
data += user + "\n";
} }
} else { // ルート作成のクリック処理
data = "Error getting documents." + task.getException().getMessage(); if(view == root){
imageRoot.setImageResource(R.drawable.pin);
Intent toRoot = new Intent(MainActivity.this,RootSearchActivity.class);
startActivity(toRoot);
}
// 提出状況のクリック処理
if(view == submission){
Intent toSubmission = new Intent(MainActivity.this,SubmissionActivity.class);
startActivity(toSubmission);
} }
textView.setText(data);//編集したデータを画面下部に表示
});
});
findViewById(R.id.mapmapcreate).setOnClickListener(
view->{
} }
);
}
@Override
public void onClick(View v) {
}
}
class User {
private String number;
private String address;
private String date;
private String time;
public User() {
}
public User(String number, String address, String data, String time) {
this.number = number;
this.address = address;
this.date = data;
this.time = time;
}
//getterとsetter
public String getNumber() {
return number;
}
public String getAddress() {
return address;
}
public String getDate() {
return date;
}
public String getTime() {
return time;
}
public void setNumber(String number) {
this.number = number;
}
public void setAddress(String address) {
this.address = address;
}
public void setDate(String date) {
this.date = date;
}
public void setTime(String time) {
this.time = time;
}
} }

View File

@ -10,19 +10,18 @@ import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.MarkerOptions;
import com.example.oplogy.databinding.ActivityMapsBinding; import com.example.oplogy.databinding.MapsBinding;
//import com.google.type.LatLng;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { public class Maps extends FragmentActivity implements OnMapReadyCallback {
private GoogleMap mMap; private GoogleMap mMap;
private ActivityMapsBinding binding; private MapsBinding binding;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
binding = ActivityMapsBinding.inflate(getLayoutInflater()); binding = MapsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot()); setContentView(binding.getRoot());
// Obtain the SupportMapFragment and get notified when the map is ready to be used. // Obtain the SupportMapFragment and get notified when the map is ready to be used.
@ -45,13 +44,8 @@ public class MapsActivity extends FragmentActivity implements OnMapReadyCallback
mMap = googleMap; mMap = googleMap;
// Add a marker in Sydney and move the camera // Add a marker in Sydney and move the camera
/// 緯度経度 LatLng sydney = new LatLng(-34, 151);
LatLng loc = new LatLng(35.17260398479137, 136.88635173557998); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
/// マーカーオプションを設定情報ウィンドウ mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
mMap.addMarker(new MarkerOptions().position(loc).title("トライデントコンピュータ専門学校"));
/// 表示位置を地図に指定
mMap.moveCamera(CameraUpdateFactory.newLatLng(loc));
/// 地図の倍率を指定
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(loc, 17));
} }
} }

View File

@ -9,6 +9,6 @@ public class RootSearchActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_root_search); setContentView(R.layout.root_search);
} }
} }

View File

@ -9,6 +9,6 @@ public class SetupActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setup); setContentView(R.layout.setup);
} }
} }

View File

@ -9,6 +9,6 @@ public class SubmissionActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_submission); setContentView(R.layout.submission);
} }
} }

View File

@ -9,6 +9,6 @@ public class TutorialActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tutorial); setContentView(R.layout.tutorial);
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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=".MainActivity"
android:orientation="vertical">
<EditText
android:id="@+id/editNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="番号" />
<EditText
android:id="@+id/editAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="住所" />
<EditText
android:id="@+id/editDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="日付" />
<EditText
android:id="@+id/editTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="時間" />
<Button
android:id="@+id/btnAdd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="追加"/>
<Button
android:id="@+id/btnShow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="表示" />
<TextView
android:id="@+id/showText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="" />
=======
<Button
android:id="@+id/mapmapcreate"
android:text="マップ生成"
android:textSize="50px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/textview1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="100px"
android:hint="ここだよ"
android:text=""
/>
</LinearLayout>

View File

@ -1,9 +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"
tools:context=".NotSubmimissionActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -4,6 +4,6 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".CreateUuidActivity"> tools:context=".CreateUUID">
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".NotSubmissionActivity"> tools:context=".DialogFragment">
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:weightSum="20"
tools:context=".MainActivity">
<Space
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"/>
<!-- ID作成のレイアウト-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="3"
android:weightSum="2"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageUuid"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@drawable/checked_image"
android:layout_weight="1"
/>
<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_weight="3"
android:weightSum="2"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageSetup"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@drawable/checked_image"
android:layout_weight="1"
/>
<TextView
android:id="@+id/setUp"
android:layout_width="99dp"
android:layout_height="wrap_content"
android:text="セットアップ"
android:textSize="40dp"
android:textStyle="bold"
android:layout_weight="1"
android:gravity="left"
android:layout_gravity="center"/>
</LinearLayout>
<!-- ルート表示のレイアウト-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="3"
android:weightSum="2"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageRoot"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@drawable/box_root"
android:layout_weight="1"
/>
<TextView
android:id="@+id/root"
android:layout_width="99dp"
android:layout_height="wrap_content"
android:text="ルート表示"
android:textSize="40dp"
android:textStyle="bold"
android:layout_weight="1"
android:gravity="left"
android:layout_gravity="center"/>
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"/>
<!-- 提出状況のレイアウト-->
<TextView
android:id="@+id/submission"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提出状況"
android:textSize="40dp"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center"/>
</LinearLayout>

View File

@ -6,4 +6,4 @@
android:name="com.google.android.gms.maps.SupportMapFragment" android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MapsActivity" /> tools:context=".Maps" />