com.wangjie.rapidfloatingactionbutton.contentimpl.labellist.RapidFloatingActionContentLabelList Java Examples

The following examples show how to use com.wangjie.rapidfloatingactionbutton.contentimpl.labellist.RapidFloatingActionContentLabelList. 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: MainActivity.java    From samples-android with Apache License 2.0 6 votes vote down vote up
private void initFabBtn() {
    RapidFloatingActionButton fab = findViewById(R.id.fab);
    RapidFloatingActionLayout fabLayout = findViewById(R.id.fab_layout);

    RapidFloatingActionContentLabelList rfaContent = new RapidFloatingActionContentLabelList(this);
    rfaContent.setOnRapidFloatingActionContentLabelListListener(this);
    List<RFACLabelItem> items = new ArrayList<>();
    items.add(new RFACLabelItem<Integer>()
            .setLabel(getString(R.string.scan_qr_code))
    );
    items.add(new RFACLabelItem<Integer>()
            .setLabel(getString(R.string.input_manually))
    );

    rfaContent.setItems(items);
    fabHelper = new RapidFloatingActionHelper(
            this,
            fabLayout,
            fab,
            rfaContent
    ).build();
}
 
Example #2
Source File: LabelListSampleActivity.java    From RapidFloatingActionButton with Apache License 2.0 4 votes vote down vote up
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.label_list_sample);
        rfaLayout = (RapidFloatingActionLayout) findViewById(R.id.label_list_sample_rfal);
        rfaButton = (RapidFloatingActionButton) findViewById(R.id.label_list_sample_rfab);
        /*
        // 可通过代码设置属性
        rfaLayout.setFrameColor(Color.RED);
        rfaLayout.setFrameAlpha(0.4f);

        rfaButton.setNormalColor(0xff37474f);
        rfaButton.setPressedColor(0xff263238);
        rfaButton.getRfabProperties().setShadowDx(ABTextUtil.dip2px(this, 3));
        rfaButton.getRfabProperties().setShadowDy(ABTextUtil.dip2px(this, 3));
        rfaButton.getRfabProperties().setShadowRadius(ABTextUtil.dip2px(this, 5));
        rfaButton.getRfabProperties().setShadowColor(0xffcccccc);
        rfaButton.getRfabProperties().setStandardSize(RFABSize.MINI);
        rfaButton.build();
        */

        RapidFloatingActionContentLabelList rfaContent = new RapidFloatingActionContentLabelList(this);
        rfaContent.setOnRapidFloatingActionContentLabelListListener(this);
        List<RFACLabelItem> items = new ArrayList<>();
        items.add(new RFACLabelItem<Integer>()
                        .setLabel("Github: wangjiegulu")
                        .setResId(R.mipmap.ico_test_d)
                        .setIconNormalColor(0xffd84315)
                        .setIconPressedColor(0xffbf360c)
                        .setWrapper(0)
        );
        items.add(new RFACLabelItem<Integer>()
                        .setLabel("[email protected]")
//                        .setResId(R.mipmap.ico_test_c)
                        .setDrawable(getResources().getDrawable(R.mipmap.ico_test_c))
                        .setIconNormalColor(0xff4e342e)
                        .setIconPressedColor(0xff3e2723)
                        .setLabelColor(Color.WHITE)
                        .setLabelSizeSp(14)
                        .setLabelBackgroundDrawable(RFABShape.generateCornerShapeDrawable(0xaa000000, RFABTextUtil.dip2px(this, 4)))
                        .setWrapper(1)
        );
        items.add(new RFACLabelItem<Integer>()
                        .setLabel("WangJie")
                        .setResId(R.mipmap.ico_test_b)
                        .setIconNormalColor(0xff056f00)
                        .setIconPressedColor(0xff0d5302)
                        .setLabelColor(0xff056f00)
                        .setWrapper(2)
        );
        items.add(new RFACLabelItem<Integer>()
                        .setLabel("Compose")
                        .setResId(R.mipmap.ico_test_a)
                        .setIconNormalColor(0xff283593)
                        .setIconPressedColor(0xff1a237e)
                        .setLabelColor(0xff283593)
                        .setWrapper(3)
        );
        rfaContent
                .setItems(items)
                .setIconShadowRadius(RFABTextUtil.dip2px(this, 5))
                .setIconShadowColor(0xff888888)
                .setIconShadowDy(RFABTextUtil.dip2px(this, 5))
        ;

        rfabHelper = new RapidFloatingActionHelper(
                this,
                rfaLayout,
                rfaButton,
                rfaContent
        ).build();

    }
 
