I have a problem with an animation in the gallery. I have the codes in red. I am a beginner. I try to import animation but it doesn't work Animation.CARD_TOP_IN_DESC
and image.getImageUrl()
are display in red.
import android.content.Context;
import android.media.Image;
import com.example.masonsrl.R;
import com.mindorks.placeholderview.Animation;
import com.mindorks.placeholderview.PlaceHolderView;
import com.mindorks.placeholderview.annotations.Animate;
import com.mindorks.placeholderview.annotations.Layout;
import com.mindorks.placeholderview.annotations.NonReusable;
import com.mindorks.placeholderview.annotations.Resolve;
import com.mindorks.placeholderview.annotations.View;
import java.util.List;
import androidx.recyclerview.widget.LinearLayoutManager;
@Animate(Animation.CARD_TOP_IN_DESC)
@NonReusable
@Layout(R.layout.activity_item_small_list)
public class ImageTypeSmallList {
@View(R.id.placeholderview)
private PlaceHolderView mPlaceHolderView;
private Context mContext;
private List<Image> mImageList;
public ImageTypeSmallList(Context context, List<Image> imageList) {
mContext = context;
mImageList = imageList;
}
@Resolve
private void onResolved() {
mPlaceHolderView.getBuilder()
.setHasFixedSize(false)
.setItemViewCacheSize(10)
.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
for(Image image : mImageList) {
mPlaceHolderView.addView(new ImageTypeSmall(mContext, mPlaceHolderView, image.getImageUrl()));
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…