Commits

Juha Kuitunen committed 72d1747

number of issues downloaded from API can be changed from settings

  • Participants
  • Parent commits 548660c

Comments (0)

Files changed (4)

File res/values-fi/strings.xml

     <string name="prefs_category_api">Toiminta Bitbucketin API:n kanssa</string>
     <string name="prefs_numChangesets_title">Muutoskokoelmien lukumäärä</string>
     <string name="prefs_numChangesets_summary">Kuinka monta muutoskokoelmaa ladataan yhdellä kerralla</string>
+    <string name="prefs_numIssues_title">Tehtävien lukumäärä</string>
+    <string name="prefs_numIssues_summary">Kuinka monta tehtävää ladataan yhdellä kerralla</string>
     <string name="prefs_category_ui">Käyttöliittymä</string>
     <string name="prefs_locale_title">Kielivalinta</string>
     <string name="prefs_locale_summary">Vaihda kieli. Tulee voimaan Activityn seuraavan käynnistyksen yhteydessä.</string>

File res/values/strings.xml

     <string name="prefs_category_api">Interaction with Bitbucket\'s API</string>
     <string name="prefs_numChangesets_title">Number of changesets</string>
     <string name="prefs_numChangesets_summary">How many changesets gets downloaded in one query</string>
+    <string name="prefs_numIssues_title">Number of issues</string>
+    <string name="prefs_numIssues_summary">How many issues gets downloaded in one query</string>
     <string name="prefs_category_ui">User Interface</string>
     <string name="prefs_locale_title">Locale</string>
     <string name="prefs_locale_summary">Change language. Takes effect after Activity\'s next restart.</string>

File res/xml/preferences.xml

 			robobunny:unitsRight=""
 		/>
 
+		<com.robobunny.SeekBarPreference
+			android:key="numIssues"
+			android:title="@string/prefs_numIssues_title"
+			android:summary="@string/prefs_numIssues_summary"
+			android:color="#000000"
+			android:defaultValue="15"
+			android:max="50"
+			robobunny:min="1"
+			robobunny:unitsLeft=""
+			robobunny:unitsRight=""
+		/>
+
 	</PreferenceCategory>
 
 </PreferenceScreen>

File src/com/saibotd/bitbeaker/IssuesActivity.java

 	}
 
 	private void loadIssuesByFilter() {
-		String url = API_BASE_URL + "/repositories/" + owner
-				+ "/" + slug + "/issues/";
+		String limit = "";
+		int numIssues = bitbeaker.getSettings().getInt("numIssues", -1);
+		if (numIssues != -1) limit = "limit="+numIssues;
+		String url = API_BASE_URL + "/repositories/" + owner+ "/" + slug + "/issues";
 		if (!TextUtils.isEmpty(filter)) {
 			url += "?status=" + filter;
+			url += "&"+limit;
 		}
+		else url += "?"+limit;
+		
 		bitbeaker.delKV(url);
 		executeAsyncLoader(url);
 	}