Java Code Examples for android.view.animation.AnimationUtils
The following code examples are extracted from open source projects. You can click to
vote up the examples that are useful to you.
Example 1
From project 2Degrees-Toolbox, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 2
From project 4308Cirrus, under directory /Extras/actionbarsherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 3
From project ActionBarSherlock, under directory /library/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 4
protected void setContentShown(View view,boolean shown,boolean animation){ View progress=view.findViewById(R.id.INTERNAL_PROGRESS_CONTAINER_ID); View content=view.findViewById(R.id.INTERNAL_FRAGMENT_CONTAINER_ID); if (shown) { if (animation) { progress.startAnimation(AnimationUtils.loadAnimation(this,R.anim.fade_out)); content.startAnimation(AnimationUtils.loadAnimation(this,R.anim.fade_in)); } progress.setVisibility(View.GONE); content.setVisibility(View.VISIBLE); } else { if (animation) { progress.startAnimation(AnimationUtils.loadAnimation(this,R.anim.fade_in)); content.startAnimation(AnimationUtils.loadAnimation(this,R.anim.fade_out)); } progress.setVisibility(View.VISIBLE); content.setVisibility(View.GONE); } }
Example 5
From project aksunai, under directory /src/org/androidnerds/app/aksunai/ui/.
Source file: ChatActivity.java

@Override public void onCreate(Bundle appState){ super.onCreate(appState); setContentView(R.layout.chat); slideLeftIn=AnimationUtils.loadAnimation(this,R.anim.slide_left_in); slideLeftOut=AnimationUtils.loadAnimation(this,R.anim.slide_left_out); slideRightIn=AnimationUtils.loadAnimation(this,R.anim.slide_right_in); slideRightOut=AnimationUtils.loadAnimation(this,R.anim.slide_right_out); mFlipper=(ViewFlipper)findViewById(R.id.chat_flipper); entry=(EditText)findViewById(R.id.ircedit); entry.setSingleLine(); entry.setOnKeyListener(mKeyListener); Button btnSend=(Button)findViewById(R.id.btnSend); btnSend.setOnClickListener(mClickListener); gestureDetector=new GestureDetector(new MyGestureDetector()); gestureListener=new View.OnTouchListener(){ public boolean onTouch( View v, MotionEvent event){ return gestureDetector.onTouchEvent(event); } } ; mFlipper.setOnTouchListener(gestureListener); mNotificationManager=(NotificationManager)getSystemService(NOTIFICATION_SERVICE); }
Example 6
From project Alerte-voirie-android, under directory /src/net/londatiga/android/.
Source file: QuickAction.java

/** * Constructor * @param anchor {@link View} on where the popup should be displayed */ public QuickAction(View anchor){ super(anchor); actionList=new ArrayList<ActionItem>(); context=anchor.getContext(); inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); root=(ViewGroup)inflater.inflate(R.layout.quickaction,null); mArrowDown=(ImageView)root.findViewById(R.id.arrow_down); mArrowUp=(ImageView)root.findViewById(R.id.arrow_up); setContentView(root); mTrackAnim=AnimationUtils.loadAnimation(anchor.getContext(),R.anim.rail); mTrackAnim.setInterpolator(new Interpolator(){ public float getInterpolation( float t){ final float inner=(t * 1.55f) - 1.1f; return 1.2f - inner * inner; } } ); mTrack=(ViewGroup)root.findViewById(R.id.tracks); animStyle=ANIM_AUTO; animateTrack=true; }
Example 7
From project Amantech, under directory /Android/action_bar_sherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 8
From project andlytics, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 9
From project android-api-demos, under directory /src/com/mobeelizer/demos/activities/.
Source file: LoginActivity.java

/** * {@inheritDoc} */ @Override protected void onCreate(final Bundle savedInstanceState){ try { Class.forName("android.os.AsyncTask"); } catch ( ClassNotFoundException e) { e.printStackTrace(); } super.onCreate(savedInstanceState); setContentView(R.layout.a_login); mShakeAnimation=AnimationUtils.loadAnimation(getApplicationContext(),R.anim.shake); mCreateSessionButton=(Button)findViewById(R.id.loginCreateSession); mConnectButton=(Button)findViewById(R.id.loginSessionConnect); mSessionCodeEditText=(EditText)findViewById(R.id.loginSessionCode); mCreateSessionButton.setOnClickListener(getOnCreateSessionClickListenter()); mConnectButton.setOnClickListener(getOnConnectClickListenter()); UIUtils.prepareClip(mCreateSessionButton); UIUtils.prepareClip(mConnectButton); mSharedPrefs=PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); String code=mSharedPrefs.getString(BaseActivity.SESSION_CODE,null); if (code != null) { mLoginDialog=new Dialog(this,R.style.MobeelizerDialogTheme); mLoginDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); mLoginDialog.setContentView(R.layout.progress_dialog); ((TextView)mLoginDialog.findViewById(R.id.dialogText)).setText(R.string.loggingIn); mLoginDialog.setCancelable(false); mLoginDialog.show(); UserType user=UserType.valueOf(mSharedPrefs.getString(BaseActivity.USER_TYPE,"A")); if (user == UserType.A) { Mobeelizer.login(code,getString(R.string.c_userALogin),getString(R.string.c_userAPassword),this); } else if (user == UserType.B) { Mobeelizer.login(code,getString(R.string.c_userBLogin),getString(R.string.c_userBPassword),this); } } }
Example 10
From project android-flash-cards, under directory /src/org/thomasamsler/android/flashcards/fragment/.
Source file: AddCardFragment.java

private void flipCard(final View v){ final Animation flip1=AnimationUtils.loadAnimation(v.getContext(),R.anim.flip1); final Animation flip2=AnimationUtils.loadAnimation(v.getContext(),R.anim.flip2); flip1.setAnimationListener(new AnimationListener(){ public void onAnimationStart( Animation animation){ } public void onAnimationRepeat( Animation animation){ } public void onAnimationEnd( Animation animation){ mWordToggle^=true; if (mWordToggle) { mFrontPageWord=mEditText.getText().toString().trim(); if (null == mBackPageWord || "".equals(mBackPageWord)) { mEditText.setText(""); } else { mEditText.setText(mBackPageWord); } mTextViewTitle.setText(R.string.add_card_back_title); } else { mBackPageWord=mEditText.getText().toString().trim(); if (null == mFrontPageWord || "".equals(mFrontPageWord)) { mEditText.setText(""); } else { mEditText.setText(mFrontPageWord); } mTextViewTitle.setText(R.string.add_card_front_title); } v.startAnimation(flip2); } } ); v.startAnimation(flip1); }
Example 11
From project android-joedayz, under directory /Proyectos/GreenDroid/src/greendroid/widget/.
Source file: QuickActionBar.java

