@Override public Bitmap get() { return BitmapFactory.decodeResource(mGvrContext.getContext() .getResources(), mThumbnailId); } }
private LayoutScroller getLayoutScroller() { if (mLayoutScroller == null) { mLayoutScroller = new LayoutScroller(mGvrContext.getContext(), mHorizontalPicker); } return mLayoutScroller; }
private List<HomeItem> createHomeItems() { List<HomeItem> homeItems = new LinkedList<>(); homeItems.add(new LocalHomeItem(getGVRContext().getContext())); homeItems.add(new ExternalHomeItem(getGVRContext().getContext())); return homeItems; }
public static float[] getColor(GVRContext gvrContext) { Resources res = gvrContext.getContext().getResources(); TypedArray colorArray = res.obtainTypedArray(R.array.colors); TypedArray colorTypeValues; float[] appleColor = new float[3]; colorTypeValues = res.obtainTypedArray(colorArray.getResourceId(Apple.currentMotion, 0)); appleColor[0] = colorTypeValues.getFloat(0, 0); appleColor[1] = colorTypeValues.getFloat(1, 0); appleColor[2] = colorTypeValues.getFloat(2, 0); return Util.normalizeColor(appleColor); }
private KeyboardItemStyle getStyleFromTypedArray(TypedArray key) { TypedArray styles = res.obtainTypedArray(key.getResourceId(1, notFoundResource)); KeyboardItemStyle keyStyle = new KeyboardItemStyle(this.gvrContext.getContext(), styles); return keyStyle; }
private KeyboardItemStyle getStyleFromTypedArray(TypedArray key) { TypedArray styles = res.obtainTypedArray(key.getResourceId(2, notFoundResource)); KeyboardItemStyle keyStyle = new KeyboardItemStyle(this.gvrContext.getContext(), styles); return keyStyle; }
private void populateSpecialList(GVRContext gvrContext) { Resources res = gvrContext.getContext().getResources(); TypedArray specialKeyboard = res.obtainTypedArray(R.array.soft_keyboard_special); int n = specialKeyboard.length(); for (int i = 0; i < n; i++) { specialCharacterSpinnerItems.add(createSpinnerItem(gvrContext, res.getString(i), i, Keyboard.SOFT_KEYBOARD_SPECIAL)); } specialKeyboard.recycle(); }
public ParseColorItem(GVRContext gvrContext) { ColorControls color = new ColorControls(gvrContext.getContext()); List<Color> colorList = color.parseColorArray(R.array.worm_colors); for(Color c : colorList){ ColorsButton button = new ColorsButton(gvrContext, c); listItens.add(button); } }
public void onPause() { if (null != mediaPlayer) { mediaPlayer.stop(); } if (null != dinosaurScene) { dinosaurScene.onPause(); } // Pause all active streams. if (null != mGvrContext) { AudioClip.getInstance(mGvrContext.getContext()).autoPause(); } }
public Worm(GVRContext gvrContext) { super(gvrContext); ColorControls gvrColor = new ColorControls(gvrContext.getContext()); Color color = gvrColor.parseColor(R.color.color10); this.color = color; createWormParts(color); }
@Override public void onKeyDelete() { answer.removeCharacter(TextField.LAST_CHARACTER); AudioClip.getInstance(mGVRContext.getContext()).playSound(AudioClip.getKeyEnterSoundID(), 1.0f, 1.0f); }
public void closeThis() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUITextDisappearSoundID(), 1.0f, 1.0f); closeAction(); for (PhotoView photoView : photos) { if (photoView.currentState == PhotoView.PHOTO_VIEW_OPENED) { photoView.closeAction(); } } }
@Override public void onSwipeBack() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(dinosaur, 4f, -45, 0, 1, 0).start(gvrContext.getAnimationEngine()); } });
@Override public void onSwipeForward() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(ankylosaurus, 4f, 45, 0, 1, 0).start(gvrContext.getAnimationEngine()); }
@Override public void onSwipeBack() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(ankylosaurus, 4f, -45, 0, 1, 0).start(gvrContext.getAnimationEngine()); }
@Override public void onSwipeBack() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(trex, 4f, -45, 0, 1, 0).start(gvrContext.getAnimationEngine()); }
public void setNomalTexture(String character, String ShaderKey) { GVRBitmapImage bitmapNormal = new GVRBitmapImage(getGVRContext(), GVRTextBitmapFactory.create( styleItem.getCharacterBackgroundWidth(), styleItem.getCharacterBackgroundHeight(), character, styleItem .getFontSize(), Paint.Align.CENTER, styleItem.getColorText(), Color.argb(0, 0, 0, 0), getGVRContext() .getContext().getApplicationContext())); GVRTexture texture = new GVRTexture(getGVRContext()); texture.setImage(bitmapNormal); getRenderData().getMaterial().setTexture(ShaderKey, texture); }
@Override public void onSwipeForward() { if (!isPlayed) { AudioClip.getInstance(getGVRContext().getContext()).playSound( AudioClip.getUIRotateSoundID(), 1.0f, 1.0f); new GVRRotationByAxisAnimation(styrocosaurus, 4f, 45, 0, 1, 0) .start(gvrContext.getAnimationEngine()); swipeIndicator.setStop(true); } }
public void show() { AnimateScale(1); AnimateOpacity(1); getGVRContext().getPeriodicEngine().runAfter(new Runnable() { @Override public void run() { hide(); } }, 2.0f); AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getExceptionSoundID(), 1.0f, 1.0f); }
public void closeAction() { AudioClip.getInstance(getGVRContext().getContext()).playSound(AudioClip.getUITextDisappearSoundID(), 1.0f, 1.0f); new GVROpacityAnimation(description, TEXT_ANIMATION_TIME, 0f).start(getGVRContext().getAnimationEngine()); new GVROpacityAnimation(title, TEXT_ANIMATION_TIME, 0f).start(getGVRContext().getAnimationEngine()); isOpen = false; }