Example #3
Source File: FragmentA.java    From RapidFloatingActionButton with Apache License 2.0 4 votes vote down vote up
private void initRFAB() {
    if (null == rfaButton) {
        return;
    }

    /*
    // 可通过代码设置属性
    rfaLayout.setFrameColor(Color.RED);
    rfaLayout.setFrameAlpha(0.4f);

    rfaBtn.setNormalColor(0xff37474f);
    rfaBtn.setPressedColor(0xff263238);
    rfaBtn.getRfabProperties().setShadowDx(ABTextUtil.dip2px(context, 3));
    rfaBtn.getRfabProperties().setShadowDy(ABTextUtil.dip2px(context, 3));
    rfaBtn.getRfabProperties().setShadowRadius(ABTextUtil.dip2px(context, 5));
    rfaBtn.getRfabProperties().setShadowColor(0xffcccccc);
    rfaBtn.getRfabProperties().setStandardSize(RFABSize.MINI);
    rfaBtn.build();
    */
    Context context = getActivity();

    RapidFloatingActionContentLabelList rfaContent = new RapidFloatingActionContentLabelList(context);
    rfaContent.setOnRapidFloatingActionContentLabelListListener(this);
    List<RFACLabelItem> items = new ArrayList<>();
    items.add(new RFACLabelItem<Integer>()
                    .setLabel("Github: wangjiegulu")
                    .setResId(R.mipmap.ico_test_d)
                    .setIconNormalColor(0xff6a1b9a)
                    .setIconPressedColor(0xff4a148c)
                    .setWrapper(0)
    );
    items.add(new RFACLabelItem<Integer>()
                    .setLabel("[email protected]")
                    .setResId(R.mipmap.ico_test_c)
                    .setIconNormalColor(0xff4e342e)
                    .setIconPressedColor(0xff3e2723)
                    .setLabelColor(Color.WHITE)
                    .setLabelSizeSp(14)
                    .setLabelBackgroundDrawable(RFABShape.generateCornerShapeDrawable(0xaa000000, RFABTextUtil.dip2px(context, 4)))
                    .setWrapper(1)
    );
    items.add(new RFACLabelItem<Integer>()
                    .setLabel("WangJie")
                    .setResId(R.mipmap.ico_test_b)
                    .setIconNormalColor(0xff056f00)
                    .setIconPressedColor(0xff0d5302)
                    .setLabelColor(0xff056f00)
                    .setWrapper(2)
    );
    items.add(new RFACLabelItem<Integer>()
                    .setLabel("Compose")
                    .setResId(R.mipmap.ico_test_a)
                    .setIconNormalColor(0xff283593)
                    .setIconPressedColor(0xff1a237e)
                    .setLabelColor(0xff283593)
                    .setWrapper(3)
    );
    rfaContent
            .setItems(items)
            .setIconShadowRadius(RFABTextUtil.dip2px(context, 5))
            .setIconShadowColor(0xff888888)
            .setIconShadowDy(RFABTextUtil.dip2px(context, 5))
    ;

    rfabHelper = new RapidFloatingActionHelper(
            context,
            rfaLayout,
            rfaButton,
            rfaContent
    ).build();
}
 
Example #4
Source File: FragmentC.java    From RapidFloatingActionButton with Apache License 2.0 4 votes vote down vote up
private void initRFAB() {
    if (null == rfaButton) {
        return;
    }

    /*
    // 可通过代码设置属性
    rfaLayout.setFrameColor(Color.RED);
    rfaLayout.setFrameAlpha(0.4f);

    rfaBtn.setNormalColor(0xff37474f);
    rfaBtn.setPressedColor(0xff263238);
    rfaBtn.getRfabProperties().setShadowDx(ABTextUtil.dip2px(context, 3));
    rfaBtn.getRfabProperties().setShadowDy(ABTextUtil.dip2px(context, 3));
    rfaBtn.getRfabProperties().setShadowRadius(ABTextUtil.dip2px(context, 5));
    rfaBtn.getRfabProperties().setShadowColor(0xffcccccc);
    rfaBtn.getRfabProperties().setStandardSize(RFABSize.MINI);
    rfaBtn.build();
    */

    Context context = getActivity();

    RapidFloatingActionContentLabelList rfaContent = new RapidFloatingActionContentLabelList(context);
    rfaContent.setOnRapidFloatingActionContentLabelListListener(this);
    List<RFACLabelItem> items = new ArrayList<>();
    items.add(new RFACLabelItem<Integer>()
                    .setLabel("Github: wangjiegulu")
                    .setResId(R.mipmap.ico_test_d)
                    .setIconNormalColor(0xff6a1b9a)
                    .setIconPressedColor(0xff4a148c)
                    .setWrapper(0)
    );
    items.add(new RFACLabelItem<Integer>()
                    .setLabel("[email protected]")
                    .setResId(R.mipmap.ico_test_c)
                    .setIconNormalColor(0xff4e342e)
                    .setIconPressedColor(0xff3e2723)
                    .setLabelColor(Color.WHITE)
                    .setLabelSizeSp(14)
                    .setLabelBackgroundDrawable(RFABShape.generateCornerShapeDrawable(0xaa000000, RFABTextUtil.dip2px(context, 4)))
                    .setWrapper(1)
    );
    items.add(new RFACLabelItem<Integer>()
                    .setLabel("WangJie")
                    .setResId(R.mipmap.ico_test_b)
                    .setIconNormalColor(0xff056f00)
                    .setIconPressedColor(0xff0d5302)
                    .setLabelColor(0xff056f00)
                    .setWrapper(2)
    );
    items.add(new RFACLabelItem<Integer>()
                    .setLabel("Compose")
                    .setResId(R.mipmap.ico_test_a)
                    .setIconNormalColor(0xff283593)
                    .setIconPressedColor(0xff1a237e)
                    .setLabelColor(0xff283593)
                    .setWrapper(3)
    );
    rfaContent
            .setItems(items)
            .setIconShadowRadius(RFABTextUtil.dip2px(context, 5))
            .setIconShadowColor(0xff888888)
            .setIconShadowDy(RFABTextUtil.dip2px(context, 5))
    ;

    rfabHelper = new RapidFloatingActionHelper(
            context,
            rfaLayout,
            rfaButton,
            rfaContent
    ).build();
}