Skip to content

Instantly share code, notes, and snippets.

View chemickypes's full-sized avatar
📱

Angelo Moroni chemickypes

📱
View GitHub Profile
@rafali
rafali / ResizeAnimation.java
Last active February 26, 2021 13:05
Resize animation on Android
public class ResizeAnimation extends Animation {
final int startWidth;
final int targetWidth;
View view;
public ResizeAnimation(View view, int targetWidth) {
this.view = view;
this.targetWidth = targetWidth;
startWidth = view.getWidth();
}
private boolean isServiceRunning() {
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)){
if("com.example.MyNeatoIntentService".equals(service.service.getClassName())) {
return true;
}
}
return false;
}