0

my Submitted application for amazon fire TV failed for the following reason :

Issue 1: Interactive portions of the screen are not highlighted when selected : Rewind, Fast Forward, and Play buttons above progress bar can be navigated and selected but no highlighted cursor is visible.

I am using the default media controller class provided by android and it does not provide this functionality. I was able to catch the controls but i was not able to add a highlight on key down and remove it on key up. can anyone help with this?

Wooble
  • 87,717
  • 12
  • 108
  • 131
S.Najjar
  • 65
  • 1
  • 9
  • This question appears to be off-topic because it is about Amazon's approval process, not programming. – Wooble Oct 07 '14 at 11:15

1 Answers1

0

Try this may be it works..

           Field ffwd = MediaController.class.getDeclaredField("mFfwdButton");
                Field rwd = MediaController.class.getDeclaredField("mRewButton");
                Field playPause = MediaController.class.getDeclaredField("mPauseButton");
                //System.out.println(f.get(d));//not accessible now
                ffwd.setAccessible(true);//Abracadabra
                rwd.setAccessible(true);//Abracadabra 
                playPause.setAccessible(true);
                //System.out.println("Fusioni"+ffwd.get(mediaController)+" "+f1.get(mediaController));//now its ok
                ffwdBtn = (ImageButton) ffwd.get(mediaController);
                rwdBtn = (ImageButton) rwd.get(mediaController);
                playPauseBtn = (ImageButton) playPause.get(mediaController);
                //Log.i("imbtn",""+imbtn);
                ffwdBtn.setOnFocusChangeListener(new OnFocusChangeListener() {
                    @Override
                    public void onFocusChange(View v, boolean hasFocus) {
                        if(hasFocus)
                            v.setBackgroundResource(R.drawable.round_background_selected);
                        else
                            v.setBackgroundColor(Color.TRANSPARENT);
                    }
                });
                rwdBtn.setOnFocusChangeListener(new OnFocusChangeListener() {
                    @Override
                    public void onFocusChange(View v, boolean hasFocus) {
                        if(hasFocus)
                            v.setBackgroundResource(R.drawable.round_background_selected);
                        else
                            v.setBackgroundColor(Color.TRANSPARENT);
                    }
                });
                playPauseBtn.setOnFocusChangeListener(new OnFocusChangeListener() {
                    @Override
                    public void onFocusChange(View v, boolean hasFocus) {
                        if(hasFocus)
                            v.setBackgroundResource(R.drawable.round_background_selected);
                        else
                            v.setBackgroundColor(Color.TRANSPARENT);
                    }
                });
                playPauseBtn.setBackgroundResource(R.drawable.round_background_selected);
                rwdBtn.setBackgroundColor(Color.TRANSPARENT);
                ffwdBtn.setBackgroundColor(Color.TRANSPARENT);
                playPauseBtn.setFocusable(true);
                playPauseBtn.requestFocus();
MPG
  • 785
  • 6
  • 20
  • this didn't work for me. i have defined the listeners for the buttons but those listeners were never fired. In fact only the pause/Play listener was fired when the HasFocus was false. no action on the FFwd or rwd. – S.Najjar Nov 24 '14 at 15:36
  • you also have to override onkeyDown and OnkeyUp methods to set and remove highlights.. v.setBackgroundResource(R.drawable.round_background_selected); in onKeyDown and v.setBackgroundColor(Color.TRANSPARENT); in onKeyUp – MPG Nov 25 '14 at 05:28