List of usage examples for android.view.animation Animation INFINITE
int INFINITE
To view the source code for android.view.animation Animation INFINITE.
Click Source Link
From source file:zjut.soft.finalwork.fragment.RightFragment.java
public void plannerScaleAction() { ScaleAnimation scaleanim1 = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); scaleanim1.setDuration(1500);/*from w ww . jav a 2 s.c o m*/ scaleanim1.setFillAfter(true); scaleanim1.setRepeatCount(Animation.INFINITE); scaleanim1.setRepeatMode(Animation.REVERSE); scaleanim1.setInterpolator(new AccelerateDecelerateInterpolator()); plannerIV.setAnimation(scaleanim1); scaleanim1.startNow(); }
From source file:com.android.idearse.Login.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login);/*from w w w. j a v a 2 s . c o m*/ getWindow().getAttributes().windowAnimations = R.style.Fade; preferences = PreferenceManager.getDefaultSharedPreferences(this); loadima = (ImageView) findViewById(R.id.loading); rotation = AnimationUtils.loadAnimation(getApplicationContext(), R.drawable.rotate_loading); rotation.setRepeatCount(Animation.INFINITE); ActionBar actionBar = getSupportActionBar(); setTitle(""); getSupportActionBar().setIcon(R.drawable.title_logo); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME); username = (EditText) findViewById(R.id.username); password = (EditText) findViewById(R.id.password); preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); String user = preferences.getString("user", ""); String pass = preferences.getString("password", ""); username.setText(user); password.setText(pass); error_msg = (TextView) findViewById(R.id.error_msg); Button login = (Button) findViewById(R.id.login_btn); final CheckBox checkBox = (CheckBox) findViewById(R.id.checkbtn); checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (!isChecked) { SharedPreferences.Editor editor = preferences.edit(); editor.putString("user", ""); editor.putString("password", ""); editor.commit(); username.setText(""); password.setText(""); } } }); if (user.length() != 0 && pass.length() != 0) { checkBox.setChecked(true); } login.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { InputMethodManager inputManager = (InputMethodManager) getSystemService( Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); if (username.length() == 0 || password.length() == 0) { error_msg.setText("Completa los campos"); error_msg.setVisibility(View.VISIBLE); } else { if (checkBox.isChecked()) { SharedPreferences.Editor editor = preferences.edit(); editor.putString("user", username.getText().toString()); editor.putString("password", password.getText().toString()); editor.commit(); } error_msg.setVisibility(View.GONE); loadima.startAnimation(rotation); loadima.setVisibility(View.VISIBLE); new LoginQuery().execute(getString(R.string.URL) + "conectar_mobil/user/login"); } } }); }
From source file:com.pwned.steamfriends.views.TwitterStream.java
@Override public void onCreate(Bundle savedInstanceState) { setMyTheme();// w ww. j av a 2 s . co m super.onCreate(savedInstanceState); tracker = GoogleAnalyticsTracker.getInstance(); tracker.start(Constants.UACODE, 20, this); tracker.trackPageView("/TwitterStream"); mManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mManager.cancel(APP_ID); setContentView(R.layout.twitter); m_streams = new ArrayList<Stream>(); this.m_adapter = new TwitterStreamAdapter(this, R.layout.row, m_streams); setListAdapter(this.m_adapter); viewStream = new Thread() { @Override public void run() { getStream(); } }; Animation a = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); a.setRepeatMode(Animation.RESTART); a.setRepeatCount(Animation.INFINITE); a.setDuration(750); a.setInterpolator(AnimationUtils.loadInterpolator(this, android.R.anim.linear_interpolator)); ivLoad = (ImageView) findViewById(R.id.loading_spinner); ivLoad.startAnimation(a); Thread thread = new Thread(null, viewStream, "SpecialsBackground"); thread.start(); //m_ProgressDialog = ProgressDialog.show(TwitterStream.this,"","Loading Twitter Stream...", true); steamHeader = (ImageView) findViewById(R.id.headerimage); steamHeader.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.HEADER_URL)); startActivity(myIntent); } }); }
From source file:freed.cam.ui.themesample.cameraui.HelpFragment.java
private void showOpenSettingsMenu() { TranslateAnimation animation = new TranslateAnimation(0.0f, 400.0f, 0.0f, 0.0f); animation.setDuration(1000);// w ww . j ava2s . co m animation.setRepeatCount(Animation.INFINITE); animation.setRepeatMode(Animation.INFINITE); animation.setFillAfter(true); finger.startAnimation(animation); description.setText("Swipe from left to right to open Settings"); }
From source file:pl.wasat.smarthma.customviews.EntryItemView.java
private void titleAnimation() { String title = this.entry.getTitle().replaceFirst("urn:ogc:def:", ""); if (title.length() < 30) { tvEntryTitle.setText(title);//from w w w .jav a 2s.co m return; } int stopAnimPos = -1000; int startAnimPos = 20; int duration = 30000; Animation animation = new TranslateAnimation(startAnimPos, stopAnimPos, 0, 0); animation.setDuration(duration); animation.setRepeatMode(Animation.RESTART); animation.setRepeatCount(Animation.INFINITE); animation.setAnimationListener(this); tvEntryTitle.setText(title); tvEntryTitle.measure(0, 0); tvEntryTitle.setAnimation(animation); }
From source file:com.hippo.widget.ProgressView.java
private void setupAnimators() { ObjectAnimator trimStart = ObjectAnimator.ofFloat(this, "trimStart", 0.0f, 0.75f); trimStart.setDuration(1333L);// www. j av a2s.c om trimStart.setInterpolator(TRIM_START_INTERPOLATOR); trimStart.setRepeatCount(Animation.INFINITE); ObjectAnimator trimEnd = ObjectAnimator.ofFloat(this, "trimEnd", 0.0f, 0.75f); trimEnd.setDuration(1333L); trimEnd.setInterpolator(TRIM_END_INTERPOLATOR); trimEnd.setRepeatCount(Animation.INFINITE); ObjectAnimator trimOffset = ObjectAnimator.ofFloat(this, "trimOffset", 0.0f, 0.25f); trimOffset.setDuration(1333L); trimOffset.setInterpolator(LINEAR_INTERPOLATOR); trimOffset.setRepeatCount(Animation.INFINITE); ObjectAnimator trimRotation = ObjectAnimator.ofFloat(this, "trimRotation", 0.0f, 720.0f); trimRotation.setDuration(6665L); trimRotation.setInterpolator(LINEAR_INTERPOLATOR); trimRotation.setRepeatCount(Animation.INFINITE); mAnimators.add(trimStart); mAnimators.add(trimEnd); mAnimators.add(trimOffset); mAnimators.add(trimRotation); }
From source file:com.android.idearse.Result.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.result);//from w w w . j a v a 2 s . c o m getWindow().getAttributes().windowAnimations = R.style.Fade; Bundle extras = getIntent().getExtras(); QR = extras.getString("qr"); preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); type = preferences.getString("type", ""); preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); sessionid = preferences.getString("sessionid", ""); session_name = preferences.getString("session_name", ""); token = preferences.getString("token", ""); nid = preferences.getString("place_id", ""); loadima = (ImageView) findViewById(R.id.loading); rotation = AnimationUtils.loadAnimation(getApplicationContext(), R.drawable.rotate_loading); rotation.setRepeatCount(Animation.INFINITE); loadima.startAnimation(rotation); ActionBar actionBar = getSupportActionBar(); setTitle(""); getSupportActionBar().setIcon(R.drawable.title_logo); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME); Button qr_again2 = (Button) findViewById(R.id.detect_again2); Button qr_again = (Button) findViewById(R.id.detect_again); Button call = (Button) findViewById(R.id.call); qr_again2.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { if (isCameraAvailable()) { Intent intent = new Intent(getApplicationContext(), ZBarScannerActivity.class); intent.putExtra(ZBarConstants.SCAN_MODES, new int[] { Symbol.QRCODE }); startActivityForResult(intent, ZBAR_QR_SCANNER_REQUEST); } else { Intent goToLogin = new Intent(getApplicationContext(), Login.class); startActivity(goToLogin); } } }); qr_again.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { if (isCameraAvailable()) { Intent intent = new Intent(getApplicationContext(), ZBarScannerActivity.class); intent.putExtra(ZBarConstants.SCAN_MODES, new int[] { Symbol.QRCODE }); startActivityForResult(intent, ZBAR_QR_SCANNER_REQUEST); } else { Intent goToLogin = new Intent(getApplicationContext(), Login.class); startActivity(goToLogin); } } }); call.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { Intent goToCall = new Intent(getApplicationContext(), Call.class); startActivity(goToCall); } }); if (type.contains("treballador")) { new QRquery().execute( getString(R.string.URL) + "conectar_mobil/trabajadores.json?nid=" + nid + "&nif=" + QR); } else if (type.contains("maquines")) { new QRquery().execute( getString(R.string.URL) + "conectar_mobil/maquinas.json?nid=" + nid + "&matricula=" + QR); } }
From source file:freed.cam.ui.themesample.cameraui.HelpFragment.java
private void showCloseSettingsMenu() { TranslateAnimation animation = new TranslateAnimation(400.0f, 0.0f, 0.0f, 0.0f); animation.setDuration(1000);//from ww w.j a va 2s . c o m animation.setRepeatCount(Animation.INFINITE); animation.setRepeatMode(Animation.INFINITE); animation.setFillAfter(true); finger.startAnimation(animation); description.setText("Swipe from right to left to close Settings"); }
From source file:freed.cam.ui.themesample.cameraui.HelpFragment.java
private void showOpenManualMenu() { TranslateAnimation animation = new TranslateAnimation(0.0f, 0.0f, 400.0f, 0.0f); animation.setDuration(1000);/*from w w w. j ava2 s. co m*/ animation.setRepeatCount(Animation.INFINITE); animation.setRepeatMode(Animation.INFINITE); animation.setFillAfter(true); finger.startAnimation(animation); description.setText("Swipe from bottom to top to open Manuals"); }
From source file:org.onebusaway.android.view.RealtimeIndicatorView.java
/** * Setup the animation/* www . ja v a2 s . c o m*/ */ private synchronized void initAnimation() { // Animate circle expand/contract mAnimation1 = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { int height = getHeight(); mNewRadius = height * interpolatedTime; invalidate(); } }; mAnimation1.setDuration(mDuration); mAnimation1.setRepeatMode(Animation.REVERSE); mAnimation1.setInterpolator(new FastOutLinearInInterpolator()); mAnimation1.setRepeatCount(Animation.INFINITE); startAnimation(mAnimation1); mInitComplete = true; }