当前位置: 首页>>代码示例>>Java>>正文


Java YoYo类代码示例

本文整理汇总了Java中com.daimajia.androidanimations.library.YoYo的典型用法代码示例。如果您正苦于以下问题:Java YoYo类的具体用法?Java YoYo怎么用?Java YoYo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


YoYo类属于com.daimajia.androidanimations.library包,在下文中一共展示了YoYo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onClick

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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();
}
 
开发者ID:kevinwang5658,项目名称:backstack,代码行数:18,代码来源:ViewGroup2.java

示例2: onActivationKeywordDetected

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
    }
}
 
开发者ID:hypeapps,项目名称:black-mirror,代码行数:22,代码来源:HomeActivity.java

示例3: show

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
}
 
开发者ID:hypeapps,项目名称:black-mirror,代码行数:25,代码来源:TimeWidgetView.java

示例4: acceptConfirmationIn

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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 );
}
 
开发者ID:tec-ustp,项目名称:SIIEScanner,代码行数:24,代码来源:ItemReaderContentExamConfirmationPresence.java

示例5: acceptConfirmationOut

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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 );
}
 
开发者ID:tec-ustp,项目名称:SIIEScanner,代码行数:24,代码来源:ItemReaderContentExamConfirmationPresence.java

示例6: reset

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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;
}
 
开发者ID:tec-ustp,项目名称:SIIEScanner,代码行数:26,代码来源:ItemReaderContentExamConfirmationPresence.java

示例7: onBindViewHolder

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
}
 
开发者ID:chenzj-king,项目名称:RealmSample,代码行数:26,代码来源:UserDeleteAdapter.java

示例8: addExitView

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
}
 
开发者ID:VoxStudio,项目名称:BubbleKeep,代码行数:24,代码来源:KeepBubbleService.java

示例9: onBindViewHolder

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
}
 
开发者ID:chenzj-king,项目名称:GreenDaoSample,代码行数:19,代码来源:UserDeleteAdapter.java

示例10: animateMyView

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
    }
}
 
开发者ID:PGMacDesign,项目名称:PGMacTips,代码行数:26,代码来源:AnimationUtilities.java

示例11: reappearButtons

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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]);
        }
    }
}
 
开发者ID:ayushr2,项目名称:PlaySoduko,代码行数:21,代码来源:GridActivity.java

示例12: showImage

import com.daimajia.androidanimations.library.YoYo; //导入依赖的package包/类
private void showImage(String url, String description, int currentPosition) {
    txtDescriptionGallery.setText(description);
    txtCurrentPosition.setText(String.valueOf(currentPosition+1));
    txtPhotosTotal.setText(String.valueOf(photos.size()));
    Picasso.with(getContext()).load(url).fit()
            .placeholder(R.drawable.photodefault)
            .into(imgPhoto);

    btnShare.setOnClickListener(this);
    viewDialog.setOnTouchListener(this);

    builder.setContentView(viewDialog);
    builder.show();
    YoYo.with(techniqueAnimation)
            .duration(700)
            .playOn(imgPhoto);
}
 
开发者ID:jeancsanchez,项目名称:PhotoViewSlider,代码行数:18,代码来源:PhotosViewSlider.java

示例13: AnimationProxy

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:27,代码来源:AnimationProxy.java

示例14: animClickFigures

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
                    }
                }

            }
        }
    }
 
开发者ID:hypeapps,项目名称:FixMath,代码行数:21,代码来源:PlayActivity.java

示例15: hideSystemUI

import com.daimajia.androidanimations.library.YoYo; //导入依赖的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);
    }
}
 
开发者ID:ayaseruri,项目名称:luxunPro,代码行数:17,代码来源:VideoView.java


注:本文中的com.daimajia.androidanimations.library.YoYo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。