public QuickActionBar(Context context){ super(context); mRackAnimation=AnimationUtils.loadAnimation(context,R.anim.gd_rack); mRackAnimation.setInterpolator(new Interpolator(){ public float getInterpolation( float t){ final float inner=(t * 1.55f) - 1.1f; return 1.2f - inner * inner; } } ); setContentView(R.layout.gd_quick_action_bar); final View v=getContentView(); mRack=(ViewGroup)v.findViewById(R.id.gdi_rack); mQuickActionItems=(ViewGroup)v.findViewById(R.id.gdi_quick_action_items); mScrollView=(HorizontalScrollView)v.findViewById(R.id.gdi_scroll); }
Example 12
From project android-pulltorefresh, under directory /library/src/com/handmark/pulltorefresh/library/internal/.
Source file: IndicatorLayout.java

public IndicatorLayout(Context context,PullToRefreshBase.Mode mode){ super(context); mArrowImageView=new ImageView(context); final int padding=getResources().getDimensionPixelSize(R.dimen.indicator_internal_padding); mArrowImageView.setPadding(padding,padding,padding,padding); addView(mArrowImageView); int inAnimResId, outAnimResId; switch (mode) { case PULL_UP_TO_REFRESH: inAnimResId=R.anim.slide_in_from_bottom; outAnimResId=R.anim.slide_out_to_bottom; setBackgroundResource(R.drawable.indicator_bg_bottom); mArrowImageView.setImageResource(R.drawable.arrow_up); break; default : case PULL_DOWN_TO_REFRESH: inAnimResId=R.anim.slide_in_from_top; outAnimResId=R.anim.slide_out_to_top; setBackgroundResource(R.drawable.indicator_bg_top); mArrowImageView.setImageResource(R.drawable.arrow_down); break; } mInAnim=AnimationUtils.loadAnimation(context,inAnimResId); mInAnim.setAnimationListener(this); mOutAnim=AnimationUtils.loadAnimation(context,outAnimResId); mOutAnim.setAnimationListener(this); final Interpolator interpolator=new LinearInterpolator(); mRotateAnimation=new RotateAnimation(0,-180,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f); mRotateAnimation.setInterpolator(interpolator); mRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION); mRotateAnimation.setFillAfter(true); mResetRotateAnimation=new RotateAnimation(-180,0,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f); mResetRotateAnimation.setInterpolator(interpolator); mResetRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION); mResetRotateAnimation.setFillAfter(true); }
Example 13
From project androidquery, under directory /src/com/androidquery/callback/.
Source file: BitmapAjaxCallback.java

private static void setBmAnimate(ImageView iv,Bitmap bm,Bitmap preset,int fallback,int animation,float ratio,float anchor,int source){ bm=filter(iv,bm,fallback); if (bm == null) { iv.setImageBitmap(null); return; } Drawable d=makeDrawable(iv,bm,ratio,anchor); Animation anim=null; if (fadeIn(animation,source)) { if (preset == null) { anim=new AlphaAnimation(0,1); anim.setInterpolator(new DecelerateInterpolator()); anim.setDuration(FADE_DUR); } else { Drawable pd=makeDrawable(iv,preset,ratio,anchor); Drawable[] ds=new Drawable[]{pd,d}; TransitionDrawable td=new TransitionDrawable(ds); td.setCrossFadeEnabled(true); td.startTransition(FADE_DUR); d=td; } } else if (animation > 0) { anim=AnimationUtils.loadAnimation(iv.getContext(),animation); } iv.setImageDrawable(d); if (anim != null) { anim.setStartTime(AnimationUtils.currentAnimationTimeMillis()); iv.startAnimation(anim); } else { iv.setAnimation(null); } }
Example 14
From project androidZenWriter, under directory /library/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 15
From project android_7, under directory /src/org/immopoly/android/fragments/.
Source file: MapFragment.java

private void hideSplashScreen(){ if (!isAdded() || !mSplashscreen.isShown()) return; Animation fadeOutAnim=AnimationUtils.loadAnimation(getActivity(),R.anim.fade_out); fadeOutAnim.setAnimationListener(new Animation.AnimationListener(){ public void onAnimationStart( Animation animation){ } public void onAnimationRepeat( Animation animation){ } public void onAnimationEnd( Animation animation){ if (isAdded() && mSplashscreen.isShown()) mSplashscreen.setVisibility(View.GONE); } } ); mSplashscreen.startAnimation(fadeOutAnim); }
Example 16
From project android_aosp_packages_apps_Settings, under directory /src/com/android/settings/applications/.
Source file: ManageApplications.java

@Override public void onRebuildComplete(ArrayList<AppEntry> apps){ if (mLoadingContainer.getVisibility() == View.VISIBLE) { mLoadingContainer.startAnimation(AnimationUtils.loadAnimation(ManageApplications.this,android.R.anim.fade_out)); mListContainer.startAnimation(AnimationUtils.loadAnimation(ManageApplications.this,android.R.anim.fade_in)); } mListContainer.setVisibility(View.VISIBLE); mLoadingContainer.setVisibility(View.GONE); mWaitingForData=false; mBaseEntries=apps; mEntries=applyPrefixFilter(mCurFilterPrefix,mBaseEntries); notifyDataSetChanged(); updateStorageUsage(); }
Example 17
From project android_packages_apps_cmparts, under directory /src/com/cyanogenmod/cmparts/activities/.
Source file: ColorPickerDialog.java

@Override public void draw(Canvas canvas){ mProgress.draw(canvas); if (mAnimation.hasStarted() && !mAnimation.hasEnded()) { mAnimation.getTransformation(AnimationUtils.currentAnimationTimeMillis(),null); mTextXScale=mAnimation.getCurrent(); } Rect bounds=getBounds(); float x=6 + mTextXScale * (bounds.width() - mTextWidth - 6- 6); float y=(bounds.height() + mPaint.getTextSize()) / 2; mOutlinePaint.setAlpha(mActive ? 255 : 255 / 2); mPaint.setAlpha(mActive ? 255 : 255 / 2); canvas.drawText(mText,x,y,mOutlinePaint); canvas.drawText(mText,x,y,mPaint); }
Example 18
From project android_packages_apps_CMSettings, under directory /src/com/cyanogenmod/settings/activities/.
Source file: ColorPickerDialog.java

@Override public void draw(Canvas canvas){ mProgress.draw(canvas); if (mAnimation.hasStarted() && !mAnimation.hasEnded()) { mAnimation.getTransformation(AnimationUtils.currentAnimationTimeMillis(),null); mTextXScale=mAnimation.getCurrent(); } Rect bounds=getBounds(); float x=6 + mTextXScale * (bounds.width() - mTextWidth - 6- 6); float y=(bounds.height() + mPaint.getTextSize()) / 2; mOutlinePaint.setAlpha(mActive ? 255 : 255 / 2); mPaint.setAlpha(mActive ? 255 : 255 / 2); canvas.drawText(mText,x,y,mOutlinePaint); canvas.drawText(mText,x,y,mPaint); }
Example 19
From project android_packages_apps_Gallery, under directory /src/com/android/camera/.
Source file: ImageGallery.java

