Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F6999287
D33.1765105106.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D33.1765105106.diff
View Options
diff --git a/res/layout/map_popup.xml b/res/layout/map_popup.xml
--- a/res/layout/map_popup.xml
+++ b/res/layout/map_popup.xml
@@ -2,27 +2,34 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="@color/cardview_light_background">
+ android:background="@color/cardview_light_background"
+ android:padding="8dp">
<TextView
- android:id="@+id/bubble_title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textColor="@color/blue_500" />
+ android:id="@+id/bubble_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textColor="@color/blue_500"/>
<TextView
- android:id="@+id/bubble_description"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ android:id="@+id/bubble_description"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ />
<TextView
android:id="@+id/bubble_subdescription"
android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ />
<ImageView
android:id="@+id/bubble_image"
android:layout_height="wrap_content"
- android:layout_width="wrap_content" />
+ android:layout_width="wrap_content"
+ android:visibility="gone"
+ />
</LinearLayout>
\ No newline at end of file
diff --git a/src/it/reyboz/bustorino/ActivityMap.java b/src/it/reyboz/bustorino/ActivityMap.java
--- a/src/it/reyboz/bustorino/ActivityMap.java
+++ b/src/it/reyboz/bustorino/ActivityMap.java
@@ -158,6 +158,8 @@
marker.setIcon(getResources().getDrawable(R.drawable.bus_marker));
// add to it a title
marker.setTitle(stopName);
+ // set the description as the ID
+ marker.setSnippet(ID);
// show popup info window of the searched marker
if (isStartMarker) {
diff --git a/src/it/reyboz/bustorino/map/CustomInfoWindow.java b/src/it/reyboz/bustorino/map/CustomInfoWindow.java
--- a/src/it/reyboz/bustorino/map/CustomInfoWindow.java
+++ b/src/it/reyboz/bustorino/map/CustomInfoWindow.java
@@ -1,11 +1,15 @@
package it.reyboz.bustorino.map;
import android.annotation.SuppressLint;
+import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
+import android.widget.TextView;
+import org.osmdroid.api.IMapView;
import org.osmdroid.views.MapView;
import org.osmdroid.views.overlay.infowindow.BasicInfoWindow;
@@ -14,6 +18,20 @@
public class CustomInfoWindow extends BasicInfoWindow {
+ @Override
+ public void onOpen(Object item) {
+ super.onOpen(item);
+
+ TextView descr_textView = (TextView) mView.findViewById(R.id.bubble_description);
+ CharSequence text = descr_textView.getText();
+ if (text==null || !text.toString().isEmpty()){
+ descr_textView.setVisibility(View.VISIBLE);
+ } else
+ descr_textView.setVisibility(View.GONE);
+
+ mView.setElevation(3.2f);
+ }
+
@SuppressLint("ClickableViewAccessibility")
public CustomInfoWindow(MapView mapView, String ID, String stopName) {
// get the personalized layout
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 11:58 (1 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1427248
Default Alt Text
D33.1765105106.diff (3 KB)
Attached To
Mode
D33: Make marker popup more beautiful in map
Attached
Detach File
Event Timeline
Log In to Comment