android 更新到 3.3.4

This commit is contained in:
weiry
2019-07-29 13:52:32 +08:00
parent ee3e6b9e75
commit b5fd5aa51a
14 changed files with 365 additions and 114 deletions
+48 -1
View File
@@ -1,6 +1,7 @@
package cn.jiguang.cordova.push;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.util.Log;
@@ -9,9 +10,13 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Map;
import java.util.Set;
import cn.jpush.android.api.CustomMessage;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.JPushMessage;
import cn.jpush.android.api.NotificationMessage;
import cn.jpush.android.service.JPushMessageReceiver;
public class JPushEventReceiver extends JPushMessageReceiver {
@@ -21,7 +26,7 @@ public class JPushEventReceiver extends JPushMessageReceiver {
@Override
public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
super.onTagOperatorResult(context, jPushMessage);
//Log.e(TAG,"onTagOperatorResult:"+jPushMessage);
JSONObject resultJson = new JSONObject();
int sequence = jPushMessage.getSequence();
@@ -72,6 +77,7 @@ public class JPushEventReceiver extends JPushMessageReceiver {
public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) {
super.onCheckTagOperatorResult(context, jPushMessage);
//Log.e(TAG,"onCheckTagOperatorResult:"+jPushMessage);
JSONObject resultJson = new JSONObject();
int sequence = jPushMessage.getSequence();
@@ -113,6 +119,7 @@ public class JPushEventReceiver extends JPushMessageReceiver {
public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
super.onAliasOperatorResult(context, jPushMessage);
//Log.e(TAG,"onAliasOperatorResult:"+jPushMessage);
JSONObject resultJson = new JSONObject();
int sequence = jPushMessage.getSequence();
@@ -152,4 +159,44 @@ public class JPushEventReceiver extends JPushMessageReceiver {
JPushPlugin.eventCallbackMap.remove(sequence);
}
@Override
public void onRegister(Context context, String regId) {
//Log.e(TAG,"onRegister:"+regId);
JPushPlugin.transmitReceiveRegistrationId(regId);
}
@Override
public void onMessage(Context context, CustomMessage customMessage) {
super.onMessage(context,customMessage);
//Log.e(TAG,"onMessage:"+customMessage);
// String msg = customMessage.message;//intent.getStringExtra(JPushInterface.EXTRA_MESSAGE);
// Map<String, Object> extras = getNotificationExtras(intent);
// JPushPlugin.transmitMessageReceive(msg, extras);
}
@Override
public void onNotifyMessageArrived(Context context, NotificationMessage notificationMessage) {
super.onNotifyMessageArrived(context, notificationMessage);
//Log.e(TAG,"onNotifyMessageArrived:"+notificationMessage);
}
@Override
public void onNotifyMessageOpened(Context context, NotificationMessage notificationMessage) {
super.onNotifyMessageOpened(context, notificationMessage);
//Log.e(TAG,"onNotifyMessageOpened:"+notificationMessage);
}
@Override
public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) {
super.onMobileNumberOperatorResult(context, jPushMessage);
//Log.e(TAG,"onMobileNumberOperatorResult:"+jPushMessage);
}
@Override
public void onMultiActionClicked(Context context, Intent intent) {
super.onMultiActionClicked(context, intent);
//Log.e(TAG,"onMultiActionClicked:"+intent);
}
}
+6
View File
@@ -0,0 +1,6 @@
package cn.jiguang.cordova.push;
import cn.jpush.android.service.JCommonService;
public class PushService extends JCommonService {
}
Binary file not shown.
Binary file not shown.
View File

Before

Width:  |  Height:  |  Size: 695 B

After

Width:  |  Height:  |  Size: 695 B

View File

Before

Width:  |  Height:  |  Size: 181 B

After

Width:  |  Height:  |  Size: 181 B

+172
View File
@@ -0,0 +1,172 @@
<?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="wrap_content"
android:paddingBottom="4dp"
android:paddingTop="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
>
<ImageView
android:id="@+id/push_notification_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
<RelativeLayout
android:id="@+id/push_notification_style_default"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<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:layout_marginLeft="6dp"
android:scaleType="centerInside"/>
<TextView
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:textColor="@android:color/black"
android:textSize="12sp"/>
<TextView
android:id="@+id/push_notification_dot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="· "
android:textColor="@android:color/black"
android:textSize="20sp"/>
<TextView
android:maxLines="1"
android:id="@+id/push_notification_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="12sp"
/>
</LinearLayout>
<ImageView
android:id="@+id/push_notification_big_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:scaleType="centerInside"/>
<TextView
android:id="@+id/push_notification_sub_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
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:visibility="gone"
android:layout_marginTop="1dp"
android:textSize="13sp"
android:maxLines="1"
/>
<TextView
android:id="@+id/push_notification_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:layout_below="@id/push_notification_sub_title"
android:layout_toLeftOf="@+id/push_notification_big_icon"
android:layout_marginLeft="6dp"
android:layout_marginRight="4dp"
android:layout_marginTop="1dp"
android:textSize="13sp"
android:maxLines="2"
android:ellipsize="end"
/>
<TextView
android:id="@+id/push_notification_content_one_line"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:textColor="@android:color/black"
android:layout_below="@id/push_notification_sub_title"
android:layout_toLeftOf="@+id/push_notification_big_icon"
android:layout_marginLeft="6dp"
android:layout_marginRight="4dp"
android:layout_marginTop="1dp"
android:textSize="13sp"
android:maxLines="1"
android:ellipsize="end"
/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/push_notification_style_1"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<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:layout_marginLeft="6dp"
android:layout_toRightOf="@+id/push_notification_style_1_big_icon"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/push_notification_style_1_date"
android:textSize="12sp"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/push_notification_style_1_title"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/push_notification_style_1_date"
android:textSize="12sp"
android:textStyle="bold"
android:maxLines="1"
android:layout_marginRight="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
<TextView
android:id="@+id/push_notification_style_1_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:layout_marginRight="4dp"
android:layout_marginTop="1dp"
android:textSize="13sp"
android:maxLines="2"
android:ellipsize="end" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical"
>
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="jg_channel_name_p_min">不重要</string>
<string name="jg_channel_name_p_low">不重要</string>
<string name="jg_channel_name_p_default">普通</string>
<string name="jg_channel_name_p_high">重要</string>
</resources>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="jg_channel_name_p_min">LOW</string>
<string name="jg_channel_name_p_low">LOW</string>
<string name="jg_channel_name_p_default">NORMAL</string>
<string name="jg_channel_name_p_high">HIGH</string>
</resources>