250x250
Notice
12-08 02:11
관리 메뉴

막내의 막무가내 프로그래밍 & 일상

[안드로이드] Android Tmap 사용법 간략 정리(feat 지도위치, 마커, 길찾기) 본문

안드로이드/코틀린 & 아키텍처 & Recent

[안드로이드] Android Tmap 사용법 간략 정리(feat 지도위치, 마커, 길찾기)

막무가내막내 2020. 9. 7. 23:45
728x90

 

[2021-04-14 업데이트]

 

 

지금까지 카카오맵, 구글맵은 사용해봤는데 Tmap은 처음사용해봤었습니다. 이에 대해 추후에도 참고하게 간략하게 기록하는 포스팅을 갖도록 하겠습니다.

세개의 Map API 를 사용하면서 느낀점은 전국의 지도가 가능하며 가장 많은 기능을 가진 것은 Google Map인 것 같고 간단하게 사용할거면 카카오맵과 Tmap API 가 좋은 것 같습니다. 근데 카카오맵이 안드로이드에서 제공하는 기능이 Tmap 보다는 많습니다.

 

Tmap 의 마커와 위치, 길찾기를 설정하는 방법에 대해 알아보겠습니다.

먼저 Tmap 을 초기화하는 함수입니다.

여기서 주의하실점이 있는데 마커의 위도,경도와 지도 위치를 설정하는 setCenterPoint의 위도 경도가 서로 순서가 다르다는 점입니다. 

private fun initTmap() {
        //지도 위치설정
        val xPos = productArg.product.xPos.toDouble() //좌표
        val yPos = productArg.product.yPos.toDouble()
        val tmapView = TMapView(context)
        tmapView.setSKTMapApiKey(getString(R.string.tmap_key))
        tmapView.setCenterPoint(
            yPos,
            xPos
        )
        tmap.addView(tmapView) //tmap(xml레이아웃)에 tmapView 동적 추가
        //마커추가
        val bitmap =
            BitmapFactory.decodeResource(
                requireActivity().resources,
                R.drawable.ic_location_orange_12
            )
        val tMapPoint1 =
            TMapPoint(xPos, yPos)
        val markerItem1 = TMapMarkerItem()
        markerItem1.icon = bitmap // 마커 아이콘 지정
        markerItem1.setPosition(0.5f, 1.0f) // 마커의 중심점을 중앙, 하단으로 설정
        markerItem1.tMapPoint = tMapPoint1 // 마커의 좌표 지정
        markerItem1.name = getString(R.string.no_money_diary_text) // 마커의 타이틀 지정
        tmapView.addMarkerItem("markerItem1", markerItem1) // 지도에 마커 추가
    }

 

 

저의 레이아웃 xml 입니다.

