mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2026-04-01 00:00:20 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76d6c5ddb1 | ||
|
|
521422cac0 | ||
|
|
c629dcc033 | ||
|
|
aeee619eab | ||
|
|
bc9e441fe2 | ||
|
|
fad4745e01 | ||
|
|
10b29611c5 | ||
|
|
03429474c0 |
@@ -21,6 +21,8 @@
|
|||||||
- [cleanTags](#cleantags)
|
- [cleanTags](#cleantags)
|
||||||
- [getAllTags](#getalltags)
|
- [getAllTags](#getalltags)
|
||||||
- [checkTagBindState](#checktagbindstate)
|
- [checkTagBindState](#checktagbindstate)
|
||||||
|
- [设置手机号](#设置手机号)
|
||||||
|
- [setMobileNumber](#setMobileNumber)
|
||||||
- [获取点击通知内容](#获取点击通知内容)
|
- [获取点击通知内容](#获取点击通知内容)
|
||||||
- [event - jpush.openNotification](#event---jpushopennotification)
|
- [event - jpush.openNotification](#event---jpushopennotification)
|
||||||
- [获取通知内容](#获取通知内容)
|
- [获取通知内容](#获取通知内容)
|
||||||
@@ -396,6 +398,37 @@ window.JPush.checkTagBindState({ sequence: 1, tag: 'tag1' },
|
|||||||
- sequence: number。用户自定义的操作序列号, 同操作结果一起返回,用来标识一次操作的唯一性。
|
- sequence: number。用户自定义的操作序列号, 同操作结果一起返回,用来标识一次操作的唯一性。
|
||||||
- tag: string,待查询的 tag。
|
- tag: string,待查询的 tag。
|
||||||
|
|
||||||
|
## 设置手机号
|
||||||
|
|
||||||
|
提供设置手机号码的接口,用于短信补充功能。
|
||||||
|
|
||||||
|
注:短信补充仅支持国内业务,号码格式为 11 位数字,有无 +86 前缀皆可。
|
||||||
|
|
||||||
|
### setMobileNumber
|
||||||
|
|
||||||
|
调用此 API 设置手机号码。该接口会控制调用频率,频率为 10s 之内最多 3 次。
|
||||||
|
|
||||||
|
#### 代码示例
|
||||||
|
|
||||||
|
```js
|
||||||
|
window.JPush.setMobileNumber({ sequence: 5, mobileNumber: '111111' },
|
||||||
|
(result) => {
|
||||||
|
var sequence = result.sequence
|
||||||
|
var number = result.mobileNumber
|
||||||
|
}, (error) => {
|
||||||
|
var sequence = error.sequence
|
||||||
|
var errorCode = error.code
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 参数说明
|
||||||
|
|
||||||
|
- sequence: number。用户自定义的操作序列号, 同操作结果一起返回,用来标识一次操作的唯一性。
|
||||||
|
- mobileNumber: string
|
||||||
|
- 手机号码。如果传空串则为解除号码绑定操作。
|
||||||
|
- 限制:只能以 “+” 或者 数字开头;后面的内容只能包含 “-” 和数字。
|
||||||
|
|
||||||
|
|
||||||
## 获取点击通知内容
|
## 获取点击通知内容
|
||||||
|
|
||||||
### event - jpush.openNotification
|
### event - jpush.openNotification
|
||||||
|
|||||||
@@ -200,6 +200,16 @@
|
|||||||
alert(error.code)
|
alert(error.code)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#setMobileNumber").click(function (event) {
|
||||||
|
var number = $("#mobileNumberText").val()
|
||||||
|
window.JPush.setMobileNumber({ sequence: 5, mobileNumber: number },
|
||||||
|
function (result) {
|
||||||
|
$("#mobileNumberResult").html(result.mobileNumber)
|
||||||
|
}, function (error){
|
||||||
|
alert(error.code)
|
||||||
|
})
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener("deviceready", onDeviceReady, false);
|
document.addEventListener("deviceready", onDeviceReady, false);
|
||||||
@@ -251,6 +261,14 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<label>MobileNumber: </label>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="number" id="mobileNumberText" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-role="fieldcontain">
|
<div data-role="fieldcontain">
|
||||||
@@ -265,6 +283,10 @@
|
|||||||
<input type="button" id="deleteAlias" value="Delete alias" />
|
<input type="button" id="deleteAlias" value="Delete alias" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<input type="button" id="setMobileNumber" value="Set mobileNumber" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div data-role="fieldcontain">
|
<div data-role="fieldcontain">
|
||||||
<label id="tagsPrompt">设置 Tag 的结果:</label>
|
<label id="tagsPrompt">设置 Tag 的结果:</label>
|
||||||
<label id="tagsResult">null</label>
|
<label id="tagsResult">null</label>
|
||||||
@@ -273,6 +295,10 @@
|
|||||||
<label id="aliasPrompt">设置 Alias 的结果:</label>
|
<label id="aliasPrompt">设置 Alias 的结果:</label>
|
||||||
<label id="aliasResult">null</label>
|
<label id="aliasResult">null</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label id="mobileNumberPrompt">设置手机号的结果:</label>
|
||||||
|
<label id="mobileNumberResult">null</label>
|
||||||
|
</div>
|
||||||
<div data-role="fieldcontain">
|
<div data-role="fieldcontain">
|
||||||
<label id="notificationPrompt">接受的通知内容:</label>
|
<label id="notificationPrompt">接受的通知内容:</label>
|
||||||
<label id="notificationResult">null</label>
|
<label id="notificationResult">null</label>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jpush-phonegap-plugin",
|
"name": "jpush-phonegap-plugin",
|
||||||
"version": "3.7.6",
|
"version": "3.8.2",
|
||||||
"description": "JPush for cordova plugin",
|
"description": "JPush for cordova plugin",
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "jpush-phonegap-plugin",
|
"id": "jpush-phonegap-plugin",
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cordova-plugin-device": "*",
|
"cordova-plugin-device": "*",
|
||||||
"cordova-plugin-jcore": ">=1.3.0"
|
"cordova-plugin-jcore": ">=1.4.0"
|
||||||
},
|
},
|
||||||
"author": "JiGuang",
|
"author": "JiGuang",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
57
plugin.xml
57
plugin.xml
@@ -2,7 +2,7 @@
|
|||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="jpush-phonegap-plugin"
|
id="jpush-phonegap-plugin"
|
||||||
version="3.7.6">
|
version="3.8.2">
|
||||||
|
|
||||||
<name>JPush</name>
|
<name>JPush</name>
|
||||||
<description>JPush for cordova plugin</description>
|
<description>JPush for cordova plugin</description>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<source-file src="src/ios/Plugins/AppDelegate+JPush.m" />
|
<source-file src="src/ios/Plugins/AppDelegate+JPush.m" />
|
||||||
|
|
||||||
<header-file src="src/ios/lib/JPUSHService.h" />
|
<header-file src="src/ios/lib/JPUSHService.h" />
|
||||||
<source-file src="src/ios/lib/jpush-ios-3.3.3.a" framework="true" />
|
<source-file src="src/ios/lib/jpush-ios-3.7.4.a" framework="true" />
|
||||||
<resource-file src="src/ios/JPushConfig.plist" />
|
<resource-file src="src/ios/JPushConfig.plist" />
|
||||||
|
|
||||||
<framework src="CFNetwork.framework" weak="true" />
|
<framework src="CFNetwork.framework" weak="true" />
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
<framework src="AdSupport.framework" weak="true" />
|
<framework src="AdSupport.framework" weak="true" />
|
||||||
<framework src="UserNotifications.framework" weak="true" />
|
<framework src="UserNotifications.framework" weak="true" />
|
||||||
<framework src="libresolv.tbd" weak="true" />
|
<framework src="libresolv.tbd" weak="true" />
|
||||||
|
<framework src="StoreKit.framework" weak="true" />
|
||||||
|
|
||||||
<config-file target="*JPushConfig.plist" parent="Appkey">
|
<config-file target="*JPushConfig.plist" parent="Appkey">
|
||||||
<string>$APP_KEY</string>
|
<string>$APP_KEY</string>
|
||||||
@@ -105,9 +106,10 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||||
|
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
|
||||||
|
|
||||||
<!--华为角标-->
|
<!--华为角标-->
|
||||||
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE "/>
|
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE"/>
|
||||||
</config-file>
|
</config-file>
|
||||||
|
|
||||||
<config-file target="AndroidManifest.xml" parent="/manifest/application" mode="merge">
|
<config-file target="AndroidManifest.xml" parent="/manifest/application" mode="merge">
|
||||||
@@ -204,7 +206,8 @@
|
|||||||
<receiver android:name="cn.jpush.android.service.SchedulerReceiver" android:exported="false"/>
|
<receiver android:name="cn.jpush.android.service.SchedulerReceiver" android:exported="false"/>
|
||||||
|
|
||||||
<!--since 3.3.0 接收JPush相关事件-->
|
<!--since 3.3.0 接收JPush相关事件-->
|
||||||
<receiver android:name="cn.jiguang.cordova.push.JPushEventReceiver">
|
<receiver android:name="cn.jiguang.cordova.push.JPushEventReceiver"
|
||||||
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
|
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
|
||||||
<category android:name="$PACKAGE_NAME"></category>
|
<category android:name="$PACKAGE_NAME"></category>
|
||||||
@@ -212,22 +215,25 @@
|
|||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<!--since 3.3.0 Required SDK核心功能-->
|
<!--since 3.3.0 Required SDK核心功能-->
|
||||||
<activity
|
|
||||||
android:name="cn.jpush.android.service.JNotifyActivity"
|
<activity
|
||||||
android:exported="true"
|
android:name="cn.jpush.android.service.JNotifyActivity"
|
||||||
android:taskAffinity="jpush.custom"
|
android:exported="true"
|
||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
android:taskAffinity="jpush.custom"
|
||||||
<intent-filter>
|
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
||||||
<action android:name="cn.jpush.android.intent.JNotifyActivity" />
|
<intent-filter>
|
||||||
<category android:name="$PACKAGE_NAME" />
|
<action android:name="cn.jpush.android.intent.JNotifyActivity" />
|
||||||
</intent-filter>
|
<category android:name="android.intent.category.DEFAULT" /><!--Required SDK核心功能 since 4.2.2-->
|
||||||
</activity>
|
<category android:name="$PACKAGE_NAME" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
<!-- since 3.3.0 Required SDK 核心功能-->
|
<!-- since 3.3.0 Required SDK 核心功能-->
|
||||||
<!-- 可配置android:process参数将PushService放在其他进程中 -->
|
<!-- 可配置android:process参数将PushService放在其他进程中 -->
|
||||||
<!--User defined. For test only 继承自cn.jpush.android.service.JCommonService-->
|
<!--User defined. For test only 继承自cn.jpush.android.service.JCommonService-->
|
||||||
<service android:name="cn.jiguang.cordova.push.PushService"
|
<service android:name="cn.jiguang.cordova.push.PushService"
|
||||||
android:process=":pushcore">
|
android:process=":pushcore"
|
||||||
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="cn.jiguang.user.service.action" />
|
<action android:name="cn.jiguang.user.service.action" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
@@ -255,22 +261,28 @@
|
|||||||
|
|
||||||
</config-file>
|
</config-file>
|
||||||
|
|
||||||
<lib-file src="src/android/libs/jpush-android-3.6.6.jar" />
|
<lib-file src="src/android/libs/jpush-android-4.2.8.jar" />
|
||||||
|
|
||||||
<source-file src="src/android/PushService.java" target-dir="src/cn/jiguang/cordova/push" />
|
<source-file src="src/android/PushService.java" target-dir="src/cn/jiguang/cordova/push" />
|
||||||
<source-file src="src/android/JPushPlugin.java" target-dir="src/cn/jiguang/cordova/push" />
|
<source-file src="src/android/JPushPlugin.java" target-dir="src/cn/jiguang/cordova/push" />
|
||||||
<source-file src="src/android/JPushReceiver.java" target-dir="src/cn/jiguang/cordova/push" />
|
<source-file src="src/android/JPushReceiver.java" target-dir="src/cn/jiguang/cordova/push" />
|
||||||
<source-file src="src/android/JPushEventReceiver.java" target-dir="src/cn/jiguang/cordova/push" />
|
<source-file src="src/android/JPushEventReceiver.java" target-dir="src/cn/jiguang/cordova/push" />
|
||||||
|
<source-file src="src/android/JLogger.java" target-dir="src/cn/jiguang/cordova/push" />
|
||||||
|
|
||||||
<resource-file src="src/android/res/drawable-hdpi/jpush_richpush_btn_selector.xml"
|
<resource-file src="src/android/res/drawable-hdpi/jpush_richpush_btn_selector.xml"
|
||||||
target="res/drawable/jpush_richpush_btn_selector.xml" />
|
target="res/drawable/jpush_richpush_btn_selector.xml" />
|
||||||
<resource-file src="src/android/res/drawable-hdpi/jpush_richpush_progressbar.xml"
|
<resource-file src="src/android/res/drawable-hdpi/jpush_richpush_progressbar.xml"
|
||||||
target="res/drawable/jpush_richpush_progressbar.xml" />
|
target="res/drawable/jpush_richpush_progressbar.xml" />
|
||||||
|
|
||||||
<resource-file src="src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png"
|
<resource-file src="src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png"
|
||||||
target="res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png" />
|
target="res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png" />
|
||||||
<resource-file src="src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png"
|
<resource-file src="src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png"
|
||||||
target="res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png" />
|
target="res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png" />
|
||||||
|
<resource-file src="src/android/res/drawable-hdpi/jpush_ic_action_cancle.png"
|
||||||
|
target="res/drawable-hdpi/jpush_ic_action_cancle.png" />
|
||||||
|
<resource-file src="src/android/res/drawable-hdpi/jpush_ic_action_close.png"
|
||||||
|
target="res/drawable-hdpi/jpush_ic_action_close.png" />
|
||||||
|
<resource-file src="src/android/res/drawable-hdpi/jpush_ic_action_close2.png"
|
||||||
|
target="res/drawable-hdpi/jpush_ic_action_close2.png" />
|
||||||
|
|
||||||
<resource-file src="src/android/res/layout/jpush_popwin_layout.xml"
|
<resource-file src="src/android/res/layout/jpush_popwin_layout.xml"
|
||||||
target="res/layout/jpush_popwin_layout.xml" />
|
target="res/layout/jpush_popwin_layout.xml" />
|
||||||
@@ -278,8 +290,19 @@
|
|||||||
target="res/layout/jpush_webview_layout.xml" />
|
target="res/layout/jpush_webview_layout.xml" />
|
||||||
<resource-file src="src/android/res/layout/push_notification.xml"
|
<resource-file src="src/android/res/layout/push_notification.xml"
|
||||||
target="res/layout/push_notification.xml" />
|
target="res/layout/push_notification.xml" />
|
||||||
|
<resource-file src="src/android/res/layout/push_notification_large.xml"
|
||||||
|
target="res/layout/push_notification_large.xml" />
|
||||||
|
<resource-file src="src/android/res/layout/push_notification_middle.xml"
|
||||||
|
target="res/layout/push_notification_middle.xml" />
|
||||||
|
<resource-file src="src/android/res/layout/jpush_inapp_banner.xml"
|
||||||
|
target="res/layout/jpush_inapp_banner.xml" />
|
||||||
|
|
||||||
<resource-file src="src/android/res/layout-v21/push_notification.xml"
|
<resource-file src="src/android/res/layout-v21/push_notification.xml"
|
||||||
target="res/layout-v21/push_notification.xml" />
|
target="res/layout-v21/push_notification.xml" />
|
||||||
|
<resource-file src="src/android/res/layout-v21/push_notification_middle.xml"
|
||||||
|
target="res/layout-v21/push_notification_middle.xml" />
|
||||||
|
<resource-file src="src/android/res/layout-v21/push_notification_large.xml"
|
||||||
|
target="res/layout-v21/push_notification_large.xml" />
|
||||||
|
|
||||||
<resource-file src="src/android/res/values/jpush_style.xml"
|
<resource-file src="src/android/res/values/jpush_style.xml"
|
||||||
target="res/values/jpush_style.xml" />
|
target="res/values/jpush_style.xml" />
|
||||||
|
|||||||
46
src/android/JLogger.java
Normal file
46
src/android/JLogger.java
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package cn.jiguang.cordova.push;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
public class JLogger {
|
||||||
|
|
||||||
|
public static final String TAG = "[Cordova-JPush]";
|
||||||
|
|
||||||
|
private static boolean isLoggerEnable = false;
|
||||||
|
|
||||||
|
public static void setLoggerEnable(boolean loggerEnable) {
|
||||||
|
Log.d(TAG, "setLoggerEnable:" + loggerEnable);
|
||||||
|
isLoggerEnable = loggerEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void i(String tag,String msg) {
|
||||||
|
if (isLoggerEnable) {
|
||||||
|
Log.i(TAG+tag, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void d(String tag,String msg) {
|
||||||
|
if (isLoggerEnable) {
|
||||||
|
Log.d(TAG+tag, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void v(String tag,String msg) {
|
||||||
|
if (isLoggerEnable) {
|
||||||
|
Log.v(TAG+tag, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void w(String tag,String msg) {
|
||||||
|
if (isLoggerEnable) {
|
||||||
|
Log.w(TAG+tag, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void e(String tag,String error) {
|
||||||
|
if (isLoggerEnable) {
|
||||||
|
Log.e(TAG+tag, error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,20 +3,18 @@ package cn.jiguang.cordova.push;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import org.apache.cordova.CallbackContext;
|
import org.apache.cordova.CallbackContext;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import cn.jpush.android.api.CustomMessage;
|
import cn.jpush.android.api.CustomMessage;
|
||||||
import cn.jpush.android.api.JPushInterface;
|
|
||||||
import cn.jpush.android.api.JPushMessage;
|
import cn.jpush.android.api.JPushMessage;
|
||||||
import cn.jpush.android.api.NotificationMessage;
|
import cn.jpush.android.api.NotificationMessage;
|
||||||
|
import cn.jpush.android.helper.Logger;
|
||||||
import cn.jpush.android.service.JPushMessageReceiver;
|
import cn.jpush.android.service.JPushMessageReceiver;
|
||||||
|
|
||||||
public class JPushEventReceiver extends JPushMessageReceiver {
|
public class JPushEventReceiver extends JPushMessageReceiver {
|
||||||
@@ -26,143 +24,58 @@ public class JPushEventReceiver extends JPushMessageReceiver {
|
|||||||
@Override
|
@Override
|
||||||
public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
|
public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
|
||||||
super.onTagOperatorResult(context, jPushMessage);
|
super.onTagOperatorResult(context, jPushMessage);
|
||||||
//Log.e(TAG,"onTagOperatorResult:"+jPushMessage);
|
JLogger.d(TAG,"onTagOperatorResult:"+jPushMessage);
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
|
|
||||||
int sequence = jPushMessage.getSequence();
|
tryCallback(jPushMessage, new SuccessCallback() {
|
||||||
try {
|
@Override
|
||||||
resultJson.put("sequence", sequence);
|
public void onSuccessCallback(JSONObject resultJson) throws JSONException {
|
||||||
} catch (JSONException e) {
|
Set<String> tags = jPushMessage.getTags();
|
||||||
e.printStackTrace();
|
JSONArray tagsJsonArr = new JSONArray();
|
||||||
}
|
for (String tag : tags) {
|
||||||
|
tagsJsonArr.put(tag);
|
||||||
CallbackContext callback = JPushPlugin.eventCallbackMap.get(sequence);
|
}
|
||||||
|
|
||||||
if (callback == null) {
|
|
||||||
Log.i(TAG, "Unexpected error, callback is null!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jPushMessage.getErrorCode() == 0) { // success
|
|
||||||
Set<String> tags = jPushMessage.getTags();
|
|
||||||
JSONArray tagsJsonArr = new JSONArray();
|
|
||||||
for (String tag : tags) {
|
|
||||||
tagsJsonArr.put(tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (tagsJsonArr.length() != 0) {
|
if (tagsJsonArr.length() != 0) {
|
||||||
resultJson.put("tags", tagsJsonArr);
|
resultJson.put("tags", tagsJsonArr);
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
callback.success(resultJson);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
resultJson.put("code", jPushMessage.getErrorCode());
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
callback.error(resultJson);
|
|
||||||
}
|
|
||||||
|
|
||||||
JPushPlugin.eventCallbackMap.remove(sequence);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) {
|
public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) {
|
||||||
super.onCheckTagOperatorResult(context, jPushMessage);
|
super.onCheckTagOperatorResult(context, jPushMessage);
|
||||||
|
|
||||||
//Log.e(TAG,"onCheckTagOperatorResult:"+jPushMessage);
|
JLogger.d(TAG,"onCheckTagOperatorResult:"+jPushMessage);
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
|
|
||||||
int sequence = jPushMessage.getSequence();
|
tryCallback(jPushMessage, new SuccessCallback() {
|
||||||
try {
|
@Override
|
||||||
resultJson.put("sequence", sequence);
|
public void onSuccessCallback(JSONObject resultJson) throws JSONException {
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
CallbackContext callback = JPushPlugin.eventCallbackMap.get(sequence);
|
|
||||||
|
|
||||||
if (callback == null) {
|
|
||||||
Log.i(TAG, "Unexpected error, callback is null!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jPushMessage.getErrorCode() == 0) {
|
|
||||||
try {
|
|
||||||
resultJson.put("tag", jPushMessage.getCheckTag());
|
resultJson.put("tag", jPushMessage.getCheckTag());
|
||||||
resultJson.put("isBind", jPushMessage.getTagCheckStateResult());
|
resultJson.put("isBind", jPushMessage.getTagCheckStateResult());
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
callback.success(resultJson);
|
});
|
||||||
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
resultJson.put("code", jPushMessage.getErrorCode());
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
callback.error(resultJson);
|
|
||||||
}
|
|
||||||
|
|
||||||
JPushPlugin.eventCallbackMap.remove(sequence);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
|
public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
|
||||||
super.onAliasOperatorResult(context, jPushMessage);
|
super.onAliasOperatorResult(context, jPushMessage);
|
||||||
|
|
||||||
//Log.e(TAG,"onAliasOperatorResult:"+jPushMessage);
|
JLogger.d(TAG,"onAliasOperatorResult:"+jPushMessage);
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
|
|
||||||
int sequence = jPushMessage.getSequence();
|
tryCallback(jPushMessage, new SuccessCallback() {
|
||||||
try {
|
@Override
|
||||||
resultJson.put("sequence", sequence);
|
public void onSuccessCallback(JSONObject resultJson) throws JSONException {
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
CallbackContext callback = JPushPlugin.eventCallbackMap.get(sequence);
|
|
||||||
|
|
||||||
if (callback == null) {
|
|
||||||
Log.i(TAG, "Unexpected error, callback is null!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jPushMessage.getErrorCode() == 0) { // success
|
|
||||||
try {
|
|
||||||
if (!TextUtils.isEmpty(jPushMessage.getAlias())) {
|
if (!TextUtils.isEmpty(jPushMessage.getAlias())) {
|
||||||
resultJson.put("alias", jPushMessage.getAlias());
|
resultJson.put("alias", jPushMessage.getAlias());
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
callback.success(resultJson);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
resultJson.put("code", jPushMessage.getErrorCode());
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
callback.error(resultJson);
|
|
||||||
}
|
|
||||||
|
|
||||||
JPushPlugin.eventCallbackMap.remove(sequence);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRegister(Context context, String regId) {
|
public void onRegister(Context context, String regId) {
|
||||||
//Log.e(TAG,"onRegister:"+regId);
|
JLogger.d(TAG,"onRegister:"+regId);
|
||||||
JPushPlugin.transmitReceiveRegistrationId(regId);
|
JPushPlugin.transmitReceiveRegistrationId(regId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,24 +92,74 @@ public class JPushEventReceiver extends JPushMessageReceiver {
|
|||||||
public void onNotifyMessageArrived(Context context, NotificationMessage notificationMessage) {
|
public void onNotifyMessageArrived(Context context, NotificationMessage notificationMessage) {
|
||||||
super.onNotifyMessageArrived(context, notificationMessage);
|
super.onNotifyMessageArrived(context, notificationMessage);
|
||||||
|
|
||||||
//Log.e(TAG,"onNotifyMessageArrived:"+notificationMessage);
|
JLogger.d(TAG,"onNotifyMessageArrived:"+notificationMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNotifyMessageOpened(Context context, NotificationMessage notificationMessage) {
|
public void onNotifyMessageOpened(Context context, NotificationMessage notificationMessage) {
|
||||||
super.onNotifyMessageOpened(context, notificationMessage);
|
super.onNotifyMessageOpened(context, notificationMessage);
|
||||||
//Log.e(TAG,"onNotifyMessageOpened:"+notificationMessage);
|
JLogger.d(TAG,"onNotifyMessageOpened:"+notificationMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) {
|
public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) {
|
||||||
super.onMobileNumberOperatorResult(context, jPushMessage);
|
super.onMobileNumberOperatorResult(context, jPushMessage);
|
||||||
//Log.e(TAG,"onMobileNumberOperatorResult:"+jPushMessage);
|
JLogger.d(TAG,"onMobileNumberOperatorResult:"+jPushMessage);
|
||||||
|
|
||||||
|
tryCallback(jPushMessage, new SuccessCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccessCallback(JSONObject resultJson) throws JSONException {
|
||||||
|
if (!TextUtils.isEmpty(jPushMessage.getMobileNumber())) {
|
||||||
|
resultJson.put("mobileNumber", jPushMessage.getMobileNumber());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMultiActionClicked(Context context, Intent intent) {
|
public void onMultiActionClicked(Context context, Intent intent) {
|
||||||
super.onMultiActionClicked(context, intent);
|
super.onMultiActionClicked(context, intent);
|
||||||
//Log.e(TAG,"onMultiActionClicked:"+intent);
|
JLogger.d(TAG,"onMultiActionClicked:"+intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SuccessCallback{
|
||||||
|
void onSuccessCallback(JSONObject resultJson) throws JSONException;
|
||||||
|
}
|
||||||
|
public void tryCallback(JPushMessage jPushMessage,SuccessCallback successCallback){
|
||||||
|
JSONObject resultJson = new JSONObject();
|
||||||
|
|
||||||
|
int sequence = jPushMessage.getSequence();
|
||||||
|
try {
|
||||||
|
resultJson.put("sequence", sequence);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
CallbackContext callback = JPushPlugin.eventCallbackMap.get(sequence);
|
||||||
|
|
||||||
|
if (callback == null) {
|
||||||
|
Logger.i(TAG, "Unexpected error, callback is null!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jPushMessage.getErrorCode() == 0) {
|
||||||
|
try {
|
||||||
|
successCallback.onSuccessCallback(resultJson);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
callback.success(resultJson);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
resultJson.put("code", jPushMessage.getErrorCode());
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
callback.error(resultJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
JPushPlugin.eventCallbackMap.remove(sequence);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,9 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
||||||
super.initialize(cordova, webView);
|
super.initialize(cordova, webView);
|
||||||
mContext = cordova.getActivity().getApplicationContext();
|
mContext = cordova.getActivity().getApplicationContext();
|
||||||
|
Log.d(TAG,"initialize plugin");
|
||||||
|
|
||||||
JPushInterface.init(mContext);
|
// JPushInterface.init(mContext);
|
||||||
|
|
||||||
cordovaActivity = cordova.getActivity();
|
cordovaActivity = cordova.getActivity();
|
||||||
|
|
||||||
@@ -254,6 +255,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
try {
|
try {
|
||||||
mode = data.getBoolean(0);
|
mode = data.getBoolean(0);
|
||||||
JPushInterface.setDebugMode(mode);
|
JPushInterface.setDebugMode(mode);
|
||||||
|
JLogger.setLoggerEnable(mode);
|
||||||
callbackContext.success();
|
callbackContext.success();
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -296,6 +298,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("error reading num json");
|
callbackContext.error("error reading num json");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (num != -1) {
|
if (num != -1) {
|
||||||
JPushInterface.setLatestNotificationNumber(mContext, num);
|
JPushInterface.setLatestNotificationNumber(mContext, num);
|
||||||
@@ -364,6 +367,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.setAlias(mContext, sequence, alias);
|
JPushInterface.setAlias(mContext, sequence, alias);
|
||||||
@@ -379,6 +383,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.deleteAlias(mContext, sequence);
|
JPushInterface.deleteAlias(mContext, sequence);
|
||||||
@@ -394,6 +399,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.getAlias(mContext, sequence);
|
JPushInterface.getAlias(mContext, sequence);
|
||||||
@@ -416,6 +422,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.setTags(mContext, sequence, tags);
|
JPushInterface.setTags(mContext, sequence, tags);
|
||||||
@@ -438,6 +445,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.addTags(mContext, sequence, tags);
|
JPushInterface.addTags(mContext, sequence, tags);
|
||||||
@@ -460,6 +468,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.deleteTags(mContext, sequence, tags);
|
JPushInterface.deleteTags(mContext, sequence, tags);
|
||||||
@@ -476,6 +485,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.cleanTags(mContext, sequence);
|
JPushInterface.cleanTags(mContext, sequence);
|
||||||
@@ -492,6 +502,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.getAllTags(mContext, sequence);
|
JPushInterface.getAllTags(mContext, sequence);
|
||||||
@@ -510,6 +521,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
callbackContext.error("Parameters error.");
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushInterface.checkTagBindState(mContext, sequence, tag);
|
JPushInterface.checkTagBindState(mContext, sequence, tag);
|
||||||
@@ -642,6 +654,25 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
JPushInterface.setBadgeNumber(mContext, badgeNumb);
|
JPushInterface.setBadgeNumber(mContext, badgeNumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setMobileNumber(JSONArray data, CallbackContext callbackContext) throws JSONException {
|
||||||
|
int sequence = -1;
|
||||||
|
String number = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
JSONObject params = data.getJSONObject(0);
|
||||||
|
sequence = params.getInt("sequence");
|
||||||
|
number = params.getString("mobileNumber");
|
||||||
|
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
callbackContext.error("Parameters error.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
eventCallbackMap.put(sequence, callbackContext);
|
||||||
|
JPushInterface.setMobileNumber(mContext,sequence, number);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isValidHour(int hour) {
|
private boolean isValidHour(int hour) {
|
||||||
return !(hour < 0 || hour > 23);
|
return !(hour < 0 || hour > 23);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
BIN
src/android/libs/jpush-android-4.2.8.jar
Executable file
BIN
src/android/libs/jpush-android-4.2.8.jar
Executable file
Binary file not shown.
BIN
src/android/res/drawable-hdpi/jpush_ic_action_cancle.png
Executable file
BIN
src/android/res/drawable-hdpi/jpush_ic_action_cancle.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 551 B |
BIN
src/android/res/drawable-hdpi/jpush_ic_action_close.png
Executable file
BIN
src/android/res/drawable-hdpi/jpush_ic_action_close.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 591 B |
BIN
src/android/res/drawable-hdpi/jpush_ic_action_close2.png
Executable file
BIN
src/android/res/drawable-hdpi/jpush_ic_action_close2.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 759 B |
@@ -3,21 +3,21 @@
|
|||||||
android:id="@+id/push_root_view"
|
android:id="@+id/push_root_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:paddingTop="2dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingBottom="4dp">
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/v21"
|
android:id="@+id/v21"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layout_version_2"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp" />
|
android:layout_height="0dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/push_notification_style_default"
|
android:id="@+id/push_notification_style_default"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/push_notification_layout_lefttop"
|
android:id="@+id/push_notification_layout_lefttop"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
android:id="@+id/push_notification_small_icon"
|
android:id="@+id/push_notification_small_icon"
|
||||||
android:layout_width="18dp"
|
android:layout_width="18dp"
|
||||||
android:layout_height="18dp"
|
android:layout_height="18dp"
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
<TextView
|
<TextView
|
||||||
style="@android:style/TextAppearance.Material.Notification.Title"
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
@@ -49,8 +48,9 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="4dp"
|
||||||
android:text="· "
|
android:textStyle="bold"
|
||||||
android:textSize="20sp" />
|
android:text="·"
|
||||||
|
android:textSize="16sp" />
|
||||||
<TextView
|
<TextView
|
||||||
style="@android:style/TextAppearance.Material.Notification.Time"
|
style="@android:style/TextAppearance.Material.Notification.Time"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
@@ -59,57 +59,69 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_height="0dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_above="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_main_layout"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/push_notification_banner_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:layout_below="@id/push_notification_layout_lefttop">
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_sub_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content_one_line"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/push_notification_big_icon"
|
android:id="@+id/push_notification_big_icon"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_alignTop="@+id/push_notification_main_layout"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_alignBottom="@+id/push_notification_main_layout"
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@android:style/TextAppearance.Material.Notification.Title"
|
|
||||||
android:id="@+id/push_notification_sub_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:layout_below="@id/push_notification_layout_lefttop"
|
|
||||||
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@android:style/TextAppearance.Material.Notification.Info"
|
|
||||||
android:id="@+id/push_notification_content"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:layout_below="@id/push_notification_sub_title"
|
|
||||||
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:textSize="13sp" />
|
|
||||||
<TextView
|
|
||||||
style="@android:style/TextAppearance.Material.Notification.Info"
|
|
||||||
android:id="@+id/push_notification_content_one_line"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
|
||||||
android:layout_below="@id/push_notification_sub_title"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:visibility="gone" />
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
@@ -125,45 +137,160 @@
|
|||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_marginLeft="6dp"
|
android:id="@+id/push_notification_style_1_main_layout"
|
||||||
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
|
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
<TextView
|
android:id="@+id/push_notification_layout_time"
|
||||||
style="@android:style/TextAppearance.Material.Notification.Time"
|
android:gravity="center_vertical"
|
||||||
android:id="@+id/push_notification_style_1_date"
|
android:weightSum="1"
|
||||||
android:layout_height="wrap_content"
|
android:orientation="horizontal">
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@android:style/TextAppearance.Material.Notification.Title"
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
android:id="@+id/push_notification_style_1_title"
|
android:id="@+id/push_notification_style_1_title"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toLeftOf="@+id/push_notification_style_1_date"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
</RelativeLayout>
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:id="@+id/push_notification_style_1_date"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="right"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView android:id="@+id/push_notification_null"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_height="20dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@android:style/TextAppearance.Material.Notification.Info"
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
android:id="@+id/push_notification_style_1_content"
|
android:id="@+id/push_notification_style_1_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:layout_marginTop="1dp"
|
android:layout_marginTop="1dp"
|
||||||
android:maxLines="2"
|
android:maxLines="1"
|
||||||
android:textSize="13sp" />
|
android:textSize="13sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_below="@id/push_notification_style_1_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_banner_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_header_neg_fb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView android:id="@+id/push_notification_header_expand"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:background="#08000000"
|
||||||
|
android:src="@drawable/jpush_ic_action_close"
|
||||||
|
android:visibility="visible"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_fb_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:layout_below="@id/push_notification_header_expand"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="不感兴趣"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="重复收到"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容低质"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容不宜"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
298
src/android/res/layout-v21/push_notification_large.xml
Executable file
298
src/android/res/layout-v21/push_notification_large.xml
Executable file
@@ -0,0 +1,298 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_root_view"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="256dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/v21"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layout_version_2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp" />
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_style_default"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_layout_lefttop"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_small_icon"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:maxWidth="200dp"
|
||||||
|
android:maxLength="24"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_dot"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="·"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:id="@+id/push_notification_date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_height="0dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:layout_above="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_main_layout"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/push_notification_banner_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:layout_below="@id/push_notification_layout_lefttop">
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_sub_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content_one_line"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_big_icon"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignTop="@+id/push_notification_main_layout"
|
||||||
|
android:layout_alignBottom="@+id/push_notification_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_style_1"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_big_icon"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_style_1_main_layout"
|
||||||
|
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/push_notification_layout_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_style_1_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:id="@+id/push_notification_style_1_date"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:gravity="right"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView android:id="@+id/push_notification_null"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_height="20dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_style_1_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_below="@id/push_notification_style_1_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
</RelativeLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_banner_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_header_neg_fb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView android:id="@+id/push_notification_header_expand"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:background="#08000000"
|
||||||
|
android:src="@drawable/jpush_ic_action_close"
|
||||||
|
android:visibility="visible"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_fb_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:layout_below="@id/push_notification_header_expand"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="不感兴趣"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="重复收到"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容低质"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容不宜"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
298
src/android/res/layout-v21/push_notification_middle.xml
Executable file
298
src/android/res/layout-v21/push_notification_middle.xml
Executable file
@@ -0,0 +1,298 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_root_view"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="202dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/v21"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layout_version_2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp" />
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_style_default"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_layout_lefttop"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_small_icon"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:maxWidth="200dp"
|
||||||
|
android:maxLength="24"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_dot"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="·"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:id="@+id/push_notification_date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_height="0dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_above="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_main_layout"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/push_notification_banner_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:layout_below="@id/push_notification_layout_lefttop">
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_sub_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content_one_line"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_big_icon"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignTop="@+id/push_notification_main_layout"
|
||||||
|
android:layout_alignBottom="@+id/push_notification_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_style_1"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_big_icon"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_style_1_main_layout"
|
||||||
|
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/push_notification_layout_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_style_1_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:id="@+id/push_notification_style_1_date"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:gravity="right"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView android:id="@+id/push_notification_null"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_height="20dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_style_1_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_below="@id/push_notification_style_1_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
</RelativeLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_banner_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_header_neg_fb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView android:id="@+id/push_notification_header_expand"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:background="#08000000"
|
||||||
|
android:src="@drawable/jpush_ic_action_close"
|
||||||
|
android:visibility="visible"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_fb_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:layout_below="@id/push_notification_header_expand"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="不感兴趣"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="重复收到"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容低质"/>
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容不宜"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
85
src/android/res/layout/jpush_inapp_banner.xml
Executable file
85
src/android/res/layout/jpush_inapp_banner.xml
Executable file
@@ -0,0 +1,85 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/banner_root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clipChildren="false"
|
||||||
|
android:clipToPadding="false">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="1.0">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/banner_content_root"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="15dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/banner_image_only"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:scaleType="fitXY"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/banner_image"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_width="64dp"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:visibility="visible" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/banner_text_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="74dp"
|
||||||
|
android:layout_toRightOf="@id/banner_image"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_centerInParent="true">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/banner_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toRightOf="@+id/banner_image"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:text=""
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:visibility="visible" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/banner_body"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/banner_title"
|
||||||
|
android:layout_toRightOf="@+id/banner_image"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:text=""
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
@@ -3,21 +3,21 @@
|
|||||||
android:id="@+id/push_root_view"
|
android:id="@+id/push_root_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:paddingTop="2dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingBottom="4dp">
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/v"
|
android:id="@+id/v"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layout_version_2"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp" />
|
android:layout_height="0dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/push_notification_style_default"
|
android:id="@+id/push_notification_style_default"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/push_notification_layout_lefttop"
|
android:id="@+id/push_notification_layout_lefttop"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -31,10 +31,9 @@
|
|||||||
android:id="@+id/push_notification_small_icon"
|
android:id="@+id/push_notification_small_icon"
|
||||||
android:layout_width="18dp"
|
android:layout_width="18dp"
|
||||||
android:layout_height="18dp"
|
android:layout_height="18dp"
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
<TextView
|
<TextView
|
||||||
style="@android:style/TextAppearance.Material.Notification.Title"
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
android:id="@+id/push_notification_title"
|
android:id="@+id/push_notification_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -44,72 +43,85 @@
|
|||||||
android:maxLength="24"
|
android:maxLength="24"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
<TextView
|
<TextView
|
||||||
style="@*android:style/TextAppearance.StatusBar.EventContent.Info"
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
android:id="@+id/push_notification_dot"
|
android:id="@+id/push_notification_dot"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="4dp"
|
||||||
android:text="· "
|
android:textStyle="bold"
|
||||||
android:textSize="20sp" />
|
android:text="·"
|
||||||
|
android:textSize="16sp" />
|
||||||
<TextView
|
<TextView
|
||||||
style="@*android:style/TextAppearance.StatusBar.EventContent.Time"
|
style="@*android:style/TextAppearance.Material.Notification.Time"
|
||||||
android:id="@+id/push_notification_date"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:id="@+id/push_notification_date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_height="0dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_above="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_main_layout"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/push_notification_banner_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:layout_below="@id/push_notification_layout_lefttop">
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_sub_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content_one_line"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/push_notification_big_icon"
|
android:id="@+id/push_notification_big_icon"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_alignTop="@+id/push_notification_main_layout"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_alignBottom="@+id/push_notification_main_layout"
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@android:style/TextAppearance.Material.Notification.Title"
|
|
||||||
android:id="@+id/push_notification_sub_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:layout_below="@id/push_notification_layout_lefttop"
|
|
||||||
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@*android:style/TextAppearance.StatusBar.EventContent.Info"
|
|
||||||
android:id="@+id/push_notification_content"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:layout_below="@id/push_notification_sub_title"
|
|
||||||
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:textSize="13sp" />
|
|
||||||
<TextView
|
|
||||||
style="@*android:style/TextAppearance.StatusBar.EventContent.Info"
|
|
||||||
android:id="@+id/push_notification_content_one_line"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="4dp"
|
|
||||||
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
|
||||||
android:layout_below="@id/push_notification_sub_title"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginLeft="6dp"
|
|
||||||
android:layout_marginTop="1dp"
|
|
||||||
android:textSize="13sp"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:visibility="gone" />
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
@@ -125,45 +137,161 @@
|
|||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:scaleType="centerInside" />
|
android:scaleType="centerInside" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_marginLeft="6dp"
|
android:id="@+id/push_notification_style_1_main_layout"
|
||||||
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
|
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/push_notification_layout_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
<TextView
|
<TextView
|
||||||
style="@*android:style/TextAppearance.StatusBar.EventContent.Time"
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
android:id="@+id/push_notification_style_1_date"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
<TextView
|
|
||||||
style="@android:style/TextAppearance.Material.Notification.Title"
|
|
||||||
android:id="@+id/push_notification_style_1_title"
|
android:id="@+id/push_notification_style_1_title"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toLeftOf="@+id/push_notification_style_1_date"
|
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
</RelativeLayout>
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:id="@+id/push_notification_style_1_date"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:gravity="right"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView android:id="@+id/push_notification_null"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_height="20dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@*android:style/TextAppearance.StatusBar.EventContent.Info"
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
android:id="@+id/push_notification_style_1_content"
|
android:id="@+id/push_notification_style_1_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="4dp"
|
android:layout_marginRight="4dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:layout_marginTop="1dp"
|
android:layout_marginTop="1dp"
|
||||||
android:maxLines="2"
|
android:maxLines="1"
|
||||||
android:textSize="13sp" />
|
android:textSize="13sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_below="@id/push_notification_style_1_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_banner_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_header_neg_fb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView android:id="@+id/push_notification_header_expand"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:background="#08000000"
|
||||||
|
android:src="@drawable/jpush_ic_action_close"
|
||||||
|
android:visibility="visible"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_fb_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:layout_below="@id/push_notification_header_expand"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="不感兴趣"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="重复收到"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容低质"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容不宜"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
297
src/android/res/layout/push_notification_large.xml
Executable file
297
src/android/res/layout/push_notification_large.xml
Executable file
@@ -0,0 +1,297 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_root_view"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="256dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/v"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layout_version_2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp" />
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_style_default"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_layout_lefttop"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_small_icon"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:maxWidth="200dp"
|
||||||
|
android:maxLength="24"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_dot"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="·"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:id="@+id/push_notification_date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_height="0dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:layout_above="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_main_layout"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/push_notification_banner_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:layout_below="@id/push_notification_layout_lefttop">
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_sub_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content_one_line"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_big_icon"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignTop="@+id/push_notification_main_layout"
|
||||||
|
android:layout_alignBottom="@+id/push_notification_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_style_1"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_big_icon"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_style_1_main_layout"
|
||||||
|
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/push_notification_layout_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_style_1_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:id="@+id/push_notification_style_1_date"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:gravity="right"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView android:id="@+id/push_notification_null"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_height="20dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_style_1_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_below="@id/push_notification_style_1_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
</RelativeLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_banner_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_header_neg_fb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView android:id="@+id/push_notification_header_expand"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:background="#08000000"
|
||||||
|
android:src="@drawable/jpush_ic_action_close"
|
||||||
|
android:visibility="visible"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_fb_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:layout_below="@id/push_notification_header_expand"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="不感兴趣"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="重复收到"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容低质"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容不宜"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
297
src/android/res/layout/push_notification_middle.xml
Executable file
297
src/android/res/layout/push_notification_middle.xml
Executable file
@@ -0,0 +1,297 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_root_view"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="202dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/v"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layout_version_2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp" />
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_style_default"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_layout_lefttop"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_small_icon"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:maxWidth="200dp"
|
||||||
|
android:maxLength="24"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_dot"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="·"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:id="@+id/push_notification_date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_height="0dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_above="@+id/push_notification_for_bottom_margin"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_main_layout"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/push_notification_banner_icon"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_toLeftOf="@+id/push_notification_big_icon"
|
||||||
|
android:layout_below="@id/push_notification_layout_lefttop">
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_sub_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_content_one_line"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_big_icon"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignTop="@+id/push_notification_main_layout"
|
||||||
|
android:layout_alignBottom="@+id/push_notification_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_style_1"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_big_icon"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_style_1_main_layout"
|
||||||
|
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/push_notification_layout_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Title"
|
||||||
|
android:id="@+id/push_notification_style_1_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Time"
|
||||||
|
android:id="@+id/push_notification_style_1_date"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:gravity="right"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
<TextView android:id="@+id/push_notification_null"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_height="20dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@*android:style/TextAppearance.Material.Notification.Info"
|
||||||
|
android:id="@+id/push_notification_style_1_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="4dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_style_1_banner_icon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_below="@id/push_notification_style_1_main_layout"
|
||||||
|
android:scaleType="centerInside" />
|
||||||
|
</RelativeLayout>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/push_notification_banner_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/push_notification_banner_img"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/push_notification_header_neg_fb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ImageView android:id="@+id/push_notification_header_expand"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_width="14dp"
|
||||||
|
android:layout_height="14dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:background="#08000000"
|
||||||
|
android:src="@drawable/jpush_ic_action_close"
|
||||||
|
android:visibility="visible"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/push_notification_fb_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:layout_below="@id/push_notification_header_expand"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="不感兴趣"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="重复收到"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容低质"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/push_notification_fb_content_no_like4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#88000000"
|
||||||
|
android:background="#0f000000"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:text="内容不宜"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
@@ -73,6 +73,9 @@ static NSMutableDictionary *_jpushEventCache;
|
|||||||
-(void)addDismissActions:(CDVInvokedUrlCommand*)command;
|
-(void)addDismissActions:(CDVInvokedUrlCommand*)command;
|
||||||
-(void)addNotificationActions:(CDVInvokedUrlCommand*)command;
|
-(void)addNotificationActions:(CDVInvokedUrlCommand*)command;
|
||||||
|
|
||||||
|
// 设置手机号
|
||||||
|
-(void)setMobileNumber:(CDVInvokedUrlCommand*)command;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 以下为js中可监听到的事件
|
* 以下为js中可监听到的事件
|
||||||
* jpush.openNotification 点击推送消息启动或唤醒app
|
* jpush.openNotification 点击推送消息启动或唤醒app
|
||||||
|
|||||||
@@ -510,6 +510,29 @@
|
|||||||
[[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:category]];
|
[[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:category]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - 设置手机号
|
||||||
|
-(void)setMobileNumber:(CDVInvokedUrlCommand *)command {
|
||||||
|
NSDictionary* params = [command.arguments objectAtIndex:0];
|
||||||
|
NSNumber* sequence = params[@"sequence"];
|
||||||
|
NSString* number = params[@"mobileNumber"];
|
||||||
|
[JPUSHService setMobileNumber:number completion:^(NSError *error) {
|
||||||
|
NSMutableDictionary* dic = [[NSMutableDictionary alloc] init];
|
||||||
|
[dic setObject:sequence forKey:@"sequence"];
|
||||||
|
CDVPluginResult* result;
|
||||||
|
if (error) {
|
||||||
|
[dic setValue:[NSNumber numberWithUnsignedInteger:error.code] forKey:@"code"];
|
||||||
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// success
|
||||||
|
[dic setObject:number forKey:@"mobileNumber"];
|
||||||
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
|
||||||
|
}
|
||||||
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
||||||
|
}];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - 内部方法
|
#pragma mark - 内部方法
|
||||||
|
|
||||||
+(void)setupJPushSDK:(NSDictionary*)userInfo{
|
+(void)setupJPushSDK:(NSDictionary*)userInfo{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
|
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPUSH_VERSION_NUMBER 3.3.3
|
#define JPUSH_VERSION_NUMBER 3.7.4
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@@ -20,12 +20,15 @@
|
|||||||
@class UNNotificationSettings;
|
@class UNNotificationSettings;
|
||||||
@class UNNotificationRequest;
|
@class UNNotificationRequest;
|
||||||
@class UNNotification;
|
@class UNNotification;
|
||||||
|
@class UIView;
|
||||||
@protocol JPUSHRegisterDelegate;
|
@protocol JPUSHRegisterDelegate;
|
||||||
@protocol JPUSHGeofenceDelegate;
|
@protocol JPUSHGeofenceDelegate;
|
||||||
|
@protocol JPushInMessageDelegate;
|
||||||
|
|
||||||
typedef void (^JPUSHTagsOperationCompletion)(NSInteger iResCode, NSSet *iTags, NSInteger seq);
|
typedef void (^JPUSHTagsOperationCompletion)(NSInteger iResCode, NSSet *iTags, NSInteger seq);
|
||||||
typedef void (^JPUSHTagValidOperationCompletion)(NSInteger iResCode, NSSet *iTags, NSInteger seq, BOOL isBind);
|
typedef void (^JPUSHTagValidOperationCompletion)(NSInteger iResCode, NSSet *iTags, NSInteger seq, BOOL isBind);
|
||||||
typedef void (^JPUSHAliasOperationCompletion)(NSInteger iResCode, NSString *iAlias, NSInteger seq);
|
typedef void (^JPUSHAliasOperationCompletion)(NSInteger iResCode, NSString *iAlias, NSInteger seq);
|
||||||
|
typedef void (^JPUSHInMssageCompletion)(NSInteger iResCode);
|
||||||
|
|
||||||
extern NSString *const kJPFNetworkIsConnectingNotification; // 正在连接中
|
extern NSString *const kJPFNetworkIsConnectingNotification; // 正在连接中
|
||||||
extern NSString *const kJPFNetworkDidSetupNotification; // 建立连接
|
extern NSString *const kJPFNetworkDidSetupNotification; // 建立连接
|
||||||
@@ -55,6 +58,17 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {
|
|||||||
JPAuthorizationStatusProvisional NS_AVAILABLE_IOS(12.0), // The application is authorized to post non-interruptive user notifications.
|
JPAuthorizationStatusProvisional NS_AVAILABLE_IOS(12.0), // The application is authorized to post non-interruptive user notifications.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger,JPushInMessageContentType){
|
||||||
|
JPushAdContentType = 1, //广告类型的inMessage
|
||||||
|
JPushNotiContentType = 2, //通知类型的inMessage
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, JPInMessageType) {
|
||||||
|
JPInMessageTypeBanner = (1 << 0), // 横幅
|
||||||
|
JPInMessageTypeModal = (1 << 1), // 模态
|
||||||
|
JPInMessageTypeFloat = (1 << 2), // 小浮窗
|
||||||
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* 通知注册实体类
|
* 通知注册实体类
|
||||||
*/
|
*/
|
||||||
@@ -415,7 +429,14 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {
|
|||||||
默认值为 10 ,iOS系统默认地理围栏最大个数为20
|
默认值为 10 ,iOS系统默认地理围栏最大个数为20
|
||||||
@param count 个数 count
|
@param count 个数 count
|
||||||
*/
|
*/
|
||||||
+ (void)setGeofenecMaxCount:(NSInteger)count;
|
+ (void)setGeofeneceMaxCount:(NSInteger)count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
设置地理围栏'圈内'类型的检测周期
|
||||||
|
默认15分钟检测一次
|
||||||
|
*/
|
||||||
|
+ (void)setGeofenecePeriodForInside:(NSInteger)seconds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
注册地理围栏的代理
|
注册地理围栏的代理
|
||||||
|
|
||||||
@@ -641,6 +662,96 @@ typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {
|
|||||||
*/
|
*/
|
||||||
+ (void)setLocationEanable:(BOOL)isEanble;
|
+ (void)setLocationEanable:(BOOL)isEanble;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 设置应用内消息的代理
|
||||||
|
*
|
||||||
|
* @discussion 遵守JPushInMessageDelegate的代理对象
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
+ (void)setInMessageDelegate:(id<JPushInMessageDelegate>)inMessageDelegate;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 设置应用内消息的inMessageView的父控件
|
||||||
|
*
|
||||||
|
* @discussion 建议设置成当前展示的window,SDK默认取当前APP顶层的Window。
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
+ (void)setInMessageSuperView:(UIView *)view;
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 主动拉取应用内消息的接口
|
||||||
|
*
|
||||||
|
* @discussion 拉取结果的回调
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
+ (void)pullInMessageCompletion:(JPUSHInMssageCompletion)completion __attribute__((deprecated("JPush 3.7.0 版本已过期")));
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 主动拉取应用内消息的接口
|
||||||
|
*
|
||||||
|
* @param types 应用内消息样式
|
||||||
|
*
|
||||||
|
* @discussion 拉取结果的回调
|
||||||
|
*/
|
||||||
|
+ (void)pullInMessageWithTypes:(NSUInteger)types completion:(JPUSHInMssageCompletion)completion __attribute__((deprecated("JPush 3.7.0 版本已过期")));
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 主动拉取应用内消息的接口
|
||||||
|
*
|
||||||
|
* @param adPosition 广告位
|
||||||
|
*
|
||||||
|
* @discussion 拉取结果的回调
|
||||||
|
*/
|
||||||
|
+ (void)pullInMessageWithAdPosition:(NSString *)adPosition completion:(JPUSHInMssageCompletion)completion;
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 主动拉取应用内消息的接口
|
||||||
|
*
|
||||||
|
* @param params 拉取条件 可传参数: @"adPosition" -> 广告位 NSString, @"event" -> 事件 NSString
|
||||||
|
*
|
||||||
|
* @discussion 拉取结果的回调
|
||||||
|
*/
|
||||||
|
+ (void)pullInMessageWithParams:(NSDictionary *)params completion:(JPUSHInMssageCompletion)completion;
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 通过事件触发应用内消息下发
|
||||||
|
*
|
||||||
|
* @param event 事件
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
+ (void)triggerInMessageByEvent:(NSString *)event;
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 在页面切换的时候调用,告诉sdk当前切换到的页面名称
|
||||||
|
*
|
||||||
|
* @param className 当前页面的类名
|
||||||
|
*
|
||||||
|
* @discussion
|
||||||
|
通过定向页面触发应用内消息下发的功能、页面跳转到黑名单页面隐藏正在曝光中的inapp的功能、inapp页面延迟展示功能都依赖于该接口调用。
|
||||||
|
请在页面切换的时候调用此方法。确保在所有页面的viewDidAppear中调用此方法。不然可能会造成inapp部分功能不完善。建议在viewController的基类中调用,或者使用method swizzling方法交换viewController的viewDidAppear方法。
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
+ (void)currentViewControllerName:(NSString *)className;
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @abstract 通过定向页面触发应用内消息下发
|
||||||
|
*
|
||||||
|
* @param pageName 当前页面的类名
|
||||||
|
*
|
||||||
|
* @discussion 请在页面切换的时候调用此方法。确保在所有页面的viewDidAppear中调用此方法。不然可能会造成该功能不完善。建议在viewController的基类中调用,或者使用method swizzling方法交换viewController的viewDidAppear方法。
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
+ (void)triggerInMessageByPageChange:(NSString *)pageName __attribute__((deprecated("JPush 3.7.4 版本已过期")));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
///----------------------------------------------------
|
||||||
///********************下列方法已过期********************
|
///********************下列方法已过期********************
|
||||||
///**************请使用新版tag/alias操作接口**************
|
///**************请使用新版tag/alias操作接口**************
|
||||||
@@ -713,6 +824,20 @@ callbackSelector:(SEL)cbSelector
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
@protocol JPUSHGeofenceDelegate <NSObject>
|
@protocol JPUSHGeofenceDelegate <NSObject>
|
||||||
|
/**
|
||||||
|
触发地理围栏
|
||||||
|
@param geofence 地理围栏触发时返回的信息
|
||||||
|
@param error 错误信息
|
||||||
|
*/
|
||||||
|
- (void)jpushGeofenceRegion:(NSDictionary *)geofence
|
||||||
|
error:(NSError *)error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
拉取地理围栏列表的回调
|
||||||
|
|
||||||
|
@param geofenceList 地理围栏列表
|
||||||
|
*/
|
||||||
|
- (void)jpushCallbackGeofenceReceived:(NSArray<NSDictionary*> *)geofenceList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
进入地理围栏区域
|
进入地理围栏区域
|
||||||
@@ -721,7 +846,7 @@ callbackSelector:(SEL)cbSelector
|
|||||||
@param userInfo 地理围栏触发时返回的信息
|
@param userInfo 地理围栏触发时返回的信息
|
||||||
@param error 错误信息
|
@param error 错误信息
|
||||||
*/
|
*/
|
||||||
- (void)jpushGeofenceIdentifer:(NSString *)geofenceId didEnterRegion:(NSDictionary *)userInfo error:(NSError *)error;
|
- (void)jpushGeofenceIdentifer:(NSString *)geofenceId didEnterRegion:(NSDictionary *)userInfo error:(NSError *)error __attribute__((deprecated("JPush 3.6.0 版本已过期")));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
离开地理围栏区域
|
离开地理围栏区域
|
||||||
@@ -730,6 +855,46 @@ callbackSelector:(SEL)cbSelector
|
|||||||
@param userInfo 地理围栏触发时返回的信息
|
@param userInfo 地理围栏触发时返回的信息
|
||||||
@param error 错误信息
|
@param error 错误信息
|
||||||
*/
|
*/
|
||||||
- (void)jpushGeofenceIdentifer:(NSString *)geofenceId didExitRegion:(NSDictionary *)userInfo error:(NSError *)error;
|
- (void)jpushGeofenceIdentifer:(NSString *)geofenceId didExitRegion:(NSDictionary *)userInfo error:(NSError *)error __attribute__((deprecated("JPush 3.6.0 版本已过期")));
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@protocol JPushInMessageDelegate <NSObject>
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
*是否允许应用内消息弹出,默认为允许
|
||||||
|
*/
|
||||||
|
- (BOOL)jPushInMessageIsAllowedInMessagePop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*应用内消息展示的回调
|
||||||
|
*/
|
||||||
|
- (void)jPushInMessageAlreadyPop __attribute__((deprecated("JPush 3.4.0 版本已过期")));
|
||||||
|
|
||||||
|
/**
|
||||||
|
*应用内消息已消失
|
||||||
|
*/
|
||||||
|
- (void)jPushInMessageAlreadyDisappear;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
inMessage展示的回调
|
||||||
|
|
||||||
|
@param messageType inMessage
|
||||||
|
@param content 下发的数据,广告类的返回数据为空时返回的信息
|
||||||
|
|
||||||
|
*/
|
||||||
|
- (void)jPushInMessageAlreadyPopInMessageType:(JPushInMessageContentType)messageType Content:(NSDictionary *)content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
inMessage点击的回调
|
||||||
|
|
||||||
|
@param messageType inMessage
|
||||||
|
@param content 下发的数据,广告类的返回数据为空时返回的信息
|
||||||
|
|
||||||
|
*/
|
||||||
|
- (void)jpushInMessagedidClickInMessageType:(JPushInMessageContentType)messageType Content:(NSDictionary *)content;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Binary file not shown.
BIN
src/ios/lib/jpush-ios-3.7.4.a
Executable file
BIN
src/ios/lib/jpush-ios-3.7.4.a
Executable file
Binary file not shown.
@@ -482,6 +482,20 @@ JPushPlugin.prototype.setBadgeNumber = function(badgeNumb) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置手机号。
|
||||||
|
*
|
||||||
|
* @param params = { 'sequence': number, 'mobileNumber': string }
|
||||||
|
*/
|
||||||
|
JPushPlugin.prototype.setMobileNumber = function(
|
||||||
|
params,
|
||||||
|
successCallback,
|
||||||
|
errorCallback
|
||||||
|
) {
|
||||||
|
this.callNative("setMobileNumber", [params], successCallback, errorCallback);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
if (!window.plugins) {
|
if (!window.plugins) {
|
||||||
window.plugins = {};
|
window.plugins = {};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user