Example usage for android.support.v4.app DialogFragment STYLE_NO_TITLE

List of usage examples for android.support.v4.app DialogFragment STYLE_NO_TITLE

Introduction

In this page you can find the example usage for android.support.v4.app DialogFragment STYLE_NO_TITLE.

Prototype

int STYLE_NO_TITLE

To view the source code for android.support.v4.app DialogFragment STYLE_NO_TITLE.

Click Source Link

Document

Style for #setStyle(int,int) : don't include a title area.

Usage

From source file:org.openmrs.mobile.activities.dialog.CustomFragmentDialog.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mCustomDialogBundle = (CustomDialogBundle) getArguments()
            .getSerializable(ApplicationConstants.BundleKeys.CUSTOM_DIALOG_BUNDLE);
    if (mCustomDialogBundle.hasLoadingBar()) {
        this.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.LoadingDialogTheme_DialogTheme);
    } else if (mCustomDialogBundle.hasPatientList()) {
        this.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.SimilarPatients_DialogTheme);
    } else {/*from  w ww .  j a  v  a  2  s.  c  om*/
        this.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.DialogTheme);
    }
    this.setRetainInstance(true);
}

From source file:org.xingjitong.ui.CallButton.java

public void onClick(View v) {
    try {/*from  w  w  w.j ava  2 s .  com*/
        if (!LinphoneManager.getInstance().acceptCallIfIncomingPending()) {
            if (app != null)
                phone = app.getCallNum();
            String toaststr = "";
            if (share.getInt(getContext().getString(R.string.setting_reg_uid), 0) == 0) {
                toastdsp(",");
                SettingReg reg = new SettingReg();
                reg.setStyle(DialogFragment.STYLE_NO_TITLE, DialogFragment.STYLE_NORMAL);
                reg.show(LinphoneActivity.instance().getSupportFragmentManager(), "reg");
                return;
            }
            if (!NetWorkUtils.isNetWorkAvailable(getContext())) {
                toastdsp("??,!");
                return;
            }
            if (mAddress.getText().length() == 0 && !"".equals(phone) && phone != null) {
                mAddress.getEditableText().insert(0, phone);
                mAddress.setDisplayedName(phone);
                return;
            }
            if (mAddress.getText().length() < 6) {
                toastdsp("???!");
                return;
            }
            if (!mAddress.getText().toString().startsWith("0") && !mAddress.getText().toString().startsWith("1")
                    && !mAddress.getText().toString().startsWith("+")) {
                toastdsp("??!");
                return;
            }
            //---------------------------------------------------------   
            if (mAddress.getText().length() > 0) {
                if (UserConfig.getInstance().iswecarecall) {
                    if (app != null)
                        app.setCallNum(mAddress.getText().toString());

                    LinphoneManager.getInstance().newOutgoingCall(mAddress); //CallButton

                    UserConfig.getInstance().iswecarecall = false;
                } else {

                    //Toast.makeText(getActivity(), "", Toast.LENGTH_LONG).show();
                    //?
                    if (app != null)
                        app.setCallNum(mAddress.getText().toString());

                    LinphoneManager.getInstance().newOutgoingCall(mAddress); //CallButton

                }
            } else {
                if (getContext().getResources().getBoolean(R.bool.call_last_log_if_adress_is_empty)) {
                    LinphoneCallLog[] logs = LinphoneManager.getLc().getCallLogs();
                    LinphoneCallLog log = null;
                    for (LinphoneCallLog l : logs) {
                        if (l.getDirection() == CallDirection.Outgoing) {
                            log = l;
                            break;
                        }
                    }
                    if (log == null) {
                        return;
                    }

                    LinphoneProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
                    if (lpc != null && log.getTo().getDomain().equals(lpc.getDomain())) {
                        mAddress.setText(log.getTo().getUserName());
                    } else {
                        mAddress.setText(log.getTo().asStringUriOnly());
                    }
                    mAddress.setSelection(mAddress.getText().toString().length());
                    mAddress.setDisplayedName(log.getTo().getDisplayName());
                }
            }
        }
    } catch (LinphoneCoreException e) {
        LinphoneManager.getInstance().terminateCall();
        onWrongDestinationAddress();
    }
    ;
}

