本文整理匯總了Java中com.sothree.slidinguppanel.SlidingUpPanelLayout.setPanelState方法的典型用法代碼示例。如果您正苦於以下問題:Java SlidingUpPanelLayout.setPanelState方法的具體用法?Java SlidingUpPanelLayout.setPanelState怎麽用?Java SlidingUpPanelLayout.setPanelState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sothree.slidinguppanel.SlidingUpPanelLayout
的用法示例。
在下文中一共展示了SlidingUpPanelLayout.setPanelState方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: onBackPressed
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入方法依賴的package包/類
/**
* Collapses the sliding panel when the user clicks the back button.
*/
@Override
public void onBackPressed() {
if (isZoomedIn) {
SlidingUpPanelLayout layout = (SlidingUpPanelLayout) findViewById(R.id.sliding_layout);
layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
} else {
super.onBackPressed();
}
}
示例3: disableSlidingPanel
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入方法依賴的package包/類
private void disableSlidingPanel() {
SlidingUpPanelLayout slidingUpLayout = (SlidingUpPanelLayout)findViewById(R.id.sliding_layout);
slidingUpLayout.setPanelHeight(0);
slidingUpLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
slidingUpLayout.setPanelHeight(0);
isSlidingPanelEnabled = false;
}
示例4: enableSlidingPanel
import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入方法依賴的package包/類
private void enableSlidingPanel() {
SlidingUpPanelLayout slidingUpLayout = (SlidingUpPanelLayout)findViewById(R.id.sliding_layout);
slidingUpLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
slidingUpLayout.setPanelHeight(78);
isSlidingPanelEnabled = true;
}