Tmap을 볼 부분은 아래 사진만 보시면 됩니다.

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:bind="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="product"
            type="com.mtjin.nomoneytrip.data.home.Product" />

        <variable
            name="vm"
            type="com.mtjin.nomoneytrip.views.lodgment_detail.LodgmentDetailViewModel" />
    </data>

    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_back"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/margin_16dp"
                    android:layout_marginTop="@dimen/margin_32dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:srcCompat="@drawable/ic_back_title" />

                <View
                    android:id="@+id/view_top"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/height_1dp"
                    android:layout_marginTop="@dimen/margin_7dp"
                    android:background="@color/colorWhiteGrayF4F4"
                    app:layout_constraintTop_toBottomOf="@id/iv_back" />


                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/tv_lodgment_name"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="@dimen/margin_12dp"
                    android:layout_marginEnd="@dimen/margin_62dp"
                    android:ellipsize="end"
                    android:fontFamily="@font/goyang_ilsan_regular"
                    android:maxLines="2"
                    android:text="@{product.title}"
                    android:textColor="@color/colorBlack2D2D"
                    android:textSize="20sp"
                    android:textStyle="bold"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/view_top"
                    tools:text="상품 이름" />

                <androidx.appcompat.widget.AppCompatRatingBar
                    android:id="@+id/rb_rating"
                    style="?android:attr/ratingBarStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:backgroundTint="@color/colorOrangeF79256"
                    android:progressTint="@color/colorOrangeF79256"
                    app:layout_constraintStart_toStartOf="@id/tv_lodgment_name"
                    app:layout_constraintTop_toBottomOf="@id/tv_lodgment_name" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/tv_score"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:textColor="@color/colorBlack2D2D"
                    android:textSize="12sp"
                    app:layout_constraintBottom_toBottomOf="@id/rb_rating"
                    app:layout_constraintStart_toEndOf="@id/rb_rating"
                    app:layout_constraintTop_toTopOf="@id/rb_rating"
                    tools:text="6" />

                <androidx.viewpager2.widget.ViewPager2
                    android:id="@+id/vp_viewpager"
                    android:layout_width="match_parent"
                    android:layout_height="160dp"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="18dp"
                    android:layout_marginEnd="28dp"
                    app:layout_constraintTop_toBottomOf="@id/tv_score"
                    tools:background="@drawable/img_product" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/tv_pager_num"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:layout_marginEnd="16dp"
                    android:background="@drawable/bg_pager_num"
                    android:paddingStart="10dp"
                    android:paddingTop="4dp"
                    android:paddingEnd="10dp"
                    android:paddingBottom="4dp"
                    android:textColor="@color/colorWhiteFDFD"
                    app:layout_constraintEnd_toEndOf="@id/vp_viewpager"
                    app:layout_constraintTop_toTopOf="@id/vp_viewpager"
                    tools:text="1 / 9" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_favorite"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    app:layout_constraintEnd_toStartOf="@id/iv_map"
                    app:layout_constraintHorizontal_chainStyle="packed"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/vp_viewpager"
                    app:srcCompat="@drawable/ic_good_off_detail" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_map"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="52dp"
                    android:layout_marginTop="12dp"
                    android:layout_marginEnd="52dp"
                    app:layout_constraintEnd_toStartOf="@id/iv_share"
                    app:layout_constraintStart_toEndOf="@id/iv_favorite"
                    app:layout_constraintTop_toBottomOf="@id/vp_viewpager"
                    app:srcCompat="@drawable/ic_map_detail" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_share"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="12dp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toEndOf="@id/iv_map"
                    app:layout_constraintTop_toBottomOf="@id/vp_viewpager"
                    app:srcCompat="@drawable/ic_share_detail" />

                <View
                    android:id="@+id/view"
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="15dp"
                    android:layout_marginEnd="28dp"
                    android:background="@color/colorWhiteGrayF4F4"
                    app:layout_constraintTop_toBottomOf="@id/iv_share" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/text_per_day"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/margin_16dp"
                    android:text="1박 기준"
                    android:textColor="@color/colorBlack2D2D"
                    android:textSize="@dimen/text_size_12sp"
                    app:layout_constraintStart_toStartOf="@id/vp_viewpager"
                    app:layout_constraintTop_toBottomOf="@id/view" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/tv_work_hour"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/margin_2dp"
                    android:text="@{product.time}"
                    android:textColor="@color/colorOrangeF79256"
                    android:textSize="@dimen/text_size_16sp"
                    app:layout_constraintStart_toStartOf="@id/vp_viewpager"
                    app:layout_constraintTop_toBottomOf="@id/text_per_day"
                    tools:text="일손 4시간" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_marginStart="@dimen/margin_18dp"
                    android:background="@drawable/bg_btn_normal_orange_radius_8dp"
                    android:gravity="center"
                    android:onClick="@{()->vm.goReservationFirst()}"
                    android:text="@string/reserve_text"
                    android:textColor="@color/colorWhiteFDFD"
                    app:layout_constraintBottom_toBottomOf="@id/tv_work_hour"
                    app:layout_constraintEnd_toEndOf="@id/vp_viewpager"
                    app:layout_constraintStart_toEndOf="@id/tv_work_hour"
                    app:layout_constraintTop_toTopOf="@id/text_per_day" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/rv_hash_tags"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/margin_32dp"
                    android:orientation="horizontal"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="@id/vp_viewpager"
                    app:layout_constraintTop_toBottomOf="@id/tv_work_hour"
                    bind:setItems="@{product.hashTagList}"
                    tools:listitem="@layout/item_product_hash_tag" />


                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/tv_explanation"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/margin_16dp"
                    android:text="@{product.content}"
                    android:textColor="@color/colorBlack2D2D"
                    app:layout_constraintEnd_toEndOf="@id/vp_viewpager"
                    app:layout_constraintStart_toStartOf="@id/vp_viewpager"
                    app:layout_constraintTop_toBottomOf="@id/rv_hash_tags"
                    tools:text="상품 설명 상세  설명 상품 설명 상세 설명 상품 설명
