Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
¿Cómo puedo aumentar la velocidad de rotación?

Quiero aumentar la velocidad de rotación. ¿Cómo puedo aumentar la velocidad de rotación de ImageView en este código? Alguien, por favor, ayúdame. Necesito ayuda con este código. Gracias por adelantado.

 public class MainActivity extends Activity { ImageView img_one; Button btn_one; Random r; int angle; boolean restart=false; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); img_one = (ImageView) findViewById(R.id.imageView_ring); r=new Random(); btn_one = (Button) findViewById(R.id.btn_1); btn_one.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (restart){ angle=angle & 360; angle=r.nextInt()+360; RotateAnimation rotate=new RotateAnimation(angle,360,RotateAnimation.RELATIVE_TO_SELF,0.5f, RotateAnimation.RELATIVE_TO_SELF,0.5f); rotate.setFillAfter(true); rotate.setDuration(50); rotate.setInterpolator(new AccelerateDecelerateInterpolator()); img_one.startAnimation(rotate); restart=false; }else { angle=r.nextInt()+360; RotateAnimation rotate=new RotateAnimation(0,angle,RotateAnimation.RELATIVE_TO_SELF,0.5f, RotateAnimation.RELATIVE_TO_SELF,0.5f); rotate.setFillAfter(true); rotate.setDuration(50); rotate.setInterpolator(new AccelerateDecelerateInterpolator()); img_one.startAnimation(rotate); restart=true; } } }); }

}

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Si desea rotar más rápido, debe reducir la duración de la animación. Actualmente lo tienes configurado para que dure 50 milisegundos:

 rotate.setDuration(50);

pero puede establecer la duración según lo que necesite para lograr el efecto deseado.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!