Example usage for android.content.res Resources getQuantityString

List of usage examples for android.content.res Resources getQuantityString

Introduction

In this page you can find the example usage for android.content.res Resources getQuantityString.

Prototype

@NonNull
public String getQuantityString(@PluralsRes int id, int quantity) throws NotFoundException 

Source Link

Document

Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity.

Usage

From source file:com.ubergeek42.WeechatAndroid.service.Notificator.java

private static void makeNoise(Builder builder, Resources res, List<HotMessage> messages) {
    if (P.notificationTicker)
        builder.setTicker(messages.size() == 0 ? res.getQuantityString(R.plurals.hot_messages_missing, 1)
                : messages.get(messages.size() - 1).forTicker());
    builder.setPriority(Notification.PRIORITY_HIGH);
    if (!TextUtils.isEmpty(P.notificationSound))
        builder.setSound(Uri.parse(P.notificationSound));
    int flags = 0;
    if (P.notificationLight)
        flags |= Notification.DEFAULT_LIGHTS;
    if (P.notificationVibrate)
        flags |= Notification.DEFAULT_VIBRATE;
    builder.setDefaults(flags);// w w w  .ja  v  a  2s .  com
}

From source file:com.limewoodmedia.nsdroid.fragments.WACouncilFragment.java

public void loadCouncil(WACouncil council, WAData data) {
    setCouncil(council);//  w  ww.  ja v a2  s .c  om

    if (data.resolution.name != null) {
        atVote.setText(Html.fromHtml("<b>" + getString(R.string.wa_at_vote) + ":</b> " + data.resolution.name));
        float total = data.resolution.votes.forVotes + data.resolution.votes.againstVotes;
        votes.setText(Html.fromHtml("<b>" + getString(R.string.wa_votes_for) + ":</b> "
                + format.format(data.resolution.votes.forVotes / total) + "<br/>" + "<b>"
                + getString(R.string.wa_votes_against) + ":</b> "
                + format.format(data.resolution.votes.againstVotes / total)));
        Calendar cal = Calendar.getInstance(Locale.ENGLISH);
        cal.setTimeInMillis(data.resolution.created * 1000);
        Log.d(TAG, "Created: " + cal.getTimeInMillis());
        cal.add(Calendar.DAY_OF_YEAR, 7);
        Log.d(TAG, "Ending: " + cal.getTimeInMillis());
        int[] daysHours = Utils.getWADaysHoursLeft(data.resolution.voteTrack.forVotes.length);
        int days = daysHours[0];
        int hours = daysHours[1];
        Resources r = getResources();
        below.setText(Html.fromHtml(getString(R.string.voting_ends, days, hours,
                r.getQuantityString(R.plurals.days, days), r.getQuantityString(R.plurals.hours, hours))
                + "<br/><br/><b>" + getString(R.string.wa_recent) + ":</b> " + data.lastResolution));

        // Set up chart
        Log.d(TAG, "Set up values");
        series.clear();
        CategorySeries forVotes = new CategorySeries("For");
        CategorySeries againstVotes = new CategorySeries("Against");
        forVotes.add("For", data.resolution.votes.forVotes);
        againstVotes.add("Against", data.resolution.votes.againstVotes);
        series.addSeries(forVotes.toXYSeries());
        series.addSeries(againstVotes.toXYSeries());

        setUpChartRenderer(renderer);
        renderer.setYAxisMax(
                Math.max(data.resolution.votes.forVotes, data.resolution.votes.againstVotes) * 1.2f);

        LinearLayout layout = (LinearLayout) root.findViewById(R.id.at_vote_chart);
        chart = ChartFactory.getBarChartView(getActivity(), series, renderer, BarChart.Type.DEFAULT);
        layout.addView(chart, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                r.getDimensionPixelSize(R.dimen.wa_bar_chart_height)));

        chart.repaint();
    } else {
        atVote.setText(R.string.none);
        votes.setVisibility(View.GONE);
        root.findViewById(R.id.at_vote_chart).setVisibility(View.GONE);
        below.setText(Html
                .fromHtml("<br/><br/><b>" + getString(R.string.wa_recent) + ":</b> " + data.lastResolution));
    }
}

