• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Asset类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.contentful.vault.Asset的典型用法代码示例。如果您正苦于以下问题:Java Asset类的具体用法?Java Asset怎么用?Java Asset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Asset类属于com.contentful.vault包,在下文中一共展示了Asset类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createEventListWithImages

import com.contentful.vault.Asset; //导入依赖的package包/类
private List<EventModel> createEventListWithImages(List<Event> eventList) {
  List<EventModel> eventModels = new ArrayList<>();

  for (final Event event : eventList) {
    final GoogleDeveloperGroup gdg = event.gdg().get(0);
    final EventModel.Builder builder = new EventModel.Builder()
        .setId(event.remoteId())
        .setName(event.name())
        .setDescription(event.description())
        .setDate(event.date())
        .setPlace(event.place())
        .setGdgName(gdg.name());

    for (Asset sphere : event.spheres()) {
      builder.addPhotoSphereUrl(sphere.url());
    }

    if (gdg.logo() != null) {
      builder.setGroupLogoUrl(gdg.logo().url());
    }

    eventModels.add(builder.build());
  }

  return eventModels;
}
 
开发者ID:gdg-berlin-android,项目名称:gdg-events-app,代码行数:27,代码来源:EventListPresenter.java


示例2: bindView

import com.contentful.vault.Asset; //导入依赖的package包/类
@Override protected void bindView(ViewHolder holder, Product product, View rootView) {
  List<Asset> images = product.images();
  if (images.size() == 0) {
    holder.photo.setImageDrawable(null);
  } else {
    Picasso.with(rootView.getContext())
        .load(images.get(0).url())
        .fit()
        .centerInside()
        .transform(new CircleTransform())
        .into(holder.photo);
  }

  holder.title.setText(product.name());
  holder.price.setText(getPriceText(product.price()));
}
 
开发者ID:contentful,项目名称:product-catalogue-android,代码行数:17,代码来源:ProductListAdapter.java


示例3: checkParcelable

import com.contentful.vault.Asset; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void checkParcelable(Asset source) {
  Parcel parcel = Parcel.obtain();
  source.writeToParcel(parcel, 0);
  parcel.setDataPosition(0);
  Asset reconstructed = Asset.CREATOR.createFromParcel(parcel);
  assertThat(reconstructed).isNotNull();
  assertThat(source.url()).isEqualTo(reconstructed.url());
  assertThat(source.mimeType()).isEqualTo(reconstructed.mimeType());
  assertThat(source.title()).isEqualTo(reconstructed.title());
  assertThat(source.description()).isEqualTo(reconstructed.description());

  assertThat((Iterable<String>) source.file().keySet())
      .containsAllIn(reconstructed.file().keySet());

  assertThat((Iterable) source.file().keySet()).hasSize(reconstructed.file().keySet().size());

  assertThat((Iterable<Object>) source.file().values())
      .containsAllIn(reconstructed.file().values());

  assertThat((Iterable) source.file().values()).hasSize(reconstructed.file().values().size());
}
 
开发者ID:contentful,项目名称:vault,代码行数:23,代码来源:ParcelableTest.java


示例4: assertInitialAssets

import com.contentful.vault.Asset; //导入依赖的package包/类
protected void assertInitialAssets() {
  List<Asset> assets = vault.fetch(Asset.class)
      .order(CREATED_AT)
      .all();

  assertThat(assets).isNotNull();
  assertThat(assets).hasSize(4);

  assertThat(assets.get(0).remoteId()).isEqualTo("nyancat");
  assertThat(assets.get(1).remoteId()).isEqualTo("jake");
  assertThat(assets.get(2).remoteId()).isEqualTo("happycat");
  assertThat(assets.get(2).url()).isEqualTo("http://happycat.jpg");
  assertThat(assets.get(3).remoteId()).isEqualTo("1x0xpXu4pSGS4OukSyWGUK");

  for (Asset asset : assets) {
    assertThat(asset.url()).isNotNull();
    assertThat(asset.mimeType()).isNotNull();
    assertThat(asset.remoteId()).isNotNull();
    assertThat(asset.updatedAt()).isNotNull();
  }
}
 
