本文整理汇总了Java中com.sothree.slidinguppanel.SlidingUpPanelLayout类的典型用法代码示例。如果您正苦于以下问题:Java SlidingUpPanelLayout类的具体用法?Java SlidingUpPanelLayout怎么用?Java SlidingUpPanelLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SlidingUpPanelLayout类属于com.sothree.slidinguppanel包,在下文中一共展示了SlidingUpPanelLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawerLayout.setDrawerListener(toggle);
toggle.syncState();
slidingUpPanelLayout = (SlidingUpPanelLayout) findViewById(R.id.sliding_layout);
// logAdapter = new LogAdapter(this);
// mLogger = (RecyclerView) findViewById(R.id.rc_logger);
// LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
// linearLayoutManager.setStackFromEnd(true);
// mLogger.setHasFixedSize(true);
// mLogger.setAdapter(logAdapter);
}
示例2: replaceFragment
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void replaceFragment(SubsonicFragment fragment, int tag, boolean replaceCurrent) {
if(slideUpPanel != null && slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED && !isPanelClosing) {
secondaryFragment = fragment;
nowPlayingFragment.setPrimaryFragment(false);
secondaryFragment.setPrimaryFragment(true);
supportInvalidateOptionsMenu();
FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
trans.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, R.anim.enter_from_left, R.anim.exit_to_right);
trans.hide(nowPlayingFragment);
trans.add(R.id.now_playing_fragment_container, secondaryFragment, tag + "");
trans.commit();
} else {
super.replaceFragment(fragment, tag, replaceCurrent);
}
}
示例3: removeCurrent
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void removeCurrent() {
if(slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED && secondaryFragment != null) {
FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
trans.setCustomAnimations(R.anim.enter_from_left, R.anim.exit_to_right, R.anim.enter_from_right, R.anim.exit_to_left);
trans.remove(secondaryFragment);
trans.show(nowPlayingFragment);
trans.commit();
secondaryFragment = null;
nowPlayingFragment.setPrimaryFragment(true);
supportInvalidateOptionsMenu();
} else {
super.removeCurrent();
}
}
示例4: onRetrieveDeadlineDays
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void onRetrieveDeadlineDays(final ScheduleDeadlineDaysModel model) {
swipeRefreshLayout.setRefreshing(false);
if (slidingUpPanelLayout.getPanelState() != SlidingUpPanelLayout.PanelState.EXPANDED) {
titleSlidingUpPanel.setText(new SimpleDateFormat("MMMM yyyy").format(date.getTime()));
}
materialCalendarView.addDecorator(new DayViewDecorator() {
@Override
public boolean shouldDecorate(CalendarDay day) {
return day.getMonth() == model.month && model.getDays().contains(day.getDay());
}
@Override
public void decorate(DayViewFacade view) {
view.addSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), android.R.color.white)));
view.setSelectionDrawable(ContextCompat.getDrawable(getContext(), R.drawable.round));
}
});
}
示例5: onBackPressed
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public boolean onBackPressed() {
boolean wasExpanded = false;
if (slidingUpPanelLayout != null) {
wasExpanded = slidingUpPanelLayout.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED;
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
return wasExpanded;
}
示例6: onBackPressed
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void onBackPressed() {
if (mBottomSheetBehavior.getState() != BottomSheetBehaviorV2.STATE_COLLAPSED) {
mBottomSheetBehavior.setState(BottomSheetBehaviorV2.STATE_COLLAPSED);
return;
}
if (mDockViewPagerAdapter.getHomeScreenDockFragment().isEditing()) {
mDockViewPagerAdapter.getHomeScreenDockFragment().stopEditAnimation();
return;
}
if (isAppDrawerOpened()) {
mSlidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
}
示例7: updateUiStartCompile
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
private void updateUiStartCompile() {
if (mActionRun != null) mActionRun.setEnabled(false);
if (mCompileProgress != null) mCompileProgress.setVisibility(View.VISIBLE);
hideKeyboard();
openDrawer(GravityCompat.START);
mMessagePresenter.resume((JavaApplication) getApplication());
mMessagePresenter.clear();
mMessagePresenter.append("Compiling...\n");
mContainerOutput.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
mDiagnosticPresenter.clear();
mBottomPage.setCurrentItem(0);
}
示例8: onCreateView
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = super
.onCreateView(inflater, container, savedInstanceState, R.layout.map_info_bottom);
mLayout = (SlidingUpPanelLayout) root.findViewById(R.id.map_bottomsheet);
mSlideableView = mLayout.findViewById(R.id.map_bottomsheet_slideable);
mLayout.setPanelSlideListener(mPanelSlideListener);
mLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
mLayout.setEnableDragViewTouchEvents(false);
// Collapse the panel when the dummy content view is touched
mPanelContent = root.findViewById(R.id.map_bottomsheet_dummycontent);
mPanelContent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
});
mPanelContent.setClickable(false);
return root;
}
示例9: onNewIntent
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (intent != null && intent.getExtras() != null) {
this.setIntent(intent);
String url = "";
Bundle bundle = getIntent().getExtras();
if (bundle != null) {
url = bundle.getString(Extras.EXTRA_URL);
}
Wallpaper wallpaper = Database.get(this).getWallpaper(url);
if (wallpaper == null) {
return;
}
mWallpaper = wallpaper;
loadWallpaper(mWallpaper.getThumbUrl());
mSlidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
}
示例10: onBackPressed
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void onBackPressed() {
if (mSlidingLayout.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
mSlidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
return;
}
if (mTooltip != null) {
mTooltip.dismiss();
mTooltip = null;
}
if (mHandler != null && mRunnable != null)
mHandler.removeCallbacks(mRunnable);
if (mExitTransition != null) {
mExitTransition.exit(this);
return;
}
super.onBackPressed();
}
示例11: onPanelStateChanged
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState,
SlidingUpPanelLayout.PanelState newState) {
File file = ImageLoader.getInstance().getDiskCache().get(mWallpaper.getUrl());
if (newState == SlidingUpPanelLayout.PanelState.COLLAPSED &&
mTooltip == null
&& Preferences.get(this).isShowWallpaperTooltip() &&
!file.exists() &&
!Preferences.get(this).isTimeToShowWallpaperPreviewIntro() &&
!Preferences.get(this).isHighQualityPreviewEnabled()) {
mTooltip = Tooltip.Builder(this)
.to(mMenuPreview)
.content(R.string.wallpaper_tooltip_preview)
.desc(R.string.wallpaper_tooltip_preview_icon_tap)
.descIcon(R.drawable.ic_toolbar_preview_full)
.visibleDontShowAgain(true)
.cancelable(false)
.buttonCallback(tooltip -> {
Preferences.get(this).setShowWallpaperTooltip(!tooltip.getCheckboxState());
tooltip.dismiss();
})
.build();
mTooltip.show();
}
}
示例12: onServiceConnected
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
Log.d("ServiceConnection", "connected");
StreamService.LocalBinder binder = (StreamService.LocalBinder) service;
mService = binder.getService();
mBound = true;
// when the service is bound there is no need to display a notification (foreground)
mService.foregroundStop();
if (mService.isPlaying()) {
fab.hide();
sup.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
panelSlider.post(new Runnable() {
@Override
public void run() {
panelMain.setPadding(0, 0, 0, panelSlider.getHeight());
playerSetConnectionType();
startPlayerUpdater();
}
});
} else
sup.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
示例13: playEnclosure
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void playEnclosure(String url) {
if (url == null)
return;
tracker.send(new HitBuilders.EventBuilder()
.setCategory("Play Enclosure")
.setAction(url)
.build());
if (Connectivity.isConnected(this)) {
if (mBound)
mService.playUrl(url);
sup.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
} else {
Snackbar.make(panelMain, getString(R.string.no_network),
Snackbar.LENGTH_LONG).show();
}
}
示例14: openPoiDetailDrawer
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void openPoiDetailDrawer(PointOfInterest poi) {
POIDrawerFragment fragment = new POIDrawerFragment();
Bundle bundle = new Bundle();
bundle.putParcelable("poi", poi);
bundle.putBoolean("close", isCloseTo(poi));
bundle.putBoolean("journey", true);
bundle.putBoolean("hasNext", currentPoi != getPois().get(getPois().size() - 1));
bundle.putString("nextTitle", currentPoi != getPois().get(getPois().size() - 1) ? getPois().get(getPois().indexOf(currentPoi) + 1).getTitle(getLocale()) : "");
fragment.setDrawerFragmentListener(this);
fragment.setArguments(bundle);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.drawer_container, fragment);
transaction.commit();
getDrawerLayout().setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
}
示例15: onMetadataUpdate
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //导入依赖的package包/类
@Override
public void onMetadataUpdate(MusicDirectory.Entry song, int fieldChange) {
if(song != null && coverArtView != null && fieldChange == DownloadService.METADATA_UPDATED_COVER_ART) {
int height = coverArtView.getHeight();
if (height <= 0) {
int[] attrs = new int[]{R.attr.actionBarSize};
TypedArray typedArray = this.obtainStyledAttributes(attrs);
height = typedArray.getDimensionPixelSize(0, 0);
typedArray.recycle();
}
getImageLoader().loadImage(coverArtView, song, false, height, false);
// We need to update it immediately since it won't update if updater is not running for it
if(nowPlayingFragment != null && slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
nowPlayingFragment.onMetadataUpdate(song, fieldChange);
}
}
}