12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package app.brest.utils;
- import android.app.Activity;
- import android.graphics.drawable.Drawable;
- import android.net.Uri;
- import android.view.View;
- import android.widget.VideoView;
- import java.net.URI;
- import app.brest.testmin3d.R;
- import min3d.core.Object3d;
- import min3d.parser.IParser;
- import min3d.parser.Parser;
- /**
- * Created by ptitcois on 14/03/17.
- */
- public class AndroidResources {
- public static Object3d getModel(Activity context, String name)
- {
- IParser myParser = Parser.createParser(Parser.Type.OBJ, context.getResources(), "app.brest.testmin3d:raw/"+name+"_obj",true);
- myParser.parse();
- return myParser.getParsedObject();
- }
- private static Uri _getAudioVideo(String name, String suffix)
- {
- String path="android.resource://app.brest.testmin3d/raw/"+name+"_"+suffix;
- return Uri.parse(path);
- }
- public static Uri getVideo(String name)
- {
- return _getAudioVideo(name, "video");
- }
- public static Uri getAudio(String name)
- {
- return _getAudioVideo(name, "audio");
- }
- public static Drawable getImage()
- {
- return null;
- }
- }
|