@Override
public void onMapReady(@NonNull NaverMap naverMap) {
map = naverMap;
fab.setOnClickListener(v -> {
if (trackingEnabled) {
disableLocation();
fab.setImageResource(R.drawable.ic_my_location_black_24dp);
} else {
CircularProgressDrawable progressDrawable = new CircularProgressDrawable(this);
progressDrawable.setStyle(CircularProgressDrawable.LARGE);
progressDrawable.setColorSchemeColors(Color.WHITE);
progressDrawable.start();
fab.setImageDrawable(progressDrawable);
tryEnableLocation();
}
trackingEnabled = !trackingEnabled;
});
}
public DefaultRefreshView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
View view = LayoutInflater.from(context).inflate(R.layout.view_default_refresh, null);
addView(view);
viewContainer = view.findViewById(R.id.viewContainer);
tvSecondFloor = view.findViewById(R.id.tvSecondFloor);
viewCover = view.findViewById(R.id.viewCover);
imageView = view.findViewById(R.id.imageView);
mProgress = new CircularProgressDrawable(getContext());
mProgress.setStyle(CircularProgressDrawable.DEFAULT);
imageView.setImageDrawable(mProgress);
mProgress.setArrowEnabled(true);
mProgress.stop();
}