Guest User

Untitled

a guest
Dec 6th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. checkBox_kahesh_Beton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  2. @Override
  3. public void onCheckedChanged(CompoundButton compoundButton, boolean bol) {
  4. z_1 = layout_1_text.getText().toString();
  5. z_2 = layout_1_text.getText().toString();
  6. if (bol) {
  7. index = 1;
  8. TranslateAnimation animate = new TranslateAnimation(0, v.getWidth(), 0, 0);
  9. animate.setDuration(500);
  10. animate.setFillAfter(true);
  11. animate.setFillBefore(false);
  12. layout_1.startAnimation(animate);
  13. layout_1.setVisibility(View.INVISIBLE);
  14. layout_2.startAnimation(animate);
  15. layout_2.setVisibility(View.INVISIBLE);
  16. dalBetoni_layout.postDelayed(new Runnable() {
  17. public void run() {
  18. layout_1.setVisibility(View.GONE);
  19. }
  20. }, 600);
  21. layout_2.postDelayed(new Runnable() {
  22. public void run() {
  23. layout_2.setVisibility(View.GONE);
  24. }
  25. }, 500);
  26. if (initialValue != 0) {
  27. conclusion.setText(decimal.format(initialValue - (Double.parseDouble(z_1) / 100 * ro_1 + Double.parseDouble(z_2) * 0.1 / 100 * 2500 * nof * 2)));
  28. }
  29.  
  30. } else {
  31. index = 0;
  32. TranslateAnimation animate = new TranslateAnimation(v.getWidth(), 0, 0, 0);
  33. animate.setDuration(500);
  34. animate.setFillAfter(true);
  35. animate.setFillBefore(true);
  36. layout_1.startAnimation(animate);
  37. layout_1.setVisibility(View.VISIBLE);
  38. layout_2.startAnimation(animate);
  39. layout_2.setVisibility(View.VISIBLE);
  40. conclusion.setText(decimal.format(initialValue));
  41. }
  42. }
  43. });
Add Comment
Please, Sign In to add comment