Example usage for android.animation AnimatorSet start

List of usage examples for android.animation AnimatorSet start

Introduction

In this page you can find the example usage for android.animation AnimatorSet start.

Prototype

@SuppressWarnings("unchecked")
@Override
public void start() 

Source Link

Document

Starting this AnimatorSet will, in turn, start the animations for which it is responsible.

Usage

From source file:com.b44t.ui.Components.PasscodeView.java

private void processDone(boolean fingerprint) {
    if (!fingerprint) {
        String password = passwordEditText.getText().toString();
        if (password.length() == 0) {
            onPasscodeError();// w  w  w .  j a  v  a 2 s. com
            return;
        }
        if (!UserConfig.checkPasscode(password)) {
            passwordEditText.setText("");
            onPasscodeError();
            return;
        }
    }
    passwordEditText.clearFocus();
    AndroidUtilities.hideKeyboard(passwordEditText);

    AnimatorSet AnimatorSet = new AnimatorSet();
    AnimatorSet.setDuration(200);
    AnimatorSet.playTogether(ObjectAnimator.ofFloat(this, "translationY", AndroidUtilities.dp(20)),
            ObjectAnimator.ofFloat(this, "alpha", AndroidUtilities.dp(0.0f)));
    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animation) {
            setVisibility(View.GONE);
        }
    });
    AnimatorSet.start();

    UserConfig.appLocked = false;
    UserConfig.saveConfig(false);
    NotificationCenter.getInstance().postNotificationName(NotificationCenter.didSetPasscode);
    setOnTouchListener(null);
    if (delegate != null) {
        delegate.didAcceptedPassword();
    }
}

From source file:com.b44t.ui.Components.PasscodeView.java

private void shakeTextView(final float x, final int num) {
    if (num == 6) {
        return;/*from   w ww  . j a v  a2s.  com*/
    }
    AnimatorSet AnimatorSet = new AnimatorSet();
    AnimatorSet.playTogether(ObjectAnimator.ofFloat(passcodeTextView, "translationX", AndroidUtilities.dp(x)));
    AnimatorSet.setDuration(50);
    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animation) {
            shakeTextView(num == 5 ? 0 : -x, num + 1);
        }
    });
    AnimatorSet.start();
}

From source file:ir.besteveryeverapp.ui.Components.PasscodeView.java

private void processDone(boolean fingerprint) {
    if (!fingerprint) {
        String password = "";
        if (UserConfig.passcodeType == 0) {
            password = passwordEditText2.getString();
        } else if (UserConfig.passcodeType == 1) {
            password = passwordEditText.getText().toString();
        }/*from   w w  w  .  j  av a  2  s .  co m*/
        if (password.length() == 0) {
            onPasscodeError();
            return;
        }
        if (!UserConfig.checkPasscode(password)) {
            passwordEditText.setText("");
            passwordEditText2.eraseAllCharacters(true);
            onPasscodeError();
            return;
        }
    }
    passwordEditText.clearFocus();
    AndroidUtilities.hideKeyboard(passwordEditText);

    AnimatorSet AnimatorSet = new AnimatorSet();
    AnimatorSet.setDuration(200);
    AnimatorSet.playTogether(ObjectAnimator.ofFloat(this, "translationY", AndroidUtilities.dp(20)),
            ObjectAnimator.ofFloat(this, "alpha", AndroidUtilities.dp(0.0f)));
    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animation) {
            setVisibility(View.GONE);
        }
    });
    AnimatorSet.start();

    UserConfig.appLocked = false;
    UserConfig.saveConfig(false);
    NotificationCenter.getInstance().postNotificationName(NotificationCenter.didSetPasscode);
    setOnTouchListener(null);
    if (delegate != null) {
        delegate.didAcceptedPassword();
    }
}

From source file:org.telegram.ui.Components.ChatActivityEnterView.java

private void hideRecordedAudioPanel() {
    audioToSendPath = null;/*from  w  w  w .j av a2  s. c om*/
    audioToSend = null;
    audioToSendMessageObject = null;
    AnimatorSet AnimatorSet = new AnimatorSet();
    AnimatorSet.playTogether(ObjectAnimator.ofFloat(recordedAudioPanel, "alpha", 0.0f));
    AnimatorSet.setDuration(200);
    AnimatorSet.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            recordedAudioPanel.setVisibility(GONE);

        }
    });
    AnimatorSet.start();
}

From source file:net.bluehack.ui.ChatActivity.java

