Skip to content

Commit

Permalink
Remove silly ping pong
Browse files Browse the repository at this point in the history
  • Loading branch information
Slion committed Oct 13, 2023
1 parent 8196572 commit 9004a81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
10 changes: 0 additions & 10 deletions app/src/main/java/acr/browser/lightning/browser/TabsManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -975,16 +975,6 @@ class TabsManager @Inject constructor(
//logger.log(TAG,"After from main")
}

/**
* Notify the presenter that a change occurred to the current tab. Currently doesn't do anything
* other than tell the view to notify the adapter about the change.
*
* @param tab the tab that changed, may be null.
*/
fun tabChangeOccurred(tab: WebPageTab?) = tab?.let {
iBrowserView.notifyTabViewChanged(tabsModel.indexOfTab(it))
}

/**
* Called when the foreground is changing.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2574,8 +2574,7 @@ abstract class BrowserActivity : ThemedBrowserActivity(), BrowserView, UIControl
}

// SL: Is this being called way too many times?
// TODO: This is completely silly all it does is calling [notifyTabViewChanged]
tabsManager.tabChangeOccurred(aTab)
doTabUpdate(aTab)
// SL: Putting this here to update toolbar background color was a bad idea
// That somehow freezes the WebView after switching between a few tabs on F(x)tec Pro1 at least (Android 9)
//initializePreferences()
Expand Down Expand Up @@ -2604,8 +2603,7 @@ abstract class BrowserActivity : ThemedBrowserActivity(), BrowserView, UIControl
}

// SL: Is this being called way too many times?
// TODO: This is completely silly all it does is calling [notifyTabViewChanged]
tabsManager.tabChangeOccurred(aTab)
doTabUpdate(aTab)
// SL: Putting this here to update toolbar background color was a bad idea
// That somehow freezes the WebView after switching between a few tabs on F(x)tec Pro1 at least (Android 9)
//initializePreferences()
Expand All @@ -2620,8 +2618,7 @@ abstract class BrowserActivity : ThemedBrowserActivity(), BrowserView, UIControl
}

// TODO: optimize for icon only update
// TODO: This is completely silly all it does is calling [notifyTabViewChanged]
tabsManager.tabChangeOccurred(aTab)
doTabUpdate(aTab)
}

/**
Expand All @@ -2633,9 +2630,15 @@ abstract class BrowserActivity : ThemedBrowserActivity(), BrowserView, UIControl
}

// TODO: optimize for title only update
// TODO: This is completely silly all it does is calling [notifyTabViewChanged]
tabsManager.tabChangeOccurred(aTab)
doTabUpdate(aTab)
}


/**
*
*/
private fun doTabUpdate(aTab: WebPageTab) {
notifyTabViewChanged(tabsManager.indexOfTab(aTab))
}


Expand Down

0 comments on commit 9004a81

Please sign in to comment.