You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Paste the code below to PlaygroundComponentSpec and run the litho sample project.
Issue: the gif image is not animating as expected.
Expected Behavior
The gif image can animated as it should be.
Link to Code
/* * Copyright (c) Facebook, Inc. and its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */packagecom.facebook.samples.litho.playground;
importandroid.graphics.Color;
importcom.facebook.drawee.backends.pipeline.Fresco;
importcom.facebook.drawee.interfaces.DraweeController;
importcom.facebook.litho.Column;
importcom.facebook.litho.Component;
importcom.facebook.litho.ComponentContext;
importcom.facebook.litho.annotations.LayoutSpec;
importcom.facebook.litho.annotations.OnCreateLayout;
importcom.facebook.litho.fresco.FrescoImage;
@LayoutSpecpublicclassPlaygroundComponentSpec {
@OnCreateLayoutstaticComponentonCreateLayout(ComponentContextc) {
finalStringurl = "https://ops-1300522992.cos.ap-guangzhou.myqcloud.com/doc/YZ/images/index/%E5%B0%8F%E9%B9%85%E5%AF%BB%E5%AE%9D%E5%85%A5%E5%8F%A3.gif";
finalDraweeControllercontroller = Fresco.newDraweeControllerBuilder()
.setAutoPlayAnimations(true)
.setUri(url)
.build();
returnColumn.create(c)
.backgroundColor(Color.WHITE)
.child(FrescoImage.create(c)
.controller(controller)
.imageAspectRatio(2f))
.build();
}
}
The text was updated successfully, but these errors were encountered:
Hi @ryanhoo! Did it work before?
I'm not particularly familiar with that Fresco part. I'd suggest asking people in Fresco repo about how to better configure it.
Version
The newest
develop
branch in litho repo.Issues and Steps to Reproduce
Paste the code below to
PlaygroundComponentSpec
and run the litho sample project.Issue: the gif image is not animating as expected.
Expected Behavior
The gif image can animated as it should be.
Link to Code
The text was updated successfully, but these errors were encountered: