Browse: pin item to the top by default; upd SharedModules
Build Debug APK / build (push) Has been cancelled
Cleanup old workflow runs / cleanup (push) Has been cancelled

This commit is contained in:
Yuriy Liskov
2026-03-15 06:50:56 +02:00
parent 5c17bb5aae
commit 03d508d36d
5 changed files with 21 additions and 10 deletions
@@ -565,16 +565,19 @@ public class BrowsePresenter extends BasePresenter<BrowseView> implements Sectio
return;
}
getSidebarService().addPinnedItem(item);
int idx = getSidebarService().addPinnedItem(item);
createPinnedMapping(item);
BrowseSection newSection = createPinnedSection(item);
//Helpers.removeIf(mSections, section -> section.getId() == newSection.getId());
if (!mSections.contains(newSection)) {
mSections.add(newSection);
if (idx != -1) {
mSections.add(idx, newSection);
} else {
mSections.add(newSection);
}
}
getView().addSection(-1, newSection);
getView().addSection(idx, newSection);
}
public void pinItem(String title, int resId, ErrorFragmentData data) {
@@ -47,13 +47,21 @@ public class SidebarService implements ProfileChangeListener {
return Collections.unmodifiableList(mPinnedItems);
}
public void addPinnedItem(Video item) {
public int addPinnedItem(Video item) {
if (mPinnedItems.contains(item)) {
return;
return -1;
}
mPinnedItems.add(item);
int idx = Helpers.indexOfFirst(mPinnedItems, obj -> obj.getId() > 100);
if (idx != -1) {
mPinnedItems.add(idx, item);
} else {
mPinnedItems.add(item);
}
persistState();
return idx;
}
public void removePinnedItem(Video item) {
@@ -708,7 +708,7 @@ public class PlayerTweaksData implements ProfileChangeListener {
mIsAudioSyncFixEnabled = Helpers.parseBoolean(split, 8, false);
mIsKeepFinishedActivityEnabled = Helpers.parseBoolean(split, 9, false);
mIsHlsStreamsForced = Helpers.parseBoolean(split, 10, false);
mIsPlaybackNotificationsDisabled = Helpers.parseBoolean(split, 11, !Helpers.isAndroidTVLauncher(mPrefs.getContext()));
mIsPlaybackNotificationsDisabled = Helpers.parseBoolean(split, 11, false);
mIsTunneledPlaybackEnabled = Helpers.parseBoolean(split, 12, false);
mPlayerButtons = Helpers.parseInt(split, 13, PLAYER_BUTTON_DEFAULT);
// Buffering fix was there.