本文整理汇总了Java中org.videolan.vlc.gui.browser.BaseBrowserFragment类的典型用法代码示例。如果您正苦于以下问题:Java BaseBrowserFragment类的具体用法?Java BaseBrowserFragment怎么用?Java BaseBrowserFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseBrowserFragment类属于org.videolan.vlc.gui.browser包,在下文中一共展示了BaseBrowserFragment类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import org.videolan.vlc.gui.browser.BaseBrowserFragment; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null){
String mrl = savedInstanceState.getString(BaseBrowserFragment.KEY_MRL);
if (mrl != null)
mUri = Uri.parse(mrl);
mItemSelected = savedInstanceState.getParcelable(SELECTED_ITEM);
} else {
Intent intent = getActivity().getIntent();
if (intent != null && intent.hasExtra(BaseBrowserFragment.KEY_MRL))
mUri = Uri.parse(intent.getStringExtra(BaseBrowserFragment.KEY_MRL));
}
setOnItemViewClickedListener(this);
setOnItemViewSelectedListener(this);
setAdapter(mAdapter);
// UI setting
setHeadersState(HEADERS_ENABLED);
setBrandColor(getResources().getColor(R.color.orange800));
}
示例2: onBackPressed
import org.videolan.vlc.gui.browser.BaseBrowserFragment; //导入依赖的package包/类
@Override
public void onBackPressed() {
/* Close the menu first */
if(mDrawerLayout.isDrawerOpen(mListView)) {
if (mFocusedPrior != 0)
requestFocusOnSearch();
mDrawerLayout.closeDrawer(mListView);
return;
}
// Slide down the audio player if it is shown entirely.
if (slideDownAudioPlayer())
return;
if (mCurrentFragment!= null) {
// If it's the directory view, a "backpressed" action shows a parent.
if (mCurrentFragment.equals(SidebarEntry.ID_NETWORK) || mCurrentFragment.equals(SidebarEntry.ID_DIRECTORIES)){
BaseBrowserFragment browserFragment = (BaseBrowserFragment) getSupportFragmentManager()
.findFragmentById(R.id.fragment_placeholder);
if (browserFragment != null) {
browserFragment.goBack();
return;
}
}
}
finish();
}
示例3: onCreate
import org.videolan.vlc.gui.browser.BaseBrowserFragment; //导入依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null){
mUri = Uri.parse(savedInstanceState.getString(BaseBrowserFragment.KEY_MRL));
} else {
Intent intent = getActivity().getIntent();
if (intent != null && intent.hasExtra(BaseBrowserFragment.KEY_MRL))
mUri = Uri.parse(intent.getStringExtra(BaseBrowserFragment.KEY_MRL));
}
setOnItemViewSelectedListener(this);
}
示例4: onSaveInstanceState
import org.videolan.vlc.gui.browser.BaseBrowserFragment; //导入依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (mUri != null)
outState.putString(BaseBrowserFragment.KEY_MRL, mUri.toString());
if (mItemSelected != null) {
outState.putParcelable(SELECTED_ITEM, mItemSelected);
}
}
示例5: onBackPressed
import org.videolan.vlc.gui.browser.BaseBrowserFragment; //导入依赖的package包/类
@Override
public void onBackPressed() {
/* Close the menu first */
if(mDrawerLayout.isDrawerOpen(mListView)) {
if (mFocusedPrior != 0)
requestFocusOnSearch();
mDrawerLayout.closeDrawer(mListView);
return;
}
/* Slide down the audio player if it is shown entirely. */
if (slideDownAudioPlayer())
return;
if (mCurrentFragment!= null) {
// If it's the directory view, a "backpressed" action shows a parent.
if (mCurrentFragment.equals(SidebarEntry.ID_NETWORK) || mCurrentFragment.equals(SidebarEntry.ID_DIRECTORIES)){
BaseBrowserFragment browserFragment = (BaseBrowserFragment) getSupportFragmentManager()
.findFragmentById(R.id.fragment_placeholder);
if (browserFragment != null) {
browserFragment.goBack();
return;
}
}
}
finish();
}
示例6: onPrepareOptionsMenu
import org.videolan.vlc.gui.browser.BaseBrowserFragment; //导入依赖的package包/类
@Override
public boolean onPrepareOptionsMenu (Menu menu) {
super.onPrepareOptionsMenu(menu);
if (menu == null)
return false;
Fragment current = getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder);
MenuItem item;
// Disable the sort option if we can't use it on the current fragment.
if (current == null || !(current instanceof ISortable)) {
item = menu.findItem(R.id.ml_menu_sortby);
if (item == null)
return false;
item.setEnabled(false);
item.setVisible(false);
} else {
ISortable sortable = (ISortable) current;
item = menu.findItem(R.id.ml_menu_sortby);
if (item == null)
return false;
item.setEnabled(true);
item.setVisible(true);
item = menu.findItem(R.id.ml_menu_sortby_name);
if (sortable.sortDirection(VideoListAdapter.SORT_BY_TITLE) == 1)
item.setTitle(R.string.sortby_name_desc);
else
item.setTitle(R.string.sortby_name);
item = menu.findItem(R.id.ml_menu_sortby_length);
if (sortable.sortDirection(VideoListAdapter.SORT_BY_LENGTH) == 1)
item.setTitle(R.string.sortby_length_desc);
else
item.setTitle(R.string.sortby_length);
item = menu.findItem(R.id.ml_menu_sortby_date);
if (sortable.sortDirection(VideoListAdapter.SORT_BY_DATE) == 1)
item.setTitle(R.string.sortby_date_desc);
else
item.setTitle(R.string.sortby_date);
}
boolean networkSave = current instanceof NetworkBrowserFragment && !((NetworkBrowserFragment)current).isRootDirectory();
if (networkSave) {
item = menu.findItem(R.id.ml_menu_save);
item.setVisible(true);
String mrl = ((BaseBrowserFragment)current).mMrl;
item.setIcon(MediaDatabase.getInstance().networkFavExists(Uri.parse(mrl)) ?
R.drawable.ic_menu_bookmark_w :
R.drawable.ic_menu_bookmark_outline_w);
} else
menu.findItem(R.id.ml_menu_save).setVisible(false);
if (current instanceof MRLPanelFragment)
menu.findItem(R.id.ml_menu_clean).setVisible(!((MRLPanelFragment) current).isEmpty());
boolean showLast = current instanceof AudioBrowserFragment || (current instanceof VideoGridFragment && mSettings.getString(PreferencesActivity.VIDEO_LAST, null) != null);
menu.findItem(R.id.ml_menu_last_playlist).setVisible(showLast);
return true;
}