1. Java / Говнокод #19079

    −44

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    private void setUpdateTime(String time) {
        if (time.equals("15m")) {
            updateTimePediodInMills = 15 * 60 * 1000;
        } else if (time.equals("30m")) {
            updateTimePediodInMills = 30 * 60 * 1000;
        } else if (time.equals("1h")) {
            updateTimePediodInMills = 60 * 60 * 1000;
        } else if (time.equals("2h")) {
            updateTimePediodInMills = 2 * 60 * 60 * 1000;
        } else if (time.equals("1d")) {
            updateTimePediodInMills = 24 * 60 * 60 * 1000;
        }
        SpannableString sb = new SpannableString(
                getString(R.string.update_time) + "\n" + getLocolizedUpdateTime(time));
        sb.setSpan(new TextAppearanceSpan("sans-serif", 0, 42,
                        getResources().getColorStateList(R.color.description_color),
                        getResources().getColorStateList(R.color.description_color)),
                getString(R.string.update_time).length() + 1, sb.length(),
                Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
        mUpdateTime.setText(sb);
    }
    
    private String getLocolizedUpdateTime(String time) {
        if (time.equals("15m")) {
            return "15" + getString(R.string.m);
        } else if (time.equals("30m")) {
            return "30" + getString(R.string.m);
        } else if (time.equals("1h")) {
            return "1" + getString(R.string.h);
        } else if (time.equals("2h")) {
            return "2" + getString(R.string.h);
        } else if (time.equals("1d")) {
            return "1" + getString(R.string.d);
        }
        return "";
    }

    И это не шутка!

    Запостил: AndroidGovno, 24 Ноября 2015

    Комментарии (1) RSS

    Добавить комментарий