private void showFooter(){ mFooterOrganizeView.setVisibility(View.VISIBLE); if (mFooterAppear == null) { mFooterAppear=AnimationUtils.loadAnimation(this,R.anim.footer_appear); } mFooterOrganizeView.startAnimation(mFooterAppear); }
Example 20
From project android_packages_apps_Gallery2, under directory /src/com/android/gallery3d/photoeditor/.
Source file: Toolbar.java

public ToolbarIdleHandler(Context context,final List<View> tools){ this.tools=tools; mainHandler=new Handler(){ @Override public void handleMessage( Message msg){ switch (msg.what) { case MAKE_IDLE: if (!idle) { idle=true; for ( View view : tools) { view.startAnimation(fadeOut); } } break; } } } ; fadeIn=AnimationUtils.loadAnimation(context,R.anim.photoeditor_fade_in); fadeOut=AnimationUtils.loadAnimation(context,R.anim.photoeditor_fade_out); }
Example 21
From project android_packages_apps_phone, under directory /src/com/android/phone/.
Source file: InCallScreen.java

/** * Initializes the "touch lock" UI widgets. We do this lazily to avoid slowing down the initial launch of the InCallScreen. */ private void initTouchLock(){ if (VDBG) log("initTouchLock()..."); if (mTouchLockOverlay != null) { Log.w(LOG_TAG,"initTouchLock: already initialized!"); return; } if (!mUseTouchLockOverlay) { Log.w(LOG_TAG,"initTouchLock: touch lock isn't used on this device!"); return; } mTouchLockOverlay=(View)findViewById(R.id.touchLockOverlay); mTouchLockIcon=(View)findViewById(R.id.touchLockIcon); mTouchLockOverlay.setOnTouchListener(this); mTouchLockIcon.setOnTouchListener(this); mTouchLockFadeIn=AnimationUtils.loadAnimation(this,R.anim.touch_lock_fade_in); }
Example 22
From project android_packages_apps_SalvageParts, under directory /src/com/salvagemod/salvageparts/activities/.
Source file: ColorPickerDialog.java

@Override public void draw(Canvas canvas){ mProgress.draw(canvas); if (mAnimation.hasStarted() && !mAnimation.hasEnded()) { mAnimation.getTransformation(AnimationUtils.currentAnimationTimeMillis(),null); mTextXScale=mAnimation.getCurrent(); } Rect bounds=getBounds(); float x=6 + mTextXScale * (bounds.width() - mTextWidth - 6- 6); float y=(bounds.height() + mPaint.getTextSize()) / 2; mOutlinePaint.setAlpha(mActive ? 255 : 255 / 2); mPaint.setAlpha(mActive ? 255 : 255 / 2); canvas.drawText(mText,x,y,mOutlinePaint); canvas.drawText(mText,x,y,mPaint); }
Example 23
From project andstatus, under directory /src/org/andstatus/app/.
Source file: SplashMoreActivity.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splash_more); mFlipper=((ViewFlipper)this.findViewById(R.id.splash_more_flipper)); AlphaAnimation anim=(AlphaAnimation)AnimationUtils.loadAnimation(SplashMoreActivity.this,R.anim.fade_in); findViewById(R.id.splash_container).startAnimation(anim); final Button getstarted=(Button)findViewById(R.id.button_splash_get_started); getstarted.setOnClickListener(new OnClickListener(){ public void onClick( View v){ startActivity(new Intent(SplashMoreActivity.this,PreferencesActivity.class)); finish(); } } ); final Button learn_more=(Button)findViewById(R.id.button_splash_learn_more); learn_more.setOnClickListener(new OnClickListener(){ public void onClick( View v){ mFlipper.showNext(); } } ); }
Example 24
From project andtweet, under directory /src/com/xorcode/andtweet/.
Source file: SplashMoreActivity.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splash_more); mFlipper=((ViewFlipper)this.findViewById(R.id.splash_more_flipper)); AlphaAnimation anim=(AlphaAnimation)AnimationUtils.loadAnimation(SplashMoreActivity.this,R.anim.fade_in); findViewById(R.id.splash_container).startAnimation(anim); final Button getstarted=(Button)findViewById(R.id.button_splash_get_started); getstarted.setOnClickListener(new OnClickListener(){ public void onClick( View v){ startActivity(new Intent(SplashMoreActivity.this,PreferencesActivity.class)); finish(); } } ); final Button learn_more=(Button)findViewById(R.id.button_splash_learn_more); learn_more.setOnClickListener(new OnClickListener(){ public void onClick( View v){ mFlipper.showNext(); } } ); }
Example 25
From project AnySoftKeyboard, under directory /src/com/anysoftkeyboard/.
Source file: AnySoftKeyboard.java

@Override public void setCandidatesViewShown(boolean shown){ final boolean shouldShow=shouldCandidatesStripBeShown() && shown; final boolean currentlyShown=mCandidatesParent != null && mCandidatesParent.getVisibility() == View.VISIBLE; super.setCandidatesViewShown(shouldShow); if (shouldShow != currentlyShown) { if (shouldShow) { mCandidatesParent.setAnimation(AnimationUtils.loadAnimation(getApplicationContext(),R.anim.candidates_bottom_to_up_enter)); } else { mCandidatesParent.setAnimation(AnimationUtils.loadAnimation(getApplicationContext(),R.anim.candidates_up_to_bottom_exit)); } } }
Example 26
From project apps-for-android, under directory /Photostream/src/com/google/android/photostream/.
Source file: LoginActivity.java

private void hideProgress(){ if (mProgress.getVisibility() != View.GONE) { final Animation fadeOut=AnimationUtils.loadAnimation(this,R.anim.fade_out); mProgress.setVisibility(View.GONE); mProgress.startAnimation(fadeOut); } }
Example 27
From project Backyard-Brains-Android-App, under directory /src/com/backyardbrains/view/.
Source file: UIFactory.java

@Override public void run(){ Animation a=null; if (this.recording == false) { a=new TranslateAnimation(Animation.RELATIVE_TO_SELF,0,Animation.RELATIVE_TO_SELF,0,Animation.RELATIVE_TO_SELF,-1,Animation.RELATIVE_TO_SELF,0); } else { a=new TranslateAnimation(Animation.RELATIVE_TO_SELF,0,Animation.RELATIVE_TO_SELF,0,Animation.RELATIVE_TO_SELF,0,Animation.RELATIVE_TO_SELF,-1); } a.setDuration(250); a.setInterpolator(AnimationUtils.loadInterpolator(this.activity,android.R.anim.anticipate_overshoot_interpolator)); View stopRecView=activity.findViewById(R.id.TapToStopRecordingTextView); stopRecView.startAnimation(a); }
Example 28
From project BazaarUtils, under directory /src/com/congenialmobile/widget/.
Source file: LazyImageView.java

private void init(Context context){ imageView=new ImageView(context); addView(imageView); setInAnimation(AnimationUtils.loadAnimation(context,android.R.anim.fade_in)); setOutAnimation(AnimationUtils.loadAnimation(context,android.R.anim.fade_out)); }
Example 29
From project beintoo-android-sdk, under directory /BeintooSDK/src/com/beintoo/activities/marketplace/.
Source file: MarketplaceList.java

