This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert mp4 to png array | |
for f in *; do echo "Got '${f}'"; cd ${f}; mkdir ~/Desktop/frames/${f}; ffmpeg -i ${f}.mp4 -vf scale=600:-1 -r 29.97 ~/Desktop/frames/${f}/ffout_"${f%.mp4}%03d.png"; cd ..; done | |
// Convert png array to gif | |
for D in *; do echo "Got '${D}'"; cd ${D}; convert -dispose none -delay 3 -loop 0 ffout* ~/Desktop/gif/${D}.gif; cd ..; done | |
// Scale mp4 to png array at certain size | |
for f in *.mp4; do ffmpeg -i ${f} -vf scale=160:-1 -r 29.97 ~/Desktop/"${f}"; done | |
// PNG array to gif with transparent background |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LeanbackUtil { | |
/** | |
* Returns true if the Leanback System feature is available otherwise false | |
* | |
* Can be used to help determine if running on an android tv device with the leanback launcher. | |
*/ | |
public static boolean isLeanbackSupported(Context context) { | |
final PackageManager pm = context.getPackageManager(); | |
return pm.hasSystemFeature("android.software.leanback"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |