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


Java TransitionDrawable.reverseTransition方法代码示例

本文整理汇总了Java中android.graphics.drawable.TransitionDrawable.reverseTransition方法的典型用法代码示例。如果您正苦于以下问题:Java TransitionDrawable.reverseTransition方法的具体用法?Java TransitionDrawable.reverseTransition怎么用?Java TransitionDrawable.reverseTransition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.graphics.drawable.TransitionDrawable的用法示例。


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

示例1: onCreate

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_result);

        final TextView search_result_back = (TextView) findViewById(R.id.search_result_back);
        final ListView search_result_list = (ListView) findViewById(R.id.search_result_list);
        img = (ImageView) findViewById(R.id.imageView3);
        ArrayAdapter<String> adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, Item.searchList);
        search_result_list.setAdapter(adapter);
        TransitionDrawable animation = (TransitionDrawable)img.getDrawable();
        animation.startTransition(3000);
        animation.reverseTransition(3000);
//        img.setBackgroundResource(R.drawable.trans);
//        AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();
//        frameAnimation.start();
        search_result_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Item.searchList.clear();
                goToSearch();
            }
        });
    }
 
开发者ID:IvoryCandy,项目名称:Plus1s,代码行数:26,代码来源:SearchResultActivity.java

示例2: repeatTransition

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
void repeatTransition(final TransitionDrawable trans, final int timeInterval) {
        r = new Runnable() {
            @Override
            public void run() {
                if (flag) {
//                    Log.d("tagg", "straight");
                    trans.startTransition(timeInterval);
                    flag = false;
                } else {
//                    Log.d("tagg", "reverse");
                    trans.reverseTransition(timeInterval);
                    flag = true;
                }
                hand.postDelayed(this, (2*timeInterval));
            }
        };
        hand.post(r);
    }
 
开发者ID:mayankagg9722,项目名称:InstagramGradientLibrary,代码行数:19,代码来源:AnimateActivity.java

示例3: onCreate

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    //For creating a full-screen activity.
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash_screen);

    image = (ImageView) findViewById(R.id.image);
    Resources res = this.getResources();
    trans = (TransitionDrawable) res.getDrawable(R.drawable.transition);
    image.setImageDrawable(trans);
    trans.reverseTransition(3000);


    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            Intent i = new Intent(SplashActivity.this, MainActivity.class);
            startActivity(i);
            finish();
        }
    }, SPLASH_TIME_OUT);
}
 
开发者ID:TheAndroidApp,项目名称:Nucleus,代码行数:27,代码来源:SplashActivity.java

