com.daimajia.androidanimations.library.Techniques Java Examples
The following examples show how to use
com.daimajia.androidanimations.library.Techniques.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommentsActivity.java From StreamHub-Android-SDK with MIT License | 6 votes |
private void setListenersToViews() { postNewCommentIv.setOnClickListener(this); notification.setOnClickListener(this); commentsLV.setOnScrollListener(onScrollListener); swipeView.setColorSchemeColors(getResources().getColor(R.color.colorPrimary)); swipeView.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { swipeView.setRefreshing(true); mCommentsAdapter = null; commentsArray.clear(); mCommentsAdapter = new CommentsAdapter(getApplication(), commentsArray); commentsLV.setAdapter(mCommentsAdapter); bootstrapClientCall(); YoYo.with(Techniques.FadeIn).duration(700).playOn(findViewById(R.id.commentsLV)); } }); }
Example #2
Source File: CachedFilesAdapter.java From Readily with MIT License | 6 votes |
private void inflateMainMenu(View v){ final View actionView = v.findViewById(R.id.action_view); YoYo.with(Techniques.FadeOut). duration(DURATION). playOn(actionView); YoYo.with(Techniques.SlideInRight). duration(DURATION). playOn(v.findViewById(R.id.main_view)); actionView.postDelayed(new Runnable() { @Override public void run(){ actionView.setVisibility(View.GONE); } }, DURATION); }
Example #3
Source File: ViewGroup2.java From backstack with Apache License 2.0 | 6 votes |
@OnClick(R.id.lbs_vg2_next_screen) public void onClick(){ linearBackStack.builder((layoutInflater, container) -> { ViewGroup viewGroup = (ViewGroup) layoutInflater.inflate(R.layout.lbs_viewgroup3, container, false); container.addView(viewGroup); return viewGroup; }).addAnimator((v, e) -> { YoYo.with(Techniques.SlideInRight) .duration(200) .onEnd((animator)->e.done()) .playOn(v); }).removeAnimator((v, e) -> { YoYo.with(Techniques.SlideOutRight) .duration(200) .onEnd((animator)->e.done()) .playOn(v); }).build(); }
Example #4
Source File: HomeActivity.java From black-mirror with MIT License | 6 votes |
/** * Zdarzenie, które oznjamia o wykryciu słowa kluczowego. */ @Override public void onActivationKeywordDetected() { Log.i("ACTIVATION PHRASE ", " DETECTED "); commandRecognizingAnimation.startAnimation(); activationKeywordTextIndicator.setVisibility(INVISIBLE); activeSpeechIndicator.setVisibility(View.INVISIBLE); // Zacznij słuchać komendy. commandSpeechRecognizer.startListeningCommand(); if (welcomeView.getVisibility() == View.VISIBLE) { YoYo.with(Techniques.Tada) .onEnd(new YoYo.AnimatorCallback() { @Override public void call(Animator animator) { welcomeView.setVisibility(View.INVISIBLE); } }).playOn(welcomeView); } }
Example #5
Source File: PlayActivity.java From FixMath with Apache License 2.0 | 6 votes |
void animClickFigures(String figureType){ for (int i = Up; i <= Down; i++) { for (int x = 0; x <= 4; x++) { String TextViewId = "var" + i + "x" + x; int id = getResources().getIdentifier(TextViewId, "id", getPackageName()); TextView allTextContainer = (TextView) findViewById(id); if(allTextContainer.getTag() != null) { String containerTags = allTextContainer.getTag().toString(); if (containerTags.equals(figureType)) { YoYo.with(Techniques.RubberBand) .duration(500) .playOn(allTextContainer); } } } } }
Example #6
Source File: TimeWidgetView.java From black-mirror with MIT License | 6 votes |
/** * Metoda pokazująca widżet dla podanej strefy czasowej. * * @param timezone strefa czasowa. */ public void show(String timezone) { clock.setTimeZone(timezone); clock.setFormat24Hour(clock.getFormat24Hour()); clock.setFormat12Hour(null); Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(timezone)); String[] dayNames = new DateFormatSymbols(new Locale("pl")).getWeekdays(); String[] monthNames = new DateFormatSymbols(new Locale("pl")).getMonths(); date.setText(String.format(context.getString(R.string.date_format), dayNames[calendar.get(Calendar.DAY_OF_WEEK)], Integer.toString(calendar.get(Calendar.DAY_OF_MONTH)), monthNames[calendar.get(Calendar.MONTH)])); YoYo.with(Techniques.ZoomIn) .onStart(new YoYo.AnimatorCallback() { @Override public void call(Animator animator) { setVisibility(VISIBLE); } }) .playOn(this); }
Example #7
Source File: ReaderFragment.java From Readily with MIT License | 6 votes |
private void showInfo(int wpm, String percentLeft){ wpmTextView.setText(wpm + " WPM"); positionTextView.setText(percentLeft); if (infoHided){ YoYo.with(Techniques.FadeIn). duration(NOTIF_APPEARING_DURATION * 2). playOn(infoLayout); infoLayout.postDelayed(new Runnable() { @Override public void run(){ infoLayout.setVisibility(View.VISIBLE); } }, NOTIF_APPEARING_DURATION); infoHided = false; } }
Example #8
Source File: ReaderFragment.java From Readily with MIT License | 6 votes |
private boolean hideNotification(boolean force){ if (!notificationHided){ if (force || System.currentTimeMillis() - localTime > NOTIF_SHOWING_LENGTH){ YoYo.with(Techniques.SlideOutUp). duration(NOTIF_APPEARING_DURATION). playOn(notification); notification.postDelayed(new Runnable() { @Override public void run(){ notification.setVisibility(View.INVISIBLE); } }, NOTIF_APPEARING_DURATION); YoYo.with(Techniques.FadeIn). duration(NOTIF_APPEARING_DURATION). playOn(upLogo); notificationHided = true; } } return notificationHided; }
Example #9
Source File: ReaderFragment.java From Readily with MIT License | 6 votes |
private void showNotification(String text){ if (!TextUtils.isEmpty(text)){ notification.setText(text); setCurrentTime(System.currentTimeMillis()); if (notificationHided){ YoYo.with(Techniques.SlideInDown). duration(NOTIF_APPEARING_DURATION). playOn(notification); notification.postDelayed(new Runnable() { @Override public void run(){ notification.setVisibility(View.VISIBLE); } }, NOTIF_APPEARING_DURATION); YoYo.with(Techniques.FadeOut). duration(NOTIF_APPEARING_DURATION). playOn(upLogo); notificationHided = false; } } }
Example #10
Source File: ViewAnimationActivity.java From 30-android-libraries-in-30-days with Apache License 2.0 | 6 votes |
private void randomAnimation() { int gen = mRandom.nextInt(5); switch (gen) { case 0: YoYo.with(Techniques.Flash).duration(1000).playOn(mButton); break; case 1: YoYo.with(Techniques.Shake).duration(1000).playOn(mButton); break; case 2: YoYo.with(Techniques.FadeInUp).duration(1000).playOn(mButton); break; case 3: YoYo.with(Techniques.RotateIn).duration(1000).playOn(mButton); break; case 4: YoYo.with(Techniques.Wave).duration(1000).playOn(mButton); break; default: YoYo.with(Techniques.Tada).duration(1000).playOn(mButton); break; } }
Example #11
Source File: ReaderFragment.java From Readily with MIT License | 5 votes |
private void hideInfo(){ if (!infoHided){ YoYo.with(Techniques.FadeOut). duration(NOTIF_APPEARING_DURATION). playOn(infoLayout); infoLayout.postDelayed(new Runnable() { @Override public void run(){ infoLayout.setVisibility(View.INVISIBLE); } }, NOTIF_APPEARING_DURATION); infoHided = true; } }
Example #12
Source File: SlideBarChartView.java From SlidePager with MIT License | 5 votes |
/** * Set up listeners for all the views in {@link #mChartProgressList} */ private void setListeners() { for (final BarChartProgressView barChartProgressView : mChartProgressList) { if (barChartProgressView != null) { barChartProgressView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { int index = barChartProgressView.getIntTag(); boolean allowed = true; if (mCallback != null) { allowed = mCallback.isDaySelectable(mPagePosition, index); } if (allowed) { if (mCallback != null) { mCallback.onDaySelected(mPagePosition, index); } toggleSelectedViews(index); } else { if (mShakeIfNotSelectable) { YoYo.with(Techniques.Shake) .duration(NOT_ALLOWED_SHAKE_ANIMATION_DURATION) .playOn(SlideBarChartView.this); } } } }); } } }
Example #13
Source File: CachedFilesAdapter.java From Readily with MIT License | 5 votes |
private void inflateActionMenu(View v){ View actionView = v.findViewById(R.id.action_view); View mainView = v.findViewById(R.id.main_view); actionView.setMinimumHeight(mainView.getHeight()); YoYo.with(Techniques.SlideOutRight). duration(DURATION). playOn(mainView); actionView.setVisibility(View.VISIBLE); YoYo.with(Techniques.FadeIn). duration(DURATION). playOn(actionView); }
Example #14
Source File: ReaderFragment.java From Readily with MIT License | 5 votes |
public void performPlay(){ if (isPaused()){ paused++; YoYo.with(Techniques.Pulse). duration(READER_PULSE_DURATION). playOn(readerLayout); if (!settingsBundle.isSwipesEnabled()){ prevButton.setVisibility(View.INVISIBLE); } hideNotification(true); hideInfo(); readerHandler.postDelayed(this, READER_PULSE_DURATION + 100); } }
Example #15
Source File: ReaderFragment.java From Readily with MIT License | 5 votes |
public void performPause(){ if (!isPaused()){ paused++; YoYo.with(Techniques.Pulse). duration(READER_PULSE_DURATION). playOn(readerLayout); if (!settingsBundle.isSwipesEnabled()){ prevButton.setVisibility(View.VISIBLE); } showNotification(R.string.pause); showInfo(this); } }
Example #16
Source File: ReaderFragment.java From Readily with MIT License | 5 votes |
private void startReader(final TextParser parser){ changeParser(parser); final int resultCode = parser.getResultCode(); if (resultCode == TextParser.RESULT_CODE_OK){ final int initialPosition = Math.max(readable.getPosition() - Constants.READER_START_OFFSET, 0); reader = new Reader(handler, initialPosition); Activity activity = getActivity(); if (activity != null){ activity.runOnUiThread(new Runnable() { @Override public void run(){ parsingProgressBar.clearAnimation(); parsingProgressBar.setVisibility(View.GONE); readerLayout.setVisibility(View.VISIBLE); if (initialPosition < wordList.size()){ showNotification(R.string.tap_to_start); progress = readable.calcProgress(initialPosition, 0); reader.updateView(initialPosition); showInfo(reader); } else { showNotification(R.string.reading_is_completed); reader.setCompleted(true); } YoYo.with(Techniques.FadeIn). duration(READER_PULSE_DURATION). playOn(readerLayout); } }); } } else { notifyBadParser(resultCode); } }
Example #17
Source File: YourActivity.java From AwesomeSplash with MIT License | 5 votes |
@Override public void initSplash(ConfigSplash configSplash) { /* you don't have to override every property */ //Customize Circular Reveal configSplash.setBackgroundColor(R.color.primary); //any color you want form colors.xml configSplash.setAnimCircularRevealDuration(2000); //int ms configSplash.setRevealFlagX(Flags.REVEAL_RIGHT); //or Flags.REVEAL_LEFT configSplash.setRevealFlagY(Flags.REVEAL_BOTTOM); //or Flags.REVEAL_TOP //Choose LOGO OR PATH; if you don't provide String value for path it's logo by default //Customize Logo configSplash.setLogoSplash(R.mipmap.ic_launcher); //or any other drawable configSplash.setAnimLogoSplashDuration(2000); //int ms configSplash.setAnimLogoSplashTechnique(Techniques.Bounce); //choose one form Techniques (ref: https://github.com/daimajia/AndroidViewAnimations) //Customize Path configSplash.setPathSplash(Constants.DROID_LOGO); //set path String configSplash.setOriginalHeight(400); //in relation to your svg (path) resource configSplash.setOriginalWidth(400); //in relation to your svg (path) resource configSplash.setAnimPathStrokeDrawingDuration(3000); configSplash.setPathSplashStrokeSize(3); //I advise value be <5 configSplash.setPathSplashStrokeColor(R.color.accent); //any color you want form colors.xml configSplash.setAnimPathFillingDuration(3000); configSplash.setPathSplashFillColor(R.color.Wheat); //path object filling color //Customize Title configSplash.setTitleSplash("My Awesome App"); configSplash.setTitleTextColor(R.color.Wheat); configSplash.setTitleTextSize(30f); //float value configSplash.setAnimTitleDuration(3000); configSplash.setAnimTitleTechnique(Techniques.FlipInX); configSplash.setTitleFont("fonts/myfont.ttf"); //provide string to your font located in assets/fonts/ }
Example #18
Source File: SlideView.java From SlidePager with MIT License | 5 votes |
/** * Set up listeners for all the views in {@link #mProgressList} */ private void setListeners() { for (final ProgressView progressView : mProgressList) { if (progressView != null) { progressView.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { int index = progressView.getIntTag(); boolean allowed = true; if (mCallback != null) { allowed = mCallback.isDaySelectable(mPagePosition, index); } if (allowed) { if (mCallback != null) { mCallback.onDaySelected(mPagePosition, index); } toggleSelectedViews(index); animateSelectedTranslation(view); } else { if (mShakeIfNotSelectable) { YoYo.with(Techniques.Shake) .duration(NOT_ALLOWED_SHAKE_ANIMATION_DURATION) .playOn(SlideView.this); } } } }); } } }
Example #19
Source File: EffectsAdapter.java From AwesomeSplash with MIT License | 5 votes |
@Override public View getView(final int position, View convertView, ViewGroup parent) { View v = LayoutInflater.from(mContext).inflate(R.layout.item, null, false); TextView t = (TextView) v.findViewById(R.id.list_item_text); t.setText(UIUtil.getTechniqueTitle(getItem(position))); v.setTag(Techniques.values()[position]); return v; }
Example #20
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
private void countToStart(){ final Timer Counter = new Timer(); final TextView counterView = (TextView) findViewById(R.id.counterView); sfxManager.TimerSfxPlay(true); Counter.scheduleAtFixedRate(new TimerTask() { @Override public void run() { runOnUiThread(new Runnable() { @Override public void run() { countSeconds--; counterView.setText("" + countSeconds); YoYo.with(Techniques.TakingOff) .duration(900) .playOn(counterView); if (countSeconds == -1) { Counter.cancel(); counterView.setVisibility(View.INVISIBLE); sfxManager.TimerSfxPlay(false); //TU POPRAWIC startTimer(timeChallenge); setNewLevel(); setVisibilityComponents(false, true); setBackgroundColor(); setNewCalculationsAndLogic(passedLinesIndexer); setCorrectFrameFigures(); isCounting = false; } } }); } }, 1000, 1000); }
Example #21
Source File: SlideChartView.java From SlidePager with MIT License | 5 votes |
/** * Set up listeners for all the views in {@link #mProgressList} */ private void setListeners() { for (final ProgressView progressView : mProgressList) { if (progressView != null) { progressView.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { int index = progressView.getIntTag(); boolean allowed = true; if (mCallback != null) { allowed = mCallback.isDaySelectable(mPagePosition, index); } if (allowed) { if (mCallback != null) { mCallback.onDaySelected(mPagePosition, index); } toggleSelectedViews(index); } else { if (mShakeIfNotSelectable) { YoYo.with(Techniques.Shake) .duration(NOT_ALLOWED_SHAKE_ANIMATION_DURATION) .playOn(SlideChartView.this); } } } }); } } }
Example #22
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
public void KeyboardClose() { View keyboardView = findViewById(R.id.t_keyboard); setClickableRecursive(keyboardView, false); YoYo.with(Techniques.ZoomOut) .duration(400) .playOn(keyboardView); closePointerAnimation(); isKeyboardOpen = false; }
Example #23
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
public void KeyboardClose(View view) { View keyboardView = findViewById(R.id.t_keyboard); setClickableRecursive(keyboardView, false); YoYo.with(Techniques.ZoomOut) .duration(400) .playOn(keyboardView); closePointerAnimation(); isKeyboardOpen = false; sfxManager.KeybordClosePlay(); }
Example #24
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
private void closePointerAnimation() { if(Pointer != null) { ImageView pointer = (ImageView) findViewById(Pointer.getId()); YoYo.with(Techniques.ZoomOut) .duration(200) .playOn(pointer); } }
Example #25
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
public void OpenPointerAnimation() { if(Pointer != null) { ImageView pointer = (ImageView) findViewById(Pointer.getId()); YoYo.with(Techniques.FlipInX) .duration(500) .playOn(pointer); } }
Example #26
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
public void WriteBlankAnimation(View animBlank) { YoYo.with(Techniques.RubberBand) .duration(500) .playOn(findViewById(animBlank.getId())); sfxManager.KeyboardClickPlay(true); new ParticleSystem(this, 5, R.drawable.star_white, 800) .setScaleRange(0.7f, 1.3f) .setSpeedRange(0.1f, 0.25f) .setRotationSpeedRange(90, 180) .setFadeOut(200, new AccelerateInterpolator()) .oneShot(animBlank, 100); }
Example #27
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
private void popUpLevelCorrectScoreAnimation(){ TextView scorePopUp = (TextView) findViewById(R.id.level_correct_scorePopUp); scorePopUp.setText("5000"); YoYo.with(Techniques.TakingOff) .duration(3200) .playOn(scorePopUp); }
Example #28
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
private void restoreCorrectLineAnimation(){ ImageView backLine = (ImageView) findViewById(R.id.back_line); backLine.setImageBitmap(BitmapManager.decodeSampledBitmapFromResource(getResources(), R.drawable.aaas, backLine.getWidth(), backLine.getHeight())); YoYo.with(Techniques.ZoomIn) .duration(500) .playOn(backLine); }
Example #29
Source File: TimeAttackActivity.java From FixMath with Apache License 2.0 | 5 votes |
private void correctLevelAnimation() { ImageView backLine = (ImageView) findViewById(R.id.back_line); backLine.setImageBitmap(BitmapManager.decodeSampledBitmapFromResource(getResources(), R.drawable.correct , backLine.getWidth(), backLine.getHeight())); YoYo.with(Techniques.ZoomIn) .duration(300) .playOn(backLine); }
Example #30
Source File: MainActivity.java From Memory-capsule with Apache License 2.0 | 5 votes |
private void initToolBarSeting(){//实现ToolBar的生成 relativeLayout=(RelativeLayout)this.findViewById(R.id.relativeLayout_main); toolbar_main=(Toolbar)this.findViewById(R.id.toolbar_main); title_toolbar_main=(TextView)findViewById(R.id.title_toolbar_main); YoYo.with(Techniques.DropOut) .duration(700) .playOn(findViewById(R.id.title_toolbar_main)); setSupportActionBar(toolbar_main); }