   :classname GridView
   :traits [:on-item-click])
 
+(defn hide-solved-problem? [a]
+  (-> (neko.data/get-shared-preferences a "4clojure" :private)
+      like-map
+      :hide-solved?))
+
 (defn refresh-ui [a]
   (let [user (:user (like-map (.getIntent a)))]
     (doto (.getAdapter (find-view a ::problems-gv))
-      (.changeCursor (db/get-problems-cursor a user true))
+      (.changeCursor (db/get-problems-cursor
+                      a user (not (hide-solved-problem? a))))
       (.notifyDataSetChanged))
     (.invalidateOptionsMenu a)))
 

           (when-let [json (assoc (api/fetch-problem problem-id)
                             "id" problem-id)]
             (db/insert-problem a json)))
         (when (pos? (count new-ids))
           (on-ui (toast (format "Downloaded %d new problems."
                                 (count new-ids)))))))
     (on-ui (refresh-ui a)))))

;; (reload-from-server (*a))

     (let [user (:user (like-map (.getIntent this)))
           online? (api/logged-in?)]
       (menu/make-menu
        menu [[:item {:title "Show solved"
                      :show-as-action :never
                      :checkable true
                      :checked (not (hide-solved-problem? this))
                      :on-click (fn [_] (safe-for-ui (toggle-hide-solved this)))}]
              [:item {:title "Reload"
                      :icon #res/drawable :org.bytopia.foreclojure/ic-menu-refresh
                      :show-as-action :always
                      :on-click (fn [_] (safe-for-ui (reload-from-server this)))}]
              [:item {:title (format "%s (%s)" user
                                     (if online? "online" "offline"))
                      :icon #res/drawable :org.bytopia.foreclojure/ic-menu-friendslist
                      :show-as-action [:always :with-text]
                      :on-click (fn [_] (safe-for-ui (switch-user this)))}]])))))

