- 浏览: 41269 次
- 性别:
- 来自: 济南
最新评论
-
kensunhu:
正是我想要的。典型的app ui布局。谢谢!
android UI - 仿威信tab样式 -
007007jing:
bing_zz 写道兄弟加油!谢谢
android2.3 api demo 学习系列(7)--App/Activity/Hello World -
bing_zz:
兄弟加油!
android2.3 api demo 学习系列(7)--App/Activity/Hello World
android2.3 api demo 学习系列(23)--App/Notification/StatusBarNotification
- 博客分类:
- Android ApiDemo
apidemo-StatusBarNotification里面展示的并没有新的知识内容,只是把先前的几个例子的内容进行了融合。这里主要看先前面几个例子里面没有涉及到的自动义notification的view
1、定义notification的layout
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" > <ImageView android:id="@+id/app_notification_status_bar_image" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_marginRight="10dp" /> <TextView android:id="@+id/app_notification_status_bar_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/app_notification_status_bar_image" style="@style/NotificationTitle" /> <TextView android:id="@+id/app_notification_status_bar_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/app_notification_status_bar_image" android:layout_below="@id/app_notification_status_bar_title" style="@style/NotificationText" /> </RelativeLayout>
里面用到的style:
<style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent" /> <style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title"> <item name="android:textColor">@drawable/red</item> </style>
2、代码中加载该layout
private void setNotificationView(int drawableId, int textId) { Notification notif = new Notification(); notif.contentIntent = makeMoodIntent(drawableId); CharSequence text = getText(textId); notif.tickerText = text; // the icon for the status bar notif.icon = drawableId; // our custom view RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.app_notification_self_view); contentView.setTextViewText(R.id.app_notification_status_bar_title, text); contentView.setTextViewText(R.id.app_notification_status_bar_text, getText(R.string.app_notification_status_bar_msg2)); contentView.setImageViewResource(R.id.app_notification_status_bar_image, drawableId); notif.contentView = contentView; mNotificationManager.notify(NOTIFICATIONS_ID, notif); }
效果展示
发表评论
-
android2.3 api demo 学习系列(22)--App/Notification/Notifying Service Controller
2012-07-06 14:56 1674因为还没有看到service的demo,这里先不对servic ... -
android2.3 api demo 学习系列(21)--App/Notification/Incoming Message
2012-07-06 11:55 2427现在我们开始学习android的Status Bar Noti ... -
android2.3 api demo 学习系列(20)--App/Menu
2012-07-06 09:58 1114现在来学习下menu的相关 ... -
android2.3 api demo 学习系列(19)--App/Intent and Launcher Shortcuts
2012-07-06 09:36 1063第一个demo:Intent,根据指定的类型,枚举出所有符合条 ... -
android2.3 api demo 学习系列(18)--App/Dialog
2012-07-06 09:13 958今天主要学习Dialog: 1、一般的dialog ... -
android2.3 api demo 学习系列(17)--App/Alarm/AlarmController and Alarm Service
2012-07-03 17:12 2146本次学习将apidemo中得两个demo:AlarmContr ... -
android2.3 api demo 学习系列(16)--App/Activity/Translucent and Blur activity
2012-07-03 11:47 1855本次同样是将apidemo中得两个demo合并起来学习:Tra ... -
android2.3 api demo 学习系列(15)--App/Activity/SetWallpaper
2012-07-03 11:00 1092本次示例我们整合了apidemo里面的两个demo:SetWa ... -
android2.3 api demo 学习系列(14)--App/Activity/Screen Orientation
2012-07-03 09:50 3081下面我们来学习下Screen Orientaiton的demo ... -
android2.3 api demo 学习系列(13)--App/Activity/Save & Restore
2012-07-02 17:29 1437前面文章android2.3 api demo 学习系 ... -
android2.3 api demo 学习系列(12)--App/Activity/Reorder Activitys
2012-07-02 16:45 960Reorder Activitys Demo主要是实现打开ac ... -
android2.3 api demo 学习系列(11)--App/Activity/Redirection
2012-07-02 15:52 831APIDEMO里面的redirection示例本身并没有新技术 ... -
android2.3 api demo 学习系列(10)--App/Activity/RecevieResult
2012-07-02 14:48 959在先前的文章 activity之间跳转传值 已经学习过这方面的 ... -
android2.3 api demo 学习系列(9)--App/Activity/QuickContactsDemo
2012-07-01 19:46 959现在我们来学习如何使用Content Provider来访问a ... -
android2.3 api demo 学习系列(8)--App/Activity/Preference State
2012-07-01 19:45 870android保存数据有很多种方式,其中最简单的就是使用Sha ... -
android2.3 api demo 学习系列(7)--App/Activity/Hello World
2012-06-29 14:03 1049学习android当然不能少了HelloWorld,接下来我们 ... -
android2.3 api demo 学习系列(6)--App/Activity/ForwardActivity
2012-06-29 13:50 799本次学习activity的跳转 1、构建intent ... -
android2.3 api demo 学习系列(5)--App/Activity/Dialog
2012-06-29 11:42 970前面我们已经学习了Custom Dialog 和 Custom ... -
android2.3 api demo 学习系列(4)--App/Activity/Custom Title
2012-06-29 11:26 1055android的标题栏默认是由android:lable定义的 ... -
android基础知识---Providing Resources
2012-06-29 10:42 775android的可使用的资源文件,google建议我们在开发应 ...
相关推荐
react-native-in-app-notification-master.rar
react-native-in-app-notification的基本外观: 您可以使用自定义组件来使react-native-in-app-notification : 安装 yarn add react-native-in-app-notification 要么 npm install react-native-in-app-...
npm install --save react-native-push-notification react-native link NOTE: For Android, you will still have to manually update the AndroidManifest.xml (as below) in order to use Scheduled Notifications...
Laravel开发-laravel-mobile-notification 向移动设备(APN、GCM)发送推送通知的Laravel/Lumen包
Android-react-native-push-notification.zip,响应本机本地和远程通知,安卓系统是谷歌在2008年设计和制造的。操作系统主要写在爪哇,C和C 的核心组件。它是在linux内核之上构建的,具有安全性优势。
"在窗口顶端或者下端弹出自定义的提示视图(notification View)。例如,图中上方的黑色标签“This is the notification.""。可用于显示当前app的状态,用户操作的提示等等。" 注意:请在Mac下解压使用
在窗口顶端弹出自定义的提示视图(notification View)。弹出的notification view可以自动隐藏。如果有多个notification view,则进行排队,按顺序显示。可用于显示当前app的状态,用户操作的提示、提醒通知等等。...
自定义UITabBar。自定义Tab Bar的文字、颜色和图片,不同tab之间切换的动作效果,以及自定义Tab Bar弹出消息的样式。 注意:请在Mac下解压使用
该存储库包含荷兰语COVID-19 Notification App CoronaMelder的原生Android实现。 android应用位于您当前正在查看的存储库中。 可以在以下位置找到iOS应用: : 后端可以在这里找到: : 可以在此处找到用作开发应用...
Laravel开发-laravel-push-notification Push Notification 服务端支持 app的推送通知发送工具,支持结果的apns和安装的gcm
极光推送 JAVA服务端 jpush-client-3.2.8 与 集成源码 jpush-api-java-client-master
yarn add vue-toast-notification # npm npm install vue-toast-notification 用法 import Vue from 'vue' ; import VueToast from 'vue-toast-notification' ; // Import one of the available themes //import '...
Android上的另一种推送通知解决方案是 ,其功能是在iOS和Android上提供相同的API,而该功能在Android上支持更多的通知功能。React本机系统通知 发送或安排React Native的Android系统通知。目录import React , { ...
Android 通知(notification)简单实用Demo,包含点击功能简单例子,供大家下载学习
learn push notification with android
安装使用yarn或npm将软件包安装为项目依赖项: $ yarn add @dafcoe/vue-notification--- or ---$ npm install --save @dafcoe/vue-notification用法全局(在main.js / main.ts文件上)或本地(在组件上)导入...
android notification完全解析Demo
类型:NotificationDemo 功能:从网上下载apk存储到手机指定目录,并在通知栏里显示其下载进度,如果下载错误,或者不想要该apk可以删除 涉及知识: 文件流、网络下载链接协议、读写权限、Handler、Notification、...
Simplified notification delivery for Android. GETTING STARTED Notify (pre-)releases are available via JitPack. It is recommended that a specific release version is selected when using the ...
Android notification进度条 demo,欢迎下载!!!!!!!!!!!!!!!!!!!!!!!!!!!!