From source file:im.ene.lab.attiq.ui.activities.ProfileActivity.java

private void updateQuantities() {
    if (mProfile == null || isFinishing()) {
        return;/*  www.j  a  va2  s .c  o m*/
    }

    final Resources res = getResources();
    mItemCount.setText(mProfile.getItemCount() + "");
    mItemQuantity.setText(res.getQuantityString(R.plurals.user_items, mProfile.getItemCount()));

    mFollowerCount.setText(mProfile.getFollowerCount() + "");
    mFollowerQuantity.setText(res.getQuantityString(R.plurals.user_followers, mProfile.getFollowerCount()));

    mFollowingCount.setText(mProfile.getFollowingCount() + "");
    mFollowingQuantity.setText(res.getQuantityString(R.plurals.user_following, mProfile.getFollowingCount()));
}

From source file:com.fastbootmobile.encore.app.adapters.SearchAdapter.java

/**
 * Updates the tag fields considering the entry is a playlist
 *
 * @param i   The item index//from  www.  ja  v a 2  s.  c  o  m
 * @param tag The tag of the view
 */
private void updatePlaylistTag(int i, ViewHolder tag) {
    final SearchEntry entry = mSortedPlaylists.get(i);
    final Playlist playlist = ProviderAggregator.getDefault().retrievePlaylist(entry.ref, entry.identifier);
    final Resources res = tag.vRoot.getResources();

    if (playlist != null && playlist.equals(tag.content)) {
        // We're already displaying it
        return;
    }

    if (playlist != null && (playlist.isLoaded() || playlist.getName() != null)) {
        tag.tvTitle.setText(playlist.getName());
        tag.tvSubtitle.setText(res.getQuantityString(R.plurals.xx_songs, playlist.getSongsCount()));
        tag.content = playlist;
        tag.sourceLogo = PluginsLookup.getDefault().getCachedLogo(tag.vRoot.getResources(), playlist);
        tag.ivSource.setImageDrawable(tag.sourceLogo);
        tag.ivOverflow.setOnClickListener(mOverflowPlaylistClickListener);
    } else {
        tag.tvTitle.setText(R.string.loading);
        tag.tvSubtitle.setText(null);
        tag.ivSource.setImageDrawable(null);
        tag.albumArtImageView.setDefaultArt();
        tag.ivOverflow.setOnClickListener(null);
    }
}