private void showGifHint() {
    SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig",
            Activity.MODE_PRIVATE);/*ww w .  j av  a  2s. co m*/
    if (preferences.getBoolean("gifhint", false)) {
        return;
    }
    preferences.edit().putBoolean("gifhint", true).commit();

    if (getParentActivity() == null || fragmentView == null || gifHintTextView != null) {
        return;
    }
    if (!allowContextBotPanelSecond) {
        if (chatActivityEnterView != null) {
            chatActivityEnterView.setOpenGifsTabFirst();
        }
        return;
    }
    SizeNotifierFrameLayout frameLayout = (SizeNotifierFrameLayout) fragmentView;
    int index = frameLayout.indexOfChild(chatActivityEnterView);
    if (index == -1) {
        return;
    }
    chatActivityEnterView.setOpenGifsTabFirst();
    emojiButtonRed = new View(getParentActivity());
    emojiButtonRed.setBackgroundResource(R.drawable.redcircle);
    frameLayout.addView(emojiButtonRed, index + 1,
            LayoutHelper.createFrame(10, 10, Gravity.BOTTOM | Gravity.LEFT, 30, 0, 0, 27));

    gifHintTextView = new TextView(getParentActivity());
    gifHintTextView.setBackgroundResource(R.drawable.tooltip);
    gifHintTextView.setTextColor(Theme.CHAT_GIF_HINT_TEXT_COLOR);
    gifHintTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
    gifHintTextView.setPadding(AndroidUtilities.dp(10), 0, AndroidUtilities.dp(10), 0);
    gifHintTextView.setText(LocaleController.getString("TapHereGifs", R.string.TapHereGifs));
    gifHintTextView.setGravity(Gravity.CENTER_VERTICAL);
    frameLayout.addView(gifHintTextView, index + 1,
            LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 32, Gravity.LEFT | Gravity.BOTTOM, 5, 0, 0, 3));

    AnimatorSet AnimatorSet = new AnimatorSet();
    AnimatorSet.playTogether(ObjectAnimator.ofFloat(gifHintTextView, "alpha", 0.0f, 1.0f),
            ObjectAnimator.ofFloat(emojiButtonRed, "alpha", 0.0f, 1.0f));
    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animation) {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public void run() {
                    if (gifHintTextView == null) {
                        return;
                    }
                    AnimatorSet AnimatorSet = new AnimatorSet();
                    AnimatorSet.playTogether(ObjectAnimator.ofFloat(gifHintTextView, "alpha", 0.0f));
                    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
                        @Override
                        public void onAnimationEnd(Animator animation) {
                            if (gifHintTextView != null) {
                                gifHintTextView.setVisibility(View.GONE);
                            }
                        }
                    });
                    AnimatorSet.setDuration(300);
                    AnimatorSet.start();
                }
            }, 2000);
        }
    });
    AnimatorSet.setDuration(300);
    AnimatorSet.start();
}

From source file:kr.wdream.ui.ChatActivity.java

private void showGifHint() {
    SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig",
            Activity.MODE_PRIVATE);// w w  w  .  j  a  va 2  s  .com
    if (preferences.getBoolean("gifhint", false)) {
        return;
    }
    preferences.edit().putBoolean("gifhint", true).commit();

    if (getParentActivity() == null || fragmentView == null || gifHintTextView != null) {
        return;
    }
    if (!allowContextBotPanelSecond) {
        if (chatActivityEnterView != null) {
            chatActivityEnterView.setOpenGifsTabFirst();
        }
        return;
    }
    SizeNotifierFrameLayout frameLayout = (SizeNotifierFrameLayout) fragmentView;
    int index = frameLayout.indexOfChild(chatActivityEnterView);
    if (index == -1) {
        return;
    }
    chatActivityEnterView.setOpenGifsTabFirst();
    emojiButtonRed = new View(getParentActivity());
    emojiButtonRed.setBackgroundResource(kr.wdream.storyshop.R.drawable.redcircle);
    frameLayout.addView(emojiButtonRed, index + 1,
            LayoutHelper.createFrame(10, 10, Gravity.BOTTOM | Gravity.LEFT, 30, 0, 0, 27));

    gifHintTextView = new TextView(getParentActivity());
    gifHintTextView.setBackgroundResource(kr.wdream.storyshop.R.drawable.tooltip);
    gifHintTextView.setTextColor(Theme.CHAT_GIF_HINT_TEXT_COLOR);
    gifHintTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
    gifHintTextView.setPadding(AndroidUtilities.dp(10), 0, AndroidUtilities.dp(10), 0);
    gifHintTextView
            .setText(LocaleController.getString("TapHereGifs", kr.wdream.storyshop.R.string.TapHereGifs));
    gifHintTextView.setGravity(Gravity.CENTER_VERTICAL);
    frameLayout.addView(gifHintTextView, index + 1,
            LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 32, Gravity.LEFT | Gravity.BOTTOM, 5, 0, 0, 3));

    AnimatorSet AnimatorSet = new AnimatorSet();
    AnimatorSet.playTogether(ObjectAnimator.ofFloat(gifHintTextView, "alpha", 0.0f, 1.0f),
            ObjectAnimator.ofFloat(emojiButtonRed, "alpha", 0.0f, 1.0f));
    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
        @Override
        public void onAnimationEnd(Animator animation) {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public void run() {
                    if (gifHintTextView == null) {
                        return;
                    }
                    AnimatorSet AnimatorSet = new AnimatorSet();
                    AnimatorSet.playTogether(ObjectAnimator.ofFloat(gifHintTextView, "alpha", 0.0f));
                    AnimatorSet.addListener(new AnimatorListenerAdapterProxy() {
                        @Override
                        public void onAnimationEnd(Animator animation) {
                            if (gifHintTextView != null) {
                                gifHintTextView.setVisibility(View.GONE);
                            }
                        }
                    });
                    AnimatorSet.setDuration(300);
                    AnimatorSet.start();
                }
            }, 2000);
        }
    });
    AnimatorSet.setDuration(300);
    AnimatorSet.start();
}