Convert util/{HttpHeaderLink,PairedList,TimestampUtils,ThemeUtils} to Kotlin (#3046)
* Fix off-by-one error in HttpHeaderLink Link headers with multiple URLs with multiple parameters were being parsed incorrectly. Detected by adding unit tests ahead of converting to Kotlin. * Convert util/HttpHeaderLink from Java to Kotlin * Convert util/ThemeUtils from Java to Kotlin * Convert util/TimestampUtils from Java to Kotlin * Add tests for PairedList * Convert util/PairedList from Java to Kotlin * Implement feedback from PR * Relicense as GPL
This commit is contained in:
parent
0def7e7230
commit
22834431ca
30 changed files with 624 additions and 510 deletions
|
|
@ -915,11 +915,11 @@ public class NotificationsFragment extends SFragment implements
|
|||
|
||||
private void onFetchNotificationsSuccess(List<Notification> notifications, String linkHeader,
|
||||
FetchEnd fetchEnd, int pos) {
|
||||
List<HttpHeaderLink> links = HttpHeaderLink.parse(linkHeader);
|
||||
HttpHeaderLink next = HttpHeaderLink.findByRelationType(links, "next");
|
||||
List<HttpHeaderLink> links = HttpHeaderLink.Companion.parse(linkHeader);
|
||||
HttpHeaderLink next = HttpHeaderLink.Companion.findByRelationType(links, "next");
|
||||
String fromId = null;
|
||||
if (next != null) {
|
||||
fromId = next.uri.getQueryParameter("max_id");
|
||||
fromId = next.getUri().getQueryParameter("max_id");
|
||||
}
|
||||
|
||||
switch (fetchEnd) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue