• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ActionMenuItemView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.support.v7.internal.view.menu.ActionMenuItemView的典型用法代码示例。如果您正苦于以下问题:Java ActionMenuItemView类的具体用法?Java ActionMenuItemView怎么用?Java ActionMenuItemView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActionMenuItemView类属于android.support.v7.internal.view.menu包,在下文中一共展示了ActionMenuItemView类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onActivityResult

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        if (requestCode== 1) {
            if (resultCode==RESULT_OK){
                latitude = data.getDoubleExtra("Latitude",0);
                longitude = data.getDoubleExtra("Longitude",0);
                Toast.makeText(this, "Posicion activada", Toast.LENGTH_SHORT).show();
                if(!locSeleccionat){
                    ((ActionMenuItemView) findViewById(R.id.action_selec_location)).setIcon(getResources().getDrawable(R.drawable.ic_place_green_24dp));
                    locSeleccionat = true;
                }
                if(locActivat){
                    ActionMenuItemView menuItem = ((ActionMenuItemView) findViewById(R.id.action_location));
                    menuItem.setIcon(getResources().getDrawable(R.drawable.ic_gps_off_white_24dp));
                    menuItem.setTitle(getResources().getString(R.string.str_activar_loc));
                    locActivat = false;
                }
            } else {
//                Toast.makeText(this, "Resultat incorrecte", Toast.LENGTH_SHORT).show();
            }

        }else{
            Toast.makeText(this, R.string.msg_activity_no_contr, Toast.LENGTH_SHORT).show();
        }
    }
 
开发者ID:syagues,项目名称:Kangapp,代码行数:27,代码来源:PublicarActivity.java