开发者ID:contentful,项目名称:vault,代码行数:22,代码来源:SyncBase.java


示例5: assertUpdateAssets

import com.contentful.vault.Asset; //导入依赖的package包/类
protected void assertUpdateAssets() {
  List<Asset> assets = vault.fetch(Asset.class)
      .order(CREATED_AT)
      .all();

  assertThat(assets).isNotNull();
  assertThat(assets).hasSize(3);
  assertThat(assets.get(0).remoteId()).isEqualTo("nyancat");
  assertThat(assets.get(1).remoteId()).isEqualTo("happycat");
  assertThat(assets.get(1).url()).isEqualTo("http://happiercat.jpg");
  assertThat(assets.get(2).remoteId()).isEqualTo("1x0xpXu4pSGS4OukSyWGUK");

  for (Asset asset : assets) {
    assertThat(asset.url()).isNotNull();
    assertThat(asset.mimeType()).isNotNull();
    assertThat(asset.remoteId()).isNotNull();
    assertThat(asset.updatedAt()).isNotNull();
  }
}
 
开发者ID:contentful,项目名称:vault,代码行数:20,代码来源:SyncBase.java


示例6: initAdapter

import com.contentful.vault.Asset; //导入依赖的package包/类
private void initAdapter() {
  adapter = new ImagePagerAdapter();
  List<String> urls = new ArrayList<>();
  for (Asset asset : product.images()) {
    urls.add(asset.url());
  }
  adapter.setUrls(urls);
}
 
开发者ID:contentful,项目名称:product-catalogue-android,代码行数:9,代码来源:ProductActivity.java


示例7: testAssetMetadata

import com.contentful.vault.Asset; //导入依赖的package包/类
@Test public void testAssetMetadata() throws Exception {
  enqueueInitial();
  sync();

  List<Asset> assets = vault.fetch(Asset.class)
      .order(CREATED_AT)
      .all();

  assertThat(assets).isNotNull();
  assertThat(assets).hasSize(4);

  assertThat(assets.get(0).title()).isEqualTo("Nyan Cat");
  assertThat(assets.get(0).description()).isNull();
  assertThat(assets.get(0).file()).hasSize(4);

  assertThat(assets.get(1).title()).isEqualTo("Jake");
  assertThat(assets.get(1).description()).isNull();
  assertThat(assets.get(1).file()).hasSize(4);

  assertThat(assets.get(2).title()).isEqualTo("Happy Cat");
  assertThat(assets.get(2).description()).isNull();
  assertThat(assets.get(2).file()).hasSize(4);

  assertThat(assets.get(3).title()).isEqualTo("Doge");
  assertThat(assets.get(3).description()).isEqualTo("nice picture");
  assertThat(assets.get(3).file()).hasSize(4);
}
 
开发者ID:contentful,项目名称:vault,代码行数:28,代码来源:SyncTest.java


示例8: setField

import com.contentful.vault.Asset; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public boolean setField(Test.AwesomeModel resource, String name, Object value) {
  if ("textField".equals(name)) {
    resource.textField = (String) value;
  }
  else if ("booleanField".equals(name)) {
    resource.booleanField = (Boolean) value;
  }
  else if ("integerField".equals(name)) {
    resource.integerField = (Integer) value;
  }
  else if ("doubleField".equals(name)) {
    resource.doubleField = (Double) value;
  }
  else if ("mapField".equals(name)) {
    resource.mapField = (Map) value;
  }
  else if ("assetLink".equals(name)) {
    resource.assetLink = (Asset) value;
  }
  else if ("entryLink".equals(name)) {
    resource.entryLink = (Test.AwesomeModel) value;
  }
  else if ("arrayOfAssets".equals(name)) {
    resource.arrayOfAssets = (List<Asset>) value;
  }
  else if ("arrayOfModels".equals(name)) {
    resource.arrayOfModels = (List<Test.AwesomeModel>) value;
  }
  else if ("arrayOfSymbols".equals(name)) {
    resource.arrayOfSymbols = (List<String>) value;
  }
  else {
    return false;
  }
  return true;
}
 
