mirror of
https://github.com/yuliskov/SmartTube.git
synced 2025-12-30 18:40:27 -06:00
player: focus suggested item fix
This commit is contained in:
Submodule MediaServiceCore updated: ff7f9f59aa...193f1d30bc
Submodule SharedModules updated: 93ee9da437...ec3ef10516
@@ -32,7 +32,7 @@ public class VideoStateService implements ProfileChangeListener {
|
||||
mPrefs = AppPrefs.instance(context);
|
||||
mPrefs.addListener(this);
|
||||
mStates = Helpers.createSafeLRUList(
|
||||
Utils.isEnoughRam(mPrefs.getContext()) ? MAX_PERSISTENT_STATE_SIZE : MIN_PERSISTENT_STATE_SIZE);
|
||||
Utils.isEnoughRam() ? MAX_PERSISTENT_STATE_SIZE : MIN_PERSISTENT_STATE_SIZE);
|
||||
restoreState();
|
||||
}
|
||||
|
||||
|
||||
@@ -641,7 +641,7 @@ public class PlayerTweaksData implements ProfileChangeListener {
|
||||
mIsSonyFrameDropFixEnabled = Helpers.parseBoolean(split, 29, false);
|
||||
mIsBufferOnStreamsDisabled = Helpers.parseBoolean(split, 30, false);
|
||||
// Cause severe garbage collector stuttering
|
||||
mIsSectionPlaylistEnabled = Helpers.parseBoolean(split, 31, Utils.isEnoughRam(mPrefs.getContext()));
|
||||
mIsSectionPlaylistEnabled = Helpers.parseBoolean(split, 31, Utils.isEnoughRam());
|
||||
mIsScreenOffTimeoutEnabled = Helpers.parseBoolean(split, 32, false);
|
||||
mScreenOffTimeoutSec = Helpers.parseInt(split, 33, 0);
|
||||
mIsUIAnimationsEnabled = Helpers.parseBoolean(split, 34, false);
|
||||
|
||||
@@ -1075,8 +1075,10 @@ public class Utils {
|
||||
return VERSION.SDK_INT <= 23 || Helpers.equals(BuildConfig.FLAVOR, "strtarmenia");
|
||||
}
|
||||
|
||||
public static boolean isEnoughRam(Context context) {
|
||||
return VERSION.SDK_INT > 21 && Helpers.getDeviceRam(context) > 1_500_000_000; // 1.5 GB
|
||||
public static boolean isEnoughRam() {
|
||||
long maxMemory = Runtime.getRuntime().maxMemory();
|
||||
|
||||
return (int)(maxMemory / (1024 * 1024)) > 350; // more than 350MB available to the app
|
||||
}
|
||||
|
||||
public static String getStackTraceAsString(Throwable throwable) {
|
||||
|
||||
@@ -60,8 +60,8 @@ android {
|
||||
applicationId "com.liskovsoft.smarttubetv"
|
||||
minSdkVersion project.properties.minSdkVersion
|
||||
targetSdkVersion project.properties.targetSdkVersion
|
||||
versionCode 2049
|
||||
versionName "28.59"
|
||||
versionCode 2050
|
||||
versionName "28.60"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
|
||||
|
||||
@@ -136,8 +136,8 @@ android {
|
||||
staptoide {
|
||||
// matchingFallbacks = ['lite']
|
||||
versionCode 11000 + defaultConfig.versionCode
|
||||
//applicationId "com.liskovsoft.videomanager"
|
||||
applicationId "com.teamsmart.videomanager.tv"
|
||||
applicationId "com.liskovsoft.videomanager"
|
||||
//applicationId "com.teamsmart.videomanager.tv"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -613,7 +613,7 @@ public class PlaybackFragment extends SeekModePlaybackFragment implements Playba
|
||||
protected void onBindRowViewHolder(RowPresenter.ViewHolder holder, Object item) {
|
||||
super.onBindRowViewHolder(holder, item);
|
||||
|
||||
focusPendingSuggestedItem();
|
||||
focusPendingSuggestedItem(holder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1515,10 +1515,10 @@ public class PlaybackFragment extends SeekModePlaybackFragment implements Playba
|
||||
|
||||
mPendingFocus = video;
|
||||
|
||||
focusPendingSuggestedItem();
|
||||
focusPendingSuggestedItem(null);
|
||||
}
|
||||
|
||||
public void focusPendingSuggestedItem() {
|
||||
private void focusPendingSuggestedItem(ViewHolder holder) {
|
||||
if (mPendingFocus == null || mPendingFocus.getGroup() == null || mRowsSupportFragment == null) {
|
||||
return;
|
||||
}
|
||||
@@ -1531,7 +1531,7 @@ public class PlaybackFragment extends SeekModePlaybackFragment implements Playba
|
||||
|
||||
int rowIndex = getRowAdapterIndex(existingAdapter);
|
||||
|
||||
ViewHolder rowViewHolder = mRowsSupportFragment.getRowViewHolder(rowIndex);
|
||||
ViewHolder rowViewHolder = holder != null ? holder : mRowsSupportFragment.getRowViewHolder(rowIndex);
|
||||
|
||||
// Skip PlaybackRowPresenter.ViewHolder
|
||||
if (rowViewHolder instanceof ListRowPresenter.ViewHolder) {
|
||||
|
||||
Reference in New Issue
Block a user