Skip to content

Improvement/bugfix for SimpleMediaFensterPlayerController #30

Open
@MFlisar

Description

  1. Bug: Currently this Controller does not handle the rewind/forward button clicks... They simple don't have click listeners and do nothing.
  2. Suggestion: add a function to even hide the two buttons for a even more simple layout...
  3. Suggestion: allow to theme the progress bar

For 2 and 3 I use currently some solution via reflection (just to show you what I would suggest to be available without reflection):

fensterSimpleVideoController.post(new Runnable()
{
    @Override
    public void run()
    {
        try
        {
            Class<?> c = fensterSimpleVideoController.getClass();
            Field mProgress = c.getDeclaredField("mProgress");
            mProgress.setAccessible(true);
            SeekBar seekbar = (SeekBar) mProgress.get(fensterSimpleVideoController);
            ThemeManager.get().themeSeekbar(seekbar);

            Field mNextButton = c.getDeclaredField("mNextButton");
            Field mPrevButton = c.getDeclaredField("mPrevButton");
            mNextButton.setAccessible(true);
            mPrevButton.setAccessible(true);

            ((View) mNextButton.get(fensterSimpleVideoController)).setVisibility(View.GONE);
            ((View) mPrevButton.get(fensterSimpleVideoController)).setVisibility(View.GONE);
        }
        catch (IllegalAccessException e)
        {

        } catch (NoSuchFieldException e)
        {

        }
    }
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions