當前位置: 首頁>>代碼示例>>Java>>正文


Java Shot類代碼示例

本文整理匯總了Java中io.plaidapp.data.api.dribbble.model.Shot的典型用法代碼示例。如果您正苦於以下問題:Java Shot類的具體用法?Java Shot怎麽用?Java Shot使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Shot類屬於io.plaidapp.data.api.dribbble.model包,在下文中一共展示了Shot類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBindViewHolder

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (getItemViewType(position)) {
        case TYPE_DESIGNER_NEWS_STORY:
            bindDesignerNewsStory((Story) getItem(position), (DesignerNewsStoryHolder) holder);
            break;
        case TYPE_DRIBBBLE_SHOT:
            bindDribbbleShotHolder((Shot) getItem(position), (DribbbleShotHolder) holder);
            break;
        case TYPE_PRODUCT_HUNT_POST:
            bindProductHuntPostView((Post) getItem(position), (ProductHuntStoryHolder) holder);
            break;
        case TYPE_LOADING_MORE:
            bindLoadingViewHolder((LoadingMoreHolder) holder);
            break;
    }
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:18,代碼來源:FeedAdapter.java

示例2: onBindViewHolder

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (getItemViewType(position)) {
        case TYPE_DESIGNER_NEWS_STORY:
            bindDesignerNewsStory((Story) getItem(position), (DesignerNewsStoryHolder) holder);
            break;
        case TYPE_DRIBBBLE_SHOT:
            bindDribbbleShotHolder(
                    (Shot) getItem(position), (DribbbleShotHolder) holder, position);
            break;
        case TYPE_PRODUCT_HUNT_POST:
            bindProductHuntPostView((Post) getItem(position), (ProductHuntStoryHolder) holder);
            break;
        case TYPE_LOADING_MORE:
            bindLoadingViewHolder((LoadingMoreHolder) holder, position);
            break;
    }
}
 
開發者ID:yongjhih,項目名稱:android-proguards,代碼行數:19,代碼來源:FeedAdapter.java

