Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class TabDialogFragment extends BaseDialogFragment {

protected final static String ARG_TAB_BUTTON = "tab_button";

protected final static String ARG_CONTENT_PANE_HEIGHT = "content_pane_height";


public static TabDialogBuilder createBuilder(Context context, FragmentManager fragmentManager) {
return new TabDialogBuilder(context, fragmentManager, TabDialogFragment.class);
Expand All @@ -50,6 +52,9 @@ protected BaseDialogFragment.Builder build(BaseDialogFragment.Builder builder) {
if (!TextUtils.isEmpty(title)) {
builder.setTitle(title);
}
final int height = getContentPaneHeight();
if (height > 0)
builder.setContentPaneHeight(height);

final CharSequence subTitle = getSubTitle();
if (!TextUtils.isEmpty(subTitle)) {
Expand Down Expand Up @@ -150,6 +155,10 @@ protected CharSequence[] getTabButtonText() {
return getArguments().getCharSequenceArray(ARG_TAB_BUTTON);
}

protected int getContentPaneHeight() {
return getArguments().getInt(ARG_CONTENT_PANE_HEIGHT);
}


/**
* Get positive button dialog listeners.
Expand Down Expand Up @@ -193,6 +202,7 @@ public static class TabDialogBuilder extends BaseDialogBuilder {
private CharSequence mPositiveButtonText;
private CharSequence mNegativeButtonText;
private CharSequence mNeutralButtonText;
private int mContentPaneHeight;

private CharSequence[] mTabButtonText;

Expand All @@ -206,6 +216,12 @@ protected TabDialogBuilder self() {
return this;
}

public TabDialogBuilder setContentPaneHeight(int height) {
mContentPaneHeight = height;
return this;
}


public TabDialogBuilder setTitle(int titleResourceId) {
mTitle = mContext.getString(titleResourceId);
return this;
Expand Down Expand Up @@ -293,7 +309,11 @@ protected Bundle prepareArguments() {

args.putCharSequenceArray(TabDialogFragment.ARG_TAB_BUTTON, mTabButtonText);

args.putInt(TabDialogFragment.ARG_CONTENT_PANE_HEIGHT, mContentPaneHeight);

return args;
}


}
}