(misc) fix pb visibility

also work on fixing the update issues

Signed-off-by: androidacy-user <opensource@androidacy.com>
master
androidacy-user 1 year ago
parent 9cf494ac13
commit ec6bfd36e3

@ -257,6 +257,7 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
moduleViewListBuilder.addNotification(NotificationType.INSTALL_FROM_STORAGE);
ModuleManager.getINSTANCE().scan();
ModuleManager.getINSTANCE().runAfterScan(moduleViewListBuilder::appendInstalledModules);
ModuleManager.getINSTANCE().runAfterScan(moduleViewListBuilderOnline::appendRemoteModules);
this.commonNext();
}
@ -276,6 +277,7 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
NotificationType.NO_INTERNET.autoAdd(moduleViewListBuilderOnline);
// hide progress bar is repo-manager says we have no internet
if (!RepoManager.getINSTANCE().hasConnectivity()) {
Timber.i("No connection, hiding progress");
runOnUiThread(() -> {
progressIndicator.setVisibility(View.GONE);
progressIndicator.setIndeterminate(false);
@ -300,12 +302,6 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
});
}
moduleViewListBuilder.applyTo(moduleList, moduleViewAdapter);
runOnUiThread(() -> {
progressIndicator.setIndeterminate(false);
progressIndicator.setMax(PRECISION);
// Fix insets not being accounted for correctly
updateScreenInsets(getResources().getConfiguration());
});
Timber.i("Scanning for modules!");
if (BuildConfig.DEBUG) Timber.i("Initialize Update");
@ -367,16 +363,8 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
}
}
}
runOnUiThread(() -> {
progressIndicator.setProgressCompat(PRECISION, true);
progressIndicator.setVisibility(View.GONE);
searchView.setEnabled(true);
updateScreenInsets(getResources().getConfiguration());
});
if (BuildConfig.DEBUG) Timber.i("Apply");
RepoManager.getINSTANCE().runAfterUpdate(moduleViewListBuilderOnline::appendRemoteModules);
// logic to handle updateable modules
moduleViewListBuilder.applyTo(moduleListOnline, moduleViewAdapterOnline);
moduleViewListBuilderOnline.applyTo(moduleListOnline, moduleViewAdapterOnline);
// if moduleViewListBuilderOnline has the upgradeable notification, show a badge on the online repo nav item
if (MainApplication.getINSTANCE().modulesHaveUpdates) {
@ -389,6 +377,12 @@ public class MainActivity extends FoxActivity implements SwipeRefreshLayout.OnRe
Timber.i("Badge applied");
});
}
runOnUiThread(() -> {
progressIndicator.setProgressCompat(PRECISION, true);
progressIndicator.setVisibility(View.GONE);
searchView.setEnabled(true);
updateScreenInsets(getResources().getConfiguration());
});
Timber.i("Finished app opening state!");
}
}, true);

@ -134,6 +134,7 @@ public final class ModuleHolder implements Comparable<ModuleHolder> {
}
public Type getType() {
Timber.d("Getting type for %s", this.moduleId);
if (this.footerPx != -1) {
return Type.FOOTER;
} else if (this.separator != null) {
@ -141,6 +142,7 @@ public final class ModuleHolder implements Comparable<ModuleHolder> {
} else if (this.notificationType != null) {
return Type.NOTIFICATION;
} else if (this.moduleInfo == null) {
Timber.d("Module %s is not installed", this.moduleId);
return Type.INSTALLABLE;
} else if (this.moduleInfo.versionCode < this.moduleInfo.updateVersionCode ||
(this.repoModule != null && this.moduleInfo.versionCode <
@ -152,8 +154,10 @@ public final class ModuleHolder implements Comparable<ModuleHolder> {
MainApplication.getINSTANCE().updateModuleCount++;
}
Timber.d("modulesHaveUpdates = %s, updateModuleCount = %s", MainApplication.getINSTANCE().modulesHaveUpdates, MainApplication.getINSTANCE().updateModuleCount);
Timber.d("Module %s has update", this.moduleId);
return Type.UPDATABLE;
} else {
Timber.d("Module %s is installed", this.moduleId);
return Type.INSTALLED;
}
}

@ -42,11 +42,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
android:scaleY="2"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintTop_toTopOf="@+id/swipe_refresh"
app:layout_constraintTop_toTopOf="@+id/root_container"
app:showAnimationBehavior="outward" />
<LinearLayout

Loading…
Cancel
Save