only show opened FAB when some accounts are enabled
This commit is contained in:
		
							parent
							
								
									6704db21fb
								
							
						
					
					
						commit
						182a81e3ef
					
				| @ -807,7 +807,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne | |||||||
| 		if (QuickConversationsService.isQuicksy()) { | 		if (QuickConversationsService.isQuicksy()) { | ||||||
| 			setRefreshing(xmppConnectionService.getQuickConversationsService().isSynchronizing()); | 			setRefreshing(xmppConnectionService.getQuickConversationsService().isSynchronizing()); | ||||||
| 		} | 		} | ||||||
| 		if (QuickConversationsService.isConversations() && this.contacts.size() == 0 && this.conferences.size() == 0 && mOpenedFab.compareAndSet(false,true)) { | 		if (QuickConversationsService.isConversations() && AccountUtils.hasEnabledAccounts(xmppConnectionService) && this.contacts.size() == 0 && this.conferences.size() == 0 && mOpenedFab.compareAndSet(false,true)) { | ||||||
| 			binding.speedDial.open(); | 			binding.speedDial.open(); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -24,6 +24,16 @@ public class AccountUtils { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |     public static boolean hasEnabledAccounts(final XmppConnectionService service) { | ||||||
|  |         final List<Account> accounts = service.getAccounts(); | ||||||
|  |         for(Account account : accounts) { | ||||||
|  |             if (account.isOptionSet(Account.OPTION_DISABLED)) { | ||||||
|  |                 return false; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public static List<String> getEnabledAccounts(final XmppConnectionService service) { |     public static List<String> getEnabledAccounts(final XmppConnectionService service) { | ||||||
|         ArrayList<String> accounts = new ArrayList<>(); |         ArrayList<String> accounts = new ArrayList<>(); | ||||||
|         for (Account account : service.getAccounts()) { |         for (Account account : service.getAccounts()) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Daniel Gultsch
						Daniel Gultsch