示例3: convert

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@Override
public List<Shot> convert(ResponseBody value) throws IOException {
    final Elements shotElements =
            Jsoup.parse(value.string(), HOST).select("li[id^=screenshot]");
    final List<Shot> shots = new ArrayList<>(shotElements.size());
    for (Element element : shotElements) {
        final Shot shot = parseShot(element, DATE_FORMAT);
        if (shot != null) {
            shots.add(shot);
        }
    }
    return shots;
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:14,代碼來源:DribbbleSearchConverter.java

示例4: parseShot

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
private static Shot parseShot(Element element, SimpleDateFormat dateFormat) {
    final Element descriptionBlock = element.select("a.dribbble-over").first();
    // API responses wrap description in a <p> tag. Do the same for consistent display.
    String description = descriptionBlock.select("span.comment").text().trim();
    if (!TextUtils.isEmpty(description)) {
        description = "<p>" + description + "</p>";
    }
    String imgUrl = element.select("img").first().attr("src");
    if (imgUrl.contains("_teaser.")) {
        imgUrl = imgUrl.replace("_teaser.", ".");
    }
    Date createdAt = null;
    try {
        createdAt = dateFormat.parse(descriptionBlock.select("em.timestamp").first().text());
    } catch (ParseException e) { }

    return new Shot.Builder()
            .setId(Long.parseLong(element.id().replace("screenshot-", "")))
            .setHtmlUrl(HOST + element.select("a.dribbble-link").first().attr("href"))
            .setTitle(descriptionBlock.select("strong").first().text())
            .setDescription(description)
            .setImages(new Images(null, imgUrl, null))
            .setAnimated(element.select("div.gif-indicator").first() != null)
            .setCreatedAt(createdAt)
            .setLikesCount(Long.parseLong(element.select("li.fav").first().child(0).text()
                    .replaceAll(",", "")))
            .setCommentsCount(Long.parseLong(element.select("li.cmnt").first().child(0).text
                    ().replaceAll(",", "")))
            .setViewsCount(Long.parseLong(element.select("li.views").first().child(0)
                    .text().replaceAll(",", "")))
            .setUser(parsePlayer(element.select("h2").first()))
            .build();
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:34,代碼來源:DribbbleSearchConverter.java

示例5: getItemViewType

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@Override
public int getItemViewType(int position) {
    if (position < getDataItemCount()
            && getDataItemCount() > 0) {
        PlaidItem item = getItem(position);
        if (item instanceof Story) {
            return TYPE_DESIGNER_NEWS_STORY;
        } else if (item instanceof Shot) {
            return TYPE_DRIBBBLE_SHOT;
        } else if (item instanceof Post) {
            return TYPE_PRODUCT_HUNT_POST;
        }
    }
    return TYPE_LOADING_MORE;
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:16,代碼來源:FeedAdapter.java

示例6: expandPopularItems

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
private void expandPopularItems() {
    // for now just expand the first dribbble image per page which should be
    // the most popular according to our weighing & sorting
    List<Integer> expandedPositions = new ArrayList<>();
    int page = -1;
    final int count = items.size();
    for (int i = 0; i < count; i++) {
        PlaidItem item = getItem(i);
        if (item instanceof Shot && item.page > page) {
            item.colspan = columns;
            page = item.page;
            expandedPositions.add(i);
        } else {
            item.colspan = 1;
        }
    }

    // make sure that any expanded items are at the start of a row
    // so that we don't leave any gaps in the grid
    for (int expandedPos = 0; expandedPos < expandedPositions.size(); expandedPos++) {
        int pos = expandedPositions.get(expandedPos);
        int extraSpannedSpaces = expandedPos * (columns - 1);
        int rowPosition = (pos + extraSpannedSpaces) % columns;
        if (rowPosition != 0) {
            int swapWith = pos + (columns - rowPosition);
            if (swapWith < items.size()) {
                Collections.swap(items, pos, swapWith);
            }
        }
    }
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:32,代碼來源:FeedAdapter.java

示例7: start

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
public static void start(Activity launching, Shot shot) {
    Intent starter = new Intent(launching, PlayerSheet.class);
    starter.putExtra(EXTRA_MODE, MODE_SHOT_LIKES);
    starter.putExtra(EXTRA_SHOT, shot);
    launching.startActivity(starter,
            ActivityOptions.makeSceneTransitionAnimation(launching).toBundle());
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:8,代碼來源:PlayerSheet.java

示例8: FeedAdapter

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
FeedAdapter(Activity hostActivity,
            @Nullable DataLoadingSubject dataLoading,
            int columns,
            boolean pocketInstalled, ViewPreloadSizeProvider<Shot> shotPreloadSizeProvider) {
    this.host = hostActivity;
    this.dataLoading = dataLoading;
    if (dataLoading != null) {
        dataLoading.registerCallback(this);
    }
    this.columns = columns;
    this.pocketIsInstalled = pocketInstalled;
    this.shotPreloadSizeProvider = shotPreloadSizeProvider;
    layoutInflater = LayoutInflater.from(host);
    comparator = new PlaidItemSorting.PlaidItemComparator();
    items = new ArrayList<>();
    setHasStableIds(true);

    // get the dribbble shot placeholder colors & badge color from the theme
    final TypedArray a = host.obtainStyledAttributes(R.styleable.DribbbleFeed);
    final int loadingColorArrayId =
            a.getResourceId(R.styleable.DribbbleFeed_shotLoadingPlaceholderColors, 0);
    if (loadingColorArrayId != 0) {
        int[] placeholderColors = host.getResources().getIntArray(loadingColorArrayId);
        shotLoadingPlaceholders = new ColorDrawable[placeholderColors.length];
        for (int i = 0; i < placeholderColors.length; i++) {
            shotLoadingPlaceholders[i] = new ColorDrawable(placeholderColors[i]);
        }
    } else {
        shotLoadingPlaceholders = new ColorDrawable[] { new ColorDrawable(Color.DKGRAY) };
    }
    final int initialGifBadgeColorId =
            a.getResourceId(R.styleable.DribbbleFeed_initialBadgeColor, 0);
    initialGifBadgeColor = initialGifBadgeColorId != 0 ?
            ContextCompat.getColor(host, initialGifBadgeColorId) : 0x40ffffff;
    a.recycle();
}
 
開發者ID:nickbutcher,項目名稱:plaid,代碼行數:37,代碼來源:FeedAdapter.java

示例9: getPreloadItems

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@NonNull
@Override
public List<Shot> getPreloadItems(int position) {
    PlaidItem item = getItem(position);
    if (item instanceof Shot) {
        return Collections.singletonList((Shot) item);
    }
    return Collections.emptyList();
}
 
開發者ID:nickbutcher,項目名稱:plaid,代碼行數:10,代碼來源:FeedAdapter.java

示例10: getPopular

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@GET("v1/shots")
Call<List<Shot>> getPopular(@Query("page") Integer page,
                            @Query("per_page") Integer pageSize);
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:4,代碼來源:DribbbleService.java

示例11: getRecent

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@GET("v1/shots?sort=recent")
Call<List<Shot>> getRecent(@Query("page") Integer page,
                           @Query("per_page") Integer pageSize);
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:4,代碼來源:DribbbleService.java

示例12: getDebuts

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@GET("v1/shots?list=debuts")
Call<List<Shot>> getDebuts(@Query("page") Integer page,
                           @Query("per_page") Integer pageSize);
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:4,代碼來源:DribbbleService.java

示例13: getAnimated

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@GET("v1/shots?list=animated")
Call<List<Shot>> getAnimated(@Query("page") Integer page,
                             @Query("per_page") Integer pageSize);
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:4,代碼來源:DribbbleService.java

示例14: getShots

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@GET("v1/shots")
Call<List<Shot>> getShots(@Query("list") @ShotType String shotType,
                          @Query("timeframe") @ShotTimeframe String timeframe,
                          @Query("sort") @ShotSort String shotSort);
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:5,代碼來源:DribbbleService.java

示例15: getShot

import io.plaidapp.data.api.dribbble.model.Shot; //導入依賴的package包/類
@GET("v1/shots/{id}")
Call<Shot> getShot(@Path("id") long shotId);
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:3,代碼來源:DribbbleService.java


注:本文中的io.plaidapp.data.api.dribbble.model.Shot類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。