Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading icon stuck on startup #897

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,19 @@ protected void onPause() {
}
mAudioEngine.pauseEngine();
SessionStore.get().setActive(false);
for (Widget widget: mWidgets.values()) {
widget.onPause();
}
super.onPause();
}

@Override
protected void onResume() {
SessionStore.get().setActive(true);
mAudioEngine.resumeEngine();
for (Widget widget: mWidgets.values()) {
widget.onResume();
}
super.onResume();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,20 @@ private void initialize(Context aContext) {
// Prevent the URL TextEdit to get focus when user touches something outside of it
setFocusable(true);
setClickable(true);
syncViews();
}

public void onPause() {
if (mIsLoading) {
mLoadingView.clearAnimation();
}
}

public void onResume() {
if (mIsLoading) {
mLoadingView.startAnimation(mLoadingAnimation);
}

}

public void setDelegate(NavigationURLBarDelegate delegate) {
Expand Down Expand Up @@ -340,6 +354,8 @@ private void syncViews() {
}
else {
mURLLeftContainer.setVisibility(View.GONE);
mLoadingView.setVisibility(View.GONE);
mInsecureIcon.setVisibility(View.GONE);
}

mURL.setPadding(leftPadding, mURL.getPaddingTop(), mURL.getPaddingRight(), mURL.getPaddingBottom());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,18 @@ else if (SessionStore.get().canUnstackSession())
handleSessionState();
}

@Override
public void onPause() {
super.onPause();
mURLBar.onPause();
}

@Override
public void onResume() {
super.onResume();
mURLBar.onResume();
}

@Override
public void releaseWidget() {
mWidgetManager.removeUpdateListener(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ private void initialize() {
mBackHandler = () -> onDismiss();
}

@Override
public void onPause() {
}

@Override
public void onResume() {
}

@Override
public void resizeByMultiplier(float aspect, float multiplier) {
// To be implemented by inheriting widgets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import android.view.Surface;

public interface Widget {
void onPause();
void onResume();
void setSurfaceTexture(SurfaceTexture aTexture, final int aWidth, final int aHeight);
void setSurface(Surface aSurface, final int aWidth, final int aHeight, Runnable aFirstDrawCallback);
void resizeSurface(final int aWidth, final int aHeight);
Expand Down