Search in sources :

Example 1 with Dialog

use of org.holoeverywhere.app.Dialog in project mobile-android by photo.

the class PhotoDetailsEditFragment method updatePhotoDetails.

private void updatePhotoDetails() {
    final ProgressDialogLoadingControl loadingControl = new ProgressDialogLoadingControl(getActivity(), true, false, getString(R.string.updating_photo_message));
    Runnable runOnSuccess = new Runnable() {

        @Override
        public void run() {
            // need to self dismiss on successful editing
            Dialog dialog = PhotoDetailsEditFragment.this.getDialog();
            if (dialog != null && dialog.isShowing()) {
                PhotoDetailsEditFragment.this.dismissAllowingStateLoss();
            }
        }
    };
    PhotoUtils.updatePhoto(photo, titleText.getText().toString(), descriptionText.getText().toString(), TagUtils.getTags(tagsText.getText().toString()), privateSwitch.isChecked(), runOnSuccess, loadingControl);
}
Also used : ProgressDialogLoadingControl(com.trovebox.android.common.util.ProgressDialogLoadingControl) Dialog(org.holoeverywhere.app.Dialog)

Example 2 with Dialog

use of org.holoeverywhere.app.Dialog in project mobile-android by photo.

the class PhotoDetailsEditFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog result = super.onCreateDialog(savedInstanceState);
    result.setTitle(R.string.photo_edit_dialog_title);
    return result;
}
Also used : Dialog(org.holoeverywhere.app.Dialog)

Example 3 with Dialog

use of org.holoeverywhere.app.Dialog in project mobile-android by photo.

the class AlbumCreateFragment method createAlbum.

private void createAlbum() {
    final ProgressDialogLoadingControl loadingControl = new ProgressDialogLoadingControl(getActivity(), true, false, getString(R.string.creating_album_message));
    Runnable runOnSuccess = new Runnable() {

        @Override
        public void run() {
            // need to self dismiss on successful editing
            Dialog dialog = AlbumCreateFragment.this.getDialog();
            if (dialog != null && dialog.isShowing()) {
                AlbumCreateFragment.this.dismissAllowingStateLoss();
            }
        }
    };
    AlbumUtils.createAlbum(titleText.getText().toString(), runOnSuccess, loadingControl);
}
Also used : ProgressDialogLoadingControl(com.trovebox.android.common.util.ProgressDialogLoadingControl) Dialog(org.holoeverywhere.app.Dialog)

Example 4 with Dialog

use of org.holoeverywhere.app.Dialog in project HoloEverywhere by Prototik.

the class PreferenceScreen method showDialog.

@SuppressLint("NewApi")
protected void showDialog(Bundle state) {
    Context preferenceContext = getContext();
    Context context = PreferenceInit.unwrap(getContext());
    final int contextTheme = getThemeResId(context);
    if (mListView != null) {
        mListView.setAdapter(null);
    }
    View childPrefScreen = LayoutInflater.inflate(preferenceContext, R.layout.preference_list_fragment);
    mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
    bind(mListView);
    final CharSequence title = getTitle();
    final boolean titleEmpty = TextUtils.isEmpty(title);
    Dialog dialog = mDialog = new PreferenceDialog(context, contextTheme);
    if (titleEmpty) {
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    } else {
        if (VERSION.SDK_INT >= 11) {
            dialog.requestWindowFeature(Window.FEATURE_ACTION_BAR);
        }
        dialog.setContentView(childPrefScreen);
        dialog.setTitle(title);
    }
    dialog.setOnDismissListener(this);
    onPrepareDialog(dialog);
    if (state != null) {
        dialog.onRestoreInstanceState(state);
    }
    getPreferenceManager().addPreferencesScreen(dialog);
    dialog.show();
}
Also used : Context(android.content.Context) Dialog(org.holoeverywhere.app.Dialog) ListView(org.holoeverywhere.widget.ListView) ActionBarView(android.support.v7.internal.widget.ActionBarView) View(android.view.View) AdapterView(android.widget.AdapterView) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Example 5 with Dialog

use of org.holoeverywhere.app.Dialog in project little-bear-dictionary by daimajia.

the class PreferenceScreen method showDialog.

@SuppressLint("NewApi")
private void showDialog(Bundle state) {
    Context context = getContext();
    if (mListView != null) {
        mListView.setAdapter(null);
    }
    final int theme = getThemeResId(context);
    LayoutInflater inflater = LayoutInflater.from(context);
    View childPrefScreen = inflater.inflate(R.layout.preference_list_fragment, null);
    mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
    bind(mListView);
    final CharSequence title = getTitle();
    final boolean titleEmpty = TextUtils.isEmpty(title);
    Dialog dialog = mDialog = new PreferenceDialog(theme);
    if (titleEmpty) {
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    } else {
        if (VERSION.SDK_INT >= 11) {
            dialog.requestWindowFeature(Window.FEATURE_ACTION_BAR);
        }
        dialog.setContentView(childPrefScreen);
        dialog.setTitle(title);
    }
    dialog.setOnDismissListener(this);
    if (state != null) {
        dialog.onRestoreInstanceState(state);
    }
    getPreferenceManager().addPreferencesScreen(dialog);
    dialog.show();
}
Also used : Context(android.content.Context) Dialog(org.holoeverywhere.app.Dialog) LayoutInflater(org.holoeverywhere.LayoutInflater) ActionBarView(com.actionbarsherlock.internal.widget.ActionBarView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(org.holoeverywhere.widget.ListView) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Aggregations

Dialog (org.holoeverywhere.app.Dialog)10 View (android.view.View)3 SuppressLint (android.annotation.SuppressLint)2 Context (android.content.Context)2 AdapterView (android.widget.AdapterView)2 ProgressDialogLoadingControl (com.trovebox.android.common.util.ProgressDialogLoadingControl)2 ListView (org.holoeverywhere.widget.ListView)2 Cursor (android.database.Cursor)1 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 Parcelable (android.os.Parcelable)1 ViewPager (android.support.v4.view.ViewPager)1 ActionBarView (android.support.v7.internal.widget.ActionBarView)1 TextView (android.widget.TextView)1 ActionBarView (com.actionbarsherlock.internal.widget.ActionBarView)1 TitlePageIndicator (com.viewpagerindicator.TitlePageIndicator)1 QueryAsyncTask (com.zhan_dui.dictionary.asynctasks.QueryAsyncTask)1 IndicatorOnPageChangeListener (com.zhan_dui.dictionary.listeners.IndicatorOnPageChangeListener)1 QueryManageFragmentPager (com.zhan_dui.dictionary.pageradapter.QueryManageFragmentPager)1 LayoutInflater (org.holoeverywhere.LayoutInflater)1