[Android] Do not set theme of MRL fragment

Geoffrey Métais git at videolan.org
Mon Jan 15 10:03:31 CET 2018


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jan 15 09:58:02 2018 +0100| [162f42bfe3141ce0b5e897b5b448570d4df4c595] | committer: Geoffrey Métais

Do not set theme of MRL fragment

It breaks display on ChromeOS

(cherry picked from commit 652eeac32a75d74e9756f72f7ac1e3b2572a1fce)

> https://code.videolan.org/videolan/vlc-android/commit/162f42bfe3141ce0b5e897b5b448570d4df4c595
---

 .../videolan/vlc/gui/network/MRLPanelFragment.java | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.java b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.java
index d9e0a4af7..cf78a111c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.java
@@ -53,10 +53,9 @@ public class MRLPanelFragment extends DialogFragment implements View.OnKeyListen
     public MRLPanelFragment(){}
 
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        int theme = UiTools.isBlackThemeEnabled() ? R.style.Theme_VLC_Black : R.style.Theme_VLC;
-        setStyle(DialogFragment.STYLE_NO_FRAME, theme);
-        View v = inflater.inflate(R.layout.mrl_panel, container, false);
-        mEditText = (TextInputLayout) v.findViewById(R.id.mrl_edit);
+        setStyle(DialogFragment.STYLE_NO_FRAME, 0);
+        final View v = inflater.inflate(R.layout.mrl_panel, container, false);
+        mEditText = v.findViewById(R.id.mrl_edit);
         mEditText.getEditText().setOnKeyListener(this);
         mEditText.getEditText().setOnEditorActionListener(this);
         mEditText.setHint(getString(R.string.open_mrl_dialog_msg));
@@ -84,11 +83,9 @@ public class MRLPanelFragment extends DialogFragment implements View.OnKeyListen
     @Override
     public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
         super.onViewStateRestored(savedInstanceState);
-        if (savedInstanceState == null || mEditText == null)
-            return;
-        String mrl = savedInstanceState.getString(KEY_MRL);
-        if (mEditText != null && mEditText.getEditText() != null)
-            mEditText.getEditText().setText(mrl);
+        if (savedInstanceState == null || mEditText == null) return;
+        final String mrl = savedInstanceState.getString(KEY_MRL);
+        if (mEditText != null && mEditText.getEditText() != null) mEditText.getEditText().setText(mrl);
     }
 
     private void updateHistory() {
@@ -106,7 +103,7 @@ public class MRLPanelFragment extends DialogFragment implements View.OnKeyListen
 
     private boolean processUri() {
         if (mEditText.getEditText() != null && !TextUtils.isEmpty(mEditText.getEditText().getText())) {
-            MediaWrapper mw = new MediaWrapper(Uri.parse(mEditText.getEditText().getText().toString().trim()));
+            final MediaWrapper mw = new MediaWrapper(Uri.parse(mEditText.getEditText().getText().toString().trim()));
             playMedia(mw);
             mEditText.getEditText().getText().clear();
             return true;
@@ -140,8 +137,7 @@ public class MRLPanelFragment extends DialogFragment implements View.OnKeyListen
     @Override
     public void onDestroy() {
         super.onDestroy();
-        Activity activity = getActivity();
-        if (activity != null && activity instanceof DialogActivity)
-            activity.finish();
+        final Activity activity = getActivity();
+        if (activity instanceof DialogActivity) activity.finish();
     }
 }



More information about the Android mailing list