Finished filter support
The game now limits trivia file questions based on the question amount picked by the player on `MainActivity`.
This commit is contained in:
		
							parent
							
								
									c3c820715b
								
							
						
					
					
						commit
						8e84fe2ff5
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -128,7 +128,11 @@ public class ApiUtil {
 | 
			
		|||
 | 
			
		||||
		ArrayList<TriviaQuestion> questions = new ArrayList<>();
 | 
			
		||||
 | 
			
		||||
		int elements = 0;
 | 
			
		||||
 | 
			
		||||
		for (JsonElement element : jsonArray) {
 | 
			
		||||
			if (elements++ == filters.getAmount())
 | 
			
		||||
				break;
 | 
			
		||||
			JsonObject object = element.getAsJsonObject();
 | 
			
		||||
			TriviaType type = TriviaType.get(object.get("type").getAsString());
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue