Android Open Source - WearPomodoro Service Provider






From Project

Back to project page WearPomodoro.

License

The source code is released under:

GNU General Public License

If you think the Android project WearPomodoro listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2014 Alex Korovyansky.//w  ww .  j  ava2s.  c om
 */
package com.alexkorovyansky.wearpomodoro.helpers;

import android.content.Context;

public class ServiceProvider {

    private static ServiceProvider instance = new ServiceProvider();
    private PersistentStorage persistentStorage;
    private UITimer uiTimer;
    private PomodoroMaster pomodoroMaster;

    public static ServiceProvider getInstance() {
        return instance;
    }

    private PersistentStorage getPersistentStorage(Context context) {
        if (persistentStorage == null) {
            persistentStorage = new PersistentStorage(context.getApplicationContext());
        }
        return persistentStorage;
    }

    public PomodoroMaster getPomodoroMaster(Context context) {
        if (pomodoroMaster == null) {
            pomodoroMaster = new PomodoroMaster(context.getApplicationContext(), getPersistentStorage(context));
        }
        return pomodoroMaster;
    }

    public UITimer getUITimer() {
        if (uiTimer == null) {
            uiTimer = new UITimer();
        }
        return uiTimer;
    }

    private ServiceProvider() {
    }
}




Java Source Code List

com.alexkorovyansky.wearpomodoro.app.MainActivity.java
com.alexkorovyansky.wearpomodoro.app.PomodoroConstants.java
com.alexkorovyansky.wearpomodoro.app.base.BasePomodoroActivity.java
com.alexkorovyansky.wearpomodoro.app.receivers.PomodoroAlarmReceiver.java
com.alexkorovyansky.wearpomodoro.app.receivers.PomodoroAlarmTickReceiver.java
com.alexkorovyansky.wearpomodoro.app.receivers.PomodoroControlReceiver.java
com.alexkorovyansky.wearpomodoro.app.services.PomodoroNotificationService.java
com.alexkorovyansky.wearpomodoro.app.ui.PomodoroEntryActivity.java
com.alexkorovyansky.wearpomodoro.app.ui.PomodoroTransitionActivity.java
com.alexkorovyansky.wearpomodoro.helpers.PersistentStorage.java
com.alexkorovyansky.wearpomodoro.helpers.PomodoroMaster.java
com.alexkorovyansky.wearpomodoro.helpers.PomodoroUtils.java
com.alexkorovyansky.wearpomodoro.helpers.ServiceProvider.java
com.alexkorovyansky.wearpomodoro.helpers.UITimer.java
com.alexkorovyansky.wearpomodoro.helpers.WakefulBroadcastReceiver.java
com.alexkorovyansky.wearpomodoro.model.ActivityType.java