private void showPriceFilter(){ RelativeLayout filter=(RelativeLayout)findViewById(R.id.marketplace_order_filter); if (filter.getVisibility() == View.GONE) { filter.startAnimation(AnimationUtils.loadAnimation(mContext,android.R.anim.fade_in)); filter.setVisibility(View.VISIBLE); } }
Example 30
From project Binaural-Beats, under directory /src/com/ihunda/android/binauralbeat/.
Source file: BBeat.java

public Animation runGoneAnimationOnView(View target){ Animation animation=AnimationUtils.loadAnimation(this,android.R.anim.slide_out_right); animation.setDuration(ANIM_TIME_MS); final View mTarget=target; animation.setAnimationListener(new AnimationListener(){ public void onAnimationEnd( Animation animation){ mTarget.setVisibility(View.GONE); } public void onAnimationRepeat( Animation animation){ } public void onAnimationStart( Animation animation){ } } ); target.startAnimation(animation); return animation; }
Example 31
protected PieceUI(Context context){ super(context); this.context=context; setWillNotDraw(false); setOnLongClickListener(this); setOnTouchListener(this); resources=context.getApplicationContext().getResources(); Display display=((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); size=display.getWidth() / 20; vibrator=(Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE); animation=AnimationUtils.loadAnimation(context,R.anim.wave_scale); paint.setColor(0x99999999); }
Example 32
From project BookingRoom, under directory /src/org/androidaalto/bookingroom/view/.
Source file: WeekView.java

private void restartView(){ Animation myFadeInAnimation=AnimationUtils.loadAnimation(mContext,R.anim.fadein); startAnimation(myFadeInAnimation); mSelectedMeetings.clear(); mComputeSelectedMeeting=true; remeasure(getWidth(),getHeight()); mSelectedMeetingInfo=null; mSelectedMeetingGeometry=null; mRedrawScreen=true; if (mTitleTextView != null) { mTitleTextView.setText("Week " + mBaseDate.getWeekNumber() + " - "+ mBaseDate.format("%m %Y")); } recalc(); reloadMeetings(); invalidate(); }
Example 33
From project Catroid-maven-playground, under directory /src/main/java/at/tugraz/ist/catroid/ui/dragndrop/.
Source file: DragAndDropListView.java

public boolean onLongClick(View view){ int itemPosition=-1; int[] location=new int[2]; if (newView) { itemPosition=this.position; (getChildAt(getChildCount() - 1)).getLocationOnScreen(location); touchPointY=location[1] + (getChildAt(getChildCount() - 1)).getHeight(); newView=false; } else { itemPosition=pointToPosition(view.getLeft(),view.getTop()); int visiblePosition=itemPosition - getFirstVisiblePosition(); (getChildAt(visiblePosition)).getLocationOnScreen(location); touchPointY=location[1] + (getChildAt(visiblePosition)).getHeight() / 2; } boolean drawingCacheEnabled=view.isDrawingCacheEnabled(); view.setDrawingCacheEnabled(true); view.measure(MeasureSpec.makeMeasureSpec(Values.SCREEN_WIDTH,MeasureSpec.EXACTLY),MeasureSpec.makeMeasureSpec(Utils.getPhysicalPixels(400,getContext()),MeasureSpec.AT_MOST)); view.layout(0,0,Values.SCREEN_WIDTH,view.getMeasuredHeight()); view.buildDrawingCache(true); if (view.getDrawingCache() == null) { return false; } Bitmap bitmap=Bitmap.createBitmap(view.getDrawingCache()); view.setDrawingCacheEnabled(drawingCacheEnabled); startDragging(bitmap,touchPointY); dragAndDropListener.drag(itemPosition,itemPosition); trashView.setVisibility(View.VISIBLE); Animation animation=AnimationUtils.loadAnimation(getContext(),R.anim.trash_in); trashView.startAnimation(animation); previousItemPosition=itemPosition; return true; }
Example 34
From project CineShowTime-Android, under directory /Libraries/CineShowTime/src/com/binomed/showtime/android/screen/main/.
Source file: SplashScreen.java

@Override protected void onResume(){ super.onResume(); try { Animation fadeIn=AnimationUtils.loadAnimation(this,R.anim.appear); Animation fadeOut=AnimationUtils.loadAnimation(SplashScreen.this,R.anim.disappear); splashImage.startAnimation(fadeOut); splashImage2.startAnimation(fadeIn); mHandler.postDelayed(mFadeOutRunnable,SPLASH_SCREEN_FIRST_DURATION); } catch ( Exception e) { } finally { mHandler.postDelayed(mPendingLauncherRunnable,SPLASH_SCREEN_DURATION); } }
Example 35
From project CityBikes, under directory /src/net/homelinux/penecoptero/android/citybikes/app/.
Source file: InfoLayer.java

public void showFlingTooltip(int direction){ Animation fadeInAnimation=AnimationUtils.loadAnimation(ctx,android.R.anim.fade_in); fadeInAnimation.setDuration(500); fadeInAnimation.setAnimationListener(new AnimationListener(){ @Override public void onAnimationEnd( Animation animation){ flingTooltip.setVisibility(View.VISIBLE); } @Override public void onAnimationRepeat( Animation animation){ } @Override public void onAnimationStart( Animation animation){ } } ); flingTooltip.setDirection(direction); flingTooltip.setVisibility(View.VISIBLE); flingTooltip.startAnimation(fadeInAnimation); }
Example 36
From project Common-Sense-Net-2, under directory /AndroidBarSherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 37
From project cornerstone, under directory /frameworks/base/services/java/com/android/server/wm/.
Source file: WindowManagerService.java

private Animation loadAnimation(WindowManager.LayoutParams lp,int animAttr){ int anim=0; Context context=mContext; if (animAttr >= 0) { AttributeCache.Entry ent=getCachedAnimations(lp); if (ent != null) { context=ent.context; anim=ent.array.getResourceId(animAttr,0); } } if (anim != 0) { return AnimationUtils.loadAnimation(context,anim); } return null; }
Example 38
From project COSsettings, under directory /src/com/cyanogenmod/cmparts/activities/.
Source file: ColorPickerDialog.java

@Override public void draw(Canvas canvas){ mProgress.draw(canvas); if (mAnimation.hasStarted() && !mAnimation.hasEnded()) { mAnimation.getTransformation(AnimationUtils.currentAnimationTimeMillis(),null); mTextXScale=mAnimation.getCurrent(); } Rect bounds=getBounds(); float x=6 + mTextXScale * (bounds.width() - mTextWidth - 6- 6); float y=(bounds.height() + mPaint.getTextSize()) / 2; mOutlinePaint.setAlpha(mActive ? 255 : 255 / 2); mPaint.setAlpha(mActive ? 255 : 255 / 2); canvas.drawText(mText,x,y,mOutlinePaint); canvas.drawText(mText,x,y,mPaint); }
Example 39
From project cow, under directory /libs/ActionBarSherlock/library/src/com/actionbarsherlock/.
Source file: ActionBarSherlock.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 40
From project creamed_glacier_app_settings, under directory /src/com/android/settings/.
Source file: AccessibilityTutorialActivity.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); final Animation inAnimation=AnimationUtils.loadAnimation(this,android.R.anim.slide_in_left); inAnimation.setAnimationListener(mInAnimationListener); final Animation outAnimation=AnimationUtils.loadAnimation(this,android.R.anim.slide_in_left); mViewAnimator=new ViewAnimator(this); mViewAnimator.setInAnimation(inAnimation); mViewAnimator.setOutAnimation(outAnimation); mViewAnimator.addView(new TouchTutorialModule1(this,this)); mViewAnimator.addView(new TouchTutorialModule2(this,this)); setContentView(mViewAnimator); mAccessibilityManager=(AccessibilityManager)getSystemService(ACCESSIBILITY_SERVICE); if (savedInstanceState != null) { show(savedInstanceState.getInt(KEY_ACTIVE_MODULE,DEFAULT_MODULE)); } else { show(DEFAULT_MODULE); } }
Example 41
From project cw-advandroid, under directory /Animation/SlidingPanelEx/src/com/commonsware/android/anim2/.
Source file: SlidingPanel.java

