本文整理匯總了Java中com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener類的典型用法代碼示例。如果您正苦於以下問題:Java OnClosedListener類的具體用法?Java OnClosedListener怎麽用?Java OnClosedListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OnClosedListener類屬於com.jeremyfeinstein.slidingmenu.lib.SlidingMenu包,在下文中一共展示了OnClosedListener類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: customizeMenu
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener; //導入依賴的package包/類
private void customizeMenu() {
SlidingMenu sm = getSlidingMenu();
sm.setShadowWidthRes(R.dimen.shadow_width);
sm.setShadowDrawable(R.drawable.shadow);
sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
sm.setFadeDegree(0.15f);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
sm.setOnOpenedListener(new OnOpenedListener() {
@Override
public void onOpened() {
fragmentChanged();
}
});
sm.setOnClosedListener(new OnClosedListener() {
@Override
public void onClosed() {
fragmentChanged();
}
});
}
示例2: onCreate
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sliding_menu_sample);
final SlidingMenu menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setBehindWidth(getResources().getDimensionPixelSize(
R.dimen.menu_width));
menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
menu.setMenu(R.layout.sliding_menu);
menu.setOnOpenedListener(new OnOpenedListener() {
@Override
public void onOpened() {
// メニューが開かれた時に呼び出される
}
});
menu.setOnClosedListener(new OnClosedListener() {
@Override
public void onClosed() {
// メニューが閉じた時に呼び出される
}
});
initializeMenuLayout(menu);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
menu.showMenu(true);
}
}, 4000);
}
開發者ID:android-opensource-library-56,項目名稱:android-opensource-library-56,代碼行數:37,代碼來源:SlidingMenuSampleActivity.java
示例3: setOnClosedListener
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener; //導入依賴的package包/類
/**
* 設置關閉監聽事件
*/
public void setOnClosedListener(OnClosedListener l) {
mClosedListener = l;
}
示例4: setOnClosedListener
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener; //導入依賴的package包/類
public void setOnClosedListener(OnClosedListener l)
{
mClosedListener = l;
}
示例5: setOnClosedListener
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener; //導入依賴的package包/類
public void setOnClosedListener(OnClosedListener l) {
mClosedListener = l;
}
示例6: setOnClosedListener
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener; //導入依賴的package包/類
public void setOnClosedListener(OnClosedListener l) {
mClosedListener = l;
}
示例7: setOnClosedListener
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener; //導入依賴的package包/類
/**
* ���ùرռ����¼�
*/
public void setOnClosedListener(OnClosedListener l) {
mClosedListener = l;
}
示例8: createSlidingMenus
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnClosedListener; //導入依賴的package包/類
/**
* Create the sliding menus for this activity. If savedInstanceState is not
* null, the menu fragment can simply be retrieved from the fragment
* manager.
*
* @param savedInstanceState
* If the activity is being re-initialized after previously being
* shut down then this Bundle contains the data it most recently
* supplied in onSaveInstanceState(Bundle). Note: Otherwise it is
* null.
*/
private void createSlidingMenus() {
SlidingMenu menu = getSlidingMenu();
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setFadeDegree(0.35f);
menu.setMenu(R.layout.sliding_menu_frame);
menu.setBehindOffsetRes(R.dimen.sliding_menu_offset);
menu.setShadowDrawable(R.drawable.sliding_menu_shadow);
menu.setShadowWidthRes(R.dimen.sliding_menu_shadow_width);
menu.setMode(SlidingMenu.LEFT_RIGHT);
menu.setSecondaryShadowDrawable(R.drawable.sliding_menu_shadow_right);
menu.setOnClosedListener(new OnClosedListener() {
@Override
public void onClosed() {
closeOptions();
}
});
Fragment optionsLeft = getFragmentManager().findFragmentByTag(
"LEFT_OPTIONS");
Fragment optionsRight = getFragmentManager().findFragmentByTag(
"RIGHT_OPTIONS");
mLogFragRight = (SlidingMenuLogListFragment) getFragmentManager()
.findFragmentByTag("RIGHT");
mLogFragLeft = (SlidingMenuLogListFragment) getFragmentManager()
.findFragmentByTag("LEFT");
FragmentTransaction ft;
// Only create new fragments if they don't exist
if (mLogFragRight == null || mLogFragLeft == null) {
mLogFragRight = new SlidingMenuLogListFragment();
mLogFragLeft = new SlidingMenuLogListFragment();
ft = getFragmentManager().beginTransaction();
ft = ft.replace(R.id.sliding_menu_frame2, mLogFragRight, "RIGHT");
ft = ft.replace(R.id.sliding_menu_frame, mLogFragLeft, "LEFT");
ft.commit();
}
ft = getFragmentManager().beginTransaction();
mLogFragRight.setControllers(p1Controller, p2Controller);
mLogFragLeft.setControllers(p1Controller, p2Controller);
// Restore the options fragments if they exist
if (optionsRight != null) {
ft = ft.replace(R.id.sliding_menu_frame2, optionsRight,
"RIGHT_OPTIONS");
}
if (optionsLeft != null) {
ft = ft.replace(R.id.sliding_menu_frame, optionsLeft,
"LEFT_OPTIONS");
}
// If there are any changes to be done, commit them
if (!ft.isEmpty()) {
ft.commit();
}
getFragmentManager().executePendingTransactions();
// set the fragments to be inverted as necessary
mLogFragRight.setUpperInverted(mPrefs.getBoolean(
getString(R.string.key_invert), true));
mLogFragLeft.setUpperInverted(mPrefs.getBoolean(
getString(R.string.key_invert), true));
}