Search in sources :

Example 16 with ActionMode

use of android.support.v7.view.ActionMode in project HoloEverywhere by Prototik.

the class ActionBarContextView method initForMode.

public void initForMode(final ActionMode mode) {
    if (mClose == null) {
        LayoutInflater inflater = LayoutInflater.from(getContext());
        mClose = inflater.inflate(R.layout.abc_action_mode_close_item, this, false);
        addView(mClose);
    } else if (mClose.getParent() == null) {
        addView(mClose);
    }
    View closeButton = mClose.findViewById(R.id.action_mode_close_button);
    closeButton.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            mode.finish();
        }
    });
    final MenuBuilder menu = (MenuBuilder) mode.getMenu();
    if (mActionMenuPresenter != null) {
        mActionMenuPresenter.dismissPopupMenus();
    }
    mActionMenuPresenter = new ActionMenuPresenter(getContext());
    mActionMenuPresenter.setReserveOverflow(true);
    final ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.FILL_PARENT);
    if (!mSplitActionBar) {
        menu.addMenuPresenter(mActionMenuPresenter);
        mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
        mMenuView.setBackgroundDrawable(null);
        addView(mMenuView, layoutParams);
    } else {
        // Allow full screen width in split mode.
        mActionMenuPresenter.setWidthLimit(getContext().getResources().getDisplayMetrics().widthPixels, true);
        // No limit to the item count; use whatever will fit.
        mActionMenuPresenter.setItemLimit(Integer.MAX_VALUE);
        // Span the whole width
        layoutParams.width = ViewGroup.LayoutParams.FILL_PARENT;
        layoutParams.height = mContentHeight;
        menu.addMenuPresenter(mActionMenuPresenter);
        mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
        mMenuView.setBackgroundDrawable(mSplitBackground);
        mSplitView.addView(mMenuView, layoutParams);
    }
}
Also used : ViewGroup(android.view.ViewGroup) LayoutInflater(org.holoeverywhere.LayoutInflater) ActionMenuView(android.support.v7.internal.view.menu.ActionMenuView) TextView(org.holoeverywhere.widget.TextView) View(android.view.View) MenuBuilder(android.support.v7.internal.view.menu.MenuBuilder) ActionMenuPresenter(android.support.v7.internal.view.menu.ActionMenuPresenter)

Example 17 with ActionMode

use of android.support.v7.view.ActionMode in project Signal-Android by WhisperSystems.

the class ConversationListFragment method handleDeleteAllSelected.

private void handleDeleteAllSelected() {
    int conversationsCount = getListAdapter().getBatchSelections().size();
    AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
    alert.setIconAttribute(R.attr.dialog_alert_icon);
    alert.setTitle(getActivity().getResources().getQuantityString(R.plurals.ConversationListFragment_delete_selected_conversations, conversationsCount, conversationsCount));
    alert.setMessage(getActivity().getResources().getQuantityString(R.plurals.ConversationListFragment_this_will_permanently_delete_all_n_selected_conversations, conversationsCount, conversationsCount));
    alert.setCancelable(true);
    alert.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            final Set<Long> selectedConversations = (getListAdapter()).getBatchSelections();
            if (!selectedConversations.isEmpty()) {
                new AsyncTask<Void, Void, Void>() {

                    private ProgressDialog dialog;

                    @Override
                    protected void onPreExecute() {
                        dialog = ProgressDialog.show(getActivity(), getActivity().getString(R.string.ConversationListFragment_deleting), getActivity().getString(R.string.ConversationListFragment_deleting_selected_conversations), true, false);
                    }

                    @Override
                    protected Void doInBackground(Void... params) {
                        DatabaseFactory.getThreadDatabase(getActivity()).deleteConversations(selectedConversations);
                        MessageNotifier.updateNotification(getActivity(), masterSecret);
                        return null;
                    }

                    @Override
                    protected void onPostExecute(Void result) {
                        dialog.dismiss();
                        if (actionMode != null) {
                            actionMode.finish();
                            actionMode = null;
                        }
                    }
                }.execute();
            }
        }
    });
    alert.setNegativeButton(android.R.string.cancel, null);
    alert.show();
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) Set(java.util.Set) HashSet(java.util.HashSet) DialogInterface(android.content.DialogInterface) AsyncTask(android.os.AsyncTask) SnackbarAsyncTask(org.thoughtcrime.securesms.util.task.SnackbarAsyncTask) ProgressDialog(android.app.ProgressDialog) Paint(android.graphics.Paint)

Example 18 with ActionMode

use of android.support.v7.view.ActionMode in project Shuttle by timusus.

