Page MenuHomeGitPull.it

D33.1765105106.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D33.1765105106.diff

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

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)

Event Timeline