[Android] Equalizer: set the fragment title in the action bar

Adrien Maglo git at videolan.org
Tue Jan 28 16:54:12 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Tue Jan 28 16:54:04 2014 +0100| [f5c6322642a3773f2eb36a731df9becaa090ad2c] | committer: Adrien Maglo

Equalizer: set the fragment title in the action bar

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f5c6322642a3773f2eb36a731df9becaa090ad2c
---

 .../src/org/videolan/vlc/gui/audio/EqualizerFragment.java       |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
index 973914d..406a682 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.java
@@ -27,10 +27,11 @@ import org.videolan.vlc.VLCApplication;
 import org.videolan.vlc.interfaces.OnEqualizerBarChangeListener;
 import org.videolan.vlc.widget.EqualizerBar;
 
+import com.actionbarsherlock.app.SherlockFragment;
+
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.preference.PreferenceManager;
-import android.support.v4.app.Fragment;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
@@ -49,7 +50,7 @@ import android.widget.SeekBar.OnSeekBarChangeListener;
 import android.widget.Spinner;
 import android.widget.ToggleButton;
 
-public class EqualizerFragment extends Fragment {
+public class EqualizerFragment extends SherlockFragment {
 
     public final static String TAG = "VLC/EqualizerFragment";
     private ToggleButton button;
@@ -66,6 +67,8 @@ public class EqualizerFragment extends Fragment {
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
     {
+        getSherlockActivity().getSupportActionBar().setTitle(getResources().getString(R.string.equalizer));
+
         super.onCreateView(inflater, container, savedInstanceState);
         View v = inflater.inflate(R.layout.equalizer, container, false);
 



More information about the Android mailing list