菊池
マップとスクロールを表示できました。確認をお願いします
This commit is contained in:
parent
1e954780cc
commit
5c7b4a28d7
52
app/src/main/java/com/example/oplogy/MapsActivity.java
Normal file
52
app/src/main/java/com/example/oplogy/MapsActivity.java
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
package com.example.oplogy;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.example.oplogy.databinding.MapsBinding;
|
||||||
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
|
import com.google.android.gms.maps.MapFragment;
|
||||||
|
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||||
|
import com.google.android.gms.maps.SupportMapFragment;
|
||||||
|
import com.google.common.collect.MapMaker;
|
||||||
|
|
||||||
|
public class MapsActivity extends AppCompatActivity implements View.OnClickListener, OnMapReadyCallback{
|
||||||
|
ImageView toMain;
|
||||||
|
private GoogleMap mMap;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_maps);
|
||||||
|
|
||||||
|
// ボタンの戻る処理
|
||||||
|
toMain = findViewById(R.id.toMain);
|
||||||
|
toMain.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
// メイン画面に戻る
|
||||||
|
if(view == toMain){
|
||||||
|
Intent toMain = new Intent(MapsActivity.this,MainActivity.class);
|
||||||
|
startActivity(toMain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onMapReady(@NonNull GoogleMap googleMap) {
|
||||||
|
mMap = googleMap;
|
||||||
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
60
app/src/main/res/layout/activity_maps.xml
Normal file
60
app/src/main/res/layout/activity_maps.xml
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?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="10"
|
||||||
|
tools:context=".MapsActivity">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="10">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/toMain"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="90dp"
|
||||||
|
android:src="@drawable/back_button"
|
||||||
|
android:layout_weight="5"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="4"
|
||||||
|
android:id="@+id/date"
|
||||||
|
android:hint="今日の日付"
|
||||||
|
android:textSize="40dp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:id="@+id/map_fragment_container"
|
||||||
|
tools:context=".Map"
|
||||||
|
android:layout_weight="6"
|
||||||
|
android:name="com.google.android.gms.maps.SupportMapFragment"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:id="@+id/scrollName"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="3"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user