本文整理汇总了Java中com.daimajia.androidanimations.library.Techniques类的典型用法代码示例。如果您正苦于以下问题:Java Techniques类的具体用法?Java Techniques怎么用?Java Techniques使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Techniques类属于com.daimajia.androidanimations.library包,在下文中一共展示了Techniques类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
@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();
}
示例2: initSplash
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
@Override
public void initSplash(ConfigSplash configSplash) {
//Customize Circular Reveal
configSplash.setBackgroundColor(R.color.primary_dark); //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
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)
configSplash.setOriginalHeight(400);
configSplash.setOriginalHeight(400);
//Customize Title
configSplash.setTitleSplash(" ");
configSplash.setTitleTextColor(R.color.primary_text);
configSplash.setTitleTextSize(30f); //float value
configSplash.setAnimTitleDuration(0000);
configSplash.setAnimTitleTechnique(Techniques.FadeInUp);
}
示例3: onActivationKeywordDetected
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
/**
* 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);
}
}
示例4: show
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
/**
* 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);
}
示例5: acceptConfirmationIn
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
private void acceptConfirmationIn( View v ) {
if( !this.opem ) return;
this.callback( this.confirmationInCallback );
YoYo.with( Techniques.ZoomOut )
.duration( 400 )
.playOn( this.ivExamConfirmationInReject );
YoYo.with( Techniques.ZoomIn )
.duration( 400 )
.withListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
ivExamConfirmationInAccept.setImageResource( R.drawable.ic_sentiment_satisfied_green_500_18dp );
}
})
.playOn( this.ivExamConfirmationInAccept )
;
//Remover o evento
this.ivExamConfirmationInReject.setOnClickListener( null );
this.ivExamConfirmationInAccept.setOnClickListener( null );
}
示例6: acceptConfirmationOut
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
private void acceptConfirmationOut( View v ) {
if( !this.opem ) return;
this.callback( this.confirmationOutCallback );
YoYo.with( Techniques.ZoomOut )
.duration( 400 )
.playOn( this.ivExamConfirmationOutReject );
YoYo.with( Techniques.ZoomIn )
.duration( 400 )
.withListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
ivExamConfirmationOutAccept.setImageResource( R.drawable.ic_sentiment_very_dissatisfied_red_500_18dp );
}
})
.playOn( this.ivExamConfirmationOutAccept )
;
//Remover o evento
this.ivExamConfirmationOutReject.setOnClickListener( null );
this.ivExamConfirmationOutAccept.setOnClickListener( null );
}
示例7: reset
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
/**
* Repor o estado inicial da visao
*/
private void reset( ){
// Repor os botao de confirmacao
YoYo.with( Techniques.ZoomIn ).duration( 0 ).playOn( this.ivExamConfirmationInAccept );
YoYo.with( Techniques.ZoomIn ).duration( 0 ).playOn( this.ivExamConfirmationInReject );
YoYo.with( Techniques.ZoomIn ).duration( 0 ).playOn( this.ivExamConfirmationOutAccept );
YoYo.with( Techniques.ZoomIn ).duration( 0 ).playOn( this.ivExamConfirmationOutReject );
// Repor os evento
this.ivExamConfirmationInAccept.setOnClickListener( this.onAcceptConfirmationIn );
this.ivExamConfirmationInReject.setOnClickListener( this.onRejectConfirmationIn );
this.ivExamConfirmationOutAccept.setOnClickListener( this.onAcceptConfirmationOut );
this.ivExamConfirmationOutReject.setOnClickListener( this.onRejectConfirmationOut );
// Repor os icon
this.ivExamConfirmationInAccept.setImageResource( R.drawable.ic_done_green_500_18dp );
this.ivExamConfirmationOutAccept.setImageResource( R.drawable.ic_clear_red_500_18dp );
// Repor os botao de escolha
YoYo.with( Techniques.SlideInLeft ).duration( 0 ).playOn( this.viewConfirmationInOpem );
YoYo.with( Techniques.SlideInRight ).duration( 0 ).playOn( this.viewConfirmationOutOpem );
this.opem = false;
}
示例8: onBindViewHolder
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
@SuppressLint("DefaultLocale")
@Override
public void onBindViewHolder(ViewHolder holder, final int position) {
final User itemData = mData.get(position);
holder.mNameTv.setText(String.format("姓名:%s", itemData.name));
holder.mSexTv.setText(String.format("性别:%s", itemData.sex));
holder.mPhoneNumTv.setText(String.format("电话号码:%s", itemData.phoneNum));
RealmResults<ExtendBean> realmResults = itemData.mExtendBeanRealmList.where().equalTo("key", "education").findAll();
if (realmResults.size() == 1) {
holder.mEducationTv.setText(String.format("学历:%s", realmResults.get(0).value));
} else {
holder.mEducationTv.setText(String.format("学历:%s", "無"));
}
holder.mSwipeLayout.setShowMode(SwipeLayout.ShowMode.LayDown);
holder.mSwipeLayout.addSwipeListener(new SimpleSwipeListener() {
@Override
public void onOpen(SwipeLayout layout) {
YoYo.with(Techniques.Tada).duration(500).delay(100).playOn(layout.findViewById(R.id.trash));
}
});
mItemManger.bindView(holder.itemView, position);
}
示例9: addExitView
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
private void addExitView() {
// add recycle bin ImageView centered on the bottom of the screen
WindowManager.LayoutParams mRecycleBinParams = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT);
mRecycleBinParams.gravity = Gravity.BOTTOM | Gravity.CENTER;
exitImage = new ImageView(this);
exitImage.setImageResource(R.mipmap.ic_bubble2);
mRecycleBinParams.x = 0;
mRecycleBinParams.y = 25;
mWindowManager.addView(exitImage, mRecycleBinParams);
YoYo.with(Techniques.FadeIn)
.duration(200)
.playOn(exitImage);
}
示例10: onBindViewHolder
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
@SuppressLint("DefaultLocale")
@Override
public void onBindViewHolder(ViewHolder holder, final int position) {
final User itemData = mData.get(position);
holder.mNameTv.setText(String.format("姓名:%s", itemData.getName()));
holder.mSexTv.setText(String.format("性别:%s", itemData.getSex()));
holder.mPhoneNumTv.setText(String.format("电话号码:%d", itemData.getPhoneNumber()));
holder.mSwipeLayout.setShowMode(SwipeLayout.ShowMode.LayDown);
holder.mSwipeLayout.addSwipeListener(new SimpleSwipeListener() {
@Override
public void onOpen(SwipeLayout layout) {
YoYo.with(Techniques.Tada).duration(500).delay(100).playOn(layout.findViewById(R.id.trash));
}
});
mItemManger.bindView(holder.itemView, position);
}
示例11: animateMyView
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
/**
* Animates a view.
* @param view View to be animated
* @param mDuration Duration (in milliseconds) of animation. 1000 would be 1 second
* @param tech The animation to actually be done. Obtain technique like so: Techniques tech1 = Techniques.Wobble;
* @param <E> A View object (IE EditText, TextView, Button, View, etc)
*/
public static <E extends View> void animateMyView(E view, Integer mDuration, Techniques tech){
//If the view is null, stop here
if(view == null){
return;
}
if(mDuration == null){
mDuration = 500;
}
//In case something small like 5 is set, this will make it at least a 10th of a second
if(mDuration < 100){
mDuration = 100;
}
//If the animation is not null, move forward with the animation
if(tech != null){
YoYo.with(tech).duration(mDuration).playOn(view);
}
}
示例12: reappearButtons
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
/**
* makes the valid keys appear
*/
protected void reappearButtons() {
Integer[] validDigits = sudoku.buttonsAvailable(currentX, currentY);
for (Integer validDigit : validDigits) {
int indexOutOfFive = validDigit % 5;
if (indexOutOfFive == 4 || indexOutOfFive == 0) {
YoYo.with(Techniques.BounceInRight)
.duration(1000)
.repeat(1)
.playOn(keyboard[validDigit]);
} else {
YoYo.with(Techniques.BounceInLeft)
.duration(1000)
.repeat(1)
.playOn(keyboard[validDigit]);
}
}
}
示例13: AnimationProxy
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
private AnimationProxy(View hoverView, int resId, Techniques technique, long duration, long delay, boolean invisibleWhenDelaying, Interpolator interpolator, Animator.AnimatorListener... listeners){
if(hoverView == null)
throw new IllegalStateException("Hover view is null");
View child = hoverView.findViewById(resId);
if(child == null)
throw new IllegalStateException("Can not find the child view");
if(duration < 0)
throw new IllegalArgumentException("Duration can not be less than 0");
if(delay < 0)
throw new IllegalArgumentException("Delay can not be less than 0");
this.composer = YoYo.with(technique).duration(duration).delay(delay).interpolate(interpolator);
this.targetView = child;
this.interpolator = interpolator;
this.delay = delay;
this.duration = duration;
this.invisibleWhenDelaying = invisibleWhenDelaying;
for(Animator.AnimatorListener l : listeners)
this.composer.withListener(l);
}
示例14: animClickFigures
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
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);
}
}
}
}
}
示例15: hideSystemUI
import com.daimajia.androidanimations.library.Techniques; //导入依赖的package包/类
private void hideSystemUI(){
if(VISIBLE == mHud.getVisibility()){
YoYo.with(Techniques.FadeOut).duration(TIME_ANIMATION).withListener(new SimpleAnimationListener(){
@Override
public void onAnimationEnd(Animator animation) {
mHud.setVisibility(INVISIBLE);
}
}).playOn(mHud);
mActivity.getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_FULLSCREEN);
}
}