()
| 153 | } |
| 154 | |
| 155 | private void init() { |
| 156 | Log.d(TAG, "MainActivity->init()"); |
| 157 | initDrawerControls(); |
| 158 | boolean reqForNewAccount = getIntent().getBooleanExtra( |
| 159 | "create_new_account", false); |
| 160 | /** |
| 161 | * checks for available account related to Odoo |
| 162 | */ |
| 163 | if (!OdooAccountManager.hasAccounts(this) || reqForNewAccount) { |
| 164 | getActionBar().setDisplayHomeAsUpEnabled(false); |
| 165 | getActionBar().setHomeButtonEnabled(false); |
| 166 | lockDrawer(true); |
| 167 | AccountFragment account = new AccountFragment(); |
| 168 | startMainFragment(account, false); |
| 169 | } else { |
| 170 | lockDrawer(false); |
| 171 | /** |
| 172 | * User found but not logged in. Requesting for login with available |
| 173 | * accounts. |
| 174 | */ |
| 175 | if (!OdooAccountManager.isAnyUser(mContext)) { |
| 176 | accountSelectionDialog( |
| 177 | OdooAccountManager.fetchAllAccounts(mContext)).show(); |
| 178 | } else { |
| 179 | initDrawer(); |
| 180 | } |
| 181 | } |
| 182 | checkForRateApplication(); |
| 183 | } |
| 184 | |
| 185 | protected void initTouchListener() { |
| 186 | OETouchListener.DEFAULT_HEADER_LAYOUT = R.layout.default_header; |
no test coverage detected