public SlidingPanel(final Context ctxt,AttributeSet attrs){ super(ctxt,attrs); TypedArray a=ctxt.obtainStyledAttributes(attrs,R.styleable.SlidingPanel,0,0); speed=a.getInt(R.styleable.SlidingPanel_speed,300); a.recycle(); fadeOut=AnimationUtils.loadAnimation(ctxt,R.anim.fade); }
Example 42
From project cw-omnibus, under directory /Animation/SlidingPanelEx/src/com/commonsware/android/anim2/.
Source file: SlidingPanel.java

public SlidingPanel(final Context ctxt,AttributeSet attrs){ super(ctxt,attrs); TypedArray a=ctxt.obtainStyledAttributes(attrs,R.styleable.SlidingPanel,0,0); speed=a.getInt(R.styleable.SlidingPanel_speed,300); a.recycle(); fadeOut=AnimationUtils.loadAnimation(ctxt,R.anim.fade); }
Example 43
From project danbooru-gallery-android, under directory /src/tw/idv/palatis/danboorugallery/utils/.
Source file: ImageLoader.java

@Override public void run(){ if (image.getTag() == null) return; String url=(String)image.getTag(); if (url.equals(image_url)) { image.setImageBitmap(bitmap); image.setScaleType(scale_type); if (do_animation) { Animation anim=image.getAnimation(); if (anim != null) { if (anim.hasEnded()) { anim.reset(); image.startAnimation(anim); } } else image.startAnimation(AnimationUtils.loadAnimation(image.getContext(),android.R.anim.fade_in)); } image.setTag(null); } }
Example 44
From project dccsched, under directory /src/com/underhilllabs/dccsched/ui/.
Source file: ScheduleActivity.java

public FlingableTabHost(Context context,AttributeSet attrs){ super(context,attrs); mRightInAnimation=AnimationUtils.loadAnimation(context,R.anim.slide_right_in); mRightOutAnimation=AnimationUtils.loadAnimation(context,R.anim.slide_right_out); mLeftInAnimation=AnimationUtils.loadAnimation(context,R.anim.slide_left_in); mLeftOutAnimation=AnimationUtils.loadAnimation(context,R.anim.slide_left_out); final int minScaledFlingVelocity=ViewConfiguration.get(context).getScaledMinimumFlingVelocity() * 10; mGestureDetector=new GestureDetector(new GestureDetector.SimpleOnGestureListener(){ @Override public boolean onFling( MotionEvent e1, MotionEvent e2, float velocityX, float velocityY){ int tabCount=getTabWidget().getTabCount(); int currentTab=getCurrentTab(); if (Math.abs(velocityX) > minScaledFlingVelocity && Math.abs(velocityY) < minScaledFlingVelocity) { final boolean right=velocityX < 0; final int newTab=MathUtils.constrain(currentTab + (right ? 1 : -1),0,tabCount - 1); if (newTab != currentTab) { View currentView=getCurrentView(); setCurrentTab(newTab); View newView=getCurrentView(); newView.startAnimation(right ? mRightInAnimation : mLeftInAnimation); currentView.startAnimation(right ? mRightOutAnimation : mLeftOutAnimation); } } return super.onFling(e1,e2,velocityX,velocityY); } } ); }
Example 45
From project DeskSMS, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 46
From project DigitbooksExamples, under directory /DigitbooksExamples/src/fr/digitbooks/android/examples/chapitre05/.
Source file: CatchMeActivity.java

@Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.imageview); final ImageView image=(ImageView)findViewById(R.id.image); image.setImageResource(R.drawable.ic_launcher); image.setOnClickListener(new OnClickListener(){ public void onClick( View arg0){ Toast.makeText(CatchMeActivity.this,"TouchÂ",Toast.LENGTH_SHORT).show(); } } ); Animation animation=(Animation)AnimationUtils.loadAnimation(this,R.anim.catchme); animation.setAnimationListener(new AnimationListener(){ public void onAnimationEnd( Animation animation){ image.startAnimation(animation); } public void onAnimationRepeat( Animation animation){ } public void onAnimationStart( Animation animation){ } } ); image.startAnimation(animation); }
Example 47
From project dmix, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 48
From project DownloadProvider, under directory /src/com/mozillaonline/providers/downloads/ui/.
Source file: DownloadList.java

private void showOrHideSelectionMenu(){ boolean shouldBeVisible=!mSelectedIds.isEmpty(); boolean isVisible=mSelectionMenuView.getVisibility() == View.VISIBLE; if (shouldBeVisible) { updateSelectionMenu(); if (!isVisible) { mSelectionMenuView.setVisibility(View.VISIBLE); mSelectionMenuView.startAnimation(AnimationUtils.loadAnimation(this,R.anim.footer_appear)); } } else if (!shouldBeVisible && isVisible) { mSelectionMenuView.setVisibility(View.GONE); mSelectionMenuView.startAnimation(AnimationUtils.loadAnimation(this,R.anim.footer_disappear)); } }
Example 49
From project dreamDroid, under directory /libraries/ABS/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 50
From project droid-comic-viewer, under directory /src/net/robotmedia/acv/ui/widget/.
Source file: ComicFrame.java

