Android Open Source - wifi-auto-forget Auto Forget Wifis Activity






From Project

Back to project page wifi-auto-forget.

License

The source code is released under:

GNU General Public License

If you think the Android project wifi-auto-forget 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

package com.cebesius.wifiautoforget.activity;
/* www.  j ava  2s.  co  m*/
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Window;

import com.cebesius.wifiautoforget.gateway.AutoForgetWifiStorage;
import com.cebesius.wifiautoforget.gateway.UserPreferenceStorage;
import com.cebesius.wifiautoforget.mvp.AutoForgetWifisModel;
import com.cebesius.wifiautoforget.mvp.AutoForgetWifisPresenter;
import com.cebesius.wifiautoforget.mvp.AutoForgetWifisView;
import com.cebesius.wifiautoforget.util.BusPortal;
import com.squareup.otto.Subscribe;

import static com.cebesius.wifiautoforget.mvp.AutoForgetWifisPresenter.*;

/**
 * Activity that hosts the AutoForgetWifis management screen
 */
public class AutoForgetWifisActivity extends Activity {

    private AutoForgetWifisPresenter presenter;
    private AutoForgetWifisModel.ActivityModelProxy modelProxy;
    private AutoForgetWifisView.ActivityViewProxy viewProxy;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        super.onCreate(savedInstanceState);

        // dependencies
        AutoForgetWifiStorage autoForgetWifiStorage = new AutoForgetWifiStorage();
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
        BusPortal busPortal = BusPortal.getInstance();
        AutoForgetWifisModel model = new AutoForgetWifisModel(autoForgetWifiStorage, new UserPreferenceStorage(sharedPreferences), busPortal);
        AutoForgetWifisView view = new AutoForgetWifisView(this, busPortal);

        // MVP
        modelProxy = model.getActivityModelProxy();
        viewProxy = view.getActivityViewProxy();
        presenter = new AutoForgetWifisPresenter(model, view, busPortal);

        if (savedInstanceState != null) {
            modelProxy.restoreState(savedInstanceState);
            viewProxy.restoreState(savedInstanceState);
        }

        viewProxy.onCreateView();
    }

    @Override
    protected void onResume() {
        super.onResume();
        BusPortal.getInstance().register(this);
        BusPortal.getInstance().register(presenter);
        viewProxy.onResume();
        presenter.init();
    }

    @Override
    protected void onPause() {
        super.onPause();
        viewProxy.onPause();
        BusPortal.getInstance().unregister(presenter);
        BusPortal.getInstance().unregister(this);
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        modelProxy.saveState(outState);
        viewProxy.saveState(outState);
    }

    @Subscribe
    public void onRequestStartOnboarding(RequestStartOnboardingEvent event) {
        // TODO: start OnboardingActivity
    }
}




Java Source Code List

antoche.HockeySender.java
com.cebesius.wifiautoforget.Secrets.java
com.cebesius.wifiautoforget.WifiAutoForgetApplication.java
com.cebesius.wifiautoforget.activity.AutoForgetWifisActivity.java
com.cebesius.wifiautoforget.adapter.AutoForgetWifisAdapter.java
com.cebesius.wifiautoforget.dialog.ChangeAutoForgetBehaviorDialog.java
com.cebesius.wifiautoforget.domain.AutoForgetWifi.java
com.cebesius.wifiautoforget.gateway.AddWifiNotificationUsageStorage.java
com.cebesius.wifiautoforget.gateway.AutoForgetWifiStorage.java
com.cebesius.wifiautoforget.gateway.NotificationIds.java
com.cebesius.wifiautoforget.gateway.SharedPreferenceKeys.java
com.cebesius.wifiautoforget.gateway.UserPreferenceStorage.java
com.cebesius.wifiautoforget.model.AutoForgetWifiModel.java
com.cebesius.wifiautoforget.mvp.ActivityView.java
com.cebesius.wifiautoforget.mvp.AddWifiModel.java
com.cebesius.wifiautoforget.mvp.AddWifiPresenter.java
com.cebesius.wifiautoforget.mvp.AddWifiView.java
com.cebesius.wifiautoforget.mvp.AppModel.java
com.cebesius.wifiautoforget.mvp.AppPresenter.java
com.cebesius.wifiautoforget.mvp.AppView.java
com.cebesius.wifiautoforget.mvp.AutoForgetWifisModel.java
com.cebesius.wifiautoforget.mvp.AutoForgetWifisPresenter.java
com.cebesius.wifiautoforget.mvp.AutoForgetWifisView.java
com.cebesius.wifiautoforget.mvp.ConnectivityChangeModel.java
com.cebesius.wifiautoforget.mvp.ConnectivityChangePresenter.java
com.cebesius.wifiautoforget.mvp.ConnectivityChangeView.java
com.cebesius.wifiautoforget.receiver.ConnectivityChangeReceiver.java
com.cebesius.wifiautoforget.service.AddWifiService.java
com.cebesius.wifiautoforget.service.ConnectivityChangeService.java
com.cebesius.wifiautoforget.util.AutoForgetDelegate.java
com.cebesius.wifiautoforget.util.BusPortal.java
com.cebesius.wifiautoforget.widget.AutoForgetWifiItem.java