Fix ordering of radicals by stroke count

Julien LepillerSat Jun 06 16:11:12+0200 2020

5104033

Fix ordering of radicals by stroke count

CHANGELOG.md

1313
* Fix a crash on notification on older devices, caused by the use of a vector
1414
  icon in the notification, which was not supported.
1515
* Fix default radical button size which was too small.
16+
* Fix ordering of radicals by stroke count on some devices.
1617
1718
### UI Fixes
1819

app/src/main/java/eu/lepiller/nani/RadicalSelectorView.java

1919
import java.text.NumberFormat;
2020
import java.util.ArrayList;
2121
import java.util.Arrays;
22+
import java.util.Collections;
2223
import java.util.List;
2324
import java.util.Map;
2425
import java.util.Set;

8586
        if(radicals == null)
8687
            return;
8788
88-
        for (int stroke : radicals.keySet()) {
89+
        ArrayList<Integer> strokes = new ArrayList<>(radicals.keySet());
90+
        Collections.sort(strokes);
91+
        for (int stroke : strokes) {
8992
            TextView strokeView = new TextView(getContext());
9093
            NumberFormat nf = NumberFormat.getInstance();
9194
            strokeView.setText(nf.format(stroke));