public void showContent(ACVComic acv,int screenIndex,int frameIndex,boolean forward,LayoutMeasures imageMeasures){ this.removeContent(); final List<ACVContent> contents=acv.getContents(screenIndex,frameIndex); final String baseURL=acv.getContentBaseURL(); final Context context=getContext(); for ( final ACVContent content : contents) { final Rect rect=content.createRect(imageMeasures.width,imageMeasures.height); final WebView w=new WebView(context); final int x=rect.left - imageMeasures.scrollX + imageMeasures.left; final int y=rect.top - imageMeasures.scrollY + imageMeasures.top; w.setLayoutParams(new AbsoluteLayout.LayoutParams(rect.width(),rect.height(),x,y)); w.setVerticalScrollBarEnabled(false); w.setHorizontalScrollBarEnabled(false); w.setBackgroundColor(Color.TRANSPARENT); w.setClickable(false); w.setLongClickable(false); final String html=acv.getContentFromSource(content); w.loadDataWithBaseURL(baseURL,html,"text/html","UTF-8",null); mContentContainer.addView(w); mContentViews.add(w); w.setWebViewClient(new WebViewClient(){ @Override public void onPageFinished( WebView view, String url){ final long transitionDuration=content.getTransitionDuration(); if (transitionDuration > 0) { final Animation animation=AnimationUtils.loadAnimation(context,android.R.anim.fade_in); animation.setDuration(transitionDuration); view.startAnimation(animation); } } @Override public boolean shouldOverrideUrlLoading( WebView view, String url){ IntentUtils.view(context,url); return true; } } ); } }
Example 51
/** * Call this when you want to know the new location. If it returns true, the animation is not yet finished. loc will be altered to provide the new location. */ public boolean computeScrollOffset(){ if (mFinished) { return false; } int timePassed=(int)(AnimationUtils.currentAnimationTimeMillis() - mStartTime); if (timePassed < mDuration) { switch (mMode) { case SCROLL_MODE: float x=(float)timePassed * mDurationReciprocal; if (mInterpolator == null) x=viscousFluid(x); else x=mInterpolator.getInterpolation(x); mCurrX=mStartX + Math.round(x * mDeltaX); mCurrY=mStartY + Math.round(x * mDeltaY); break; case FLING_MODE: float timePassedSeconds=timePassed / 1000.0f; float distance=(mVelocity * timePassedSeconds) - (mDeceleration * timePassedSeconds * timePassedSeconds / 2.0f); mCurrX=mStartX + Math.round(distance * mCoeffX); mCurrX=Math.min(mCurrX,mMaxX); mCurrX=Math.max(mCurrX,mMinX); mCurrY=mStartY + Math.round(distance * mCoeffY); mCurrY=Math.min(mCurrY,mMaxY); mCurrY=Math.max(mCurrY,mMinY); break; } } else { mCurrX=mFinalX; mCurrY=mFinalY; mFinished=true; } return true; }
Example 52
From project dungbeetle, under directory /src/edu/stanford/mobisocial/dungbeetle/.
Source file: QuickAction.java

/** * Constructor * @param anchor {@link View} on where the popup should be displayed */ public QuickAction(View anchor){ super(anchor); actionList=new ArrayList<ActionItem>(); context=anchor.getContext(); inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); root=(ViewGroup)inflater.inflate(R.layout.quickaction,null); mArrowDown=(ImageView)root.findViewById(R.id.arrow_down); mArrowUp=(ImageView)root.findViewById(R.id.arrow_up); setContentView(root); mTrackAnim=AnimationUtils.loadAnimation(anchor.getContext(),R.anim.rail); mTrackAnim.setInterpolator(new Interpolator(){ public float getInterpolation( float t){ final float inner=(t * 1.55f) - 1.1f; return 1.2f - inner * inner; } } ); mTrack=(ViewGroup)root.findViewById(R.id.tracks); animStyle=ANIM_AUTO; animateTrack=true; }
Example 53
From project Ebento, under directory /src/mobisocial/bento/ebento/ui/quickaction/.
Source file: QuickAction.java

/** * Constructor. * @param context Context */ public QuickAction(Context context){ super(context); inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); mTrackAnim=AnimationUtils.loadAnimation(context,R.anim.rail); mTrackAnim.setInterpolator(new Interpolator(){ public float getInterpolation( float t){ final float inner=(t * 1.55f) - 1.1f; return 1.2f - inner * inner; } } ); setRootViewId(R.layout.quickaction); mAnimStyle=ANIM_AUTO; mAnimateTrack=true; mChildPos=0; }
Example 54
From project evodroid, under directory /src/com/sonorth/evodroid/util/.
Source file: AppTitleBar.java

public void hideDashboardOverlay(){ ImageButton showDashboardButton=(ImageButton)findViewById(R.id.home_small); showDashboardButton.setImageDrawable(getResources().getDrawable(R.drawable.icon_titlebar_home)); Animation fadeOutAnimation=AnimationUtils.loadAnimation(context,R.anim.dashboard_hide); dashboard.startAnimation(fadeOutAnimation); dashboard.setVisibility(View.GONE); isShowingDashboard=false; }
Example 55
From project examples_2, under directory /SearchView/actionbarsherlock-lib/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 56
From project external-replicaisland, under directory /src/com/replica/replicaisland/.
Source file: DiaryActivity.java

@Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.diary); TextView text=(TextView)findViewById(R.id.diarytext); ImageView image=(ImageView)findViewById(R.id.diarybackground); image.startAnimation(AnimationUtils.loadAnimation(this,R.anim.fade)); final Intent callingIntent=getIntent(); final int textResource=callingIntent.getIntExtra("text",-1); if (textResource != -1) { text.setText(textResource); } ImageView okArrow=(ImageView)findViewById(R.id.ok); okArrow.setOnClickListener(mKillDiaryListener); okArrow.setBackgroundResource(R.anim.ui_button); AnimationDrawable anim=(AnimationDrawable)okArrow.getBackground(); anim.start(); BaseObject.sSystemRegistry.customToastSystem.toast(getString(R.string.diary_found),Toast.LENGTH_SHORT); }
Example 57
From project fanfoudroid, under directory /src/com/ch_linghu/fanfoudroid/ui/base/.
Source file: WithHeaderActivity.java

protected void addWriteButton(){ writeButton=(ImageButton)findViewById(R.id.writeMessage); writeButton.setOnClickListener(new View.OnClickListener(){ public void onClick( View v){ Animation anim=AnimationUtils.loadAnimation(v.getContext(),R.anim.scale_lite); v.startAnimation(anim); Intent intent=new Intent(); intent.setClass(v.getContext(),WriteActivity.class); v.getContext().startActivity(intent); } } ); }
Example 58
From project farebot, under directory /libs/ActionBarSherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 59
From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/library/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 60
From project FlipDroid, under directory /app/src/com/goal98/flipdroid2/activity/.
Source file: ContentLoadedActivity.java

private void addFavoriteTagAnim(View view,RelativeLayout body,int belowViewId){ ImageView favoriteImageView=new ImageView(view.getContext()); RelativeLayout.LayoutParams layoutParams=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT); layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); layoutParams.addRule(RelativeLayout.BELOW,belowViewId); favoriteImageView.setLayoutParams(layoutParams); favoriteImageView.setImageResource(R.drawable.tag_favorite); body.addView(favoriteImageView); Animation animation=AnimationUtils.loadAnimation(view.getContext(),R.anim.favoriteanim); favoriteImageView.startAnimation(animation); }
Example 61
From project framework_base_policy, under directory /src/com/android/internal/policy/impl/.
Source file: PhoneWindow.java

