[Android] Remove the now-obsolete browse menu
Edward Wang
git at videolan.org
Sun Aug 12 04:28:04 CEST 2012
android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sat Aug 11 12:59:32 2012 -0400| [3f3fa172aae260149ea80639f5dd6c1a6cf3bf3a] | committer: Edward Wang
Remove the now-obsolete browse menu
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=3f3fa172aae260149ea80639f5dd6c1a6cf3bf3a
---
vlc-android/res/menu/media_library.xml | 5 --
.../src/org/videolan/vlc/gui/MainActivity.java | 77 --------------------
2 files changed, 82 deletions(-)
diff --git a/vlc-android/res/menu/media_library.xml b/vlc-android/res/menu/media_library.xml
index 7dde954..4b6a936 100644
--- a/vlc-android/res/menu/media_library.xml
+++ b/vlc-android/res/menu/media_library.xml
@@ -29,11 +29,6 @@
android:title="@string/refresh"
android:showAsAction="ifRoom" />
<item
- android:id="@+id/ml_menu_browse"
- android:icon="@drawable/ic_menu_archive"
- android:title="@string/directories"
- android:showAsAction="ifRoom" />
- <item
android:id="@+id/ml_menu_preferences"
android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/preferences" />
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 8a61dc8..74d3763 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -97,8 +97,6 @@ public class MainActivity extends SherlockFragmentActivity {
private TextView mInfoText;
private DirectoryViewFragment mDirectoryView;
private String mCurrentFragment;
- private int mCurrentViewTab;
- private Boolean mMediaLibraryActive;
private SharedPreferences mSettings;
@@ -177,16 +175,6 @@ public class MainActivity extends SherlockFragmentActivity {
}
});
- /* DirectoryView */
- mDirectoryView = new DirectoryViewFragment();
- mDirectoryView.setRetainInstance(true); /* Retain instance across attach/detach */
- getSupportFragmentManager().beginTransaction()
- .add(R.id.fragment_placeholder, mDirectoryView)
- .commit();
- getSupportFragmentManager().beginTransaction()
- .detach(mDirectoryView)
- .commit();
-
/* Set up the mini audio player */
mAudioPlayer = new AudioMiniPlayer();
mAudioController = AudioServiceController.getInstance();
@@ -341,20 +329,6 @@ public class MainActivity extends SherlockFragmentActivity {
else
MediaLibrary.getInstance(this).loadMediaItems(this);
break;
- // Browse Folders
- case R.id.ml_menu_browse:
- if(mMediaLibraryActive) {
- item.setTitle(R.string.media_library);
- showDirectoryView();
- }
- else {
- item.setTitle(R.string.directories);
- if (mCurrentViewTab == AUDIO_TAB)
- showAudioTab();
- else
- showVideoTab();
- }
- break;
// Open MRL
case R.id.ml_menu_open_mrl:
onOpenMRL();
@@ -371,34 +345,6 @@ public class MainActivity extends SherlockFragmentActivity {
mCurrentFragment = sharedPrefs.getString("fragment", "audio");
}
- private void showDirectoryView() {
- FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction();
-
- ft.setCustomAnimations(R.anim.anim_enter_bottom, 0);
-
- /* Remove existing tabs */
- if (mActionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD)
- mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
- /* Load directory view fragment */
- ft.attach(mDirectoryView);
- ft.commitAllowingStateLoss();
- mMediaLibraryActive = false;
- }
-
- private void hideDirectoryView() {
- FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction();
-
- ft.setCustomAnimations(0, R.anim.anim_leave_bottom);
-
- /* Restore the tabs */
- if (mActionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_TABS)
- mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
- /* Remove the directory view from the tabs */
- ft.detach(mDirectoryView);
- ft.commitAllowingStateLoss();
- mMediaLibraryActive = true;
- }
-
private void showInfoDialog() {
final Dialog infoDialog = new Dialog(this, R.style.info_dialog);
infoDialog.setContentView(R.layout.info_dialog);
@@ -423,29 +369,6 @@ public class MainActivity extends SherlockFragmentActivity {
* onClick event from xml
* @param view
*/
- public void changeTabClick(View view) {
- // Toggle audio- and video-tab
- if (mActionBar.getSelectedNavigationIndex() == VIDEO_TAB) {
- showAudioTab();
- } else {
- showVideoTab();
- }
- }
-
- private void showVideoTab() {
- hideDirectoryView();
- mActionBar.setSelectedNavigationItem(VIDEO_TAB);
- }
-
- private void showAudioTab() {
- hideDirectoryView();
- mActionBar.setSelectedNavigationItem(AUDIO_TAB);
- }
-
- /**
- * onClick event from xml
- * @param view
- */
public void searchClick(View view) {
onSearchRequested();
}
More information about the Android
mailing list