Can't Identify which element is used....?
Asked Answered
S

1

0

I've an android application, which set Location based reminders. After I added an alarm, it displays as following.

enter image description here

I can't understand which component is used to display the small map and text both. Also the small map has location which I've selected on the map. I'm developing similar application, and I want to use this type of display feature.

Strati answered 18/8, 2016 at 6:26 Comment(6)
Do you have the source code to that application?Slide
The answer is of course NO.Strati
The small map is a MapView kept under RelativeLayout or some other layout!!!Fourposter
But it is Click able. and what about text?Strati
In developer options...check "Show layout boundaries"Fourposter
There might be one TextView and one MapView used in some parent layout, say linear or relative view.Trackman
C
-1

That looks like a Lite mode Google Map to me.

this video is the best explanation on the internet and covers the use case i think you are refering to. https://youtu.be/N0N1Xkc_1pU

You can check out my answer to another similar question here: https://mcmap.net/q/522467/-how-to-retrieve-snapshot-of-map-from-place-picker-activity

Here's the google developers page on the topic https://developers.google.com/maps/documentation/android-api/lite

Also here's a link to a demo activity that uses lite maps in a list https://github.com/googlemaps/android-samples/blob/master/ApiDemos/app/src/main/java/com/example/mapdemo/LiteListDemoActivity.java

you probably want your list item layout file to look something like

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_toLeftOf="@+id/map">
    <TextView
        android:id="@+id/title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <TextView
        android:id="@+id/location"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    <TextView
        android:id="@+id/created_at"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</LinearLayout>

<fragment
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:map="http://schemas.android.com/apk/res-auto"
    android:name="com.google.android.gms.maps.MapFragment"
    android:id="@+id/map"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_alignParentRight="true"
    map:cameraZoom="13"
    map:mapType="normal"
    map:liteMode="true"/>

</RelativeLayout>

Note the map:liteMode="true" in the map fragment declaration.

Conjurer answered 13/9, 2016 at 5:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.