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 NV21 (YYYYYYYYY:VUVU) to I420 (YYYYYYYY:UU:VV) | |
Convert I420 (YYYYYYYY:UU:VV) to NV21 (YYYYYYYYY:VUVU) can be get here: https://gist.github.com/pnemonic78/2d8411ed6b0bd6c71b651800bc97eb8e | |
*/ | |
public byte[] NV21toI420(final byte[] input, byte[] output, final int width, final int height) { | |
if (output == null) { | |
output = new byte[input.length]; | |
} | |
final int size = width * height; | |
final int quarter = size / 4; | |
final int v0 = size + quarter; |
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
import android.widget.ListPopupWindow; | |
import android.widget.PopupWindow; | |
import android.widget.Spinner; | |
public static void avoidSpinnerDropdownFocus(Spinner spinner) { | |
try { | |
Field listPopupField = Spinner.class.getDeclaredField("mPopup"); | |
listPopupField.setAccessible(true); | |
Object listPopup = listPopupField.get(spinner); | |
if (listPopup instanceof ListPopupWindow) { |