Java Code Examples for android.support.v4.app.DialogFragment#setStyle()

The following examples show how to use android.support.v4.app.DialogFragment#setStyle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SplashActivity.java    From mangosta-android with Apache License 2.0 5 votes vote down vote up
private void createLoginDialog() {
    if (!isFinishing() && !isDestroyed()) {
        DialogFragment fragment = LoginDialogFragment.newInstance();
        fragment.setCancelable(false);
        fragment.setStyle(DialogFragment.STYLE_NO_TITLE, 0);

        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.add(fragment, getString(R.string.title_login));
        fragmentTransaction.commitAllowingStateLoss();
    }
}
 
Example 2
Source File: MainActivity.java    From bitcoinpos with MIT License 5 votes vote down vote up
@Override
// from ItemFragment
public void onListItemClickFragmentInteraction(Item item) {
    DialogFragment myDialog = ItemActionListFragment.newInstance(item.getItemId().toString());
    // for API >= 23 the title is disable by default -- we set a style that enables it
    myDialog.setStyle(DialogFragment.STYLE_NORMAL, R.style.ItemActionListDialogFragment);
    myDialog.show(getSupportFragmentManager(), getString(R.string.item_action_list_dialog_fragment_tag));
}
 
Example 3
Source File: MainActivity.java    From bitcoinpos with MIT License 5 votes vote down vote up
@Override
// from ItemActionListFragment
public void onEditItemAction(int id) {
    // get item from database
    ItemHelper itemHelper = ItemHelper.getInstance(getApplicationContext());
    Item itemToUpdate = itemHelper.get(id);
    if(itemToUpdate != null) {
        DialogFragment myDialog = AddItemDialogFragment.newInstance(id, itemToUpdate.getName(), itemToUpdate.getAmount());
        // for API >= 23 the title is disable by default -- we set a style that enables it
        myDialog.setStyle(DialogFragment.STYLE_NORMAL, R.style.AddItemDialogFragment);
        myDialog.show(getSupportFragmentManager(), getString(R.string.add_item_dialog_fragment_tag));
    }
}
 
Example 4
Source File: ActivityViewData.java    From gsn with GNU General Public License v3.0 5 votes vote down vote up
private void showDialogDetail() {
	String out = getDataOutput();

	DialogFragment newFragment = DetailedDataFragment.newInstance(out);
	newFragment.setStyle(DialogFragment.STYLE_NO_TITLE, 0);
	newFragment.show(getSupportFragmentManager(), "dialog");
}
 
Example 5
Source File: MainActivity.java    From bitcoinpos with MIT License 4 votes vote down vote up
private void showAbout() {
    DialogFragment myDialog = AboutFragment.newInstance();
    // for API >= 23 the title is disable by default -- we set a style that enables it
    myDialog.setStyle(DialogFragment.STYLE_NORMAL, R.style.AboutFragment);
    myDialog.show(getSupportFragmentManager(), getString(R.string.about_fragment_tag));
}
 
Example 6
Source File: ItemFragment.java    From bitcoinpos with MIT License 4 votes vote down vote up
private void getNewItemDetails() {
    DialogFragment myDialog = AddItemDialogFragment.newInstance(-1, "", 0);
    // for API >= 23 the title is disable by default -- we set a style that enables it
    myDialog.setStyle(DialogFragment.STYLE_NORMAL, R.style.AddItemDialogFragment);
    myDialog.show(getFragmentManager(), getString(R.string.add_item_dialog_fragment_tag));
}