Select to view content in your preferred language

Callout flashing when tapping on high-res mobile device screen

3985
5
Jump to solution
02-24-2016 02:08 AM
MikeC
by
Deactivated User

In high-res devices, the Callout in MapView flashes (hide and show) when tapping on the device screen, which affects user experience a lot.

From analysis, the com.esri.android.map.MapOnTouchListner calls Callout.hide( ) in a number of events (e.g. onDoubleTapDrag). My design is to do an identify task on the MapView when user long tap on the screen and display the result in Callout. But with such an existing issue, the result is very frustrating.

Do any other developers faced this issue as well?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
AlexanderNohe1
Honored Contributor

Hey Mike C​,

I was able to reproduce this on a Nexus 5x.  I went ahead and logged the following defect:

BUG-000097661 : Callouts are flickering in the Android SDK when they are moved to a new location.

View solution in original post

0 Kudos
5 Replies
WillCrick
Deactivated User

If possible could you record a video of this behavior and post it here?

0 Kudos
AlexanderNohe1
Honored Contributor

Hello Mike C​,

I am trying to reproduce this issue and I am having trouble.

This is the code I am using to display the callout:

@Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  myText = new TextView(getApplicationContext());
  myText.setText("TEST");

  mapView = (MapView) findViewById(R.id.map);
  mapView.setOnLongPressListener(new OnLongPressListener() {
   @Override public boolean onLongPress(float v, float v1) {
  Log.e("NOHE", "TEST");
   Log.e("NOHE", "" + v + " " + v1);
   mapView.getCallout().setContent(myText);
   Point mapPoint = mapView.toMapPoint(v,v1);
   mapView.getCallout().show(mapPoint);
  return false;
   }
  });
}

Are you doing something similar or different?

Thanks,

Alexander

0 Kudos
AlexanderNohe1
Honored Contributor

Hi Mike C​,

I read a little more into what you are doing and also tried reproducing this way without success:

public class MapEventsBrian extends MapOnTouchListener {

  MapView mMapView;
  Context mContext;
  TextView myText;
  Point mapPoint;

  public MapEventsBrian(Context context, MapView view) {
   super(context, view);

   mContext = context;
  this.mMapView = view;

   myText = new TextView(context);
   myText.setText("TEST");

  }

  @Override public void onLongPress(MotionEvent point) {
   super.onLongPress(point);
  float v = point.getX();
  float v1 = point.getY();
   Log.e("NOHE", "TEST");
   Log.e("NOHE", "" + v + " " + v1);
   mMapView.getCallout().setContent(myText);
   mapPoint = mMapView.toMapPoint(v,v1);
   mMapView.getCallout().show(mapPoint);

  }

  @Override public boolean onLongPressUp(MotionEvent point) {
   mMapView.getCallout().hide();
  return true;

  }
}

and this was my implementation:

public class MainActivity extends AppCompatActivity {

  MapView mapView;
  TextView myText;

  @Override protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);



   mapView = (MapView) findViewById(R.id.map);
   MapEventsBrian mapB = new MapEventsBrian(getApplicationContext(), mapView);
   mapView.setOnTouchListener(mapB);
  }
}
0 Kudos
MikeC
by
Deactivated User

Hi Alexander,

We'd did a bit more to get into the problem.

When the LongPress event is triggered, we make an async call to get some results from web services, and show the callout when the result is arrived.

OR when we do a view.postDelayed() and show the callout in Runnable.run(), similar case will occurred:

// inside onLongPress(x, y)

final Point pt = mapView.toMapPoint(x, y);

mapView.postDelayed(new Runnable() {

     @Override

     public void run() {

          Callout callout = mapView.getCallout();

          // ... customized the callout,

          callout.show(pt, view);

     }

});

And I encountered this issue on Sony Xperia Z3 and Z3 compact at the moment.

0 Kudos
AlexanderNohe1
Honored Contributor

Hey Mike C​,

I was able to reproduce this on a Nexus 5x.  I went ahead and logged the following defect:

BUG-000097661 : Callouts are flickering in the Android SDK when they are moved to a new location.

0 Kudos