本文整理汇总了Java中io.plaidapp.ui.transitions.FabTransform类的典型用法代码示例。如果您正苦于以下问题:Java FabTransform类的具体用法?Java FabTransform怎么用?Java FabTransform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FabTransform类属于io.plaidapp.ui.transitions包,在下文中一共展示了FabTransform类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import io.plaidapp.ui.transitions.FabTransform; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dribbble_login);
container = (ViewGroup) findViewById(R.id.container);
message = (TextView) findViewById(R.id.login_message);
login = (Button) findViewById(R.id.login);
loading = (ProgressBar) findViewById(R.id.loading);
loginFailed = (TextView) container.findViewById(R.id.login_failed_message);
loading.setVisibility(View.GONE);
dribbblePrefs = DribbblePrefs.get(this);
if (!FabTransform.setup(this, container)) {
MorphTransform.setup(this, container,
ContextCompat.getColor(this, R.color.background_light),
getResources().getDimensionPixelSize(R.dimen.dialog_corners));
}
if (savedInstanceState != null) {
isLoginFailed = savedInstanceState.getBoolean(STATE_LOGIN_FAILED, false);
loginFailed.setVisibility(isLoginFailed ? View.VISIBLE : View.GONE);
}
checkAuthCallback(getIntent());
}
示例2: onCreate
import io.plaidapp.ui.transitions.FabTransform; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dribbble_login);
ButterKnife.bind(this);
loading.setVisibility(View.GONE);
dribbblePrefs = DribbblePrefs.get(this);
if (!FabTransform.setup(this, container)) {
MorphTransform.setup(this, container,
ContextCompat.getColor(this, R.color.background_light),
getResources().getDimensionPixelSize(R.dimen.dialog_corners));
}
if (savedInstanceState != null) {
isLoginFailed = savedInstanceState.getBoolean(STATE_LOGIN_FAILED, false);
loginFailed.setVisibility(isLoginFailed ? View.VISIBLE : View.GONE);
}
checkAuthCallback(getIntent());
}
示例3: onClick
import io.plaidapp.ui.transitions.FabTransform; //导入依赖的package包/类
@Override
public void onClick(View view) {
if (dribbblePrefs.isLoggedIn()) {
fab.toggle();
doLike();
} else {
final Intent login = new Intent(DribbbleShot.this, DribbbleLogin.class);
FabTransform.addExtras(login, ContextCompat.getColor(DribbbleShot.this, R
.color.dribbble), R.drawable.ic_heart_empty_56dp);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation
(DribbbleShot.this, fab, getString(R.string.transition_dribbble_login));
startActivityForResult(login, RC_LOGIN_LIKE, options.toBundle());
}
}
示例4: onCreate
import io.plaidapp.ui.transitions.FabTransform; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_designer_news_login);
ButterKnife.bind(this);
if (!FabTransform.setup(this, container)) {
MorphTransform.setup(this, container,
ContextCompat.getColor(this, R.color.background_light),
getResources().getDimensionPixelSize(R.dimen.dialog_corners));
}
loading.setVisibility(View.GONE);
setupAccountAutocomplete();
username.addTextChangedListener(loginFieldWatcher);
// the primer checkbox messes with focus order so force it
username.setOnEditorActionListener((v, actionId, event) -> {
if (actionId == EditorInfo.IME_ACTION_NEXT) {
password.requestFocus();
return true;
}
return false;
});
password.addTextChangedListener(loginFieldWatcher);
password.setOnEditorActionListener((v, actionId, event) -> {
if (actionId == EditorInfo.IME_ACTION_DONE && isLoginValid()) {
login.performClick();
return true;
}
return false;
});
designerNewsPrefs = DesignerNewsPrefs.get(this);
}
示例5: onCreate
import io.plaidapp.ui.transitions.FabTransform; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post_new_designer_news_story);
ButterKnife.bind(this);
if (!FabTransform.setup(this, bottomSheetContent)) {
MorphTransform.setup(this, bottomSheetContent,
ContextCompat.getColor(this, R.color.background_light), 0);
}
bottomSheet.registerCallback(new BottomSheet.Callbacks() {
@Override
public void onSheetDismissed() {
// After a drag dismiss, finish without the shared element return transition as
// it no longer makes sense. Let the launching window know it's a drag dismiss so
// that it can restore any UI used as an entering shared element
setResult(RESULT_DRAG_DISMISSED);
finish();
}
});
scrollContainer.setListener(new ObservableScrollView.OnScrollListener() {
@Override
public void onScrolled(int scrollY) {
if (scrollY != 0
&& sheetTitle.getTranslationZ() != appBarElevation) {
sheetTitle.animate()
.translationZ(appBarElevation)
.setStartDelay(0L)
.setDuration(80L)
.setInterpolator(AnimUtils.getFastOutSlowInInterpolator
(PostNewDesignerNewsStory.this))
.start();
} else if (scrollY == 0 && sheetTitle.getTranslationZ() == appBarElevation) {
sheetTitle.animate()
.translationZ(0f)
.setStartDelay(0L)
.setDuration(80L)
.setInterpolator(AnimUtils.getFastOutSlowInInterpolator
(PostNewDesignerNewsStory.this))
.start();
}
}
});
// check for share intent
if (isShareIntent()) {
ShareCompat.IntentReader intentReader = ShareCompat.IntentReader.from(this);
url.setText(intentReader.getText());
title.setText(intentReader.getSubject());
// when receiving a share there is no shared element transition so animate up the
// bottom sheet to establish the spatial model i.e. that it can be dismissed downward
overridePendingTransition(R.anim.post_story_enter, R.anim.fade_out_rapidly);
bottomSheetContent.getViewTreeObserver().addOnPreDrawListener(
new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
bottomSheetContent.getViewTreeObserver().removeOnPreDrawListener(this);
bottomSheetContent.setTranslationY(bottomSheetContent.getHeight());
bottomSheetContent.animate()
.translationY(0f)
.setStartDelay(120L)
.setDuration(240L)
.setInterpolator(AnimUtils.getLinearOutSlowInInterpolator
(PostNewDesignerNewsStory.this));
return false;
}
});
}
}
示例6: onCreate
import io.plaidapp.ui.transitions.FabTransform; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post_new_designer_news_story);
ButterKnife.bind(this);
if (!FabTransform.setup(this, bottomSheetContent)) {
MorphTransform.setup(this, bottomSheetContent,
ContextCompat.getColor(this, R.color.background_light), 0);
}
bottomSheet.registerCallback(new BottomSheet.Callbacks() {
@Override
public void onSheetDismissed() {
// After a drag dismiss, finish without the shared element return transition as
// it no longer makes sense. Let the launching window know it's a drag dismiss so
// that it can restore any UI used as an entering shared element
setResult(RESULT_DRAG_DISMISSED);
finish();
}
});
scrollContainer.setListener(new ObservableScrollView.OnScrollListener() {
@Override
public void onScrolled(int scrollY) {
if (scrollY != 0
&& sheetTitle.getTranslationZ() != appBarElevation) {
sheetTitle.animate()
.translationZ(appBarElevation)
.setStartDelay(0L)
.setDuration(80L)
.setInterpolator(AnimUtils.getFastOutSlowInInterpolator
(PostNewDesignerNewsStory.this))
.start();
} else if (scrollY == 0 && sheetTitle.getTranslationZ() == appBarElevation) {
sheetTitle.animate()
.translationZ(0f)
.setStartDelay(0L)
.setDuration(80L)
.setInterpolator(AnimUtils.getFastOutSlowInInterpolator
(PostNewDesignerNewsStory.this))
.start();
}
}
});
// check for share intent
if (isShareIntent()) {
ShareCompat.IntentReader intentReader = ShareCompat.IntentReader.from(this);
url.setText(intentReader.getText());
title.setText(intentReader.getSubject());
}
if (!hasSharedElementTransition()) {
// when launched from share or app shortcut there is no shared element transition so
// animate up the bottom sheet to establish the spatial model i.e. that it can be
// dismissed downward
overridePendingTransition(R.anim.post_story_enter, R.anim.post_story_exit);
bottomSheetContent.getViewTreeObserver().addOnPreDrawListener(
new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
bottomSheetContent.getViewTreeObserver().removeOnPreDrawListener(this);
bottomSheetContent.setTranslationY(bottomSheetContent.getHeight());
bottomSheetContent.animate()
.translationY(0f)
.setStartDelay(120L)
.setDuration(240L)
.setInterpolator(AnimUtils.getLinearOutSlowInInterpolator
(PostNewDesignerNewsStory.this));
return false;
}
});
}
ShortcutHelper.reportPostUsed(this);
}
示例7: onCreate
import io.plaidapp.ui.transitions.FabTransform; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post_new_designer_news_story);
ButterKnife.bind(this);
if (!FabTransform.setup(this, bottomSheetContent)) {
MorphTransform.setup(this, bottomSheetContent,
ContextCompat.getColor(this, R.color.background_light), 0);
}
bottomSheet.registerCallback(new BottomSheet.Callbacks() {
@Override
public void onSheetDismissed() {
// After a drag dismiss, finish without the shared element return transition as
// it no longer makes sense. Let the launching window know it's a drag dismiss so
// that it can restore any UI used as an entering shared element
setResult(RESULT_DRAG_DISMISSED);
finish();
}
});
scrollContainer.setListener(scrollY -> {
if (scrollY != 0
&& sheetTitle.getTranslationZ() != appBarElevation) {
sheetTitle.animate()
.translationZ(appBarElevation)
.setStartDelay(0L)
.setDuration(80L)
.setInterpolator(AnimUtils.getFastOutSlowInInterpolator
(PostNewDesignerNewsStory.this))
.start();
} else if (scrollY == 0 && sheetTitle.getTranslationZ() == appBarElevation) {
sheetTitle.animate()
.translationZ(0f)
.setStartDelay(0L)
.setDuration(80L)
.setInterpolator(AnimUtils.getFastOutSlowInInterpolator
(PostNewDesignerNewsStory.this))
.start();
}
});
// check for share intent
if (isShareIntent()) {
ShareCompat.IntentReader intentReader = ShareCompat.IntentReader.from(this);
url.setText(intentReader.getText());
title.setText(intentReader.getSubject());
}
if (!hasSharedElementTransition()) {
// when launched from share or app shortcut there is no shared element transition so
// animate up the bottom sheet to establish the spatial model i.e. that it can be
// dismissed downward
overridePendingTransition(R.anim.post_story_enter, R.anim.post_story_exit);
bottomSheetContent.getViewTreeObserver().addOnPreDrawListener(
new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
bottomSheetContent.getViewTreeObserver().removeOnPreDrawListener(this);
bottomSheetContent.setTranslationY(bottomSheetContent.getHeight());
bottomSheetContent.animate()
.translationY(0f)
.setStartDelay(120L)
.setDuration(240L)
.setInterpolator(AnimUtils.getLinearOutSlowInInterpolator
(PostNewDesignerNewsStory.this));
return false;
}
});
}
ShortcutHelper.reportPostUsed(this);
}