示例4: onUrlFocusChange

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
@Override
public void onUrlFocusChange(final boolean hasFocus) {
    super.onUrlFocusChange(hasFocus);

    triggerUrlFocusAnimation(hasFocus);

    TransitionDrawable shadowDrawable = (TransitionDrawable) mToolbarShadow.getDrawable();
    if (hasFocus) {
        dismissTabSwitcherCallout();
        shadowDrawable.startTransition(URL_FOCUS_CHANGE_ANIMATION_DURATION_MS);
    } else {
        shadowDrawable.reverseTransition(URL_FOCUS_CHANGE_ANIMATION_DURATION_MS);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:15,代码来源:ToolbarPhone.java

示例5: handleFindToolbarStateChange

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
@Override
protected void handleFindToolbarStateChange(boolean showing) {
    setVisibility(showing ? View.GONE : View.VISIBLE);
    TransitionDrawable shadowDrawable = (TransitionDrawable) mToolbarShadow.getDrawable();
    if (showing) {
        shadowDrawable.startTransition(URL_FOCUS_CHANGE_ANIMATION_DURATION_MS);
    } else {
        shadowDrawable.reverseTransition(URL_FOCUS_CHANGE_ANIMATION_DURATION_MS);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:11,代码来源:ToolbarPhone.java

示例6: onDestroyActionMode

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
@Override
public void onDestroyActionMode(ActionMode mode) {
    // show fab
    mListener.setFabVisible(true);

    // show all tabs
    TabLayout tabLayout = mListener.getTabLayout();
    if (tabLayout.getChildAt(0) instanceof ViewGroup) {
        ViewGroup tabLayoutChild0 = (ViewGroup) tabLayout.getChildAt(0);
        if (tabLayoutChild0.getChildCount() == tabLayout.getTabCount()) {
            for (int i = 0; i < tabLayoutChild0.getChildCount(); i++) {
                if (i == tabLayout.getSelectedTabPosition())
                    continue;

                View child = tabLayoutChild0.getChildAt(i);
                child.animate().setDuration(300).alpha(1);
            }
        }
    }

    // restore tabLayout background
    TransitionDrawable transitionDrawable = (TransitionDrawable) mListener.getTabLayout().getBackground();
    transitionDrawable.reverseTransition(300);

    // enable paging
    mListener.getViewPager().setPagingEnabled(true);

    // restore statusBar color
    if (Build.VERSION.SDK_INT >= 21) {
        getActivity().getWindow().setStatusBarColor(ContextCompat.getColor(getContext(), R.color.colorPrimaryDark));
    }

    mAdapter.deselectAllItems();
    mActionMode = null;
}
 
开发者ID:efidroid,项目名称:android_app_efidroidmanager,代码行数:36,代码来源:ReplacementItemFragment.java

示例7: onUrlFocusChange

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
@Override
public void onUrlFocusChange(final boolean hasFocus) {
    super.onUrlFocusChange(hasFocus);

    triggerUrlFocusAnimation(hasFocus);

    TransitionDrawable shadowDrawable = (TransitionDrawable) mToolbarShadow.getDrawable();
    if (hasFocus) {
        shadowDrawable.startTransition(URL_FOCUS_CHANGE_ANIMATION_DURATION_MS);
    } else {
        shadowDrawable.reverseTransition(URL_FOCUS_CHANGE_ANIMATION_DURATION_MS);
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:14,代码来源:ToolbarPhone.java

示例8: onTouch

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
@Override
public boolean onTouch(View view_, MotionEvent motionEvent_) {
    TransitionDrawable dr = (TransitionDrawable) view_.getBackground();
    switch (motionEvent_.getAction()) {
        case MotionEvent.ACTION_DOWN:
            dr.startTransition(500);
            return true;
        case MotionEvent.ACTION_UP:
            dr.reverseTransition(500);
            break;
    }
    return false;
}
 
开发者ID:ratmole,项目名称:Mach3Pendant,代码行数:14,代码来源:HotkeysAdapter.java

示例9: hideOverlayView

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
@Override
public void hideOverlayView(boolean animated) {
    if (overlayVisible) {
        TransitionDrawable drawable = (TransitionDrawable) overlayView.getBackground();
        int duration = OVERLAY_TRANSITION_DURATION;
        if (!animated) duration = 0;
        drawable.reverseTransition(duration);
        overlayView.setClickable(false);
        overlayVisible = false;
    }
}
 
开发者ID:flipkart-incubator,项目名称:springy-heads,代码行数:12,代码来源:DefaultChatHeadManager.java

示例10: closeActivity

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
void closeActivity()
{
    if (isClosing) return;
    if (enableAnimations)
    {
        ViewGroup container = (ViewGroup) findViewById(R.id.container);
        TransitionDrawable transitionDrawable = (TransitionDrawable) container.getBackground();
        transitionDrawable.reverseTransition(ANIMATION_OUT_DURATION);
        int maxChildId = container.getChildCount()-1;
        for (int i=maxChildId; i >= 0 ; i--)
        {
            int j = maxChildId-i;
            View child = container.getChildAt(i);
            animateCardOut(child, calcualteCardOriginY(j), new Runnable()
            {
                
                @Override
                public void run()
                {
                    finish();					
                }
            });
        }
    }
    else finish();		
    isClosing=true;
}
 
开发者ID:mick88,项目名称:dit-timetables,代码行数:28,代码来源:UnfoldActivity.java

示例11: updateBackground

import android.graphics.drawable.TransitionDrawable; //导入方法依赖的package包/类
private void updateBackground(View view) {
    int checked = mLayoutSelector.getSelected();
    int unchecked = mLayoutSelector.getUnselected();
    //Set text color
    ColorStateList colorStateList = new ColorStateList(new int[][]{
            {-android.R.attr.state_checked},
            {android.R.attr.state_checked}},
            new int[]{mTintColor, mCheckedTextColor});
    ((Button) view).setTextColor(colorStateList);

    //Redraw with tint color
    Drawable checkedDrawable = resources.getDrawable(checked).mutate();
    Drawable uncheckedDrawable = resources.getDrawable(unchecked).mutate();
    ((GradientDrawable) checkedDrawable).setColor(mTintColor);
    ((GradientDrawable) checkedDrawable).setStroke(mMarginDp, mTintColor);
    ((GradientDrawable) uncheckedDrawable).setStroke(mMarginDp, mTintColor);
    ((GradientDrawable) uncheckedDrawable).setColor(mUnCheckedTintColor);
    //Set proper radius
    ((GradientDrawable) checkedDrawable).setCornerRadii(mLayoutSelector.getChildRadii(view));
    ((GradientDrawable) uncheckedDrawable).setCornerRadii(mLayoutSelector.getChildRadii(view));

    GradientDrawable maskDrawable = (GradientDrawable) resources.getDrawable(unchecked).mutate();
    maskDrawable.setStroke(mMarginDp, mTintColor);
    maskDrawable.setColor(mUnCheckedTintColor);
    maskDrawable.setCornerRadii(mLayoutSelector.getChildRadii(view));
    int maskColor = Color.argb(50, Color.red(mTintColor), Color.green(mTintColor), Color.blue(mTintColor));
    maskDrawable.setColor(maskColor);
    LayerDrawable pressedDrawable = new LayerDrawable(new Drawable[] {uncheckedDrawable, maskDrawable});

    Drawable[] drawables = {uncheckedDrawable, checkedDrawable};
    TransitionDrawable transitionDrawable = new TransitionDrawable(drawables);
    if (((RadioButton) view).isChecked()) {
        transitionDrawable.reverseTransition(0);
    }

    StateListDrawable stateListDrawable = new StateListDrawable();
    stateListDrawable.addState(new int[] {-android.R.attr.state_checked, android.R.attr.state_pressed}, pressedDrawable);
    stateListDrawable.addState(StateSet.WILD_CARD, transitionDrawable);

    mDrawableMap.put(view.getId(), transitionDrawable);

    //Set button background
    if (Build.VERSION.SDK_INT >= 16) {
        view.setBackground(stateListDrawable);
    } else {
        view.setBackgroundDrawable(stateListDrawable);
    }

    super.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            TransitionDrawable current = mDrawableMap.get(checkedId);
            current.reverseTransition(200);
            if (mLastCheckId != 0) {
                TransitionDrawable last = mDrawableMap.get(mLastCheckId);
                if (last != null) last.reverseTransition(200);
            }
            mLastCheckId = checkedId;

            if (mCheckedChangeListener != null) {
                mCheckedChangeListener.onCheckedChanged(group, checkedId);
            }
        }
    });
}
 
开发者ID:coderswithoutborders,项目名称:deglancer,代码行数:66,代码来源:SegmentedGroup.java


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