[android] #3276 - only update thumb Icon when needed, disabled background task for now, added view pool counter
This commit is contained in:
@@ -74,6 +74,7 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView
|
||||
});
|
||||
|
||||
final View fab = findViewById(R.id.fab);
|
||||
final TextView viewCountView = (TextView) findViewById(R.id.countView);
|
||||
if (fab != null) {
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -81,6 +82,22 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView
|
||||
if (mMapboxMap != null) {
|
||||
fab.animate().alpha(0).start();
|
||||
mMapboxMap.setMarkerViewAdapter(new TextAdapter(BulkMarkerActivity.this));
|
||||
mMapView.addOnMapChangedListener(new MapView.OnMapChangedListener() {
|
||||
@Override
|
||||
public void onMapChanged(@MapView.MapChange int change) {
|
||||
if (change == MapView.REGION_IS_CHANGING || change == MapView.REGION_DID_CHANGE) {
|
||||
if (mMapboxMap.getMarkerViewAdapter() != null) {
|
||||
viewCountView.setText("ViewCache size " + (mMapView.getChildCount()-5));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
mMapboxMap.setOnMarkerViewClickListener(new MapboxMap.OnMarkerViewClickListener() {
|
||||
@Override
|
||||
public void onMarkerClick(@NonNull Marker marker, @NonNull View view) {
|
||||
mMapboxMap.selectMarker(marker);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
app:style_url="@string/style_mapbox_streets"
|
||||
app:zoom="10" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/countView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:padding="16dp"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
|
||||
Reference in New Issue
Block a user