當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。