From source file:com.grokkingandroid.sampleapp.samples.about.AboutFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Resources res = getResources();
    if (getArguments() == null) {
        throw new IllegalStateException("Arguments bundle must not be empty");
    }//from w ww. ja va  2s .  c om
    int[] resIds = getArguments().getIntArray(KEY_RESOURCE_IDS);
    getDialog().setTitle(res.getString(R.string.about));
    View view = inflater.inflate(R.layout.fragment_about, container, false);
    ViewGroup libParent = (ViewGroup) view.findViewById(R.id.about_container);

    String[] libTitles = null;
    String[] libDescriptions = null;
    if (resIds[0] != -1) {
        libTitles = res.getStringArray(resIds[0]);
        libDescriptions = res.getStringArray(resIds[1]);
    }
    if (getArguments().getBoolean(KEY_ADD_DEFAULT_LIBS, true)) {
        if (resIds[0] == -1) {
            libTitles = res.getStringArray(R.array.grokkingandroidsample_about_titles);
            libDescriptions = res.getStringArray(R.array.grokkingandroidsample_about_contents);
        } else {
            String[] defaultTitles = res.getStringArray(R.array.grokkingandroidsample_about_titles);
            String[] target = new String[defaultTitles.length + libTitles.length];
            System.arraycopy(libTitles, 0, target, 0, libTitles.length);
            System.arraycopy(defaultTitles, 0, target, libTitles.length, defaultTitles.length);
            libTitles = target;
            String[] defaultDescriptions = res.getStringArray(R.array.grokkingandroidsample_about_contents);
            target = new String[defaultDescriptions.length + libTitles.length];
            System.arraycopy(libDescriptions, 0, target, 0, libDescriptions.length);
            System.arraycopy(defaultDescriptions, 0, target, libDescriptions.length,
                    defaultDescriptions.length);
            libDescriptions = target;
        }
    }
    String libraryPlural = res.getQuantityString(R.plurals.plural_libraries, libTitles.length);
    String appTitle = res.getString(resIds[3]);
    String copyrightYear = res.getString(resIds[4]);
    String repositoryLink = res.getString(resIds[5]);
    String aboutText = res.getString(resIds[2], appTitle, copyrightYear, repositoryLink, libraryPlural);
    Spanned spannedAboutText = Html.fromHtml(aboutText);
    TextView aboutTv = (TextView) libParent.findViewById(R.id.about_text);
    aboutTv.setText(spannedAboutText);
    aboutTv.setMovementMethod(LinkMovementMethod.getInstance());

    if (libTitles != null) {
        for (int i = 0; i < libTitles.length; i++) {
            View libContainer = inflater.inflate(R.layout.single_library_layout, libParent, false);
            TextView currLibTitle = (TextView) libContainer.findViewById(R.id.library_title);
            currLibTitle.setText(libTitles[i]);
            TextView currLibDesc = (TextView) libContainer.findViewById(R.id.library_text);
            Spanned spanned = Html.fromHtml(libDescriptions[i]);
            currLibDesc.setText(spanned);
            currLibDesc.setMovementMethod(LinkMovementMethod.getInstance());
            libParent.addView(libContainer);
        }
    }
    return view;
}

From source file:com.limewoodmedia.nsdroid.activities.WorldAssembly.java

private void setUpChartRenderer(XYMultipleSeriesRenderer chartRenderer, XYSeriesRenderer forRenderer,
        XYSeriesRenderer againstRenderer) {
    Log.d(TAG, "Set up chart renderer");
    Resources r = getResources();
    float legendTextSize = r.getDimension(R.dimen.area_chart_legend_size);
    float labelTextSize = r.getDimension(R.dimen.area_chart_label_size);

    // For renderer
    forRenderer.setColor(r.getColor(R.color.wa_for));
    forRenderer.setChartValuesTextSize(legendTextSize);
    forRenderer.setDisplayChartValues(true);
    XYSeriesRenderer.FillOutsideLine line = new XYSeriesRenderer.FillOutsideLine(
            XYSeriesRenderer.FillOutsideLine.Type.BELOW);
    line.setColor(r.getColor(R.color.wa_for_below));
    forRenderer.addFillOutsideLine(line);

    againstRenderer.setColor(r.getColor(R.color.wa_against));
    againstRenderer.setChartValuesTextSize(legendTextSize);
    againstRenderer.setDisplayChartValues(true);
    line = new XYSeriesRenderer.FillOutsideLine(XYSeriesRenderer.FillOutsideLine.Type.BELOW);
    line.setColor(r.getColor(R.color.wa_against_below));
    againstRenderer.addFillOutsideLine(line);

    chartRenderer.setZoomButtonsVisible(false);
    chartRenderer.setClickEnabled(true);
    chartRenderer.setInScroll(true);/*from   w ww  . j  a  v a 2s .  com*/
    chartRenderer.setAntialiasing(true);
    chartRenderer.setShowLegend(true);
    chartRenderer.setLegendTextSize(legendTextSize);
    chartRenderer.setLabelsTextSize(labelTextSize);
    chartRenderer.setTextTypeface(Typeface.DEFAULT);
    chartRenderer.setPanEnabled(false);
    chartRenderer.setShowLabels(true);
    chartRenderer.setXAxisMin(0);
    chartRenderer.setXAxisMax(24 * 4 + 1); // 1 per hour, 4 days, 1 at origo
    chartRenderer.setYAxisMin(0);
    chartRenderer.setXLabels(0);
    chartRenderer.setXLabelsAngle(-25);
    chartRenderer.setXLabelsAlign(Paint.Align.RIGHT);
    chartRenderer.setFitLegend(true);
    for (int i = 1; i < 5; i++) {
        chartRenderer.addXTextLabel(24 * i, i + " " + r.getQuantityString(R.plurals.days, i));
    }
    chartRenderer.setYLabels(0);
    chartRenderer.setGridColor(Color.WHITE);
    chartRenderer.setMarginsColor(Color.WHITE);
    chartRenderer.setMargins(new int[] { 0, 0, r.getDimensionPixelSize(R.dimen.area_chart_margin_bottom), 0 });
    chartRenderer.setBackgroundColor(Color.WHITE);
    chartRenderer.setApplyBackgroundColor(true);
    chartRenderer.removeAllRenderers();
    chartRenderer.addSeriesRenderer(forRenderer);
    chartRenderer.addSeriesRenderer(againstRenderer);
}

