aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/apps/cachelist/AbstractLocusCacheListApp.java
blob: 6411758dfc3f7ac1bb79096dfc89dcf876a1631d (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
package cgeo.geocaching.apps.cachelist;

import cgeo.geocaching.Geocache;
import cgeo.geocaching.R;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.apps.AbstractLocusApp;

import org.apache.commons.collections4.CollectionUtils;

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

import java.util.List;

abstract class AbstractLocusCacheListApp extends AbstractLocusApp implements CacheListApp {

    private boolean export;

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

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

        showInLocus(cacheList, false, export, activity);

        return true;
    }

}