use of org.telegram.ui.Components.SlideView in project Telegram-FOSS by Telegram-FOSS-Team.
the class ChangePhoneActivity method setPage.
public void setPage(int page, boolean animated, Bundle params, boolean back) {
if (page == 3) {
doneButton.setVisibility(View.GONE);
} else {
if (page == 0) {
checkPermissions = true;
}
doneButton.setVisibility(View.VISIBLE);
}
final SlideView outView = views[currentViewNum];
final SlideView newView = views[page];
currentViewNum = page;
newView.setParams(params, false);
actionBar.setTitle(newView.getHeaderName());
newView.onShow();
newView.setX(back ? -AndroidUtilities.displaySize.x : AndroidUtilities.displaySize.x);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
animatorSet.setDuration(300);
animatorSet.playTogether(ObjectAnimator.ofFloat(outView, "translationX", back ? AndroidUtilities.displaySize.x : -AndroidUtilities.displaySize.x), ObjectAnimator.ofFloat(newView, "translationX", 0));
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
newView.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animator animation) {
outView.setVisibility(View.GONE);
outView.setX(0);
}
});
animatorSet.start();
}
use of org.telegram.ui.Components.SlideView in project Telegram-FOSS by Telegram-FOSS-Team.
the class CancelAccountDeletionActivity method setPage.
public void setPage(int page, boolean animated, Bundle params, boolean back) {
if (page == 3 || page == 0) {
doneButton.setVisibility(View.GONE);
} else {
doneButton.setVisibility(View.VISIBLE);
}
final SlideView outView = views[currentViewNum];
final SlideView newView = views[page];
currentViewNum = page;
newView.setParams(params, false);
actionBar.setTitle(newView.getHeaderName());
newView.onShow();
newView.setX(back ? -AndroidUtilities.displaySize.x : AndroidUtilities.displaySize.x);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
animatorSet.setDuration(300);
animatorSet.playTogether(ObjectAnimator.ofFloat(outView, "translationX", back ? AndroidUtilities.displaySize.x : -AndroidUtilities.displaySize.x), ObjectAnimator.ofFloat(newView, "translationX", 0));
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
newView.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animator animation) {
outView.setVisibility(View.GONE);
outView.setX(0);
}
});
animatorSet.start();
}
use of org.telegram.ui.Components.SlideView in project Telegram-FOSS by Telegram-FOSS-Team.
the class LoginActivity method onResume.
@Override
public void onResume() {
super.onResume();
if (newAccount) {
ConnectionsManager.getInstance(currentAccount).setAppPaused(false, false);
}
AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);
fragmentView.requestLayout();
try {
if (currentViewNum >= 1 && currentViewNum <= 4 && views[currentViewNum] instanceof LoginActivitySmsView) {
int time = ((LoginActivitySmsView) views[currentViewNum]).openTime;
if (time != 0 && Math.abs(System.currentTimeMillis() / 1000 - time) >= 24 * 60 * 60) {
views[currentViewNum].onBackPressed(true);
setPage(0, false, null, true);
}
}
} catch (Exception e) {
FileLog.e(e);
}
if (currentViewNum == 0 && !needRequestPermissions) {
SlideView view = views[currentViewNum];
if (view != null) {
view.onShow();
}
}
}
use of org.telegram.ui.Components.SlideView in project Telegram-FOSS by Telegram-FOSS-Team.
the class LoginActivity method saveSelfArgs.
@Override
public void saveSelfArgs(Bundle outState) {
try {
Bundle bundle = new Bundle();
bundle.putInt("currentViewNum", currentViewNum);
bundle.putInt("syncContacts", syncContacts ? 1 : 0);
for (int a = 0; a <= currentViewNum; a++) {
SlideView v = views[a];
if (v != null) {
v.saveStateParams(bundle);
}
}
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.clear();
putBundleToEditor(bundle, editor, null);
editor.commit();
} catch (Exception e) {
FileLog.e(e);
}
}
use of org.telegram.ui.Components.SlideView in project Telegram-FOSS by Telegram-FOSS-Team.
the class PassportActivity method setPage.
public void setPage(int page, boolean animated, Bundle params) {
if (page == 3) {
doneItem.setVisibility(View.GONE);
}
final SlideView outView = views[currentViewNum];
final SlideView newView = views[page];
currentViewNum = page;
newView.setParams(params, false);
newView.onShow();
if (animated) {
newView.setTranslationX(AndroidUtilities.displaySize.x);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
animatorSet.setDuration(300);
animatorSet.playTogether(ObjectAnimator.ofFloat(outView, "translationX", -AndroidUtilities.displaySize.x), ObjectAnimator.ofFloat(newView, "translationX", 0));
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
newView.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animator animation) {
outView.setVisibility(View.GONE);
outView.setX(0);
}
});
animatorSet.start();
} else {
newView.setTranslationX(0);
newView.setVisibility(View.VISIBLE);
if (outView != newView) {
outView.setVisibility(View.GONE);
}
}
}
Aggregations