상품 설명 상세 설명 상품 설명 상세 설명 상품 설명
상품 설명 상세 설명 상품 설명 상세 설명 상품 설명" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/text_lodgement_info"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="24dp"
                    android:text="@string/lodgement_info_text"
                    android:textColor="@color/colorBlack2D2D"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/tv_explanation" />

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/tmap"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/height_160dp"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="21dp"
                    android:layout_marginEnd="28dp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/text_lodgement_info" />


                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/cl_info"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="12dp"
                    android:layout_marginEnd="28dp"
                    android:background="@drawable/bg_grayf4f4_radius_8dp"
                    android:paddingBottom="17dp"
                    app:cardCornerRadius="8dp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/tmap">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/text_address"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="16dp"
                        android:text="@string/address_text"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="14sp"
                        android:textStyle="bold"
                        app:layout_constraintStart_toStartOf="@+id/cl_info"
                        app:layout_constraintTop_toTopOf="@id/cl_info" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/tv_address"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="12dp"
                        android:layout_marginTop="16dp"
                        android:layout_marginEnd="32dp"
                        android:ellipsize="end"
                        android:maxLines="2"
                        android:text="@{product.address}"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="14sp"
                        app:layout_constraintEnd_toEndOf="@id/cl_info"
                        app:layout_constraintStart_toEndOf="@id/text_address"
                        app:layout_constraintTop_toTopOf="@id/cl_info"
                        tools:text="주소입니다. 주소에요 . 주소라구요. 두