the class DetailFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.fragment_detail, container, false);
    recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerView);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    recyclerView.setAdapter(adapter);
    if (canEdit()) {
        itemTouchHelper = new ItemTouchHelper(new ItemTouchHelperCallback((from, to) -> {
            long songViewCount = Stream.of(adapter.items).filter(adaptableItem -> adaptableItem instanceof SongView).count();
            int offset = (int) (adapter.getItemCount() - songViewCount);
            if (to >= offset) {
                adapter.moveItem(from, to);
            }
        }, (from, to) -> {
            // The 'offset' here is the number of items in the list which are not
            // SongViews. We need this to determine the actual playlist positions of the items.
            long songViewCount = Stream.of(adapter.items).filter(adaptableItem -> adaptableItem instanceof SongView).count();
            int offset = (int) (adapter.getItemCount() - songViewCount);
            from -= offset;
            to -= offset;
            try {
                MediaStore.Audio.Playlists.Members.moveItem(getActivity().getContentResolver(), playlist.id, from, to);
            } catch (IllegalArgumentException e) {
                CrashlyticsCore.getInstance().log(String.format("Failed to move playlist item from %s to %s. Adapter count: %s. Error:%s", from, to, adapter.getItemCount(), e.getMessage()));
            }
        }, null));
        itemTouchHelper.attachToRecyclerView(recyclerView);
    }
    fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
    fab.setOnClickListener(this);
    lineOne = (TextView) rootView.findViewById(R.id.line_one);
    lineTwo = (TextView) rootView.findViewById(R.id.line_two);
    overflowButton = (NonScrollImageButton) rootView.findViewById(R.id.btn_overflow);
    overflowButton.setOnClickListener(this);
    if (albumArtist != null) {
        lineOne.setText(albumArtist.name);
        overflowButton.setContentDescription(getString(R.string.btn_options, albumArtist.name));
    } else if (album != null) {
        lineOne.setText(album.name);
        overflowButton.setContentDescription(getString(R.string.btn_options, album.name));
    } else if (genre != null) {
        lineOne.setText(genre.name);
        overflowButton.setVisibility(View.GONE);
    } else if (playlist != null) {
        lineOne.setText(playlist.name);
        overflowButton.setContentDescription(getString(R.string.btn_options, playlist.name));
    }
    textProtectionScrim = rootView.findViewById(R.id.textProtectionScrim);
    headerImageView = (ImageView) rootView.findViewById(R.id.background);
    String transitionName = getArguments().getString(ARG_TRANSITION_NAME);
    ViewCompat.setTransitionName(headerImageView, transitionName);
    if (transitionName != null) {
        textProtectionScrim.setVisibility(View.GONE);
        fab.setVisibility(View.GONE);
    }
    int width = ResourceUtils.getScreenSize().width + ResourceUtils.toPixels(60);
    int height = getResources().getDimensionPixelSize(R.dimen.header_view_height);
    if (albumArtist != null || album != null) {
        requestManager.load(albumArtist == null ? album : albumArtist).override(width, height).diskCacheStrategy(DiskCacheStrategy.SOURCE).priority(Priority.HIGH).placeholder(GlideUtils.getPlaceHolderDrawable(albumArtist == null ? album.name : albumArtist.name, false)).centerCrop().animate(new AlwaysCrossFade(false)).into(headerImageView);
    }
    actionMode = null;
    //Set the RecyclerView HeaderView height equal to the headerItem height
    headerView = rootView.findViewById(R.id.headerView);
    headerView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {

        @Override
        public void onGlobalLayout() {
            headerView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            DetailFragment.this.headerItem.height = headerView.getHeight();
        }
    });
    recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            headerTranslation = headerView.getTranslationY() - dy;
            headerImageTranslation = headerImageView.getTranslationY() + dy / 2;
            //the header translation.
            if (headerTranslation == 0) {
                headerImageTranslation = 0;
            }
            float ratio = Math.min(1, -headerTranslation / headerView.getHeight());
            headerView.setTranslationY(headerTranslation);
            headerImageView.setTranslationY(headerImageTranslation);
            //when recreating this fragment.
            if (getActivity() != null) {
                if (((MainActivity) getActivity()).canSetAlpha()) {
                    ((MainActivity) getActivity()).setActionBarAlpha(ratio, true);
                }
            }
        }
    });
    themeUIComponents();
    headerView.setTranslationY(headerTranslation);
    headerImageView.setTranslationY(headerImageTranslation);
    return rootView;
}
Also used : ModalMultiSelectorCallback(com.bignerdranch.android.multiselector.ModalMultiSelectorCallback) R(com.simplecity.amp_library.R) Genre(com.simplecity.amp_library.model.Genre) Bundle(android.os.Bundle) SongView(com.simplecity.amp_library.ui.modelviews.SongView) CrashlyticsCore(com.crashlytics.android.core.CrashlyticsCore) PlaylistUtils(com.simplecity.amp_library.utils.PlaylistUtils) Uri(android.net.Uri) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) AndroidSchedulers(rx.android.schedulers.AndroidSchedulers) Random(java.util.Random) ItemAdapter(com.simplecity.amp_library.ui.adapters.ItemAdapter) ColorStateList(android.content.res.ColorStateList) Song(com.simplecity.amp_library.model.Song) Priority(com.bumptech.glide.Priority) RequestManager(com.bumptech.glide.RequestManager) HorizontalAlbumView(com.simplecity.amp_library.ui.modelviews.HorizontalAlbumView) MediaStore(android.provider.MediaStore) ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) MenuUtils(com.simplecity.amp_library.utils.MenuUtils) Schedulers(rx.schedulers.Schedulers) View(android.view.View) DetailAdapter(com.simplecity.amp_library.ui.adapters.DetailAdapter) ResourceUtils(com.simplecity.amp_library.utils.ResourceUtils) ViewCompat(android.support.v4.view.ViewCompat) Transition(android.transition.Transition) PreferenceManager(android.preference.PreferenceManager) ItemTouchHelperCallback(com.simplecity.amp_library.ui.recyclerview.ItemTouchHelperCallback) FloatingActionButton(android.support.design.widget.FloatingActionButton) SortManager(com.simplecity.amp_library.utils.SortManager) ActionMode(android.support.v7.view.ActionMode) Playlist(com.simplecity.amp_library.model.Playlist) MainActivity(com.simplecity.amp_library.ui.activities.MainActivity) ObjectAnimator(android.animation.ObjectAnimator) IntentFilter(android.content.IntentFilter) PopupMenu(android.support.v7.widget.PopupMenu) SubMenu(android.view.SubMenu) BroadcastReceiver(android.content.BroadcastReceiver) AppCompatActivity(android.support.v7.app.AppCompatActivity) ViewGroup(android.view.ViewGroup) BaseAdaptableItem(com.simplecity.amp_library.ui.modelviews.BaseAdaptableItem) NonScrollImageButton(com.simplecity.amp_library.ui.views.NonScrollImageButton) Serializable(java.io.Serializable) MusicUtils(com.simplecity.amp_library.utils.MusicUtils) List(java.util.List) TextView(android.widget.TextView) PermissionUtils(com.simplecity.amp_library.utils.PermissionUtils) GlideUtils(com.simplecity.amp_library.glide.utils.GlideUtils) AdaptableItem(com.simplecity.amp_library.model.AdaptableItem) Subscription(rx.Subscription) Context(android.content.Context) Album(com.simplecity.amp_library.model.Album) Stream(com.annimon.stream.Stream) EmptyView(com.simplecity.amp_library.ui.modelviews.EmptyView) DrawableUtils(com.simplecity.amp_library.utils.DrawableUtils) Intent(android.content.Intent) StringUtils(com.simplecity.amp_library.utils.StringUtils) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) Observable(rx.Observable) ThemeUtils(com.simplecity.amp_library.utils.ThemeUtils) ColorUtils(com.simplecity.amp_library.utils.ColorUtils) MenuInflater(android.view.MenuInflater) Toast(android.widget.Toast) DiskCacheStrategy(com.bumptech.glide.load.engine.DiskCacheStrategy) Menu(android.view.Menu) AnimatorSet(android.animation.AnimatorSet) WeakReference(java.lang.ref.WeakReference) ShuttleUtils(com.simplecity.amp_library.utils.ShuttleUtils) SharedElementCallback(android.support.v4.app.SharedElementCallback) AlwaysCrossFade(com.simplecity.amp_library.glide.utils.AlwaysCrossFade) ViewType(com.simplecity.amp_library.ui.modelviews.ViewType) Collectors(com.annimon.stream.Collectors) LayoutInflater(android.view.LayoutInflater) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DiscNumberView(com.simplecity.amp_library.ui.modelviews.DiscNumberView) DialogUtils(com.simplecity.amp_library.utils.DialogUtils) TimeUnit(java.util.concurrent.TimeUnit) CompositeSubscription(rx.subscriptions.CompositeSubscription) RecyclerView(android.support.v7.widget.RecyclerView) BlacklistHelper(com.simplecity.amp_library.sql.databases.BlacklistHelper) Glide(com.bumptech.glide.Glide) SharedPreferences(android.content.SharedPreferences) HorizontalRecyclerView(com.simplecity.amp_library.ui.modelviews.HorizontalRecyclerView) OvershootInterpolator(android.view.animation.OvershootInterpolator) MultiSelector(com.bignerdranch.android.multiselector.MultiSelector) ComparisonUtils(com.simplecity.amp_library.utils.ComparisonUtils) ViewTreeObserver(android.view.ViewTreeObserver) DataManager(com.simplecity.amp_library.utils.DataManager) AlbumArtist(com.simplecity.amp_library.model.AlbumArtist) Operators(com.simplecity.amp_library.utils.Operators) Collections(java.util.Collections) ContentUris(android.content.ContentUris) SongView(com.simplecity.amp_library.ui.modelviews.SongView) AlwaysCrossFade(com.simplecity.amp_library.glide.utils.AlwaysCrossFade) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ItemTouchHelperCallback(com.simplecity.amp_library.ui.recyclerview.ItemTouchHelperCallback) ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) RecyclerView(android.support.v7.widget.RecyclerView) HorizontalRecyclerView(com.simplecity.amp_library.ui.modelviews.HorizontalRecyclerView) ViewTreeObserver(android.view.ViewTreeObserver)

