// Path: nimble/src/main/java/com/lenguyenthanh/nimble/NimbleView.java
// public interface NimbleView {
// }
// 
// Path: nimble/src/main/java/com/lenguyenthanh/nimble/NimblePresenter.java
// public interface NimblePresenter<View extends NimbleView> {
//   void takeView(View view);
// 
//   void onSave(Bundle outState);
// 
//   void dropView(View view);
// 
//   void onCreate(Bundle savedInstanceState);
// 
//   void onDestroy();
// }


import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.CallSuper;
import com.lenguyenthanh.nimble.NimbleView;
import com.lenguyenthanh.nimble.NimblePresenter;
/*
 * Copyright 2016 Thanh Le.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.lenguyenthanh.nimble.view;


public abstract class NimbleActivity<V extends NimbleView> extends Activity implements NimbleView {

  abstract protected NimblePresenter<V> presenter();

  abstract protected int layoutId();

  @Override
  @CallSuper
  protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initialize();
    presenter().takeView(getNimbleView());
    presenter().onCreate(savedInstanceState);
  }

  @CallSuper
// Path: nimble/src/main/java/com/lenguyenthanh/nimble/NimbleView.java
// public interface NimbleView {
// }
// 
// Path: nimble/src/main/java/com/lenguyenthanh/nimble/NimblePresenter.java
// public interface NimblePresenter<View extends NimbleView> {
//   void takeView(View view);
// 
//   void onSave(Bundle outState);
// 
//   void dropView(View view);
// 
//   void onCreate(Bundle savedInstanceState);
// 
//   void onDestroy();
// }


// Path: nimble/src/main/java/com/lenguyenthanh/nimble/view/NimbleActivity.java
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.CallSuper;
import com.lenguyenthanh.nimble.NimbleView;
import com.lenguyenthanh.nimble.NimblePresenter;

/*
 * Copyright 2016 Thanh Le.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.lenguyenthanh.nimble.view;


public abstract class NimbleActivity<V extends NimbleView> extends Activity implements NimbleView {

  abstract protected NimblePresenter<V> presenter();

  abstract protected int layoutId();

  @Override
  @CallSuper
  protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initialize();
    presenter().takeView(getNimbleView());
    presenter().onCreate(savedInstanceState);
  }

  @CallSuper
  protected void initialize() {