줄입니다." />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/text_tel"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="12dp"
                        android:text="@string/telephone_text"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="14sp"
                        android:textStyle="bold"
                        app:layout_constraintStart_toStartOf="@id/cl_info"
                        app:layout_constraintTop_toBottomOf="@id/tv_address" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/tv_tel"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="12dp"
                        android:ellipsize="end"
                        android:singleLine="true"
                        android:text="@{product.phone}"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="14sp"
                        app:layout_constraintStart_toEndOf="@id/text_tel"
                        app:layout_constraintTop_toTopOf="@id/text_tel"
                        tools:text="+821012345677" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/text_homepage"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="12dp"
                        android:text="@string/homepage_text"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="14sp"
                        android:textStyle="bold"
                        app:layout_constraintStart_toStartOf="@id/cl_info"
                        app:layout_constraintTop_toBottomOf="@id/text_tel" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/tv_homepage"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="12dp"
                        android:layout_marginEnd="19dp"
                        android:ellipsize="end"
                        android:singleLine="true"
                        android:text="@{product.homePage}"
                        android:textColor="@color/colorBlack2D2D"
                        app:layout_constraintEnd_toEndOf="@id/cl_info"
                        app:layout_constraintStart_toEndOf="@id/text_homepage"
                        app:layout_constraintTop_toTopOf="@id/text_homepage"
                        tools:text="http://www.naver.com" />


                </androidx.constraintlayout.widget.ConstraintLayout>

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/iv_search_road"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/height_44dp"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="12dp"
                    android:layout_marginEnd="28dp"
                    android:background="@drawable/bg_btn_orange_edge"
                    android:gravity="center"
                    android:text="길찾기"
                    android:textColor="@color/colorOrangeF79256"
                    android:textSize="@dimen/text_size_14sp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/cl_info" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/text_facility"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="36dp"
                    android:text="@string/facility_text"
                    android:textColor="@color/colorBlack2D2D"
                    android:textSize="16sp"
                    android:textStyle="bold"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/iv_search_road" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_internet"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="16dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/text_facility"
                    app:srcCompat="@drawable/ic_internet" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_car"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="87dp"
                    app:layout_constraintStart_toEndOf="@id/iv_internet"
                    app:layout_constraintTop_toTopOf="@id/iv_internet"
                    app:srcCompat="@drawable/ic_car" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_store"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="8dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/iv_internet"
                    app:srcCompat="@drawable/ic_store" />

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/iv_dog"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="87dp"
                    app:layout_constraintStart_toEndOf="@id/iv_store"
                    app:layout_constraintTop_toTopOf="@id/iv_store"
                    app:srcCompat="@drawable/ic_dog" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/text_housing_policy"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="36dp"
                    android:text="@string/housing_policy_text"
                    android:textColor="@color/colorBlack2D2D"
                    android:textSize="16sp"
                    android:textStyle="bold"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/iv_dog" />

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/cl_policy"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="28dp"
                    android:layout_marginTop="16dp"
                    android:layout_marginEnd="28dp"
                    android:background="@drawable/bg_garyf4f4f4"
                    android:paddingBottom="16dp"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/text_housing_policy">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/text_check_in"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="@string/check_in_text"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="14sp"
                        android:textStyle="bold"
                        app:layout_constraintEnd_toStartOf="@id/text_check_out"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/text_check_out"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="체크아웃"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="14sp"
                        android:textStyle="bold"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toEndOf="@id/text_check_in"
                        app:layout_constraintTop_toTopOf="parent" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/tv_check_in_time"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="12dp"
                        android:text="@{product.checkIn}"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="14sp"
                        app:layout_constraintEnd_toEndOf="@id/text_check_in"
                        app:layout_constraintStart_toStartOf="@id/text_check_in"
                        app:layout_constraintTop_toBottomOf="@id/text_check_in"
                        tools:text="오전 9시" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/tv_check_out_time"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/margin_12dp"
                        android:text="@{product.checkOut}"
                        android:textColor="@color/colorBlack2D2D"
                        android:textSize="@dimen/text_size_14sp"
                        app:layout_constraintEnd_toEndOf="@id/text_check_out"
                        app:layout_constraintStart_toStartOf="@id/text_check_out"
                        app:layout_constraintTop_toBottomOf="@id/text_check_out"
                        tools:text="다음날 오전 11시" />

                </androidx.constraintlayout.widget.ConstraintLayout>

                <TextView
                    android:id="@+id/tv_tour_review"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/margin_28dp"
                    android:layout_marginTop="@dimen/margin_32dp"
                    android:textColor="@color/colorBlack2D2D"
                    android:textSize="@dimen/text_size_18sp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/cl_policy"
                    tools:text="이 지역 여행기" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/rv_reviews"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/margin_20dp"
                    android:orientation="vertical"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/tv_tour_review"
                    tools:itemCount="1"
                    tools:listitem="@layout/item_lodgement_review" />


                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/tv_view_all_local"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/height_44dp"
                    android:layout_marginTop="@dimen/margin_16dp"
                    android:layout_marginBottom="@dimen/margin_40dp"
                    android:background="@drawable/bg_btn_orange_edge"
                    android:gravity="center"
                    android:text="이 지역 여행기 전체보기"
                    android:textColor="@color/colorOrangeF79256"
                    android:textSize="@dimen/text_size_14sp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="@id/vp_viewpager"
                    app:layout_constraintStart_toStartOf="@id/vp_viewpager"
                    app:layout_constraintTop_toBottomOf="@id/rv_reviews" />
            </androidx.constraintlayout.widget.ConstraintLayout>

        </ScrollView>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:elevation="1dp">

            <androidx.appcompat.widget.AppCompatTextView
                android:layout_width="match_parent"
                android:layout_height="@dimen/height_64dp"
                android:background="@color/colorOrangeF79256"
                android:gravity="center"
                android:onClick="@{()->vm.goReservationFirst()}"
                android:text="@string/reserve_text"
                android:textColor="@color/colorWhiteFDFD"
                android:textSize="@dimen/text_size_14sp"
                app:layout_constraintBottom_toBottomOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.appcompat.widget.LinearLayoutCompat>
</layout>

 

[길찾기]

searchDirection.observe(this@LodgmentDetailFragment, Observer {
                val tMapTapi = TMapTapi(thisContext)
                if (tMapTapi.isTmapApplicationInstalled) tMapTapi.invokeRoute(
                    productArg.product.address,
                    productArg.product.yPos.toFloat(),
                    productArg.product.xPos.toFloat()
                )
                else showToast(getString(R.string.please_install_tmap_text))
            })

 

 

이상 간략하게 기록겸 정리해봤습니다.

감사합니다. !! 

 

 

[참고]

tmapapi.sktelecom.com/main.html#android/guide/androidGuide.sample1

 

Guide | T MAP API

 

tmapapi.sktelecom.com

 

728x90
0 Comments
댓글쓰기 폼