Git Product home page Git Product logo

TestSmirk's Projects

android-wheel icon android-wheel

Automatically exported from code.google.com/p/android-wheel

android_data icon android_data

收集整理一些学习 Android 资料,希望能帮助到你学习 Android 开发

androidbmi icon androidbmi

Automatically exported from code.google.com/p/androidbmi

badgeview icon badgeview

GitHub控件之BadgeView(数字提醒) 开发者当然可以自己用相对布局来实现这样的效果。一个还好,但是多了呢!就会很繁琐。GitHub上有一个开源的第三方控件,叫做BadgeView。使用它可以很方面的实现想要的效果。 先来怎么使用,简单的三行代码就可以实现数字提醒: [java] view plaincopy在CODE上查看代码片派生到我的代码片 BadgeView badgeView = new com.jauker.widget.BadgeView(this); badgeView.setTargetView(textView); badgeView.setBadgeCount(3); 看一下badgeview中常用的方法: 1. setTargetView(View) --> 设置哪个控件显示数字提醒,参数就是一个view对象 2. setBadgeCount(int) --> 设置提醒的数字 3. setBadgeGravity(Gravity) --> 设置badgeview的显示位置 4. setBackgroundColor() --> 设置badgeview的背景色,当然还可以设置背景图片 5. setBackgroundResource() --> 设置背景图片 6. setTypeface() --> 设置显示的字体 7. setShadowLayer() --> 设置字体的阴影 [java] view plaincopy在CODE上查看代码片派生到我的代码片 badgeView = new BadgeView(this); badgeView.setTargetView(layout); badgeView.setBackground(12, Color.parseColor("#9b2eef")); badgeView.setText("提示"); [java] view plaincopy在CODE上查看代码片派生到我的代码片 badgeView = new BadgeView(this); badgeView.setTargetView(layout); badgeView.setBadgeGravity(Gravity.BOTTOM | Gravity.CENTER); badgeView.setBadgeCount(4); [java] view plaincopy在CODE上查看代码片派生到我的代码片 badgeView = new BadgeView(this); badgeView.setTargetView(layout); badgeView.setBadgeGravity(Gravity.TOP | Gravity.LEFT); badgeView.setTypeface(Typeface.create(Typeface.SANS_SERIF, Typeface.ITALIC)); badgeView.setShadowLayer(2, -1, -1, Color.GREEN); badgeView.setBadgeCount(2); 实际上BadgeView这个类就是继承TextView的。很多TextView中设置字体的方法都适用于BadgeView。 OK。效果实现完毕。

baota icon baota

宝塔Linux面板 - 简单好用的服务器运维面板

cordova_alipayv2 icon cordova_alipayv2

new version of alipay on cordove platform 阿里 支付宝 支付插件

dnspod_ddns icon dnspod_ddns

dnspod 动态更新sub domain的ip(ipv4) bash脚本

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.