use of androidx.annotation.UiThread in project EhViewer by seven332.
the class SpiderQueen method obtainSpiderQueen.
@UiThread
public static SpiderQueen obtainSpiderQueen(@NonNull Context context, @NonNull GalleryInfo galleryInfo, @Mode int mode) {
OSUtils.checkMainLoop();
SpiderQueen queen = sQueenMap.get(galleryInfo.gid);
if (queen == null) {
EhApplication application = (EhApplication) context.getApplicationContext();
queen = new SpiderQueen(application, galleryInfo);
sQueenMap.put(galleryInfo.gid, queen);
// Set mode
queen.setMode(mode);
queen.start();
} else {
// Set mode
queen.setMode(mode);
}
return queen;
}
use of androidx.annotation.UiThread in project BigImageViewer by Piasy.
the class BigImageView method doOnFinish.
@UiThread
private void doOnFinish() {
if (mOptimizeDisplay) {
AnimationSet set = new AnimationSet(true);
AlphaAnimation animation = new AlphaAnimation(1, 0);
animation.setDuration(500);
animation.setFillAfter(true);
set.addAnimation(animation);
if (mThumbnailView != null) {
mThumbnailView.setAnimation(set);
}
if (mProgressIndicatorView != null) {
mProgressIndicatorView.setAnimation(set);
}
if (mProgressIndicator != null) {
mProgressIndicator.onFinish();
}
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
if (mThumbnailView != null) {
mThumbnailView.setVisibility(GONE);
}
if (mProgressIndicatorView != null) {
mProgressIndicatorView.setVisibility(GONE);
}
// ref: https://stackoverflow.com/q/33242776/3077508
if (mThumbnailView != null || mProgressIndicatorView != null) {
post(new Runnable() {
@Override
public void run() {
clearThumbnailAndProgressIndicator();
}
});
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
} else {
if (mProgressIndicator != null) {
mProgressIndicator.onFinish();
}
clearThumbnailAndProgressIndicator();
}
}
use of androidx.annotation.UiThread in project android_packages_apps_Settings by omnirom.
the class InternetResetHelper method suspendPreferences.
@UiThread
protected void suspendPreferences() {
Log.d(TAG, "Suspend the subsystem preferences");
if (mMobileNetworkController != null) {
mMobileNetworkController.hidePreference(true, /* hide */
true);
}
if (mWifiTogglePreferences != null) {
mWifiTogglePreferences.setVisible(false);
}
for (PreferenceCategory pref : mWifiNetworkPreferences) {
pref.removeAll();
pref.setVisible(false);
}
if (mResettingPreference != null) {
mResettingPreference.setVisible(true);
}
}
use of androidx.annotation.UiThread in project android_packages_apps_Settings by omnirom.
the class InternetResetHelper method resumePreferences.
@UiThread
protected void resumePreferences() {
if (mIsRecoveryReady && mMobileNetworkController != null) {
Log.d(TAG, "Resume the Mobile Network controller");
mMobileNetworkController.hidePreference(false, /* hide */
false);
}
if (mIsWifiReady && mWifiTogglePreferences != null) {
Log.d(TAG, "Resume the Wi-Fi preferences");
mWifiTogglePreferences.setVisible(true);
for (PreferenceCategory pref : mWifiNetworkPreferences) {
pref.setVisible(true);
}
}
if (mIsRecoveryReady && mIsWifiReady) {
mHandlerInjector.removeCallbacks(mTimeoutRunnable);
if (mResettingPreference != null) {
Log.d(TAG, "Resume the Resetting preference");
mResettingPreference.setVisible(false);
}
}
}
use of androidx.annotation.UiThread in project mapbox-plugins-android by mapbox.
the class CircleManager method create.
/**
* Create a list of circles on the map.
* <p>
* Circles are going to be created only for features with a matching geometry.
* <p>
* All supported properties are:<br>
* CircleOptions.PROPERTY_CIRCLE_RADIUS - Float<br>
* CircleOptions.PROPERTY_CIRCLE_COLOR - String<br>
* CircleOptions.PROPERTY_CIRCLE_BLUR - Float<br>
* CircleOptions.PROPERTY_CIRCLE_OPACITY - Float<br>
* CircleOptions.PROPERTY_CIRCLE_STROKE_WIDTH - Float<br>
* CircleOptions.PROPERTY_CIRCLE_STROKE_COLOR - String<br>
* CircleOptions.PROPERTY_CIRCLE_STROKE_OPACITY - Float<br>
* Learn more about above properties in the <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/">Style specification</a>.
* <p>
* Out of spec properties:<br>
* "is-draggable" - Boolean, true if the circle should be draggable, false otherwise
*
* @param featureCollection the featureCollection defining the list of circles to build
* @return the list of built circles
*/
@UiThread
public List<Circle> create(@NonNull FeatureCollection featureCollection) {
List<Feature> features = featureCollection.features();
List<CircleOptions> options = new ArrayList<>();
if (features != null) {
for (Feature feature : features) {
CircleOptions option = CircleOptions.fromFeature(feature);
if (option != null) {
options.add(option);
}
}
}
return create(options);
}
Aggregations