Add gif support
This commit is contained in:
1 parent
ccea1ffc06
commit
c463714a9b
22 files changed
+1951
-98
No files matched your search
@@ -39,10 +39,10 @@ import com.hippo.scene.SceneManager;
|
||||
import com.hippo.scene.SimpleCurtain;
|
||||
import com.hippo.scene.StageActivity;
|
||||
import com.hippo.scene.StageLayout;
|
||||
import com.hippo.yorozuya.Messenger;
|
||||
import com.hippo.vectorold.content.VectorContext;
|
||||
import com.hippo.widget.DrawerLayout;
|
||||
import com.hippo.widget.DrawerListView;
|
||||
import com.hippo.yorozuya.Messenger;
|
||||
|
||||
public final class ContentActivity extends StageActivity
|
||||
implements FitStageLayout.OnFitPaddingBottomListener,
|
||||
@@ -174,6 +174,41 @@ public final class ContentActivity extends StageActivity
|
||||
if (savedInstanceState == null) {
|
||||
startScene(GalleryListScene.class, null);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
try {
|
||||
|
||||
BitmapPool bitmapPool = new BitmapPool();
|
||||
ByteArrayPool byteArrayPool = new ByteArrayPool();
|
||||
GifBitmapProvider gifBitmapProvider = new GifBitmapProvider(bitmapPool, byteArrayPool);
|
||||
|
||||
|
||||
File file = new File(Environment.getExternalStorageDirectory(), "00000001.gif");
|
||||
UniRandomReadFile randomReadFile = UniRandomReadFile.fromFile(file);
|
||||
GifHeader gifHeader = new GifHeaderParser().setData(randomReadFile).parseHeader();
|
||||
if (gifHeader.getStatus() == GifDecoder.STATUS_OK) {
|
||||
GifDecoder gifDecoder = new GifDecoder(gifBitmapProvider, gifHeader, randomReadFile);
|
||||
|
||||
|
||||
for (int i = 0, n = gifDecoder.getFrameCount(); i < n * 2; i++) {
|
||||
gifDecoder.advance();
|
||||
gifDecoder.getNextFrame().compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream(new File(Environment.getExternalStorageDirectory(), String.format("%08d", i) + ".png")));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user