Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/src/main/java/com/example/map_google/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.example.map_google
import android.Manifest
import android.annotation.SuppressLint
import android.content.ContentValues.TAG
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.Color
import android.location.Location
Expand Down Expand Up @@ -105,6 +106,19 @@ class MainActivity : AppCompatActivity(), OnMapReadyCallback {
refreshCarmera()
}

val shareButton: Button = findViewById(R.id.shareButton)
shareButton.setOnClickListener {
val intent = Intent(Intent.ACTION_SEND)
intent.type = "text/plain"

val url = "exampleURL"
val content = "링크를 클릭하여 위치 공유에 참여하세요"
intent.putExtra(Intent.EXTRA_TEXT, "$content\n\n$url")

val chooserTitle = "링크 공유하기"
startActivity(Intent.createChooser(intent, chooserTitle))
}

// 타이머 시간 설정 후 시작
// TODO: 추후 이전 페이지에서 설정된 시간(분)을 가져와서 설정
startTime = 5;
Expand Down
Binary file added app/src/main/res/drawable/share_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,29 @@
app:srcCompat="@android:drawable/ic_menu_mylocation"
app:tint="#9800d4" />


<com.google.android.material.button.MaterialButton
android:id="@+id/shareButton"
android:layout_width="180dp"
android:layout_height="56dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="10dp"
android:text="링크로 공유하기"
android:clickable="true"
android:textColor="@color/black"
app:backgroundTint="@color/white"
app:icon="@drawable/share_icon"
app:iconGravity="textStart"
app:iconPadding="8dp"
app:iconSize="24dp"
app:iconTint="@color/black"
app:elevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/toggleButton"/>




<com.google.android.material.button.MaterialButton
android:id="@+id/add5Min"
android:layout_width="0dp"
Expand Down