This might be very late to answer but here is the solution to customize and also play the animation:-
final private LottieDrawable ld = new LottieDrawable();
Field f = swipeRefreshLayout.getClass().getDeclaredField("mCircleView");
f.setAccessible(true);
ImageView imgVW = (ImageView)f.get(swipeRefreshLayout);
ld.setBounds(0, 0, 64, 64);
@SuppressLint("WrongThread") LottieResult<LottieComposition> result = LottieCompositionFactory.fromAssetSync(App.activity, "LottieSpinner.json");
ld.setComposition(result.getValue());
ld.setRepeatCount(LottieDrawable.INFINITE);
imgVW.setImageDrawable(ld);
Inside your SwipeRefreshLayout listener:-
swipeRefreshLayout.setOnRefreshListener(() -> {
ld.playAnimation();
})
Once network call is finished:-
void stop() {
ld.stop()
}