本文整理了Java中android.support.v4.widget.DrawerLayout.postDelayed()
方法的一些代码示例,展示了DrawerLayout.postDelayed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DrawerLayout.postDelayed()
方法的具体详情如下:
包路径:android.support.v4.widget.DrawerLayout
类名称:DrawerLayout
方法名:postDelayed
暂无
代码示例来源:origin: Aspsine/SwipeToLoadLayout
@Override
public boolean onNavigationItemSelected(final MenuItem menuItem) {
drawerLayout.closeDrawer(GravityCompat.START);
drawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
int itemId = menuItem.getItemId();
if (itemId == R.id.nav_about) {
startActivity(new Intent(MainActivity.this, AboutActivity.class));
} else {
mFragmentNavigator.showFragment(IDS.indexOf(itemId));
}
}
}, 200);
return true;
}
}
代码示例来源:origin: kingargyle/adt-leanback-support
@Override
public void onEdgeTouched(int edgeFlags, int pointerId) {
postDelayed(mPeekRunnable, PEEK_DELAY);
}
代码示例来源:origin: CoderGuoy/Coder
@Override
protected void onNoDoubleClick(final View v) {
bindingView.drawerlayout.closeDrawer(GravityCompat.START);
bindingView.drawerlayout.postDelayed(new Runnable() {
@Override
public void run() {
switch (v.getId()) {
case R.id.ll_nav_video:
startActivity(new Intent(HomeActivity.this, FreeVideoActivity.class));
break;
case R.id.ll_nav_2:
ToastUtil.show("敬请期待");
break;
case R.id.ll_nav_3:
ToastUtil.show("敬请期待");
break;
case R.id.ll_nav_4:
ToastUtil.show("敬请期待");
break;
case R.id.ll_nav_5:
ToastUtil.show("敬请期待");
break;
}
}
}, 260);
}
};
代码示例来源:origin: wasdennnoch/AndroidN-ify
private void onCategoriesChanged() {
if (sDashboardCategories != null) {
updateDrawer();
} else if (mFailCount < 10) {
mFailCount++;
mDrawerLayout.postDelayed(mUpdateCategories, 1000);
}
}
代码示例来源:origin: ywwynm/EverythingDone
@Override
public void onReceive(Context context, final Intent intent) {
String mRemoteIntentInfo = "mRemoteIntent[null]";
if (mRemoteIntent != null) {
mRemoteIntentInfo = "mRemoteIntent.resultCode[" +
mRemoteIntent.getIntExtra(Def.Communication.KEY_RESULT_CODE,
Def.Communication.RESULT_NO_UPDATE) + "]";
}
Log.i(TAG, "UPDATE_MAIN_UI broadcast received, "
+ "canSeeThingsActivity[" + mCanSeeUi + "], "
+ mRemoteIntentInfo);
if (!mCanSeeUi) {
if (mRemoteIntent != null) {
updateMainUi(mRemoteIntent);
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
mRemoteIntent = intent;
}
}, 600);
} else {
mRemoteIntent = intent;
}
return;
}
updateMainUi(intent);
}
};
代码示例来源:origin: stackoverflow.com
DrawerLayout mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout);
TextView tv_test = (TextView )findViewById(R.id.tv_test);
tv_test.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mDrawerLayout.closeDrawer(linearLayout);//don't forget it
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
//action
}
}
}
});
代码示例来源:origin: ywwynm/EverythingDone
private void updateMainUiForDoingOrCancel(Intent data) {
Log.i(TAG, "updateMainUiForDoingOrCancel called");
final Thing thing = data.getParcelableExtra(Def.Communication.KEY_THING);
final boolean justNotifyAll = App.justNotifyAll();
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
Log.i(TAG, "updateMainUiForDoingOrCancel: delayed Runnable started.");
if (justNotifyAll) {
justNotifyAll();
} else {
int position = mThingManager.getPosition(thing.getId());
if (position != -1) {
mAdapter.notifyItemChanged(position);
}
mUpdateMainUiInOnResume = true;
mRemoteIntent = null;
if (mCanSeeUi) {
App.setSomethingUpdatedSpecially(false);
}
}
}
}, 560);
}
代码示例来源:origin: garretyoder/app-theme-engine
mDrawer.closeDrawers();
final int mItemId = item.getItemId();
mDrawer.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: NativeMonkey/ofo
case R.id.rl_header_bg:
mBinding.drawerLayout.closeDrawer(GravityCompat.START);
mBinding.drawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
case R.id.ll_nav_trip:
mBinding.drawerLayout.closeDrawer(GravityCompat.START);
mBinding.drawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
case R.id.ll_nav_money:
mBinding.drawerLayout.closeDrawer(GravityCompat.START);
mBinding.drawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
case R.id.ll_nav_message:
mBinding.drawerLayout.closeDrawer(GravityCompat.START);
mBinding.drawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
case R.id.ll_nav_guide:
mBinding.drawerLayout.closeDrawer(GravityCompat.START);
mBinding.drawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: ywwynm/EverythingDone
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: xbmc/Kore
private void selectItem(DrawerItem item, int position) {
if (item.type == DrawerItem.TYPE_DIVIDER) return;
if (mDrawerListView != null) {
mDrawerListView.setItemChecked(position, true);
}
mDrawerLayout.closeDrawer(GravityCompat.START);
// Same activity, just return
if (item.id == getItemIdFromActivity())
return;
final Intent launchIntentFinal = new Intent(getActivity(),
activityItemIdMap.get(item.id))
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
startActivity(launchIntentFinal);
getActivity().overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
}
}, CLOSE_DELAY);
}
代码示例来源:origin: ywwynm/EverythingDone
+ "typeBefore[" + typeBefore + "], "
+ "justNotifyAll[" + justNotifyAll + "]");
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: ywwynm/EverythingDone
+ "justNotifyAll[" + justNotifyAll + "]");
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: ywwynm/EverythingDone
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: ywwynm/EverythingDone
@Override
public void run() {
Log.i(TAG, "updateMainUiForStickyOrCancel: delayed Runnable started.");
if (justNotifyAll) {
justNotifyAll();
} else if (oldPosition != -1 && newPosition != -1) {
mAdapter.notifyItemMoved(oldPosition, newPosition);
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
mAdapter.notifyItemChanged(newPosition);
}
}, mRecyclerView.getItemAnimator().getMoveDuration());
}
mDrawerHeader.updateCompletionRate();
mUpdateMainUiInOnResume = true;
if (mCanSeeUi) {
App.setSomethingUpdatedSpecially(false);
}
mRemoteIntent = null;
}
}, 560);
代码示例来源:origin: ywwynm/EverythingDone
switch (resultCode) {
case Def.Communication.RESULT_JUST_NOTIFY_DATASET_CHANGED:
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
break;
case Def.Communication.RESULT_CREATE_BLANK_THING:
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
break;
case Def.Communication.RESULT_ABANDON_NEW_THING:
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: stackoverflow.com
mDrawerLayout.setDrawerListener(mDrawerToggle);
if (((UberApplication) getApplication()).isFirstLaunchForVersion()) {
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: guanpj/JReadHub
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
mDrawerLayout.closeDrawer(GravityCompat.START);
mDrawerLayout.postDelayed(() -> {
switch (item.getItemId()) {
case R.id.nav_home:
MainFragment mainFragment = findFragment(MainFragment.class);
start(mainFragment, SupportFragment.SINGLETASK);
break;
case R.id.nav_star:
StarFragment starFragment = findFragment(StarFragment.class);
if (starFragment == null) {
startWithPopTo(StarFragment.newInstance(), MainFragment.class, false);
} else {
start(starFragment, SupportFragment.SINGLETASK);
}
break;
case R.id.nav_setting:
//SettingActivity.start(this);
findFragment(MainFragment.class).start(SettingFragment.newInstance());
break;
case R.id.nav_about:
findFragment(MainFragment.class).start(AboutFragment.newInstance());
break;
default:
break;
}
}, 300);
return true;
}
代码示例来源:origin: ywwynm/EverythingDone
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
代码示例来源:origin: ywwynm/EverythingDone
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
mDrawerLayout.postDelayed(new Runnable() {
@Override
public void run() {
内容来源于网络,如有侵权,请联系作者删除!