private void hideProgressBars(ProgressBar horizontalProgressBar,ProgressBar spinnyProgressBar){ final int features=getLocalFeatures(); Animation anim=AnimationUtils.loadAnimation(getContext(),com.android.internal.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 62
From project friendica-for-android, under directory /libpulltorefresh/src/com/handmark/pulltorefresh/library/internal/.
Source file: IndicatorLayout.java

public IndicatorLayout(Context context,PullToRefreshBase.Mode mode){ super(context); mArrowImageView=new ImageView(context); FrameLayout.LayoutParams lp=new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,FrameLayout.LayoutParams.WRAP_CONTENT,Gravity.CENTER); lp.topMargin=lp.bottomMargin=lp.leftMargin=lp.rightMargin=getResources().getDimensionPixelSize(R.dimen.indicator_internal_padding); addView(mArrowImageView,lp); int inAnimResId, outAnimResId; switch (mode) { case PULL_UP_TO_REFRESH: inAnimResId=R.anim.slide_in_from_bottom; outAnimResId=R.anim.slide_out_to_bottom; setBackgroundResource(R.drawable.indicator_bg_bottom); mArrowImageView.setImageResource(R.drawable.arrow_up); break; default : case PULL_DOWN_TO_REFRESH: inAnimResId=R.anim.slide_in_from_top; outAnimResId=R.anim.slide_out_to_top; setBackgroundResource(R.drawable.indicator_bg_top); mArrowImageView.setImageResource(R.drawable.arrow_down); break; } mInAnim=AnimationUtils.loadAnimation(context,inAnimResId); mInAnim.setAnimationListener(this); mOutAnim=AnimationUtils.loadAnimation(context,outAnimResId); mOutAnim.setAnimationListener(this); final Interpolator interpolator=new LinearInterpolator(); mRotateAnimation=new RotateAnimation(0,-180,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f); mRotateAnimation.setInterpolator(interpolator); mRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION); mRotateAnimation.setFillAfter(true); mResetRotateAnimation=new RotateAnimation(-180,0,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f); mResetRotateAnimation.setInterpolator(interpolator); mResetRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION); mResetRotateAnimation.setFillAfter(true); }
Example 63
From project Gmote, under directory /gmoteclient/src/org/gmote/client/android/.
Source file: ImageBrowser.java

@Override public void onCreate(Bundle icicle){ System.out.println("ImageBrowser"); super.onCreate(icicle); mUtil=new ActivityUtil(); mUtil.onCreate(icicle,this); Intent intent=getIntent(); mImages=intent.getStringArrayListExtra(getString(R.string.gmote_stream_playlist)); setContentView(R.layout.image_browser); mSwitcher=(ImageSwitcher)findViewById(R.id.switcher); mSwitcher.setFactory(this); mSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,android.R.anim.fade_in)); mSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,android.R.anim.fade_out)); mGallery=(Gallery)findViewById(R.id.gallery); mGallery.setAdapter(new ImageAdapter(this)); mGallery.setOnItemSelectedListener(this); mGallery.setSelection(intent.getIntExtra(getString(R.string.file_type),0),false); }
Example 64
From project GnucashMobile, under directory /com_actionbarsherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 65
From project Google-Tasks-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 66
From project GreenDroid, under directory /GreenDroid/src/greendroid/widget/.
Source file: QuickActionBar.java

public QuickActionBar(Context context){ super(context); mRackAnimation=AnimationUtils.loadAnimation(context,R.anim.gd_rack); mRackAnimation.setInterpolator(new Interpolator(){ public float getInterpolation( float t){ final float inner=(t * 1.55f) - 1.1f; return 1.2f - inner * inner; } } ); setContentView(R.layout.gd_quick_action_bar); final View v=getContentView(); mRack=(ViewGroup)v.findViewById(R.id.gdi_rack); mQuickActionItems=(ViewGroup)v.findViewById(R.id.gdi_quick_action_items); mScrollView=(HorizontalScrollView)v.findViewById(R.id.gdi_scroll); }
Example 67
From project GreenDroidQABar, under directory /src/greendroid/widget/.
Source file: QuickActionBar.java

public QuickActionBar(Context context){ super(context); mRackAnimation=AnimationUtils.loadAnimation(context,R.anim.gd_rack); mRackAnimation.setInterpolator(new Interpolator(){ public float getInterpolation( float t){ final float inner=(t * 1.55f) - 1.1f; return 1.2f - inner * inner; } } ); setContentView(R.layout.gd_quick_action_bar); final View v=getContentView(); mRack=(ViewGroup)v.findViewById(R.id.gdi_rack); mQuickActionItems=(ViewGroup)v.findViewById(R.id.gdi_quick_action_items); mScrollView=(HorizontalScrollView)v.findViewById(R.id.gdi_scroll); }
Example 68
From project GSM-Signal-Tracking-, under directory /gpstracker/src/nl/sogeti/android/gpstracker/actions/.
Source file: Statistics.java

/** * Called when the activity is first created. */ @Override protected void onCreate(Bundle load){ super.onCreate(load); mUnits=new UnitsI18n(this,new UnitsI18n.UnitsChangeListener(){ public void onUnitsChange(){ drawTrackingStatistics(); } } ); setContentView(R.layout.statistics); mCalculator=new StatisticsCalulator(this,mUnits); mViewFlipper=(ViewFlipper)findViewById(R.id.flipper); mSlideLeftIn=AnimationUtils.loadAnimation(this,R.anim.slide_left_in); mSlideLeftOut=AnimationUtils.loadAnimation(this,R.anim.slide_left_out); mSlideRightIn=AnimationUtils.loadAnimation(this,R.anim.slide_right_in); mSlideRightOut=AnimationUtils.loadAnimation(this,R.anim.slide_right_out); mGraphTimeSpeed=(GraphCanvas)mViewFlipper.getChildAt(0); mGraphDistanceSpeed=(GraphCanvas)mViewFlipper.getChildAt(1); mGraphTimeAltitude=(GraphCanvas)mViewFlipper.getChildAt(2); mGraphDistanceAltitude=(GraphCanvas)mViewFlipper.getChildAt(3); mGraphTimeSpeed.setType(GraphCanvas.TIMESPEEDGRAPH); mGraphDistanceSpeed.setType(GraphCanvas.DISTANCESPEEDGRAPH); mGraphTimeAltitude.setType(GraphCanvas.TIMEALTITUDEGRAPH); mGraphDistanceAltitude.setType(GraphCanvas.DISTANCEALTITUDEGRAPH); mGestureDetector=new GestureDetector(new MyGestureDetector()); maxSpeedView=(TextView)findViewById(R.id.stat_maximumspeed); minAltitudeView=(TextView)findViewById(R.id.stat_minimalaltitide); maxAltitudeView=(TextView)findViewById(R.id.stat_maximumaltitude); overallavgSpeedView=(TextView)findViewById(R.id.stat_overallaveragespeed); avgSpeedView=(TextView)findViewById(R.id.stat_averagespeed); distanceView=(TextView)findViewById(R.id.stat_distance); starttimeView=(TextView)findViewById(R.id.stat_starttime); endtimeView=(TextView)findViewById(R.id.stat_endtime); waypointsView=(TextView)findViewById(R.id.stat_waypoints); if (load != null && load.containsKey(TRACKURI)) { mTrackUri=Uri.withAppendedPath(Tracks.CONTENT_URI,load.getString(TRACKURI)); } else { mTrackUri=this.getIntent().getData(); } }
Example 69
From project HeLauncher, under directory /src/com/handlerexploit/launcher_reloaded/.
Source file: AnimatedDrawer.java

