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