use of android.support.v4.view.animation.FastOutLinearInInterpolator in project AnExplorer by 1hakr.
the class FabSpeedDial method removeFabMenuItems.
private void removeFabMenuItems() {
if (touchGuard != null)
touchGuard.setVisibility(GONE);
ViewCompat.animate(menuItemsLayout).setDuration(getResources().getInteger(android.R.integer.config_shortAnimTime)).alpha(0f).setInterpolator(new FastOutLinearInInterpolator()).setListener(new ViewPropertyAnimatorListenerAdapter() {
@Override
public void onAnimationStart(View view) {
super.onAnimationStart(view);
isAnimating = true;
}
@Override
public void onAnimationEnd(View view) {
super.onAnimationEnd(view);
menuItemsLayout.removeAllViews();
isAnimating = false;
}
}).start();
}
use of android.support.v4.view.animation.FastOutLinearInInterpolator in project Android-Week-View by alamkanak.
the class WeekView method init.
private void init() {
// Scrolling initialization.
mGestureDetector = new GestureDetectorCompat(mContext, mGestureListener);
mScroller = new OverScroller(mContext, new FastOutLinearInInterpolator());
mMinimumFlingVelocity = ViewConfiguration.get(mContext).getScaledMinimumFlingVelocity();
mScaledTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
// Measure settings for time column.
mTimeTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mTimeTextPaint.setTextAlign(Paint.Align.RIGHT);
mTimeTextPaint.setTextSize(mTextSize);
mTimeTextPaint.setColor(mHeaderColumnTextColor);
Rect rect = new Rect();
mTimeTextPaint.getTextBounds("00 PM", 0, "00 PM".length(), rect);
mTimeTextHeight = rect.height();
mHeaderMarginBottom = mTimeTextHeight / 2;
initTextTimeWidth();
// Measure settings for header row.
mHeaderTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mHeaderTextPaint.setColor(mHeaderColumnTextColor);
mHeaderTextPaint.setTextAlign(Paint.Align.CENTER);
mHeaderTextPaint.setTextSize(mTextSize);
mHeaderTextPaint.getTextBounds("00 PM", 0, "00 PM".length(), rect);
mHeaderTextHeight = rect.height();
mHeaderTextPaint.setTypeface(Typeface.DEFAULT_BOLD);
// Prepare header background paint.
mHeaderBackgroundPaint = new Paint();
mHeaderBackgroundPaint.setColor(mHeaderRowBackgroundColor);
// Prepare day background color paint.
mDayBackgroundPaint = new Paint();
mDayBackgroundPaint.setColor(mDayBackgroundColor);
mFutureBackgroundPaint = new Paint();
mFutureBackgroundPaint.setColor(mFutureBackgroundColor);
mPastBackgroundPaint = new Paint();
mPastBackgroundPaint.setColor(mPastBackgroundColor);
mFutureWeekendBackgroundPaint = new Paint();
mFutureWeekendBackgroundPaint.setColor(mFutureWeekendBackgroundColor);
mPastWeekendBackgroundPaint = new Paint();
mPastWeekendBackgroundPaint.setColor(mPastWeekendBackgroundColor);
// Prepare hour separator color paint.
mHourSeparatorPaint = new Paint();
mHourSeparatorPaint.setStyle(Paint.Style.STROKE);
mHourSeparatorPaint.setStrokeWidth(mHourSeparatorHeight);
mHourSeparatorPaint.setColor(mHourSeparatorColor);
// Prepare the "now" line color paint
mNowLinePaint = new Paint();
mNowLinePaint.setStrokeWidth(mNowLineThickness);
mNowLinePaint.setColor(mNowLineColor);
// Prepare today background color paint.
mTodayBackgroundPaint = new Paint();
mTodayBackgroundPaint.setColor(mTodayBackgroundColor);
// Prepare today header text color paint.
mTodayHeaderTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mTodayHeaderTextPaint.setTextAlign(Paint.Align.CENTER);
mTodayHeaderTextPaint.setTextSize(mTextSize);
mTodayHeaderTextPaint.setTypeface(Typeface.DEFAULT_BOLD);
mTodayHeaderTextPaint.setColor(mTodayHeaderTextColor);
// Prepare event background color.
mEventBackgroundPaint = new Paint();
mEventBackgroundPaint.setColor(Color.rgb(174, 208, 238));
// Prepare header column background color.
mHeaderColumnBackgroundPaint = new Paint();
mHeaderColumnBackgroundPaint.setColor(mHeaderColumnBackgroundColor);
// Prepare event text size and color.
mEventTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG | Paint.LINEAR_TEXT_FLAG);
mEventTextPaint.setStyle(Paint.Style.FILL);
mEventTextPaint.setColor(mEventTextColor);
mEventTextPaint.setTextSize(mEventTextSize);
// Set default event color.
mDefaultEventColor = Color.parseColor("#9fc6e7");
mScaleDetector = new ScaleGestureDetector(mContext, new ScaleGestureDetector.OnScaleGestureListener() {
@Override
public void onScaleEnd(ScaleGestureDetector detector) {
mIsZooming = false;
}
@Override
public boolean onScaleBegin(ScaleGestureDetector detector) {
mIsZooming = true;
goToNearestOrigin();
return true;
}
@Override
public boolean onScale(ScaleGestureDetector detector) {
mNewHourHeight = Math.round(mHourHeight * detector.getScaleFactor());
invalidate();
return true;
}
});
}
use of android.support.v4.view.animation.FastOutLinearInInterpolator in project ServiceStack.Java by ServiceStack.
the class LoginActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Twitter(new TwitterAuthConfig(getString(R.string.twitter_key), getString(R.string.twitter_secret))));
setContentView(R.layout.login);
Toolbar toolbar = (Toolbar) findViewById(R.id.loginToolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
txtStatus = (TextView) findViewById(R.id.txtStatus);
UiHelpers.setStatus(txtStatus, "");
// see this max value coming back here, we animale towards that value
animation = ObjectAnimator.ofInt(progressBar, "progress", 0, 500);
animation.setRepeatMode(ValueAnimator.REVERSE);
animation.setRepeatCount(100);
animation.setDuration(1500);
animation.setInterpolator(new FastOutLinearInInterpolator());
LoginActivity activity = this;
ImageButton btnTwitter = (ImageButton) findViewById(R.id.btnTwitter);
twitterAuth = new TwitterAuthClient();
btnTwitter.setOnClickListener(view -> {
startProgressBar();
twitterAuth.authorize(activity, new Callback<TwitterSession>() {
@Override
public void success(Result<TwitterSession> result) {
UiHelpers.setStatus(txtStatus, "Local twitter sign-in successful, signing into server...");
TwitterSession session = result.data;
App.get().getServiceClient().postAsync(new dtos.Authenticate().setProvider("twitter").setAccessToken(session.getAuthToken().token).setAccessTokenSecret(session.getAuthToken().secret).setRememberMe(true), r -> {
UiHelpers.setStatus(txtStatus, "Server twitter sign-in successful, opening chat...");
App.get().saveTwitterAccessToken(session.getAuthToken());
Intent intent = new Intent(activity, MainActivity.class);
stopProgressBar();
startActivity(intent);
}, error -> {
UiHelpers.setStatusError(txtStatus, "Server twitter sign-in failed", error);
stopProgressBar();
});
}
@Override
public void failure(TwitterException exception) {
exception.printStackTrace();
stopProgressBar();
}
});
});
facebookCallback = CallbackManager.Factory.create();
LoginManager.getInstance().registerCallback(facebookCallback, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
UiHelpers.setStatus(txtStatus, "Local facebook sign-in successful, signing into server...");
App.get().getServiceClient().postAsync(new dtos.Authenticate().setProvider("facebook").setAccessToken(loginResult.getAccessToken().getToken()).setRememberMe(true), r -> {
UiHelpers.setStatus(txtStatus, "Server facebook sign-in successful, opening chat...");
Intent intent = new Intent(activity, MainActivity.class);
stopProgressBar();
startActivity(intent);
}, error -> {
UiHelpers.setStatusError(txtStatus, "Server facebook sign-in failed", error);
stopProgressBar();
});
}
@Override
public void onCancel() {
stopProgressBar();
}
@Override
public void onError(FacebookException exception) {
Log.e(exception);
stopProgressBar();
}
});
ImageButton btnFacebook = (ImageButton) findViewById(R.id.btnFacebook);
btnFacebook.setOnClickListener(view -> {
startProgressBar();
LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("email"));
});
ImageButton btnAnon = (ImageButton) findViewById(R.id.btnAnon);
btnAnon.setOnClickListener(view -> {
UiHelpers.setStatus(txtStatus, "Opening chat as guest...");
startGuestChatActivity(App.get().getServiceClient());
});
dtos.Authenticate authDto = App.get().getSavedAccessToken();
if (authDto != null) {
UiHelpers.setStatus(txtStatus, "Signing in with saved " + authDto.getProvider() + " AccessToken...");
App.get().getServiceClient().postAsync(authDto, r -> {
Intent intent = new Intent(activity, MainActivity.class);
stopProgressBar();
startActivity(intent);
}, error -> {
UiHelpers.setStatusError(txtStatus, "Error logging into " + authDto.getProvider() + " using Saved AccessToken", error);
stopProgressBar();
});
}
}
use of android.support.v4.view.animation.FastOutLinearInInterpolator in project ServiceStack.Java by ServiceStack.
the class LoginButtonsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Twitter(new TwitterAuthConfig(getString(R.string.twitter_key), getString(R.string.twitter_secret))));
setContentView(R.layout.login_buttons);
Toolbar toolbar = (Toolbar) findViewById(R.id.loginToolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(true);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
txtStatus = (TextView) findViewById(R.id.txtStatus);
UiHelpers.setStatus(txtStatus, "");
// see this max value coming back here, we animale towards that value
animation = ObjectAnimator.ofInt(progressBar, "progress", 0, 500);
animation.setRepeatMode(ValueAnimator.REVERSE);
animation.setRepeatCount(100);
animation.setDuration(1500);
animation.setInterpolator(new FastOutLinearInInterpolator());
LoginButtonsActivity activity = this;
btnTwitterLogin = (TwitterLoginButton) findViewById(R.id.btnTwitterLogin);
btnTwitterLogin.setCallback(new Callback<TwitterSession>() {
@Override
public void success(Result<TwitterSession> result) {
startProgressBar();
UiHelpers.setStatus(txtStatus, "Local twitter sign-in successful, signing into server...");
TwitterSession session = result.data;
App.get().getServiceClient().postAsync(new dtos.Authenticate().setProvider("twitter").setAccessToken(session.getAuthToken().token).setAccessTokenSecret(session.getAuthToken().secret).setRememberMe(true), r -> {
UiHelpers.setStatus(txtStatus, "Server twitter sign-in successful, opening chat...");
App.get().saveTwitterAccessToken(session.getAuthToken());
Intent intent = new Intent(activity, MainActivity.class);
stopProgressBar();
startActivity(intent);
}, error -> {
UiHelpers.setStatusError(txtStatus, "Server twitter sign-in failed", error);
stopProgressBar();
});
}
@Override
public void failure(TwitterException exception) {
Log.e(exception);
stopProgressBar();
}
});
facebookCallback = CallbackManager.Factory.create();
btnFacebookLogin = (LoginButton) findViewById(R.id.btnFacebookLogin);
btnFacebookLogin.setReadPermissions("email");
btnFacebookLogin.registerCallback(facebookCallback, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
UiHelpers.setStatus(txtStatus, "Local facebook sign-in successful, signing into server...");
App.get().getServiceClient().postAsync(new dtos.Authenticate().setProvider("facebook").setAccessToken(loginResult.getAccessToken().getToken()).setRememberMe(true), r -> {
UiHelpers.setStatus(txtStatus, "Server facebook sign-in successful, opening chat...");
Intent intent = new Intent(activity, MainActivity.class);
stopProgressBar();
startActivity(intent);
}, error -> {
UiHelpers.setStatusError(txtStatus, "Server facebook sign-in failed", error);
stopProgressBar();
});
}
@Override
public void onCancel() {
stopProgressBar();
}
@Override
public void onError(FacebookException exception) {
Log.e(exception);
stopProgressBar();
}
});
Button btnGuestLogin = (Button) findViewById(R.id.btnGuestLogin);
btnGuestLogin.setOnClickListener(view -> {
UiHelpers.setStatus(txtStatus, "Opening chat as guest...");
startGuestChatActivity(App.get().getServiceClient());
});
dtos.Authenticate authDto = App.get().getSavedAccessToken();
if (authDto != null) {
UiHelpers.setStatus(txtStatus, "Signing in with saved " + authDto.getProvider() + " AccessToken...");
App.get().getServiceClient().postAsync(authDto, r -> {
Intent intent = new Intent(activity, MainActivity.class);
stopProgressBar();
startActivity(intent);
}, error -> {
UiHelpers.setStatusError(txtStatus, "Error logging into " + authDto.getProvider() + " using Saved AccessToken", error);
stopProgressBar();
});
}
}
use of android.support.v4.view.animation.FastOutLinearInInterpolator in project 91Pop by DanteAndroid.
the class BasePlayVideo method hideCommentLayout.
private void hideCommentLayout() {
if (commentLayoutShown) {
etCommentInputLayout.animate().scaleX(0).setInterpolator(new FastOutLinearInInterpolator()).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
etCommentInputLayout.setVisibility(View.GONE);
fab.show();
}
}).start();
}
commentLayoutShown = false;
}
Aggregations