@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mActivity = (NavigationActivity) getActivity(); mCoreAPI = CoreAPI.getApi(); Display display = mActivity.getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); mDistanceThreshold = size.x / 10; }
private void checkTabs(MotionEvent ev) { selectedTab = getTabNum(ev); if (selectedTab == -1) return; // ignore Send and Request until wallets are loaded if ((selectedTab == NavigationActivity.Tabs.REQUEST.ordinal() || selectedTab == NavigationActivity.Tabs.SEND.ordinal()) && AirbitzApplication.isLoggedIn() && mCoreAPI.walletsStillLoading()) { selectedTab = mLastTab; mActivity.ShowFadingDialog(getString(R.string.wait_until_wallets_loaded)); return; } else if (selectedTab == mLastTab) { displayPopup(ev); } else if (selectedTab != NavigationActivity.Tabs.MORE.ordinal()) { displayPopup(ev); selectTab(selectedTab); unselectTab(mLastTab); mLastTab = selectedTab; } if (mActivity != null) mActivity.onNavBarSelected(selectedTab); }