Commit 3db3b7d9 authored by Alexandre Perraud's avatar Alexandre Perraud

DPAD navigation : Show Advanced Option help when focus

parent bee7a8f6
......@@ -117,6 +117,8 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
private IPlaybackSettingsController mPlaybackController;
private Toast mToast;
public AdvOptionsDialog() {}
@Override
......@@ -170,6 +172,9 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
mAdapter = new AdvOptionsAdapter();
mRecyclerView.setAdapter(mAdapter);
mToast = Toast.makeText(VLCApplication.getAppContext(), "", Toast.LENGTH_SHORT);
mToast.setGravity(Gravity.TOP,0,100);
//Get default color
int[] attrs = new int[] { android.R.attr.textColorSecondary };
TypedArray a = getActivity().getTheme().obtainStyledAttributes(R.style.Theme_VLC, attrs);
......@@ -504,6 +509,8 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
if (v instanceof TextView)
((TextView) v).setTextColor(v.hasFocus() ?
FOCUSED_TEXT_COLOR : mTextColor);
mToast.setText(mAdapter.getSelectedAdvOptionHelp());
mToast.show();
}
......@@ -666,6 +673,10 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
notifyItemInserted(mList.size()-1);
}
public String getSelectedAdvOptionHelp () {
return mList.get(getSelection()).text;
}
public void setSelection(int position) {
if (mSelection == position || position < 0 || position >= mList.size())
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment