Como evitair a animação de conflito com a rotation do dispositivo no Android?

Eu tenho dois objects de button em atividade, este object tem alguma animação de movimento com ObjectAnimator, essas animações funcionam perfeitamente, mas quando a animação é executada em segundo plano, eu quero girair o dispositivo algumas vezes a coordenada do modo retrato em ObjectAnimator executado no modo paisagem ou reviewso.

ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn, "x", next_btn.getX(), next_btn.getX() + next_btn.getWidth()); 

no código acima, o button deve sair da canvas, mas depois que esta linha seja executada, se o dispositivo girair paira o modo de paisagem for na canvas do meio, acho que quando este problema ocorrer, a coordenada do retrato é executada no modo paisagem.

  • Problema de foco do Android WebView
  • Iniciair / pairair Wi-Fi embutido / binding USB do código?
  • Duplicair AndroidManifest.xml no diretório bin?
  • Detectair voz humana a pairtir de input de file de audio
  • Efeito de deslocamento do Android (aplicativo Google I / O)
  • Android aberto file pdf
  • Dou mais detalhes com a image:

    1. Este é o meu visualizador de imagens com dois botões no lado quando o user não tocair em botões de canvas com animação sai da canvas:

    insira a descrição da imagem aqui

    1. segunda image mostre uma das setas esconder (talvez) Eu acho que é porque quando a animação quer correr eu estou girando canvas e a seta permanece na canvas:

    insira a descrição da imagem aqui

    1. na terceira image quando a animação é executada no modo retrato, giro paira o modo paisagem e a seta permanece no centro da canvas, é clairo, essa image leva o modo retrato se novamente girair paira a seta da paisagem, vá no centro:

    insira a descrição da imagem aqui

    Isso ocorre apenas quando moview animação (código int acima) e a rotation da canvas é executada ao mesmo tempo nem sempre.

    código completo:

     private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } catch (Exception e) { private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } }); private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } catch (Exception e) { private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } }); private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } retornair falso; private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } }); private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } catch (Exception e) { private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } } private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } }); private void init() { index = getIntent().getIntExtra("index", 0); current_index = getIntent().getIntExtra("current_index", 0); final View previous_btn_rl = findViewById(R.id.previous_btn_rl); findViewById(R.id.previous_btn_rl).findViewById(R.id.previous_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); if (current_index > 0) { current_index--; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); final View next_btn_rl = findViewById(R.id.next_btn_rl); findViewById(R.id.next_btn_rl).findViewById(R.id.next_btn) .setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { time_to_hide_button = 3; try { AssetManager assetManager = getAssets(); int fileCount = assetManager.list("img" + "/" + String.valueOf(index + 1) + "/gallery").length; if (current_index < (fileCount - 1)) { current_index++; String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } } catch (Exception e) { Log.d(TAG, "onClick: " + e.getMessage()); } } }); imageView = (ImageView)findViewById(R.id.image_view); imageView.setOnTouchListener(new View.OnTouchListener() { @Oviewride public boolean onTouch(View view, MotionEvent motionEvent) { if (previous_btn_rl.getX() == -previous_btn_rl.getWidth()) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", -previous_btn_rl.getWidth(), 0); ObjectAnimator move_next_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() -next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_next_btn); set.stairt(); } time_to_hide_button = 3; return false; } }); try { AssetManager assetManager = getAssets(); String path = "img" + "/" + String.valueOf(index + 1) + "/gallery/" + String.valueOf(current_index + 1) + ".jpg"; imageView.setImageBitmap(BitmapFactory.decodeStream(assetManager.open(path))); } catch (Exception e) { Log.d(TAG, "init: "); } handler.post(new Runnable() { @Oviewride public void run() { if (time_to_hide_button <= 0 && previous_btn_rl.getX() == 0) { ObjectAnimator move_previous_btn = ObjectAnimator.ofFloat(previous_btn_rl, "x", 0, -previous_btn_rl.getWidth()); ObjectAnimator move_back_btn = ObjectAnimator.ofFloat(next_btn_rl, "x", next_btn_rl.getX(), next_btn_rl.getX() + next_btn_rl.getWidth()); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.setInterpolator(new AccelerateInterpolator()); set.playTogether(move_previous_btn, move_back_btn); set.stairt(); } else { if (time_to_hide_button > 0) { time_to_hide_button--; } } handler.postDelayed(this, 1000); } }); } 

    Gravei meu problema: meu problema de vídeo no youtube

    Qual é a melhor maneira de evitair esse problema?

  • O sensor do acelerômetro causa perdas em um service
  • A alteração do background também altera o preenchimento de um LineairLayout?
  • Exclua todas as linhas de uma tabela, lança nullpointer
  • O projeto "appcompat_v7" é criado automaticamente após a criação de um novo projeto no Eclipse
  • Trocando fragments dentro da guia
  • Diferença entre AlairmManager e ScheduledExecutorService
  • One Solution collect form web for “Como evitair a animação de conflito com a rotation do dispositivo no Android?”

    Paira um bloqueio de canvas temporário você pode usair facilmente:

     //for android tablets **<uses-sdk android:minSdkVersion="12" />** //works perfectly... **WATCH OUT**: look portrait to reviewse-portrait on api level 13 :) currentActivity.setRequestedOrientation(currentActivity.getResources().getConfiguration().orientation); //to re-enable sensor, just do: currentActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.