From source file:com.limewoodmedia.nsdroid.activities.WorldAssembly.java

private void doSetup() {
    // General Assembly overview
    generalAssembly.loadCouncil(WACouncil.GENERAL_ASSEMBLY, gaData);

    // Security Council overview
    securityCouncil.loadCouncil(WACouncil.SECURITY_COUNCIL, scData);

    // Happenings
    StringBuilder happText = null;
    for (WAHappening happ : gaData.happenings) {
        if (happText == null) {
            happText = new StringBuilder();
        } else {//from  ww  w.  j  a  v a2 s. c om
            happText.append("<br/><br/>");
        }
        happText.append("<i>" + TagParser.parseTimestamp(this, happ.timestamp) + ":</i> " + happ.text);
    }
    if (happText != null) {
        happenings.setText(Html.fromHtml(happText.toString()));
        happenings.setMovementMethod(LinkMovementMethod.getInstance());
    } else {
        happenings.setVisibility(View.GONE);
    }

    Resources r = getResources();

    // General Assembly
    if (gaData.resolution.name != null) {
        gaTitle.setText(gaData.resolution.name);
        String catText = gaData.resolution.category;
        if (catText.equals("Repeal")) {
            catText += " of GA#" + (Integer.parseInt(gaData.resolution.option) + 1);
        } else {
            catText += "; Strength: " + gaData.resolution.option;
        }
        gaCategory.setText(catText);
        gaProposer.setText(Html.fromHtml(getString(R.string.wa_proposed_by)
                + " <a href=\"com.limewoodMedia.nsdroid.nation://" + gaData.resolution.proposedBy + "\">"
                + TagParser.idToName(gaData.resolution.proposedBy) + "</a>"));
        gaProposer.setMovementMethod(LinkMovementMethod.getInstance());
        gaNation.setText(Html.fromHtml("<b>" + nationData.name + ":</b> " + nationData.generalAssemblyVote));
        gaText.setText(Html.fromHtml(TagParser.parseTags(gaData.resolution.desc.replace("\n", "<br/>"))));
        float total = gaData.resolution.votes.forVotes + gaData.resolution.votes.againstVotes;
        int[] daysHours = Utils.getWADaysHoursLeft(gaData.resolution.voteTrack.forVotes.length);
        int days = daysHours[0];
        int hours = daysHours[1];
        gaBelow.setText(Html
                .fromHtml("<b>" + getString(R.string.wa_votes_for) + ":</b> " + gaData.resolution.votes.forVotes
                        + " (" + format.format(gaData.resolution.votes.forVotes / total) + ")<br/><b>"
                        + getString(R.string.wa_votes_against) + ":</b> " + gaData.resolution.votes.againstVotes
                        + " (" + format.format(gaData.resolution.votes.againstVotes / total) + ")<br/><br/>"
                        + getString(R.string.voting_ends, days, hours,
                                r.getQuantityString(R.plurals.days, days),
                                r.getQuantityString(R.plurals.hours, hours))));

        // Chart
        gaSeries.clear();
        XYSeries forVotes = new XYSeries("For");
        XYSeries againstVotes = new XYSeries("Against");
        int i = 0;
        int forMax = 0;
        for (Integer f : gaData.resolution.voteTrack.forVotes) {
            forVotes.add(i++, f);
            if (f > forMax) {
                forMax = f;
            }
        }
        i = 0;
        int againstMax = 0;
        for (Integer a : gaData.resolution.voteTrack.againstVotes) {
            againstVotes.add(i++, a);
            if (a > againstMax) {
                againstMax = a;
            }
        }
        gaSeries.addSeries(forVotes);
        gaSeries.addSeries(againstVotes);

        gaForRenderer = new XYSeriesRenderer();
        gaAgainstRenderer = new XYSeriesRenderer();
        setUpChartRenderer(gaRenderer, gaForRenderer, gaAgainstRenderer);
        gaRenderer.setYAxisMax(Math.max(forMax, againstMax) * 1.2f);

        LinearLayout layout = (LinearLayout) gaPage.findViewById(R.id.chart);
        gaChart = ChartFactory.getLineChartView(this, gaSeries, gaRenderer);
        layout.addView(gaChart, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                r.getDimensionPixelSize(R.dimen.wa_area_chart_height)));

        gaChart.repaint();
    } else {
        gaTitle.setText(getString(R.string.none));
        gaCategory.setVisibility(View.GONE);
        gaProposer.setVisibility(View.GONE);
        gaText.setVisibility(View.GONE);
        gaBelow.setVisibility(View.GONE);
        gaPage.findViewById(R.id.chart).setVisibility(View.GONE);
    }

    // Security Council
    if (scData.resolution.name != null) {
        scTitle.setText(scData.resolution.name);
        String catText = scData.resolution.category + "; ";
        String[] arr = scData.resolution.option.split(":");
        if (arr[0].equals("N")) {
            catText += getString(R.string.nation) + " <a href=\"com.limewoodMedia.nsdroid.nation://" + arr[1]
                    + "\">" + TagParser.idToName(arr[1]) + "</a>";
        } else if (arr[0].equals("R")) {
            catText += getString(R.string.region) + " <a href=\"com.limewoodMedia.nsdroid.region://" + arr[1]
                    + "\">" + TagParser.idToName(arr[1]) + "</a>";
        } else {
            catText += scData.resolution.option;
        }
        scCategory.setText(Html.fromHtml(catText));
        scCategory.setMovementMethod(LinkMovementMethod.getInstance());
        scProposer.setText(Html.fromHtml(getString(R.string.wa_proposed_by)
                + " <a href=\"com.limewoodMedia.nsdroid.nation://" + scData.resolution.proposedBy + "\">"
                + TagParser.idToName(scData.resolution.proposedBy) + "</a>"));
        scProposer.setMovementMethod(LinkMovementMethod.getInstance());
        scNation.setText(Html.fromHtml("<b>" + nationData.name + ":</b> " + nationData.securityCouncilVote));
        scText.setText(Html.fromHtml(TagParser.parseTags(scData.resolution.desc.replace("\n", "<br/>"))));
        float total = scData.resolution.votes.forVotes + scData.resolution.votes.againstVotes;
        int[] daysHours = Utils.getWADaysHoursLeft(scData.resolution.voteTrack.forVotes.length);
        int days = daysHours[0];
        int hours = daysHours[1];
        scBelow.setText(Html
                .fromHtml("<b>" + getString(R.string.wa_votes_for) + ":</b> " + scData.resolution.votes.forVotes
                        + " (" + format.format(scData.resolution.votes.forVotes / total) + ")<br/><b>"
                        + getString(R.string.wa_votes_against) + ":</b> " + scData.resolution.votes.againstVotes
                        + " (" + format.format(scData.resolution.votes.againstVotes / total) + ")<br/><br/>"
                        + getString(R.string.voting_ends, days, hours,
                                r.getQuantityString(R.plurals.days, days),
                                r.getQuantityString(R.plurals.hours, hours))));

        // Chart
        scSeries.clear();
        XYSeries forVotes = new XYSeries("For");
        XYSeries againstVotes = new XYSeries("Against");
        int i = 0;
        int forMax = 0;
        for (Integer f : scData.resolution.voteTrack.forVotes) {
            forVotes.add(i++, f);
            if (f > forMax) {
                forMax = f;
            }
        }
        i = 0;
        int againstMax = 0;
        for (Integer a : scData.resolution.voteTrack.againstVotes) {
            againstVotes.add(i++, a);
            if (a > againstMax) {
                againstMax = a;
            }
        }
        scSeries.addSeries(forVotes);
        scSeries.addSeries(againstVotes);

        scForRenderer = new XYSeriesRenderer();
        scAgainstRenderer = new XYSeriesRenderer();
        setUpChartRenderer(scRenderer, scForRenderer, scAgainstRenderer);
        scRenderer.setYAxisMax(Math.max(forMax, againstMax) * 1.2f);

        LinearLayout layout = (LinearLayout) scPage.findViewById(R.id.chart);
        scChart = ChartFactory.getLineChartView(this, scSeries, scRenderer);
        layout.addView(scChart, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                r.getDimensionPixelSize(R.dimen.wa_area_chart_height)));

        scChart.repaint();
    } else {
        scTitle.setText(getString(R.string.none));
        scCategory.setVisibility(View.GONE);
        scProposer.setVisibility(View.GONE);
        scText.setVisibility(View.GONE);
        scBelow.setVisibility(View.GONE);
        scPage.findViewById(R.id.chart).setVisibility(View.GONE);
    }

    supportInvalidateOptionsMenu();
}

