This library is now in a usable condition and may evolve as requirements increase.
License:
You are free to use this library in commercial/non-commericial projects. If you use it for something cool, it would be nice if you could post a screenshot of your app using this library on the forum (probably Share Your Creations).
You may use the source code and add new functions to it. If you do so, you are required to post the improvements/additions in this thread.
Usage:
1. The Layout of the Notification
This is defined in an xml layout file. Create your layout, name it to "cm.xml" and copy it to your projects Objects/res/Layout folder. Mark it as read-only. See XML Resources for further information.
Make sure you give an id to each view in the xml, because in order to set these views we will use the same id.
Code:
<TextView android:id="@+id/title"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
If you have trouble with the xml file (like I did), do Clean Project. Make the xml file in utf-8. use dreamweaver.
2. Add the Library to your project
Right hand pane, contains a library tab. Select "CustomNotifications"
3. B4A Code
Create a notification object as you normally would.
Then to customize it, do:
Code:
Dim cn as CustomNotification
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.SetInfo("Hello","hello","")
cn.setCustomView(n)
cn.setText(n,"title","NewTitle")
cn.setText(n,"text","NewText")
cn.setTextColor(n,"text",Colors.Red)
cn.setTextSize(n,"title",20)
cn.setImage(n,"image",c.Bitmap)
The id used here to set the properties, is the same id defined in your xml layout.
Still having problems?
Before posting a question, check and double check your xml file.
Most errors happen due to your xml file not being added as a resource. Look in the Objects/gen/<packagename>/R.java file to see it the xml file is being added into it.
Then read this link carefully and thoroughly: Custom Notifcation Layouts
Also dont try to put a listview or a scrollview in a notification. It only supports buttons, labels, progressbars, imageviews and panels. There may be other restrictions on what it supports.
XML Resources:
Learn about xml layouts and styles. Each ROM has a different style so it could cause your text to be invisible.
Custom Notifcation Layouts
LinearLayout
没有合适的资源?快使用搜索试试~ 我知道了~
B4A类库资源大全,还有示例
共922个文件
zip:393个
class:118个
xml:79个
需积分: 50 26 下载量 25 浏览量
2016-12-05
10:29:05
上传
评论
收藏 44.56MB RAR 举报
温馨提示
B4A类库资源大全,还有示例
资源推荐
资源详情
资源评论
收起资源包目录
B4A类库资源大全,还有示例 (922个子文件)
temp.ap_ 254KB
temp.ap_ 128KB
temp.ap_ 110KB
temp.ap_ 104KB
temp.ap_ 95KB
temp.ap_ 95KB
temp.ap_ 90KB
temp.ap_ 90KB
temp.ap_ 90KB
temp.ap_ 89KB
temp.ap_ 87KB
temp.ap_ 87KB
temp.ap_ 86KB
temp.ap_ 85KB
TouchImageView.apk 254KB
AHDashboard.apk 110KB
ACL.apk 104KB
PreferenceActivity.apk 96KB
ClickableTVDemo.apk 95KB
WheelView.apk 95KB
CollectionsExtraDemo.apk 90KB
SQL.apk 90KB
result.apk 90KB
PhoneStateListener.apk 89KB
BroadCastReceiver.apk 87KB
Camera.apk 87KB
GesturesDemo.apk 86KB
BitmapExtended.apk 85KB
FFTdemo.b4a 49KB
ABPhysicsEngineTest.b4a 8KB
EncryptionDemo.b4a 8KB
OpenGLDemo.b4a 7KB
USB.b4a 7KB
OpenGL2Demo.b4a 6KB
TabHostExtrasDemo.b4a 6KB
PageTurnViewDemo.b4a 6KB
ReflectionDemo.b4a 5KB
Charts.b4a 5KB
GpsToOsgbDemo.b4a 5KB
DialogsDemo.b4a 5KB
SlidingPanels.b4a 5KB
EQGui.b4a 4KB
JpegDemo.b4a 4KB
LocaleExample.b4a 4KB
JSInterface example.b4a 4KB
ThreadingDemo.b4a 4KB
ABZipUnzipTest.b4a 4KB
RichStringDemo.b4a 3KB
wheel.b4a 3KB
SQL.b4a 3KB
PreferenceActivity.b4a 3KB
MySQL.b4a 3KB
GesturesDemo.b4a 2KB
PreferenceActivity mod.b4a 2KB
WheelView.b4a 2KB
TouchImageView.b4a 2KB
GenericSample.b4a 2KB
ClocksDemo.b4a 2KB
TabHostExtrasDemo.b4a 2KB
WebViewExtrasDemo.b4a 2KB
ACL.b4a 2KB
BigNumbersDemo.b4a 2KB
JpegUtilsDemo.b4a 2KB
GifDecoderDemo.b4a 2KB
SVGdemo.b4a 2KB
ABSimMetricsTest.b4a 2KB
ExpressionEvaluator.b4a 2KB
BroadCastReceiver.b4a 2KB
ByteConverterDemo.b4a 2KB
AHDashboard.b4a 2KB
ClickableTVDemo.b4a 2KB
Camera.b4a 1KB
testWIFI.b4a 1KB
BitmapExtended.b4a 1KB
CNExample.b4a 1KB
PhoneStateListener.b4a 1KB
CollectionsExtraDemo.b4a 1KB
FFTdemo.bal 119KB
eq.bal 11KB
layout.bal 7KB
mainlayout.bal 6KB
Layout.bal 6KB
main.bal 5KB
Layout.bal 4KB
1.bal 4KB
layouttabcontent.bal 3KB
panel1.bal 2KB
layout.bal 2KB
layout.bal 2KB
layoutmain.bal 2KB
clickabletvlayout.bal 2KB
layouttabcontent.bal 2KB
1.bal 2KB
layout.bal 2KB
ABZipUnzipTest.bal 2KB
absimmetricstest.bal 2KB
1.bal 2KB
Layout.bal 2KB
layoutmain.bal 1KB
1.bal 1KB
共 922 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
zyixin2
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功