mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-02-20 20:22:50 +08:00
support rich push.
This commit is contained in:
parent
1f2499a893
commit
4ed844e0c5
@ -2,7 +2,7 @@
|
||||
|
||||
[](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
||||
[](https://gitter.im/jpush/jpush-phonegap-plugin)
|
||||
[](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||
[](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||
[](https://github.com/jpush/jpush-phonegap-plugin)
|
||||
[](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jpush-phonegap-plugin",
|
||||
"version": "2.1.6",
|
||||
"version": "2.1.7",
|
||||
"description": "JPush for cordova plugin",
|
||||
"cordova": {
|
||||
"id": "cn.jpush.phonegap.JPushPlugin",
|
||||
|
19
plugin.xml
19
plugin.xml
@ -2,7 +2,7 @@
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
id="cn.jpush.phonegap.JPushPlugin"
|
||||
version="2.1.6">
|
||||
version="2.1.7">
|
||||
|
||||
<name>JPush Plugin</name>
|
||||
<description>JPush for cordova plugin</description>
|
||||
@ -95,6 +95,13 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- Rich push 核心功能 since 2.0.6-->
|
||||
<activity
|
||||
android:name="cn.jpush.android.ui.PopWinActivity"
|
||||
android:theme="@style/MyDialogStyle"
|
||||
android:exported="false">
|
||||
</activity>
|
||||
|
||||
<!-- Required SDK核心功能-->
|
||||
<service
|
||||
android:name="cn.jpush.android.service.DownloadService"
|
||||
@ -166,6 +173,7 @@
|
||||
<meta-data android:name="JPUSH_CHANNEL" android:value="developer-default"/>
|
||||
<meta-data android:name="JPUSH_APPKEY" android:value="$API_KEY"/>
|
||||
</config-file>
|
||||
|
||||
<source-file src="src/android/jpush-android-2.1.3.jar" target-dir="libs"/>
|
||||
<source-file src="src/android/armeabi/libjpush213.so" target-dir="libs/armeabi"/>
|
||||
<source-file src="src/android/armeabi-v7a/libjpush213.so" target-dir="libs/armeabi-v7a"/>
|
||||
@ -177,5 +185,14 @@
|
||||
<source-file src="src/android/MyReceiver.java" target-dir="src/cn/jpush/phonegap"/>
|
||||
<source-file src="src/android/test_notification_layout.xml" target-dir="res/layout"/>
|
||||
<source-file src="src/android/jpush_notification_icon.png" target-dir="res/drawable"/>
|
||||
|
||||
<!-- Rich Push resources -->
|
||||
<source-file src="src/android/ic_richpush_actionbar_back.png" target-dir="res/drawable" />
|
||||
<source-file src="src/android/ic_richpush_actionbar_divider.png" target-dir="res/drawable" />
|
||||
<source-file src="src/android/richpush_btn_selector.png" target-dir="res/drawable" />
|
||||
<source-file src="src/android/jpush_popwin_layout.xml" target-dir="res/layout" />
|
||||
<source-file src="src/android/jpush_style.xml" target-dir="res/layout" />
|
||||
<source-file src="src/android/jpush_webview_layout.xml" target-dir="res/layout" />
|
||||
|
||||
</platform>
|
||||
</plugin>
|
||||
|
@ -30,6 +30,10 @@ public class MyReceiver extends BroadcastReceiver {
|
||||
handlingNotificationReceive(context, intent);
|
||||
} else if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(action)) {
|
||||
handlingNotificationOpen(context, intent);
|
||||
} else if (JPushInterface.ACTION_RICHPUSH_CALLBACK.equals(action)) {
|
||||
// 当在 HTML 页面中调用 JPushWeb.triggerNativeAction(String params) 方法时触发此方法,
|
||||
// 再进行相关的操作。
|
||||
|
||||
} else {
|
||||
Log.d(TAG, "Unhandled intent - " + action);
|
||||
}
|
||||
|
BIN
src/android/ic_richpush_actionbar_back.png
Normal file
BIN
src/android/ic_richpush_actionbar_back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 695 B |
BIN
src/android/ic_richpush_actionbar_divider.png
Normal file
BIN
src/android/ic_richpush_actionbar_divider.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 181 B |
15
src/android/jpush_popwin_layout.xml
Normal file
15
src/android/jpush_popwin_layout.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/popLayoutId"
|
||||
style="@style/MyDialogStyle"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="250dp" >
|
||||
|
||||
<WebView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/wvPopwin"/>
|
||||
|
||||
</LinearLayout>
|
13
src/android/jpush_style.xml
Normal file
13
src/android/jpush_style.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<style name="MyDialogStyle">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
</style>
|
||||
</resources>
|
51
src/android/jpush_webview_layout.xml
Normal file
51
src/android/jpush_webview_layout.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<cn.jpush.android.ui.FullScreenView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/actionbarLayoutId"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rlRichpushTitleBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40.0dp"
|
||||
android:background="#29313a">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/imgRichpushBtnBack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="9dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/richpush_btn_selector" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@id/imgRichpushBtnBack"
|
||||
android:clickable="false"
|
||||
android:src="@drawable/ic_richpush_actionbar_divider" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRichpushTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_toRightOf="@id/imgView"
|
||||
android:clickable="false"
|
||||
android:text=" "
|
||||
android:textSize="20sp"
|
||||
android:textColor="#ffffff" />
|
||||
</RelativeLayout>
|
||||
|
||||
<WebView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/fullWebView"
|
||||
android:background="#000000" />
|
||||
|
||||
</cn.jpush.android.ui.FullScreenView>
|
21
src/android/richpush_btn_selector.xml
Normal file
21
src/android/richpush_btn_selector.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<!-- 获得焦点但未按下时的背景图片 -->
|
||||
<item
|
||||
android:state_focused="true"
|
||||
android:state_enabled="true"
|
||||
android:state_pressed="false"
|
||||
android:drawable="@drawable/ic_richpush_actionbar_back" />
|
||||
<!-- 按下时的背景图片 -->
|
||||
<item
|
||||
android:state_enabled="true"
|
||||
android:state_pressed="true"
|
||||
android:drawable="@android:color/darker_gray" />
|
||||
<!-- 按下时的背景图片 -->
|
||||
<item
|
||||
android:state_enabled="true"
|
||||
android:state_checked="true"
|
||||
android:drawable="@android:color/darker_gray" />
|
||||
<!-- 默认时的背景图片 -->
|
||||
<item android:drawable="@drawable/ic_richpush_actionbar_back" />
|
||||
</selector>
|
Loading…
Reference in New Issue
Block a user