From source file:planets.position.Position.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.position);/*from  ww  w .  ja  va  2  s.co  m*/

    dateButton = (Button) findViewById(R.id.pos_date_button);
    timeButton = (Button) findViewById(R.id.pos_time_button);
    nameButton = (Button) findViewById(R.id.pos_name_button);
    pAzText = (TextView) findViewById(R.id.pos_az_text);
    pAltText = (TextView) findViewById(R.id.pos_alt_text);
    pRAText = (TextView) findViewById(R.id.pos_ra_text);
    pDecText = (TextView) findViewById(R.id.pos_dec_text);
    pBelowText = (TextView) findViewById(R.id.pos_below_text);
    pDistText = (TextView) findViewById(R.id.pos_dis_text);
    pMagText = (TextView) findViewById(R.id.pos_mag_text);
    pRiseText = (TextView) findViewById(R.id.pos_riseTime_text);
    pSetText = (TextView) findViewById(R.id.pos_setTime_text);

    // load bundle from previous activity
    bundle = getIntent().getExtras();
    if (bundle != null) {
        offset = bundle.getDouble("Offset", 0);
        g[1] = bundle.getDouble("Lat", 0);
        g[0] = bundle.getDouble("Long", 0);
        g[2] = bundle.getDouble("Elevation", 0);
        planetNum = bundle.getInt("num", -1);
        planetName = bundle.getString("name");
    }

    // get the current date, time
    final Calendar c = Calendar.getInstance();
    mHour = c.get(Calendar.HOUR_OF_DAY);
    mMinute = c.get(Calendar.MINUTE);
    mYear = c.get(Calendar.YEAR);
    mMonth = c.get(Calendar.MONTH);
    mDay = c.get(Calendar.DAY_OF_MONTH);

    // display the current date (this method is below)
    updateDisplay();

    dateButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            dateTimeDialog = DateTimeDialog.newInstance(1, mHour, mMinute, mDay, mMonth, mYear);
            dateTimeDialog.setStyle(DialogFragment.STYLE_NO_TITLE, 0);
            dateTimeDialog.show(getSupportFragmentManager(), "dtDialog");
        }
    });

    nameButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            planetDialog = PlanetListDialog.newInstance(R.array.planets_array, 4, R.string.planet_prompt, 0);
            planetDialog.show(getSupportFragmentManager(), "planetDialog");
        }
    });

    timeButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            dateTimeDialog = DateTimeDialog.newInstance(0, mHour, mMinute, mDay, mMonth, mYear);
            dateTimeDialog.setStyle(DialogFragment.STYLE_NO_TITLE, 0);
            dateTimeDialog.show(getSupportFragmentManager(), "dtDialog");
        }
    });
}

From source file:com.cerema.cloud2.ui.dialog.SamlWebViewDialog.java

@SuppressLint("SetJavaScriptEnabled")
@Override/*from   w  w w. java2  s  . c  o m*/
public void onCreate(Bundle savedInstanceState) {
    Log_OC.v(TAG, "onCreate, savedInstanceState is " + savedInstanceState);
    super.onCreate(savedInstanceState);

    setRetainInstance(true);

    CookieSyncManager.createInstance(getActivity().getApplicationContext());

    if (savedInstanceState == null) {
        mInitialUrl = getArguments().getString(ARG_INITIAL_URL);
        mTargetUrl = getArguments().getString(ARG_TARGET_URL);
    } else {
        mInitialUrl = savedInstanceState.getString(ARG_INITIAL_URL);
        mTargetUrl = savedInstanceState.getString(ARG_TARGET_URL);
    }

    setStyle(DialogFragment.STYLE_NO_TITLE, R.style.Theme_ownCloud_Dialog);
}

From source file:com.synox.android.ui.dialog.SamlWebViewDialog.java

@SuppressLint("SetJavaScriptEnabled")
@Override/* www .  j a  v  a 2 s  . c o m*/
public void onCreate(Bundle savedInstanceState) {
    Log_OC.v(TAG, "onCreate, savedInstanceState is " + savedInstanceState);
    super.onCreate(savedInstanceState);

    setRetainInstance(true);

    CookieSyncManager.createInstance(getActivity().getApplicationContext());

    if (savedInstanceState == null) {
        mInitialUrl = getArguments().getString(ARG_INITIAL_URL);
        mTargetUrl = getArguments().getString(ARG_TARGET_URL);
    } else {
        mInitialUrl = savedInstanceState.getString(ARG_INITIAL_URL);
        mTargetUrl = savedInstanceState.getString(ARG_TARGET_URL);
    }

    setStyle(DialogFragment.STYLE_NO_TITLE, R.style.synox_Dialog);
}

From source file:de.azapps.mirakel.new_ui.fragments.TaskFragment.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Holo_Light_Dialog);
    final Bundle arguments = getArguments();
    task = arguments.getParcelable(ARGUMENT_TASK);
    observer = new MirakelContentObserver(new Handler(Looper.getMainLooper()), getActivity(), Task.URI,
            new MirakelContentObserver.ObserverCallBack() {
                @Override/*  w ww  .j  av  a2  s  . c  o  m*/
                public void handleChange() {
                    updateTask();
                }

                @Override
                public void handleChange(final long id) {
                    updateTask();
                }
            });
    inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
}

