This commit is contained in:
Yuriy Liskov
2025-04-27 14:01:39 +03:00
parent 05ac93ff64
commit e143cd89fc
2 changed files with 8 additions and 7 deletions

View File

@ -60,8 +60,8 @@ android {
applicationId "com.liskovsoft.smarttubetv" applicationId "com.liskovsoft.smarttubetv"
minSdkVersion project.properties.minSdkVersion minSdkVersion project.properties.minSdkVersion
targetSdkVersion project.properties.targetSdkVersion targetSdkVersion project.properties.targetSdkVersion
versionCode 1933 versionCode 1934
versionName "27.43" versionName "27.44"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L" buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"

View File

@ -28,7 +28,7 @@ public class BrowseSectionFragmentFactory extends BrowseSupportFragment.Fragment
private int mFragmentType = BrowseSection.TYPE_GRID; private int mFragmentType = BrowseSection.TYPE_GRID;
private int mSelectedItemIndex = -1; private int mSelectedItemIndex = -1;
private Video mSelectedItem; private Video mSelectedItem;
private Runnable mRunListeners; private Runnable mOnSectionSelected;
public interface OnSectionSelectedListener { public interface OnSectionSelectedListener {
void onSectionSelected(Row row); void onSectionSelected(Row row);
@ -144,8 +144,9 @@ public class BrowseSectionFragmentFactory extends BrowseSupportFragment.Fragment
} }
public void cleanup() { public void cleanup() {
Utils.removeCallbacks(mOnSectionSelected);
mCurrentFragment = null; mCurrentFragment = null;
mRunListeners = null; mOnSectionSelected = null;
} }
public int getCurrentFragmentItemIndex() { public int getCurrentFragmentItemIndex() {
@ -201,16 +202,16 @@ public class BrowseSectionFragmentFactory extends BrowseSupportFragment.Fragment
} }
private void runListeners(Row row) { private void runListeners(Row row) {
Utils.removeCallbacks(mRunListeners); Utils.removeCallbacks(mOnSectionSelected);
// give a chance to clear pending updates // give a chance to clear pending updates
mRunListeners = () -> { mOnSectionSelected = () -> {
if (mSectionSelectedListener != null) { if (mSectionSelectedListener != null) {
mSectionSelectedListener.onSectionSelected(row); mSectionSelectedListener.onSectionSelected(row);
} }
}; };
// Wait till the main fragment changed // Wait till the main fragment changed
Utils.postDelayed(mRunListeners, 100); Utils.postDelayed(mOnSectionSelected, 100);
} }
} }