Example 19 with ActionMode

use of android.support.v7.view.ActionMode in project RoboBinding-gallery by RoboBinding.

the class ContextualActionModeActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MemoryProductStore productStore = MemoryProductStore.getInstance();
    productStore.reset();
    presentationModel = new ContextualActionModePresentationModel(productStore);
    initializeContentView(R.layout.activity_contextual_action_mode, presentationModel);
    ListView productListView = (ListView) findViewById(R.id.productList);
    productListView.setOnItemLongClickListener(new OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            startSupportActionMode(new ActionMode.Callback() {

                @Override
                public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
                    return false;
                }

                @Override
                public void onDestroyActionMode(ActionMode actionMode) {
                }

                @Override
                public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
                    MenuBinder menuBinder = createMenuBinder(menu, getMenuInflater());
                    menuBinder.inflateAndBind(R.menu.contextual_action_mode, presentationModel);
                    return true;
                }

                @Override
                public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
                    return false;
                }
            });
            return true;
        }
    });
}
Also used : MemoryProductStore(org.robobinding.gallery.model.MemoryProductStore) MenuBinder(org.robobinding.MenuBinder) MenuItem(android.view.MenuItem) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) OnItemLongClickListener(android.widget.AdapterView.OnItemLongClickListener) ContextualActionModePresentationModel(org.robobinding.gallery.presentationmodel.ContextualActionModePresentationModel) ListView(android.widget.ListView) ActionMode(android.support.v7.view.ActionMode) Menu(android.view.Menu)