From source file:com.owncloud.android.ui.fragment.EditShareFragment.java

/**
 * {@inheritDoc}/*www. j  ava  2  s.co  m*/
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log_OC.d(TAG, "onCreate");
    if (getArguments() != null) {
        mFile = getArguments().getParcelable(ARG_FILE);
        mAccount = getArguments().getParcelable(ARG_ACCOUNT);
        if (savedInstanceState == null) {
            mShare = getArguments().getParcelable(ARG_SHARE);
        } else {
            mShare = savedInstanceState.getParcelable(ARG_SHARE);
        }
        Log_OC.e(TAG, String.format(Locale.getDefault(), "Share has id %1$d remoteId %2$d", mShare.getId(),
                mShare.getRemoteId()));
    }

    setStyle(DialogFragment.STYLE_NO_TITLE, 0);
}

From source file:com.tony.selene.dialog.AbDialogUtil.java

/**
 * // www. j a v a  2s.co  m
 * ???.
 * 
 * @param view
 * @param gravity
 *            ?
 * @param style
 * @param onCancelListener
 *            ?
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int gravity, int style,
        DialogInterface.OnCancelListener onCancelListener) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            style, gravity);
    newFragment.setContentView(view);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.setOnCancelListener(onCancelListener);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

From source file:dev.dworks.widgets.adateslider.PickerDialogFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle args = getArguments();//from   w w  w.j a v  a2s.c om
    if (args != null && args.containsKey(REFERENCE_KEY)) {
        mLayoutID = args.getInt(REFERENCE_KEY);
    }
    if (args != null && args.containsKey(THEME_RES_ID_KEY)) {
        mTheme = args.getInt(THEME_RES_ID_KEY);
    }
    if (args != null && args.containsKey(INITIAL_TIME_KEY)) {
        mInitialTime = (Calendar) args.getSerializable(INITIAL_TIME_KEY);
    }
    if (args != null && args.containsKey(MIN_TIME_KEY)) {
        minTime = (Calendar) args.getSerializable(MIN_TIME_KEY);
    }
    if (args != null && args.containsKey(MAX_TIME_KEY)) {
        maxTime = (Calendar) args.getSerializable(MAX_TIME_KEY);
    }
    if (args != null && args.containsKey(MINUTE_INTERVAL_KEY)) {
        this.minuteInterval = args.getInt(MINUTE_INTERVAL_KEY);
    }

    mInitialTime = Calendar.getInstance(mInitialTime.getTimeZone());
    mInitialTime.setTimeInMillis(mInitialTime.getTimeInMillis());

    if (minuteInterval > 1) {
        int minutes = mInitialTime.get(Calendar.MINUTE);
        int diff = ((minutes + minuteInterval / 2) / minuteInterval) * minuteInterval - minutes;
        mInitialTime.add(Calendar.MINUTE, diff);
    }
    setStyle(DialogFragment.STYLE_NO_TITLE, 0);

    // Init defaults
    mTextColor = getResources().getColorStateList(R.color.dialog_text_color_holo_dark);
    mButtonBackgroundResId = R.drawable.button_background_dark;
    mDividerColor = getResources().getColor(R.color.default_divider_color_dark);
    mDialogBackgroundResId = R.drawable.dialog_full_holo_dark;

    if (savedInstanceState != null) {
        Calendar c = (Calendar) savedInstanceState.getSerializable("time");
        if (c != null) {
            mInitialTime = c;
        }
    }

    if (mTheme != -1) {

        TypedArray a = getActivity().getApplicationContext().obtainStyledAttributes(mTheme,
                R.styleable.PickersDialogFragment);

        mTextColor = a.getColorStateList(R.styleable.PickersDialogFragment_textColor);
        mButtonBackgroundResId = a.getResourceId(R.styleable.PickersDialogFragment_buttonBackground,
                mButtonBackgroundResId);
        mDividerColor = a.getColor(R.styleable.PickersDialogFragment_dividerColor, mDividerColor);
        mDialogBackgroundResId = a.getResourceId(R.styleable.PickersDialogFragment_dialogBackground,
                mDialogBackgroundResId);
        a.recycle();
    }
}

From source file:ru.tlrs.vincent.LightBox.java

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    prevOverlay = isOverlay;//from  w  w w .j a  va  2  s .  c  o  m
    getFields(getArguments());
    if (prevOverlay != isOverlay || prevOverlay == null) {
        if (isOverlay) {
            setStyle(DialogFragment.STYLE_NO_TITLE, R.style.Vincent_Dialog_Overlay);
        } else {
            setStyle(DialogFragment.STYLE_NO_TITLE, R.style.Vincent_Dialog_Modal);
        }
    }
    Log.d(TAG, "onCreate: ");
}