Esempio n. 1
0
 public boolean back() {
   Mode backMode;
   switch (currMode) {
     case Album:
       backMode = Mode.Artist;
       break;
     case Artist:
       backMode = Mode.Genre;
       break;
     case Genre:
       backMode = null;
       break;
     case Track:
       backMode = Mode.Album;
       break;
     case Dir:
       backMode = Mode.Dir;
       break;
     default:
       throw new RuntimeException(currMode.name() + " not expexted here");
   }
   final List<Filter<? super Tables.Tracks>> filtersAddedByBack = filtersAddWithMode.get(backMode);
   if (backMode == null || filtersAddedByBack.isEmpty()) {
     return true;
   } else {
     final Filter<? super Tables.Tracks> filterAddedByBack =
         filtersAddedByBack.remove(filtersAddedByBack.size() - 1);
     filterList.post(
         new Runnable() {
           public void run() {
             removeFilter(filterAddedByBack);
           }
         });
     change(backMode, null, false);
     return false;
   }
 }