Example 20 with ActionMode

use of android.support.v7.view.ActionMode in project ForPDA by RadiationX.

the class ThemeFragmentWeb method addShowingView.

@SuppressLint("SetJavaScriptEnabled")
@Override
protected void addShowingView() {
    messagePanel.setHeightChangeListener(newHeight -> {
        webView.setPaddingBottom(newHeight);
    });
    webView = getMainActivity().getWebViewsProvider().pull(getContext());
    attachWebView(webView);
    webView.setJsLifeCycleListener(this);
    refreshLayout.addView(webView);
    refreshLayoutLongTrigger(refreshLayout);
    webView.addJavascriptInterface(this, JS_INTERFACE);
    webView.addJavascriptInterface(this, JS_POSTS_FUNCTIONS);
    registerForContextMenu(webView);
    fab.setOnClickListener(v -> {
        if (webView.getDirection() == ExtendedWebView.DIRECTION_DOWN) {
            webView.pageDown(true);
        } else if (webView.getDirection() == ExtendedWebView.DIRECTION_UP) {
            webView.pageUp(true);
        }
    });
    webView.setOnDirectionListener(direction -> {
        if (webView.getDirection() == ExtendedWebView.DIRECTION_DOWN) {
            fab.setImageDrawable(App.getVecDrawable(fab.getContext(), R.drawable.ic_arrow_down));
        } else if (webView.getDirection() == ExtendedWebView.DIRECTION_UP) {
            fab.setImageDrawable(App.getVecDrawable(fab.getContext(), R.drawable.ic_arrow_up));
        }
    });
    // Кастомизация менюхи при выделении текста
    webView.setActionModeListener((actionMode, callback, type) -> {
        Menu menu = actionMode.getMenu();
        ArrayList<MenuItem> items = new ArrayList<>();
        for (int i = 0; i < menu.size(); i++) {
            items.add(menu.getItem(i));
        }
        menu.clear();
        menu.add(R.string.copy).setIcon(App.getVecDrawable(getContext(), R.drawable.ic_toolbar_content_copy)).setOnMenuItemClickListener(item -> {
            webView.evalJs("copySelectedText()");
            actionMode.finish();
            return true;
        }).setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS);
        if (currentPage.canQuote())
            menu.add(R.string.quote).setIcon(App.getVecDrawable(getContext(), R.drawable.ic_toolbar_quote_post)).setOnMenuItemClickListener(item -> {
                webView.evalJs("selectionToQuote()");
                actionMode.finish();
                return true;
            }).setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS);
        menu.add(R.string.all_text).setIcon(App.getVecDrawable(getContext(), R.drawable.ic_toolbar_select_all)).setOnMenuItemClickListener(item -> {
            webView.evalJs("selectAllPostText()");
            return true;
        }).setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS);
        menu.add(R.string.share).setIcon(App.getVecDrawable(getContext(), R.drawable.ic_toolbar_share)).setOnMenuItemClickListener(item -> {
            webView.evalJs("shareSelectedText()");
            return true;
        }).setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS);
        for (MenuItem item : items) {
            if (item.getIntent() != null) {
                menu.add(item.getGroupId(), item.getItemId(), item.getOrder(), item.getTitle()).setIntent(item.getIntent()).setNumericShortcut(item.getNumericShortcut()).setAlphabeticShortcut(item.getAlphabeticShortcut());
            }
        }
    });
}
Also used : JavascriptInterface(android.webkit.JavascriptInterface) ThemePost(forpdateam.ru.forpda.api.theme.models.ThemePost) Theme(forpdateam.ru.forpda.api.theme.Theme) Utils(forpdateam.ru.forpda.common.Utils) Uri(android.net.Uri) Pair(android.util.Pair) MenuItem(android.view.MenuItem) ArrayList(java.util.ArrayList) ExtendedWebView(forpdateam.ru.forpda.ui.views.ExtendedWebView) SuppressLint(android.annotation.SuppressLint) ACRA(org.acra.ACRA) Matcher(java.util.regex.Matcher) Menu(android.view.Menu) WebViewClient(android.webkit.WebViewClient) IBaseForumPost(forpdateam.ru.forpda.api.IBaseForumPost) CustomWebViewClient(forpdateam.ru.forpda.common.webview.CustomWebViewClient) WebView(android.webkit.WebView) Log(android.util.Log) WebChromeClient(android.webkit.WebChromeClient) IntentHandler(forpdateam.ru.forpda.common.IntentHandler) IPostFunctions(forpdateam.ru.forpda.common.webview.jsinterfaces.IPostFunctions) ThemePage(forpdateam.ru.forpda.api.theme.models.ThemePage) AlertDialog(android.support.v7.app.AlertDialog) ImageViewerActivity(forpdateam.ru.forpda.ui.activities.imageviewer.ImageViewerActivity) Bitmap(android.graphics.Bitmap) CustomWebChromeClient(forpdateam.ru.forpda.common.webview.CustomWebChromeClient) App(forpdateam.ru.forpda.App) Pattern(java.util.regex.Pattern) R(forpdateam.ru.forpda.R) ArrayList(java.util.ArrayList) MenuItem(android.view.MenuItem) Menu(android.view.Menu) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Aggregations

ActionMode (android.support.v7.view.ActionMode)15 Menu (android.view.Menu)11 MenuItem (android.view.MenuItem)11 View (android.view.View)10 AlertDialog (android.support.v7.app.AlertDialog)8 DialogInterface (android.content.DialogInterface)6 Context (android.content.Context)5 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)5 RecyclerView (android.support.v7.widget.RecyclerView)5 Toolbar (android.support.v7.widget.Toolbar)5 ArrayList (java.util.ArrayList)5 Bundle (android.os.Bundle)4 ImageView (android.widget.ImageView)4 TextView (android.widget.TextView)4 SuppressLint (android.annotation.SuppressLint)3 Intent (android.content.Intent)3 FastAdapter (com.mikepenz.fastadapter.FastAdapter)3 ActionModeHelper (com.mikepenz.fastadapter_extensions.ActionModeHelper)3 MaterializeBuilder (com.mikepenz.materialize.MaterializeBuilder)3 AlertDialog (android.app.AlertDialog)2