aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/apps/cachelist/LocusCacheListApp.java
blob: b7557c3252b6a5f8aa5f39a0a3a604bc736c8ea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package cgeo.geocaching.apps.cachelist;

import cgeo.geocaching.IGeoData;
import cgeo.geocaching.R;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.apps.AbstractLocusApp;
import cgeo.geocaching.cgCache;

import org.apache.commons.collections.CollectionUtils;

import android.app.Activity;
import android.content.Intent;

import java.util.List;

class LocusCacheListApp extends AbstractLocusApp implements CacheListApp {

    private boolean export;

    public LocusCacheListApp(boolean export) {
        super(getString(export ? R.string.caches_map_locus_export : R.string.caches_map_locus), Intent.ACTION_VIEW);
        this.export = export;
    }

    /**
     * show caches in Locus
     *
     * @see AbstractLocusApp#showInLocus
     * @author koem
     */
    @Override
    public boolean invoke(IGeoData geo, List<cgCache> cacheList, Activity activity, final SearchResult search) {
        if (CollectionUtils.isEmpty(cacheList)) {
            return false;
        }

        showInLocus(cacheList, false, export, activity);

        return true;
    }

}