Android 悬浮窗菜单 FloatMenuSample

码农软件 · 软件分类 · Android UI 组件 · 2019-04-24 23:29:33

软件介绍

Android 悬浮窗菜单,可在launcher或app中使用。


示例代码:

@Override
public void onCreate() {
    super.onCreate();
    mFloatMenu = new FloatMenu.Builder(this)
            .floatLoader(R.drawable.yw_anim_background)
            .floatLogo(R.drawable.yw_image_float_logo)
            .addMenuItem(android.R.color.transparent, R.drawable.yw_menu_account, Const.MENU_ITEMS[0], android.R.color.black, this)
            .addMenuItem(android.R.color.transparent, R.drawable.yw_menu_favour, Const.MENU_ITEMS[1], android.R.color.black, this)
            .addMenuItem(android.R.color.transparent, R.drawable.yw_menu_fb, Const.MENU_ITEMS[2], android.R.color.black, this)
            .addMenuItem(android.R.color.transparent, R.drawable.yw_menu_msg, Const.MENU_ITEMS[3], android.R.color.black, this)
            .addMenuItem(android.R.color.transparent, R.drawable.yw_menu_close, Const.MENU_ITEMS[4], android.R.color.black, this)
            .menuBackground(R.drawable.yw_menu_bg)
            .onMenuActionListner(this)
            .build();
    mFloatMenu.show();
}


public void showFloat() {
    if (mFloatMenu != null)
        mFloatMenu.show();
}

public void hideFloat() {
    if (mFloatMenu != null) {
        mFloatMenu.hide();
    }
}

public void destroyFloat() {
    hideFloat();
    if (mFloatMenu != null) {
        mFloatMenu.destroy();
    }
    mFloatMenu = null;
}

 private void showRed() {
    if (!hasNewMsg) {
        mFloatMenu.changeLogo(R.drawable.yw_image_float_logo, R.drawable.yw_menu_msg, 3);
    } else {
        mFloatMenu.changeLogo(R.drawable.yw_image_float_logo_red, R.drawable.yw_menu_msg_red, 3);
    }
}

本文地址:https://codercto.com/soft/d/4322.html

Processing语言权威指南

Processing语言权威指南

Casey Reas、Ben Fry / 张静 / 电子工业出版社 / 2013-10-1 / 139.00

本书介绍了可视化艺术中的计算机编程概念,对开源编程语言Processing作了非常详尽的阐述。学生、艺术家、设计师、建筑师、研究者,以及任何想编程实现绘画、动画和互动的人都可以使用它。书中的大部分章节是短小的单元,介绍Processing的语法和基本概念(变量、函数、面向对象编程),涵盖与软件相关的图像处理、绘制,并且给出了大量简短的原型程序,配以相应的过程图像与注释。书中还有一些访谈文章,与动画......一起来看看 《Processing语言权威指南》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具