From source file:com.nikhilnayak.games.octoshootar.ui.fragments.GameScoreFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final Resources res = getResources();
    View v = inflater.inflate(R.layout.fragment_score, container, false);
    final int[] clickable = new int[] { R.id.score_button_replay, R.id.score_button_home,
            R.id.score_button_skip, R.id.score_button_share, R.id.score_button_next_mission,
            R.id.fragment_score_btn_loot_help };
    for (int i : clickable) {
        v.findViewById(i).setOnClickListener(this);
    }//from w  w  w.  jav  a2  s  . c o  m

    if (savedInstanceState != null) {
        mIsDisplayDone = savedInstanceState.getBoolean(BUNDLE_IS_DISPLAY_DONE, false);
        mAchievementChecked = savedInstanceState.getBoolean(BUNDLE_CURRENT_ACHIEVEMENT_CHECKED, false);
        mPlayerProfileSaved = savedInstanceState.getBoolean(BUNDLE_CURRENT_PLAYER_PROFILE_SAVED, false);
        mHasIncreaseRank = savedInstanceState.getBoolean(BUNDLE_HAS_INCREASED_RANK, false);
        mHasLeveledUp = savedInstanceState.getBoolean(BUNDLE_HAS_LEVELED_UP, false);
    }

    if (getArguments().containsKey(EXTRA_GAME_INFORMATION)) {
        mGameInformation = getArguments().getParcelable(EXTRA_GAME_INFORMATION);
        retrieveGameDetails(mGameInformation);

        //set info to details card
        ((TextView) v.findViewById(R.id.numberOfTargetsKilled)).setText(String.valueOf(mRetrievedTargetKilled));
        ((TextView) v.findViewById(R.id.numberOfBulletsFired)).setText(String.valueOf(mRetrievedBulletFired));
        ((TextView) v.findViewById(R.id.maxCombo)).setText(String.valueOf(mRetrievedCombo));
        ((TextView) v.findViewById(R.id.expEarned)).setText(String.valueOf(mRetrievedExpEarned));
        ((TextView) v.findViewById(R.id.fragment_score_game_mode_name))
                .setText(mGameInformation.getGameMode().getTitle());
    }

    //update playerProfile with value of this game
    updatePlayerProfile();

    //populate the view
    final LevelInformation levelInformation = mPlayerProfile.getLevelInformation();
    ((TextView) v.findViewById(R.id.result_level))
            .setText(String.format(getString(R.string.profile_level), levelInformation.getLevel()));
    ((TextView) v.findViewById(R.id.result_current_exp)).setText(String.format(getString(R.string.profile_exp),
            levelInformation.getExpProgress(), levelInformation.getExpNeededToLevelUp()));
    mRetrievedExpBar = levelInformation.getProgressInPercent();

    //congratz card ?
    final View congratzCard = v.findViewById(R.id.result_card_congratz);
    final TextView congratsText = (TextView) v.findViewById(R.id.result_congratz_message);
    if (mHasLeveledUp) {
        congratzCard.setVisibility(View.VISIBLE);
        congratsText.setText(getString(R.string.score_congratz_level_up) + "\n");
    }
    if (mHasIncreaseRank) {
        congratzCard.setVisibility(View.VISIBLE);
        congratsText.setText(congratsText.getText() + getString(R.string.score_congratz_rank_up));
    }

    mFinalScoreTopTextView = (TextView) v.findViewById(R.id.result_score_top);
    mFinalScoreBottomTextView = (TextView) v.findViewById(R.id.finalScore);
    mSkipButton = (Button) v.findViewById(R.id.score_button_skip);
    mSignInView = v.findViewById(R.id.sign_in_message);
    mExpEarnedTextView = (TextView) v.findViewById(R.id.result_earned_exp);
    mExpbar = (ProgressBar) v.findViewById(R.id.result_level_progess_bar);

    HashMap<Integer, Integer> loots = mGameInformation.getLoot();
    if (loots.size() != 0) {
        String stringLoot = "";
        for (Map.Entry<Integer, Integer> entry : loots.entrySet()) {
            InventoryItemEntry inventoryItemEntry = InventoryItemEntryFactory.create(entry.getKey(),
                    entry.getValue());
            final long quantityDropped = inventoryItemEntry.getQuantityAvailable();
            final int titleResourceId = inventoryItemEntry.getTitleResourceId();
            stringLoot += String.valueOf(quantityDropped) + "x "
                    + res.getQuantityString(titleResourceId, (int) quantityDropped) + "\n";
        }
        stringLoot = stringLoot.substring(0, stringLoot.length() - 1);
        ((TextView) v.findViewById(R.id.score_loot_list)).setText(stringLoot);
    }

    //show the right rank
    String[] ranks = res.getStringArray(R.array.ranks_array_full);
    String[] grades = res.getStringArray(R.array.ranks_array_letter);
    final int gameRank = mGameInformation.getRank();
    switch (gameRank) {
    case GameModeFactory.GAME_RANK_DESERTER:
    case GameModeFactory.GAME_RANK_SOLDIER:
    case GameModeFactory.GAME_RANK_CORPORAL:
    case GameModeFactory.GAME_RANK_SERGEANT:
    case GameModeFactory.GAME_RANK_ADMIRAL:
        ((TextView) v.findViewById(R.id.result_rang)).setText(ranks[gameRank]);
        ((TextView) v.findViewById(R.id.result_grade)).setText(grades[gameRank]);
        break;
    default:
        ((TextView) v.findViewById(R.id.result_rang)).setText(ranks[0]);
        ((TextView) v.findViewById(R.id.result_grade)).setText(grades[0]);
        break;
    }

    return v;
}