aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/settings/CheckECCredentialsPreference.java
blob: 8f7da2cff290dccf79e5e5f4a3e596e4c1d670bc (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
package cgeo.geocaching.settings;

import cgeo.geocaching.connector.ec.ECConnector;
import cgeo.geocaching.connector.ec.ECLogin;
import cgeo.geocaching.enumerations.StatusCode;

import org.apache.commons.lang3.tuple.ImmutablePair;

import rx.Observable;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;

public class CheckECCredentialsPreference extends AbstractCheckCredentialsPreference {

    public CheckECCredentialsPreference(final Context context, final AttributeSet attrs) {
        super(context, attrs);
    }

    public CheckECCredentialsPreference(final Context context, final AttributeSet attrs, final int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected ImmutablePair<String, String> getCredentials() {
        return Settings.getCredentials(ECConnector.getInstance());
    }

    @Override
    protected ImmutablePair<StatusCode, Observable<Drawable>> login() {
        return new ImmutablePair<>(ECLogin.getInstance().login(), null);
    }
}