src/main/java/de/blau/android/presets/PresetItem.java
/**
     * Arrange any i18n keys that have dynamically been added to this preset
     * 
     * @param i18nKeys List of candidate i18n keys
     */
Arrange any i18n keys that have dynamically been added to this preset

@param i18nKeys List of candidate i18n keys
Arrange any i18n keys that have dynamically been added to this preset @param i18nKeys List of candidate i18n keys
public void groupI18nKeys(List<String> i18nKeys) {
        LinkedHashMap<String, PresetField> temp = new LinkedHashMap<>();
        ArrayList<String> keys = new ArrayList<>(fields.keySet());
        while (!keys.isEmpty()) {
            String key = keys.get(0);
            keys.remove(0);
            if (i18nKeys.contains(key)) {
                temp.put(key, fields.get(key));
                int i = 0;
                while (!keys.isEmpty() && i < keys.size()) {
                    String i18nKey = keys.get(i);
                    if (i18nKey.startsWith(key + ":")) {
                        temp.put(i18nKey, fields.get(i18nKey));
                        keys.remove(i);
                    } else {
                        i++;
                    }
                }
            } else {
                temp.put(key, fields.get(key));
            }
        }
        fields.clear();
        fields.putAll(temp);
    }
public void groupI18nKeys ( List < String > i18nKeys ) { LinkedHashMap < String , PresetField > temp = new LinkedHashMap < > ( ) ; ArrayList < String > keys = new ArrayList < > ( fields . keySet ( ) ) ; while ( ! keys . isEmpty ( ) ) { String key = keys . get ( 0 ) ; keys . remove ( 0 ) ; if ( i18nKeys . contains ( key ) ) { temp . put ( key , fields . get ( key ) ) ; int i = 0 ; while ( ! keys . isEmpty ( ) && i < keys . size ( ) ) { String i18nKey = keys . get ( i ) ; if ( i18nKey . startsWith ( key + ":" ) ) { temp . put ( i18nKey , fields . get ( i18nKey ) ) ; keys . remove ( i ) ; } else { i ++ ; } } } else { temp . put ( key , fields . get ( key ) ) ; } } fields . clear ( ) ; fields . putAll ( temp ) ; }
Arrange any i18n keys that have dynamically been added to this preset
Arrange any i18n keys that have dynamically been added to this preset