Search in sources :

Example 1 with MapEntry

use of com.amaze.filemanager.utils.MapEntry in project AmazeFileManager by TeamAmaze.

the class SearchTextTask method onPostExecute.

@Override
protected void onPostExecute(final ArrayList<MapEntry> mapEntries) {
    super.onPostExecute(mapEntries);
    for (Map.Entry mapEntry : mapEntries) {
        Map.Entry keyMapEntry = (Map.Entry) mapEntry.getKey();
        if (textEditorActivity.getAppTheme().equals(AppTheme.LIGHT)) {
            mInput.getText().setSpan(new BackgroundColorSpan(Color.YELLOW), (Integer) keyMapEntry.getKey(), (Integer) keyMapEntry.getValue(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        } else {
            mInput.getText().setSpan(new BackgroundColorSpan(Color.LTGRAY), (Integer) keyMapEntry.getKey(), (Integer) keyMapEntry.getValue(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        }
    }
    if (mapEntries.size() != 0) {
        upButton.setEnabled(true);
        downButton.setEnabled(true);
        // downButton
        textEditorActivity.onClick(downButton);
    } else {
        upButton.setEnabled(false);
        downButton.setEnabled(false);
    }
}
Also used : ImmutableEntry(com.amaze.filemanager.utils.ImmutableEntry) MapEntry(com.amaze.filemanager.utils.MapEntry) Map(java.util.Map) BackgroundColorSpan(android.text.style.BackgroundColorSpan)

Aggregations

BackgroundColorSpan (android.text.style.BackgroundColorSpan)1 ImmutableEntry (com.amaze.filemanager.utils.ImmutableEntry)1 MapEntry (com.amaze.filemanager.utils.MapEntry)1 Map (java.util.Map)1