/*
 * Copyright 2017 Hippo Seven
 *
 * 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.hippo.android.dialog.conductor;

/*
 * Created by Hippo on 4/3/2017.
 */

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.hippo.android.dialog.base.DialogView;
import com.hippo.conductor.dialog.DialogController;

/**
 * A dialog {@link com.bluelinelabs.conductor.Controller} with
 * {@code alertDialogTheme} and {@link DialogView}.
 */
public abstract class AnDialogController extends DialogController {

  @Override
  public int getActualThemeId() {
    final int themeId = getThemeId();
    if (themeId == 0) {
      final TypedValue outValue = new TypedValue();
      getActivity().getTheme().resolveAttribute(R.attr.alertDialogTheme, outValue, true);
      return outValue.resourceId;
    } else {
      return themeId;
    }
  }

  @Nullable
  @Override
  protected final View onCreateContentView
      (@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
    DialogView view = onCreateDialogView(inflater, container);
    view.setDialog(this);
    return view;
  }

  /**
   * Create a {@link DialogView} for this dialog.
   */
  @NonNull
  protected abstract DialogView onCreateDialogView(
      @NonNull LayoutInflater inflater, @NonNull ViewGroup container);
}

@@ -675,16 +675,82 @@
 7.%0A */%0A%0A
+import android.os.Bundle;%0Aimport android.support.annotation.Keep;%0A
 import a
@@ -824,24 +824,68 @@
 n.Nullable;%0A
+import android.support.annotation.StyleRes;%0A
 import andro
@@ -1291,16 +1291,245 @@
 ller %7B%0A%0A
+  public AnDialogController() %7B%7D%0A%0A  public AnDialogController(@StyleRes int themeId) %7B%0A    super(themeId);%0A  %7D%0A%0A  /**%0A   * Do %3Cb%3ENOT%3C/b%3E call it.%0A   */%0A  @Keep%0A  public AnDialogController(Bundle bundle) %7B%0A    super(bundle);%0A  %7D%0A%0A
   @Overr

Add AnDialogController constructors