示例2: clickedEdit

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
private void clickedEdit() {
    List<CommonBean> data = DBHelper.getInstance(this).getAllBeans(DBHelper.DB_TABLE_WISH);
    CommonBean commonBean = data.get(ViewPagerSelectedItem);
    EditText editText = (EditText) viewList.get(ViewPagerSelectedItem).findViewById(R.id.my_wishes_details_content_editView);

    if (!EditableFlag) {
        editText.setEnabled(true);
        editText.selectAll();
        ((InputMethodManager)this.getSystemService(INPUT_METHOD_SERVICE)).toggleSoftInputFromWindow(editText.getWindowToken(),InputMethodManager.SHOW_FORCED,0);

        ((ActionMenuItemView) findViewById(R.id.menu_my_wishes_detail_edit)).setIcon(getResources().getDrawable(R.drawable.ic_done_black_24dp));
        EditableFlag = !EditableFlag;
    } else {
        commonBean.setContent(editText.getText().toString());
        commonBean.setPicture(0 + "");
        DBHelper.getInstance(this).updateBean(DBHelper.DB_TABLE_WISH, commonBean.getID(), commonBean);
        editText.setEnabled(false);

        EditableFlag = !EditableFlag;
        ((ActionMenuItemView) findViewById(R.id.menu_my_wishes_detail_edit)).setIcon(getResources().getDrawable(R.drawable.ic_mode_edit_black_24dp));
        Toast.makeText(this, "修改成功", Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:wuapnjie,项目名称:Timer,代码行数:24,代码来源:MyWishDetailsActivity.java


示例3: onPostExecute

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void onPostExecute(VehicleRoutingSolution solution) {
    Log.d(TAG, "Calculation finished.");
    if (fragment != null) {
        Activity activity = fragment.getActivity();
        if (activity != null) {
            ActionMenuItemView item = (ActionMenuItemView) activity.findViewById(R.id.action_run);
            item.setIcon(activity.getResources().getDrawable(R.drawable.ic_play_arrow_white_24dp));
            if (toast != null) {
                toast.cancel();
            }
            toast = Toast.makeText(activity, R.string.calculation_finished, Toast.LENGTH_SHORT);
            toast.show();
            fragment.setVrs(solution);
        }
    }
}
 
开发者ID:tomasdavidorg,项目名称:android-vehicle-routing-problem,代码行数:21,代码来源:VrpSolverTask.java


示例4: bindItemView

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
public final void bindItemView(MenuItemImpl paramMenuItemImpl, MenuView.ItemView paramItemView)
{
  paramItemView.initialize$6b732f7b(paramMenuItemImpl);
  ActionMenuView localActionMenuView = (ActionMenuView)this.mMenuView;
  ActionMenuItemView localActionMenuItemView = (ActionMenuItemView)paramItemView;
  localActionMenuItemView.setItemInvoker(localActionMenuView);
  if (this.mPopupCallback == null) {
    this.mPopupCallback = new ActionMenuPopupCallback((byte)0);
  }
  localActionMenuItemView.setPopupCallback(this.mPopupCallback);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:12,代码来源:ActionMenuPresenter.java


示例5: a

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
public final void a(xp paramxp, yc paramyc)
{
  paramyc.a(paramxp, 0);
  ActionMenuView localActionMenuView = (ActionMenuView)this.e;
  ActionMenuItemView localActionMenuItemView = (ActionMenuItemView)paramyc;
  localActionMenuItemView.b = localActionMenuView;
  if (this.v == null) {
    this.v = new xf(this);
  }
  localActionMenuItemView.c = this.v;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:12,代码来源:acl.java


示例6: onOptionsItemSelected

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    ActionMenuItemView m = (ActionMenuItemView) getActivity().findViewById(R.id.filter);
    Drawable d;
    if (item.getGroupId() == R.id.group_tab_file_sort) {
        SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
        SharedPreferences.Editor e = p.edit();
        switch (item.getItemId()) {
            case R.id.filter_send:
                e.putInt("fileTabShow", 1).commit();
                presenter.showFiles(1);
                d = getIcon(1);
                break;
            case R.id.filter_received:
                e.putInt("fileTabShow", 2).commit();
                presenter.showFiles(2);
                d = getIcon(2);
                break;
            default:
                e.putInt("fileTabShow", 0).commit();
                presenter.showFiles(0);
                d = getIcon(0);
                break;
        }
        m.setIcon(d);
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:weichweich,项目名称:AluShare,代码行数:32,代码来源:FileTabFragment.java


示例7: onOptionsItemSelected

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    Intent intent;

    switch (item.getItemId()) {
        case R.id.action_location:
            if(!locActivat) {
                item.setIcon(getResources().getDrawable(R.drawable.ic_gps_fixed_green_24dp));
                item.setTitle(getResources().getString(R.string.str_desactivar_loc));
                ((ActionMenuItemView) findViewById(R.id.action_selec_location)).setIcon(getResources().getDrawable(R.drawable.ic_place_white_24dp));
                locSeleccionat = false;
                mGoogleApiClient.connect();
            } else {
                item.setIcon(getResources().getDrawable(R.drawable.ic_gps_off_white_24dp));
                item.setTitle(getResources().getString(R.string.str_activar_loc));
                mGoogleApiClient.disconnect();
                Toast.makeText(this, "Localización desactivada", Toast.LENGTH_LONG).show();
            }
            locActivat = !locActivat;
            return true;
        case R.id.action_photos:
            intent = new Intent(getApplicationContext(), UploadToServerActivity.class);
            Bundle bundle = new Bundle();
            bundle.putInt("item_id", itemId);
            intent.putExtras(bundle);
            startActivity(intent);
            return true;
        case R.id.action_selec_location:
            intent = new Intent(getApplicationContext(), SelecLocationActivity.class);
            startActivityForResult(intent, 1);
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:syagues,项目名称:Kangapp,代码行数:36,代码来源:PublicarActivity.java


示例8: colorizeToolbar

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
/**
 * Use this method to colorize toolbar icons to the desired target color
 *
 * @param toolbarView       toolbar view being colored
 * @param toolbarIconsColor the target color of toolbar icons
 * @param activity          reference to activity needed to register observers
 */
public static void colorizeToolbar(Toolbar toolbarView, int toolbarIconsColor, Activity activity) {
    final PorterDuffColorFilter colorFilter
            = new PorterDuffColorFilter(toolbarIconsColor, PorterDuff.Mode.MULTIPLY);

    for (int i = 0; i < toolbarView.getChildCount(); i++) {
        final View v = toolbarView.getChildAt(i);

        //Step 1 : Changing the color of back button (or open drawer button).
        if (v instanceof ImageButton) {
            //Action Bar back button
            ((ImageButton) v).getDrawable().setColorFilter(colorFilter);
        }

        if (v instanceof ActionMenuView) {
            for (int j = 0; j < ((ActionMenuView) v).getChildCount(); j++) {

                //Step 2: Changing the color of any ActionMenuViews - icons that
                //are not back button, nor text, nor overflow menu icon.
                final View innerView = ((ActionMenuView) v).getChildAt(j);

                if (innerView instanceof ActionMenuItemView) {
                    int drawablesCount = ((ActionMenuItemView) innerView).getCompoundDrawables().length;
                    for (int k = 0; k < drawablesCount; k++) {
                        if (((ActionMenuItemView) innerView).getCompoundDrawables()[k] != null) {
                            final int finalK = k;

                            //Important to set the color filter in seperate thread,
                            //by adding it to the message queue
                            //Won't work otherwise.
                            innerView.post(new Runnable() {
                                @Override
                                public void run() {
                                    ((ActionMenuItemView) innerView).getCompoundDrawables()[finalK].setColorFilter(colorFilter);
                                }
                            });
                        }
                    }
                }
            }
        }

        //Step 3: Changing the color of title and subtitle.
        toolbarView.setTitleTextColor(toolbarIconsColor);
        toolbarView.setSubtitleTextColor(toolbarIconsColor);

        //Step 4: Changing the color of the Overflow Menu icon.
        setOverflowButtonColor(activity, colorFilter);
    }


}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:59,代码来源:Utils.java


示例9: getActionAddFriend

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
public ActionMenuItemView getActionAddFriend() {
    return (ActionMenuItemView) findViewById(R.id.action_addfriend);
}
 
开发者ID:CMPUT301F15T05,项目名称:cuddly-quack,代码行数:4,代码来源:MainMenu.java


示例10: colorizeToolbar

import android.support.v7.internal.view.menu.ActionMenuItemView; //导入依赖的package包/类
/**
 * Use this method to colorize toolbar icons to the desired target color
 * @param toolbarView toolbar view being colored
 * @param toolbarIconsColor the target color of toolbar icons
 * @param activity reference to activity needed to register observers
 */
public static void colorizeToolbar(Toolbar toolbarView, int toolbarIconsColor, Activity activity) {

    toolbarIconsColor = activity.getResources().getColor(toolbarIconsColor);

    final PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(toolbarIconsColor, PorterDuff.Mode.MULTIPLY);

    for(int i = 0; i < toolbarView.getChildCount(); i++) {
        final View v = toolbarView.getChildAt(i);

        //Step 1 : Changing the color of back button (or open drawer button).
        if(v instanceof ImageButton) {
            //Action Bar back button
            ((ImageButton)v).getDrawable().setColorFilter(colorFilter);
        }


        if(v instanceof ActionMenuView) {
            for(int j = 0; j < ((ActionMenuView)v).getChildCount(); j++) {

                //Step 2: Changing the color of any ActionMenuViews - icons that are not back button, nor text, nor overflow menu icon.
                //Colorize the ActionViews -> all icons that are NOT: back button | overflow menu
                final View innerView = ((ActionMenuView)v).getChildAt(j);
                if(innerView instanceof ActionMenuItemView) {
                    for(int k = 0; k < ((ActionMenuItemView)innerView).getCompoundDrawables().length; k++) {
                        if(((ActionMenuItemView)innerView).getCompoundDrawables()[k] != null) {
                            final int finalK = k;

                            //Important to set the color filter in seperate thread, by adding it to the message queue
                            //Won't work otherwise.
                            innerView.post(new Runnable() {
                                @Override
                                public void run() {
                                    ((ActionMenuItemView) innerView).getCompoundDrawables()[finalK].setColorFilter(colorFilter);
                                }
                            });
                        }
                    }
                }
            }
        }

        //Step 3: Changing the color of title and subtitle.
        toolbarView.setTitleTextColor(toolbarIconsColor);
        toolbarView.setSubtitleTextColor(toolbarIconsColor);

        //Step 4: Changing the color of the Overflow Menu icon.
        setOverflowButtonColor(activity, colorFilter);
    }
}
 
开发者ID:briansalvattore,项目名称:CustomToolbarAnimation,代码行数:56,代码来源:ToolbarColorizeHelper.java



注:本文中的android.support.v7.internal.view.menu.ActionMenuItemView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BuildData类代码示例发布时间:2022-05-22
下一篇:
Java JacksonMessageBodyProvider类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap