|
|
@ -186,6 +186,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
private String mUntitledTitle; |
|
|
|
private String mUntitledTitle; |
|
|
|
private String mCameraPhotoPath; |
|
|
|
private String mCameraPhotoPath; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Handler mDrawerHandler = new Handler(); |
|
|
|
|
|
|
|
|
|
|
|
// The singleton BookmarkManager
|
|
|
|
// The singleton BookmarkManager
|
|
|
|
@Inject BookmarkManager mBookmarkManager; |
|
|
|
@Inject BookmarkManager mBookmarkManager; |
|
|
|
|
|
|
|
|
|
|
@ -923,7 +925,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
// Use a delayed handler to make the transition smooth
|
|
|
|
// Use a delayed handler to make the transition smooth
|
|
|
|
// otherwise it will get caught up with the showTab code
|
|
|
|
// otherwise it will get caught up with the showTab code
|
|
|
|
// and cause a janky motion
|
|
|
|
// and cause a janky motion
|
|
|
|
new Handler().postDelayed(new Runnable() { |
|
|
|
mDrawerHandler.postDelayed(new Runnable() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
mDrawerLayout.closeDrawers(); |
|
|
|
mDrawerLayout.closeDrawers(); |
|
|
@ -959,14 +961,14 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
// Use a delayed handler to make the transition smooth
|
|
|
|
// Use a delayed handler to make the transition smooth
|
|
|
|
// otherwise it will get caught up with the showTab code
|
|
|
|
// otherwise it will get caught up with the showTab code
|
|
|
|
// and cause a janky motion
|
|
|
|
// and cause a janky motion
|
|
|
|
new Handler().postDelayed(new Runnable() { |
|
|
|
mDrawerHandler.postDelayed(new Runnable() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
mDrawerLayout.closeDrawers(); |
|
|
|
mDrawerLayout.closeDrawers(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, 200); |
|
|
|
}, 200); |
|
|
|
|
|
|
|
|
|
|
|
// new Handler().postDelayed(new Runnable() {
|
|
|
|
// mDrawerHandler.postDelayed(new Runnable() {
|
|
|
|
// @Override
|
|
|
|
// @Override
|
|
|
|
// public void run() {
|
|
|
|
// public void run() {
|
|
|
|
// Remove browser frame background to reduce overdraw
|
|
|
|
// Remove browser frame background to reduce overdraw
|
|
|
@ -1168,16 +1170,12 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void onPause() { |
|
|
|
protected void onPause() { |
|
|
|
super.onPause(); |
|
|
|
super.onPause(); |
|
|
|
final LightningView currentTab = mTabsManager.getCurrentTab(); |
|
|
|
|
|
|
|
Log.d(TAG, "onPause"); |
|
|
|
Log.d(TAG, "onPause"); |
|
|
|
if (currentTab != null) { |
|
|
|
mTabsManager.pauseAll(); |
|
|
|
currentTab.pauseTimers(); |
|
|
|
|
|
|
|
currentTab.onPause(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
BrowserApp.get(this).unregisterReceiver(mNetworkReceiver); |
|
|
|
BrowserApp.get(this).unregisterReceiver(mNetworkReceiver); |
|
|
|
} catch (IllegalArgumentException e) { |
|
|
|
} catch (IllegalArgumentException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
Log.e(TAG, "Receiver was not registered", e); |
|
|
|
} |
|
|
|
} |
|
|
|
if (isIncognito() && isFinishing()) { |
|
|
|
if (isIncognito() && isFinishing()) { |
|
|
|
overridePendingTransition(R.anim.fade_in_scale, R.anim.slide_down_out); |
|
|
|
overridePendingTransition(R.anim.fade_in_scale, R.anim.slide_down_out); |
|
|
@ -1227,16 +1225,12 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void onResume() { |
|
|
|
protected void onResume() { |
|
|
|
super.onResume(); |
|
|
|
super.onResume(); |
|
|
|
final LightningView currentTab = mTabsManager.getCurrentTab(); |
|
|
|
|
|
|
|
Log.d(TAG, "onResume"); |
|
|
|
Log.d(TAG, "onResume"); |
|
|
|
if (mSuggestionsAdapter != null) { |
|
|
|
if (mSuggestionsAdapter != null) { |
|
|
|
mSuggestionsAdapter.refreshPreferences(); |
|
|
|
mSuggestionsAdapter.refreshPreferences(); |
|
|
|
mSuggestionsAdapter.refreshBookmarks(); |
|
|
|
mSuggestionsAdapter.refreshBookmarks(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (currentTab != null) { |
|
|
|
mTabsManager.resumeAll(); |
|
|
|
currentTab.resumeTimers(); |
|
|
|
|
|
|
|
currentTab.onResume(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
initializePreferences(); |
|
|
|
initializePreferences(); |
|
|
|
mTabsManager.resume(this); |
|
|
|
mTabsManager.resume(this); |
|
|
|
|
|
|
|
|
|
|
@ -2157,8 +2151,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
mPresenter.loadUrlInCurrentView(event.url); |
|
|
|
mPresenter.loadUrlInCurrentView(event.url); |
|
|
|
// keep any jank from happening when the drawer is closed after the
|
|
|
|
// keep any jank from happening when the drawer is closed after the
|
|
|
|
// URL starts to load
|
|
|
|
// URL starts to load
|
|
|
|
final Handler handler = new Handler(); |
|
|
|
mDrawerHandler.postDelayed(new Runnable() { |
|
|
|
handler.postDelayed(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
mDrawerLayout.closeDrawer(mDrawerRight); |
|
|
|
mDrawerLayout.closeDrawer(mDrawerRight); |
|
|
|