Сегодня 25 апреля, четверг ГлавнаяНовостиО проектеЛичный кабинетПомощьКонтакты Сделать стартовойКарта сайтаНаписать администрации
Поиск по сайту
 
Ваше мнение
Какой рейтинг вас больше интересует?
 
 
 
 
 
Проголосовало: 7272
Кнопка
BlogRider.ru - Каталог блогов Рунета
получить код
Kir Kolyshkin
Kir Kolyshkin
Голосов: 1
Адрес блога: http://k001.livejournal.com/
Добавлен: 2008-02-19 12:45:30 блограйдером Lurk
 

android 2.3 browser find on page dialog bug

2011-03-26 22:49:13 (читать в оригинале)

Here is a piece of Java code:
private void setMatchesFound(int found) {
    String template = mBrowserActivity.getResources().
        getQuantityString(R.plurals.matches_found, found, found);

    mMatches.setText(template);
}


and the corresponding XML resource:
    <!-- Displayed on the Find dialog to display the number of matches
         found in the current page. -->
    <plurals name="matches_found">
        <!-- Case of no matches -->
        <item quantity="zero">No matches</item>
        <!-- Case of one match -->
        <item quantity="one">1 match</item>
        <!-- Case of "few" (two) matches -->
        <item quantity="few"><xliff:g id="number" example="2">d</xliff:g> matches</item>
        <!-- Case of several matches -->
        <item quantity="other"><xliff:g id="number" example="137">%d</xliff:g> matches</item>
    </plurals>


It works just fine, showing something like "12 matches" in a "Find text on page" dialog. The code was added by this git commit (oh year, with a "very descriptive" log message).

Now, there is a git commit that changes the above Java code, here's the relevant diff:
-                getQuantityString(R.plurals.matches_found, found, found);
+                getQuantityString(R.plurals.matches_found, mNumberOfMatches,
+                mWebView.findIndex() + 1, mNumberOfMatches);


As you can see, the aim is to print something like "Match 3 of 5". The problem is that XML code is not changed, so it shows something like "Matches: 3" instead of what it should. Bad and broken UI. Android 2.3.3.

The good thing is it is open source so anyone (incl. me) can fix it. I an not an expert in the field but I'll try.

Тэги: android, java, linux, wtf

 


Самый-самый блог
Блогер Рыбалка
Рыбалка
по среднему баллу (5.00) в категории «Спорт»
Изменения рейтинга
Категория «Проза»
Взлеты Топ 5
Падения Топ 5


Загрузка...Загрузка...
BlogRider.ru не имеет отношения к публикуемым в записях блогов материалам. Все записи
взяты из открытых общедоступных источников и являются собственностью их авторов.