[Android] Audio GUI: rename and move the AudioMiniPlayer class and its menu
Adrien Maglo
git at videolan.org
Wed Jan 29 16:39:25 CET 2014
vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed Jan 29 16:38:17 2014 +0100| [409588dadf5f6afd5f4a72d5f6058fd7e620e499] | committer: Adrien Maglo
Audio GUI: rename and move the AudioMiniPlayer class and its menu
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=409588dadf5f6afd5f4a72d5f6058fd7e620e499
---
vlc-android/res/layout/main.xml | 4 +--
.../{audio_player_mini.xml => audio_player.xml} | 0
.../src/org/videolan/vlc/gui/MainActivity.java | 38 ++++++++++----------
.../audio/AudioPlayer.java} | 14 ++++----
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/vlc-android/res/layout/main.xml b/vlc-android/res/layout/main.xml
index 8f46540..390fcc3 100644
--- a/vlc-android/res/layout/main.xml
+++ b/vlc-android/res/layout/main.xml
@@ -45,14 +45,14 @@
</RelativeLayout>
<View
- android:id="@+id/audio_mini_player_filling"
+ android:id="@+id/audio_player_filling"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:visibility="gone" />
</org.videolan.vlc.widget.ContentLinearLayout>
<FrameLayout
- android:id="@+id/audio_mini_player"
+ android:id="@+id/audio_player"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
diff --git a/vlc-android/res/menu/audio_player_mini.xml b/vlc-android/res/menu/audio_player.xml
similarity index 100%
rename from vlc-android/res/menu/audio_player_mini.xml
rename to vlc-android/res/menu/audio_player.xml
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index e4a0523..36a537f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -30,9 +30,9 @@ import org.videolan.vlc.Util;
import org.videolan.vlc.VLCCallbackTask;
import org.videolan.vlc.WeakHandler;
import org.videolan.vlc.gui.SidebarAdapter.SidebarEntry;
+import org.videolan.vlc.gui.audio.AudioPlayer;
import org.videolan.vlc.gui.video.VideoListAdapter;
import org.videolan.vlc.interfaces.ISortable;
-import org.videolan.vlc.widget.AudioMiniPlayer;
import org.videolan.vlc.widget.SlidingPaneLayout;
import android.annotation.TargetApi;
@@ -98,7 +98,7 @@ public class MainActivity extends SherlockFragmentActivity {
private ActionBar mActionBar;
private SlidingMenu mMenu;
private SidebarAdapter mSidebarAdapter;
- private AudioMiniPlayer mAudioPlayer;
+ private AudioPlayer mAudioPlayer;
private AudioServiceController mAudioController;
private SlidingPaneLayout mSlidingPane;
@@ -192,7 +192,7 @@ public class MainActivity extends SherlockFragmentActivity {
mInfoLayout = v_main.findViewById(R.id.info_layout);
mInfoProgress = (ProgressBar) v_main.findViewById(R.id.info_progress);
mInfoText = (TextView) v_main.findViewById(R.id.info_text);
- mAudioPlayerFilling = v_main.findViewById(R.id.audio_mini_player_filling);
+ mAudioPlayerFilling = v_main.findViewById(R.id.audio_player_filling);
/* Set up the action bar */
prepareActionBar();
@@ -218,8 +218,8 @@ public class MainActivity extends SherlockFragmentActivity {
*/
getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
- /* Slide down the mini player */
- slideDownMiniPlayer();
+ /* Slide down the audio player */
+ slideDownAudioPlayer();
/* Switch the fragment */
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
@@ -241,12 +241,12 @@ public class MainActivity extends SherlockFragmentActivity {
}
});
- /* Set up the mini audio player */
- mAudioPlayer = new AudioMiniPlayer();
+ /* Set up the audio player */
+ mAudioPlayer = new AudioPlayer();
mAudioController = AudioServiceController.getInstance();
getSupportFragmentManager().beginTransaction()
- .replace(R.id.audio_mini_player, mAudioPlayer)
+ .replace(R.id.audio_player, mAudioPlayer)
.commit();
/* Show info/alpha/beta Warning */
@@ -410,8 +410,8 @@ public class MainActivity extends SherlockFragmentActivity {
return;
}
- // Slide down the mini player if it is shown entirely.
- if (slideDownMiniPlayer())
+ // Slide down the audio player if it is shown entirely.
+ if (slideDownAudioPlayer())
return;
// If it's the directory view, a "backpressed" action shows a parent.
@@ -467,8 +467,8 @@ public class MainActivity extends SherlockFragmentActivity {
* Show a new fragment.
*/
public Fragment showNewFragment(String fragmentTag) {
- // Slide down the mini player if needed.
- slideDownMiniPlayer();
+ // Slide down the audio player if needed.
+ slideDownAudioPlayer();
// Do not show the new fragment if the requested fragment is already shown.
if (mCurrentFragment.equals(fragmentTag))
@@ -681,7 +681,7 @@ public class MainActivity extends SherlockFragmentActivity {
}
}
} else if (action.equalsIgnoreCase(ACTION_SHOW_PLAYER)) {
- showMiniPlayer();
+ showAudioPlayer();
}
}
};
@@ -776,9 +776,9 @@ public class MainActivity extends SherlockFragmentActivity {
}
/**
- * Show the mini player.
+ * Show the audio player.
*/
- public void showMiniPlayer() {
+ public void showAudioPlayer() {
// Open the pane only if is entirely opened.
if (mSlidingPane.getState() == mSlidingPane.STATE_OPENED_ENTIRELY)
mSlidingPane.openPane();
@@ -786,10 +786,10 @@ public class MainActivity extends SherlockFragmentActivity {
}
/**
- * Slide down the mini player.
+ * Slide down the audio player.
* @return true on success else false.
*/
- public boolean slideDownMiniPlayer() {
+ public boolean slideDownAudioPlayer() {
if (mSlidingPane.getState() == mSlidingPane.STATE_CLOSED) {
mSlidingPane.openPane();
return true;
@@ -798,9 +798,9 @@ public class MainActivity extends SherlockFragmentActivity {
}
/**
- * Hide the mini player.
+ * Hide the audio player.
*/
- public void hideMiniPlayer() {
+ public void hideAudioPlayer() {
mSlidingPane.openPaneEntirely();
mAudioPlayerFilling.setVisibility(View.GONE);
}
diff --git a/vlc-android/src/org/videolan/vlc/widget/AudioMiniPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
similarity index 98%
rename from vlc-android/src/org/videolan/vlc/widget/AudioMiniPlayer.java
rename to vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 5b6a474..b922a78 100644
--- a/vlc-android/src/org/videolan/vlc/widget/AudioMiniPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-package org.videolan.vlc.widget;
+package org.videolan.vlc.gui.audio;
import java.util.ArrayList;
@@ -34,9 +34,9 @@ import org.videolan.vlc.Util;
import org.videolan.vlc.gui.CommonDialogs;
import org.videolan.vlc.gui.MainActivity;
import org.videolan.vlc.gui.CommonDialogs.MenuType;
-import org.videolan.vlc.gui.audio.AudioListAdapter;
-import org.videolan.vlc.gui.audio.AudioPlaylistView;
import org.videolan.vlc.interfaces.IAudioPlayer;
+import org.videolan.vlc.widget.AnimatedCoverView;
+import org.videolan.vlc.widget.AudioMediaSwitcher;
import org.videolan.vlc.widget.AudioMediaSwitcher.AudioMediaSwitcherListener;
import android.graphics.Bitmap;
@@ -63,7 +63,7 @@ import android.widget.ViewSwitcher;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.SeekBar.OnSeekBarChangeListener;
-public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
+public class AudioPlayer extends Fragment implements IAudioPlayer {
public static final String TAG = "VLC/AudioMiniPlayer";
private ProgressBar mProgressBar;
@@ -259,7 +259,7 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
MenuInflater menuInflater = getActivity().getMenuInflater();
- menuInflater.inflate(R.menu.audio_player_mini, menu);
+ menuInflater.inflate(R.menu.audio_player, menu);
}
@Override
@@ -463,12 +463,12 @@ public class AudioMiniPlayer extends Fragment implements IAudioPlayer {
public void show() {
MainActivity activity = (MainActivity)getActivity();
- activity.showMiniPlayer();
+ activity.showAudioPlayer();
}
public void hide() {
MainActivity activity = (MainActivity)getActivity();
- activity.hideMiniPlayer();
+ activity.hideAudioPlayer();
}
/**
More information about the Android
mailing list