/** * @param animate Animation toggle, only applies if you utilized setAnimationStyle */ public void open(boolean animate){ if (this.getVisibility() != View.VISIBLE) { if (animate && (mAnimationIn != 0)) { mAnimation=AnimationUtils.loadAnimation(getContext(),mAnimationIn); mAnimation.reset(); this.clearAnimation(); this.startAnimation(mAnimation); } this.setVisibility(View.VISIBLE); } }
Example 70
From project hiofenigma-android, under directory /opendice/src/edu/killerud/diceroll/.
Source file: Main.java

private void rollTheDice(){ for (int i=0; i < mDice.size(); i++) { ((TextView)mAppWindow.getChildAt(i)).setText("" + mDice.get(i).roll()); Animation wobble=AnimationUtils.loadAnimation(getApplicationContext(),R.animator.wobble); ((TextView)mAppWindow.getChildAt(i)).setAnimation(wobble); ((TextView)mAppWindow.getChildAt(i)).startAnimation(wobble); } }
Example 71
From project HSR-Timetable, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 72
From project iosched_1, under directory /src/com/google/android/apps/iosched/ui/.
Source file: ScheduleActivity.java

public FlingableTabHost(Context context,AttributeSet attrs){ super(context,attrs); mRightInAnimation=AnimationUtils.loadAnimation(context,R.anim.slide_right_in); mRightOutAnimation=AnimationUtils.loadAnimation(context,R.anim.slide_right_out); mLeftInAnimation=AnimationUtils.loadAnimation(context,R.anim.slide_left_in); mLeftOutAnimation=AnimationUtils.loadAnimation(context,R.anim.slide_left_out); final int minScaledFlingVelocity=ViewConfiguration.get(context).getScaledMinimumFlingVelocity() * 10; mGestureDetector=new GestureDetector(new GestureDetector.SimpleOnGestureListener(){ @Override public boolean onFling( MotionEvent e1, MotionEvent e2, float velocityX, float velocityY){ int tabCount=getTabWidget().getTabCount(); int currentTab=getCurrentTab(); if (Math.abs(velocityX) > minScaledFlingVelocity && Math.abs(velocityY) < minScaledFlingVelocity) { final boolean right=velocityX < 0; final int newTab=MathUtils.constrain(currentTab + (right ? 1 : -1),0,tabCount - 1); if (newTab != currentTab) { View currentView=getCurrentView(); setCurrentTab(newTab); View newView=getCurrentView(); newView.startAnimation(right ? mRightInAnimation : mLeftInAnimation); currentView.startAnimation(right ? mRightOutAnimation : mLeftOutAnimation); } } return super.onFling(e1,e2,velocityX,velocityY); } } ); }
Example 73
From project iosched_3, under directory /libprojects/abs/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 74
From project IRC-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/.
Source file: ActionBarSherlockCompat.java

private void hideProgressBars(IcsProgressBar horizontalProgressBar,IcsProgressBar spinnyProgressBar){ final int features=mFeatures; Animation anim=AnimationUtils.loadAnimation(mActivity,android.R.anim.fade_out); anim.setDuration(1000); if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) { spinnyProgressBar.startAnimation(anim); spinnyProgressBar.setVisibility(View.INVISIBLE); } if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) { horizontalProgressBar.startAnimation(anim); horizontalProgressBar.setVisibility(View.INVISIBLE); } }
Example 75
From project jamendo-android, under directory /src/com/teleca/jamendo/activity/.
Source file: SplashscreenActivity.java

@Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splashscreen); findViewById(R.id.splashlayout); endAnimation=AnimationUtils.loadAnimation(this,R.anim.fade_out); endAnimation.setFillAfter(true); endAnimationHandler=new Handler(); endAnimationRunnable=new Runnable(){ @Override public void run(){ findViewById(R.id.splashlayout).startAnimation(endAnimation); } } ; endAnimation.setAnimationListener(new AnimationListener(){ @Override public void onAnimationStart( Animation animation){ } @Override public void onAnimationRepeat( Animation animation){ } @Override public void onAnimationEnd( Animation animation){ HomeActivity.launch(SplashscreenActivity.this); SplashscreenActivity.this.finish(); } } ); showTutorial(); }
Example 76
From project Juggernaut_SystemUI, under directory /src/com/android/systemui/statusbar/.
Source file: LatestItemContainer.java

public LatestItemContainer(final Context context,AttributeSet attrs){ super(context,attrs); mGestureDetector=new GestureDetector(context,new GestureDetector.SimpleOnGestureListener(){ @Override public boolean onFling( MotionEvent e1, MotionEvent e2, float vX, float vY){ if (mSwipeCallback != null) { if (Math.abs(vX) > Math.abs(vY)) { int id; if (vX > 0) { id=R.anim.slide_out_right_basic; } else { id=R.anim.slide_out_left_basic; } Animation animation=AnimationUtils.loadAnimation(context,id); startAnimation(animation); mHandler.postDelayed(mSwipeCallback,animation.getDuration()); return true; } } return false; } } ); }
Example 77
From project lastfm-android, under directory /app/src/fm/last/android/activity/.
Source file: Player.java

@Override public void onPostExecute(Boolean result){ if (Player.this.mArtistName.getText().toString().compareToIgnoreCase(mArtist) != 0) return; if (result) { Animation a=AnimationUtils.loadAnimation(Player.this,R.anim.tag_fadein); a.setAnimationListener(new AnimationListener(){ public void onAnimationEnd( Animation animation){ } public void onAnimationRepeat( Animation animation){ } public void onAnimationStart( Animation animation){ mOntourButton.setVisibility(View.VISIBLE); } } ); mOntourButton.startAnimation(a); } else { } }
Example 78
From project Locast-Android, under directory /src/android/support/v4_map/app/.
Source file: FragmentManager.java

Animation loadAnimator(Fragment fragment,int transit,boolean enter,int transitionStyle){ final Animation animObj=fragment.onCreateAnimator(transit,enter,fragment.mNextAnim); if (animObj != null) { return animObj; } if (fragment.mNextAnim != 0) { final Animation anim=AnimationUtils.loadAnimation(mActivity,fragment.mNextAnim); if (anim != null) { return anim; } } if (transit == 0) { return null; } final int styleIndex=transitToStyleIndex(transit,enter); if (styleIndex < 0) { return null; } if (transitionStyle == 0 && mActivity.getWindow() != null) { transitionStyle=mActivity.getWindow().getAttributes().windowAnimations; } if (transitionStyle == 0) { return null; } return null; }