package lib.morkim.mfw.ui;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.preference.PreferenceFragment;

import lib.morkim.mfw.app.MorkimApp;

@SuppressLint("NewApi")
public abstract class MPreferenceFragment extends PreferenceFragment implements Viewable {
	
	private static final String TAG_CONTROLLER_FRAGMENT = "fragment.controller.fragment.tag";

	protected Navigation navigation;

	protected Controller controller;
	private Presenter presenter;

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
	
		MorkimApp morkimApp = (MorkimApp) activity.getApplication();
		
		navigation = morkimApp.acquireNavigation();

		controller = morkimApp.acquireController(this);
		presenter = morkimApp.acquirePresenter(this);
	}
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
	}

	@Override
	public void onResume() {
		super.onResume();
	}
	
	@Override
	public void onPause() {
		super.onPause();
	}

	protected abstract Controller createController();
}

@@ -163,16 +163,54 @@
 gment;%0A%0A
+import lib.morkim.mfw.app.AppContext;%0A
 import l
@@ -1141,11 +1141,228 @@
 oller();
+%0A%0A%09@Override%0A%09public AppContext getMorkimContext() %7B%0A%09%09return ((Screen) getActivity()).getMorkimContext();%0A%09%7D%0A%0A%09@Override%0A%09public void keepScreenOn(boolean keepOn) %7B%0A%09%09((Screen) getActivity()).keepScreenOn(keepOn);%0A%09%7D
 %0A%7D%0A

Remove view model in presenter