Commit 3f3fa172 authored by Edward Wang's avatar Edward Wang

Remove the now-obsolete browse menu

parent c59c3da7
...@@ -28,11 +28,6 @@ ...@@ -28,11 +28,6 @@
android:icon="@drawable/ic_menu_refresh" android:icon="@drawable/ic_menu_refresh"
android:title="@string/refresh" android:title="@string/refresh"
android:showAsAction="ifRoom" /> android:showAsAction="ifRoom" />
<item
android:id="@+id/ml_menu_browse"
android:icon="@drawable/ic_menu_archive"
android:title="@string/directories"
android:showAsAction="ifRoom" />
<item <item
android:id="@+id/ml_menu_preferences" android:id="@+id/ml_menu_preferences"
android:icon="@android:drawable/ic_menu_preferences" android:icon="@android:drawable/ic_menu_preferences"
......
...@@ -97,8 +97,6 @@ public class MainActivity extends SherlockFragmentActivity { ...@@ -97,8 +97,6 @@ public class MainActivity extends SherlockFragmentActivity {
private TextView mInfoText; private TextView mInfoText;
private DirectoryViewFragment mDirectoryView; private DirectoryViewFragment mDirectoryView;
private String mCurrentFragment; private String mCurrentFragment;
private int mCurrentViewTab;
private Boolean mMediaLibraryActive;
private SharedPreferences mSettings; private SharedPreferences mSettings;
...@@ -177,16 +175,6 @@ public class MainActivity extends SherlockFragmentActivity { ...@@ -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 */ /* Set up the mini audio player */
mAudioPlayer = new AudioMiniPlayer(); mAudioPlayer = new AudioMiniPlayer();
mAudioController = AudioServiceController.getInstance(); mAudioController = AudioServiceController.getInstance();
...@@ -341,20 +329,6 @@ public class MainActivity extends SherlockFragmentActivity { ...@@ -341,20 +329,6 @@ public class MainActivity extends SherlockFragmentActivity {
else else
MediaLibrary.getInstance(this).loadMediaItems(this); MediaLibrary.getInstance(this).loadMediaItems(this);
break; 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 // Open MRL
case R.id.ml_menu_open_mrl: case R.id.ml_menu_open_mrl:
onOpenMRL(); onOpenMRL();
...@@ -371,34 +345,6 @@ public class MainActivity extends SherlockFragmentActivity { ...@@ -371,34 +345,6 @@ public class MainActivity extends SherlockFragmentActivity {
mCurrentFragment = sharedPrefs.getString("fragment", "audio"); 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() { private void showInfoDialog() {
final Dialog infoDialog = new Dialog(this, R.style.info_dialog); final Dialog infoDialog = new Dialog(this, R.style.info_dialog);
infoDialog.setContentView(R.layout.info_dialog); infoDialog.setContentView(R.layout.info_dialog);
...@@ -419,29 +365,6 @@ public class MainActivity extends SherlockFragmentActivity { ...@@ -419,29 +365,6 @@ public class MainActivity extends SherlockFragmentActivity {
infoDialog.show(); infoDialog.show();
} }
/**
* 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 * onClick event from xml
* @param view * @param view
......
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