开发者ID:contentful,项目名称:vault,代码行数:39,代码来源:ModelInjection.java


示例9: populate

import com.contentful.vault.Asset; //导入依赖的package包/类
public void populate(Author author) {
  Asset asset = author.profilePhoto();
  if (asset != null) {
    Picasso.with(getContext()).load(asset.url()).fit().centerInside().into(photo);
  }
  name.setText(author.name());
  bio.setText(author.biography());
}
 
开发者ID:contentful,项目名称:blog-app-android,代码行数:9,代码来源:AuthorView.java


示例10: PostLoader

import com.contentful.vault.Asset; //导入依赖的package包/类
public PostLoader(Post post) {
  postTitle = defaultString(post.title(), "");
  postBody = defaultString(post.body(), "");
  postDate = post.date();

  Asset image = post.featuredImage();
  postImage = image == null ? null : image.url();

  List<Author> authors = post.authors();
  if (authors.size() == 0) {
    author = null;
  } else {
    author = authors.get(0);
  }
}
 
开发者ID:contentful,项目名称:blog-app-android,代码行数:16,代码来源:PostLoader.java


示例11: meshFile

import com.contentful.vault.Asset; //导入依赖的package包/类
public Asset meshFile() {
  return meshFile;
}
 
开发者ID:contentful-labs,项目名称:contentful-cardboard,代码行数:4,代码来源:Product.java


示例12: previewMeshFile

import com.contentful.vault.Asset; //导入依赖的package包/类
public Asset previewMeshFile() {
  return previewMeshFile;
}
 
开发者ID:contentful-labs,项目名称:contentful-cardboard,代码行数:4,代码来源:Product.java


示例13: textures

import com.contentful.vault.Asset; //导入依赖的package包/类
public List<Asset> textures() {
  return textures;
}
 
开发者ID:contentful-labs,项目名称:contentful-cardboard,代码行数:4,代码来源:Product.java


示例14: logo

import com.contentful.vault.Asset; //导入依赖的package包/类
public Asset logo() {
  return logo;
}
 
开发者ID:gdg-berlin-android,项目名称:gdg-events-app,代码行数:4,代码来源:GoogleDeveloperGroup.java


示例15: spheres

import com.contentful.vault.Asset; //导入依赖的package包/类
public List<Asset> spheres() {
  return spheres;
}
 
开发者ID:gdg-berlin-android,项目名称:gdg-events-app,代码行数:4,代码来源:Event.java


示例16: profilePhoto

import com.contentful.vault.Asset; //导入依赖的package包/类
public Asset profilePhoto() {
  return profilePhoto;
}
 
开发者ID:contentful,项目名称:gallery-app-android,代码行数:4,代码来源:Author.java


示例17: photo

import com.contentful.vault.Asset; //导入依赖的package包/类
public Asset photo() {
  return photo;
}
 
开发者ID:contentful,项目名称:gallery-app-android,代码行数:4,代码来源:Image.java


示例18: coverImage

import com.contentful.vault.Asset; //导入依赖的package包/类
public Asset coverImage() {
  return coverImage;
}
 
开发者ID:contentful,项目名称:gallery-app-android,代码行数:4,代码来源:Gallery.java


示例19: icon

import com.contentful.vault.Asset; //导入依赖的package包/类
public Asset icon() {
  return icon;
}
 
开发者ID:contentful,项目名称:product-catalogue-android,代码行数:4,代码来源:Category.java


示例20: images

import com.contentful.vault.Asset; //导入依赖的package包/类
public List<Asset> images() {
  return images;
}
 
开发者ID:contentful,项目名称:product-catalogue-android,代码行数:4,代码来源:Product.java



注:本文中的com.contentful.vault.Asset类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OtpErlangObject类代码示例发布时间:2022-05-23
下一篇:
Java HTMLTextPresenter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap