From db66b085308b8bc7a1ff9440c85895d41c98b5ed Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 27 二月 2021 15:24:44 +0800 Subject: [PATCH] Android推送完善 --- BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java | 10 BuWanVideo/build.gradle | 24 BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java | 1 BuWanVideo/src/com/weikou/beibeivideo/receiver/XMPushMessageReceiver.java | 100 ++++ library-push/src/main/java/com/yeshi/push/PushUtil.java | 125 +++++ library-push/build.gradle | 37 + library-push/consumer-rules.pro | 0 library-push/src/test/java/com/yeshi/ec/push/ExampleUnitTest.java | 17 BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayFragment.java | 41 + library-push/libs/vivo_pushsdk_v3.0.0.0_480.aar | 0 BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java | 73 +++ BuWanVideo/res/layout/item_video_search_result_video.xml | 28 BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java | 2 build.gradle | 2 library-push/.gitignore | 1 BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java | 26 BuWanVideo/src/com/weikou/beibeivideo/receiver/VIVOPushMessageReceiver.java | 28 + library-push/libs/MiPush_SDK_Client_3_8_5.jar | 0 BuWanVideo/agconnect-services.json | 52 ++ BuWanVideo/src/com/weikou/beibeivideo/receiver/MZPushMessageReceiver.java | 130 +++++ settings.gradle | 2 library-common/src/com/lcjian/library/util/ManifestDataUtil.java | 9 BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java | 31 + BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java | 2 library-push/src/androidTest/java/com/yeshi/ec/push/ExampleInstrumentedTest.java | 25 + BuWanVideo/src/com/weikou/beibeivideo/ui/push/PushOpenClickActivity.java | 180 +++++++ library-push/libs/com.heytap.msp.aar | 0 /dev/null | 13 BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java | 6 BuWanVideo/res/layout/item_video_search_result_album.xml | 9 library-push/src/main/AndroidManifest.xml | 102 ++++ BuWanVideo/src/com/weikou/beibeivideo/ui/video/SearchResultAdapter.java | 15 library-push/proguard-rules.pro | 2 BuWanVideo/AndroidManifest.xml | 130 ++++- BuWanVideo/src/com/weikou/beibeivideo/service/HWPushService.java | 192 ++++++++ 35 files changed, 1,318 insertions(+), 97 deletions(-) diff --git a/BuWanVideo/AndroidManifest.xml b/BuWanVideo/AndroidManifest.xml index 8ec5fed..da7bc45 100644 --- a/BuWanVideo/AndroidManifest.xml +++ b/BuWanVideo/AndroidManifest.xml @@ -53,7 +53,6 @@ <uses-permission android:name="android.permission.WRITE_APN_SETTINGS" /> - <application android:name="com.weikou.beibeivideo.BeibeiVideoApplication" android:allowBackup="true" @@ -510,43 +509,120 @@ </provider> - <!-- 鏋佸厜鎺ㄩ�� --> - <service - android:name=".service.JPushService" - android:enabled="true" - android:exported="false" - android:process=":pushcore"> - <intent-filter> - <action android:name="cn.jiguang.user.service.action" /> - </intent-filter> - </service> - - - <receiver - android:name=".receiver.MyJPushReceiver" - android:enabled="true" - android:exported="false"> - <intent-filter> - <action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" /> - <category android:name="${applicationId}" /> - </intent-filter> - </receiver> - - - + <!-- 鎺ㄩ�� --> <activity - android:name=".ui.push.OpenClickActivity" + android:name=".ui.push.PushOpenClickActivity" android:exported="true"> + + <intent-filter> <action android:name="android.intent.action.VIEW" /> + <category android:name="android.intent.category.DEFAULT" /> - <action android:name="com.weikou.beibeivideo.ui.push.OpenClickActivity" /> + <category android:name="android.intent.category.BROWSABLE" /> + <!-- 鎵撳紑璇ctivity鐨勯摼鎺�--> + <data + android:host="com.huawei.codelabpush" + android:path="/deeplink" + android:scheme="buwanpush" /> + </intent-filter> </activity> + <!-- 鍗庝负鎺ㄩ�佽嚜鍔ㄥ垵濮嬪寲 --> + + <meta-data + android:name="push_kit_auto_init_enabled" + android:value="true" /> + <!-- 鍗庝负鎺ㄩ�佹湇鍔℃敞鍐� --> + <service + android:name=".service.HWPushService" + android:exported="false"> + <intent-filter> + <action android:name="com.huawei.push.action.MESSAGING_EVENT" /> + </intent-filter> + </service> + <!--灏忕背鎺ㄩ�� --> + + <meta-data + android:name="XIAOMI_APPID" + android:value="${XIAOMI_APPID}"></meta-data> + <meta-data + android:name="XIAOMI_APPKEY" + android:value="${XIAOMI_APPKEY}"></meta-data> + + <receiver + android:name=".receiver.XMPushMessageReceiver" + android:exported="true"> + <intent-filter> + <action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" /> + </intent-filter> + <intent-filter> + <action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" /> + </intent-filter> + <intent-filter> + <action android:name="com.xiaomi.mipush.ERROR" /> + </intent-filter> + </receiver> + + <!--OPPO --> + <meta-data + android:name="OPPO_APPKEY" + android:value="${OPPO_APPKEY}" /> + <meta-data + android:name="OPPO_APPSECRET" + android:value="${OPPO_APPSECRET}" /> + + + <!-- VIVO鎺ㄩ�� --> + <receiver + android:name=".receiver.VIVOPushMessageReceiver" + android:exported="false"> + <intent-filter> + <!--鎺ユ敹push娑堟伅--> + <action android:name="com.vivo.pushclient.action.RECEIVE" /> + </intent-filter> + </receiver> + + <!--Vivo Push寮�鏀惧钩鍙颁腑搴旂敤鐨刟ppid 鍜宎pi key--> + <meta-data + android:name="com.vivo.push.api_key" + android:value="${VIVO_APPKEY}" /> + + <meta-data + android:name="com.vivo.push.app_id" + android:value="${VIVO_APPID}" /> + + + <!--榄呮棌鎺ㄩ�� --> + + <meta-data + android:name="MEIZU_APPKEY" + android:value="${MEIZU_APPKEY}"></meta-data> + + <meta-data + android:name="MEIZU_APPID" + android:value="${MEIZU_APPID}"></meta-data> + + <receiver android:name=".receiver.MZPushMessageReceiver"> + <intent-filter> + <!-- 鎺ユ敹 push 娑堟伅 --> + <action android:name="com.meizu.flyme.push.intent.MESSAGE" /> + <!-- 鎺ユ敹 register 娑堟伅 --> + <action android:name="com.meizu.flyme.push.intent.REGISTER.FEEDBACK" /> + <!-- 鎺ユ敹 unregister 娑堟伅--> + <action android:name="com.meizu.flyme.push.intent.UNREGISTER.FEEDBACK" /> + <!-- 鍏煎浣庣増鏈� Flyme3 鎺ㄩ�佹湇鍔¢厤缃� --> + <action android:name="com.meizu.c2dm.intent.REGISTRATION" /> + <action android:name="com.meizu.c2dm.intent.RECEIVE" /> + + <category android:name="${applicationId}" /> + </intent-filter> + </receiver> + </application> </manifest> \ No newline at end of file diff --git a/BuWanVideo/agconnect-services.json b/BuWanVideo/agconnect-services.json new file mode 100644 index 0000000..cb918e4 --- /dev/null +++ b/BuWanVideo/agconnect-services.json @@ -0,0 +1,52 @@ +{ + "agcgw":{ + "backurl":"connect-drcn.dbankcloud.cn", + "url":"connect-drcn.hispace.hicloud.com", + "websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.cn", + "websocketurl":"connect-ws-drcn.hispace.dbankcloud.com" + }, + "agcgw_all":{ + "CN":"connect-drcn.hispace.hicloud.com", + "CN_back":"connect-drcn.dbankcloud.cn", + "DE":"connect-dre.hispace.hicloud.com", + "DE_back":"connect-dre.dbankcloud.cn", + "RU":"connect-drru.hispace.hicloud.com", + "RU_back":"connect-drru.dbankcloud.cn", + "SG":"connect-dra.hispace.hicloud.com", + "SG_back":"connect-dra.dbankcloud.cn" + }, + "client":{ + "cp_id":"890086000102013438", + "product_id":"9105163812218575689", + "client_id":"327170740694549568", + "client_secret":"1AD92B6573E4337C7522550024BBE61A188DFECD51352A8D0C17D1C7F0C6F6D0", + "project_id":"9105163812218575689", + "app_id":"10409568", + "api_key":"CV6k6L9rmDyEVcDB9HbgkLPCN106z8Wq37kQwo2hBHlt7txuD9uaIeEdAFNphEIY9k4XKA8x/nARKnJHMMvygkWVoJhN", + "package_name":"com.doudou.ysvideo" + }, + "service":{ + "analytics":{ + "collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn", + "resource_id":"p1", + "channel_id":"" + }, + "search":{ + "url":"https://search-drcn.cloud.huawei.com" + }, + "cloudstorage":{ + "storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn" + }, + "ml":{ + "mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn" + } + }, + "region":"CN", + "configuration_version":"2.0", + "appInfos":[ + { + "package_name":"com.doudou.ysvideo", + "app_id":"10409568" + } + ] +} \ No newline at end of file diff --git a/BuWanVideo/build.gradle b/BuWanVideo/build.gradle index 7331260..3ead4b0 100644 --- a/BuWanVideo/build.gradle +++ b/BuWanVideo/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'android' +apply plugin: 'com.huawei.agconnect' dependencies { implementation project(':library-ViewPagerIndicator') implementation files('libs/SohuPlayerExtend_4.1.0_0_201606121225_open_release.jar') @@ -58,18 +59,13 @@ implementation project(path: ':library-EventBus') implementation project(path: ':library-VideoPlayer') implementation project(path: ':library-common') - implementation project(path: ':library-jpush') + implementation project(path: ':library-push') annotationProcessor 'com.github.jokermonn:permissions4m:2.1.2-processor' //寰俊SDK api 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+' //鍔犺浇鍔ㄧ敾搴� implementation 'com.github.ybq:Android-SpinKit:1.4.0' - - //oppo_dependencies_start - // oppo 鍘傚晢 aar 闇�瑕佸崟鐙紩鍏� - implementation(name: 'com.heytap.msp-push-2.1.0', ext: 'aar') - } android { signingConfigs { @@ -107,21 +103,17 @@ } manifestPlaceholders = [ - JPUSH_PKGNAME: applicationId, - JPUSH_APPKEY : "c26d6c58b6aa5d0391248edf", //鏋佸厜寮�鍙戝钩鍙颁笂娉ㄥ唽鐨勫寘鍚嶅搴旂殑appkey. - JPUSH_CHANNEL: "developer-default", //鏆傛椂濉啓榛樿鍊煎嵆鍙�. //meizu_config_start - MEIZU_APPKEY : "MZ-dc40ea74e19948a683cb1876d5a8813e", - MEIZU_APPID : "MZ-139085", + MEIZU_APPKEY : "MEIZU-dc40ea74e19948a683cb1876d5a8813e", + MEIZU_APPID : "MEIZU-139085", //meizu_config_end //xiaomi_config_start - XIAOMI_APPID : "MI-2882303761517505364", - XIAOMI_APPKEY : "MI-5681750540364", + XIAOMI_APPID : "XIAOMI-2882303761517505364", + XIAOMI_APPKEY : "XIAOMI-5681750540364", //xiaomi_config_end //oppo_config_start - OPPO_APPKEY : "OP-9w8ke27Mlk8osgCoOkg4Ow8cg", - OPPO_APPID : "OP-3375605", - OPPO_APPSECRET: "OP-eAbC32A01d02E8073b7788F687769502", + OPPO_APPKEY : "OPPO-9w8ke27Mlk8osgCoOkg4Ow8cg", + OPPO_APPSECRET: "OPPO-eAbC32A01d02E8073b7788F687769502", //oppo_config_end //vivo_config_start VIVO_APPKEY : "e9add1dfed7086061119d407857628ef", diff --git a/BuWanVideo/libs/com.heytap.msp-push-2.1.0.aar b/BuWanVideo/libs/com.heytap.msp-push-2.1.0.aar deleted file mode 100644 index 608aced..0000000 --- a/BuWanVideo/libs/com.heytap.msp-push-2.1.0.aar +++ /dev/null Binary files differ diff --git a/BuWanVideo/res/layout/item_video_search_result_album.xml b/BuWanVideo/res/layout/item_video_search_result_album.xml index bcfc243..fe0ae5a 100644 --- a/BuWanVideo/res/layout/item_video_search_result_album.xml +++ b/BuWanVideo/res/layout/item_video_search_result_album.xml @@ -26,6 +26,15 @@ android:layout_height="match_parent" android:scaleType="centerCrop"></ImageView> + + <ImageView + android:visibility="gone" + android:id="@+id/iv_vip" + android:layout_width="29.5dp" + android:layout_height="17.5dp" + android:layout_gravity="top|right" + android:src="@drawable/icon_video_vip" /> + </FrameLayout> </com.lcjian.library.widget.RatioLayout> diff --git a/BuWanVideo/res/layout/item_video_search_result_video.xml b/BuWanVideo/res/layout/item_video_search_result_video.xml index 0263b41..ee1706b 100644 --- a/BuWanVideo/res/layout/item_video_search_result_video.xml +++ b/BuWanVideo/res/layout/item_video_search_result_video.xml @@ -3,6 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" + android:orientation="horizontal"> @@ -12,13 +13,28 @@ android:layout_weight="120" app:ratio="0.6667"> - <ImageView - android:id="@+id/iv_movie_cover" + <FrameLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_alignParentStart="true" - android:layout_alignParentLeft="true" - android:scaleType="centerCrop" /> + android:layout_height="match_parent"> + + <ImageView + android:id="@+id/iv_movie_cover" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_alignParentStart="true" + android:layout_alignParentLeft="true" + android:scaleType="centerCrop" /> + + <ImageView + android:id="@+id/iv_vip" + android:layout_width="29.5dp" + android:layout_height="17.5dp" + android:layout_gravity="top|right" + android:src="@drawable/icon_video_vip" + android:visibility="gone" /> + + </FrameLayout> + </com.lcjian.library.widget.RatioLayout> diff --git a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java index 6e77821..3f084a5 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java @@ -30,7 +30,9 @@ import com.loopj.android.http.RequestParams; import com.loopj.android.http.ResponseHandlerInterface; import com.loopj.android.http.SyncHttpClient; +import com.ut.device.UTDevice; import com.weikou.beibeivideo.util.BeibeiConstant; +import com.weikou.beibeivideo.util.UserUtil; import org.json.JSONArray; @@ -87,6 +89,11 @@ params.put("Lat", lat); params.put("Lng", lng); params.put("Channel", channel); + try { + params.put("UtdId", UTDevice.getUtdid(context)); + } catch (Exception e) { + + } if (!StringUtils.isBlank(BeibeiVideoApplication.deviceNumber)) { params.put("DeviceName", BeibeiVideoApplication.deviceName); params.put("DeviceNumber", BeibeiVideoApplication.deviceNumber); @@ -1245,6 +1252,63 @@ } + /** + * 鎺ㄩ�佺粦瀹歍oken + * + * @param context + * @param type + * @param token + * @param handler + */ + public static void pushBindToken(Context context, String type, String token, + ResponseHandlerInterface handler, boolean async) { + String loginUid = UserUtil.getLoginUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + + if (type != null) + params.put("type", type); + + if (token != null) + params.put("regId", token); + + String model = android.os.Build.MODEL; + if (model != null) + params.put("model", model); + + String version = android.os.Build.VERSION.RELEASE; + if (version != null) { + params.put("androidVersion", version); + } + + + commonPost(context, BASE_URL + "push/bindDeviceToken", params, null, handler, async, false); + } + + + /** + * 涓婁紶PPTV鎾斁璁板綍 + * + * @param context + * @param cid + * @param vid + * @param handler + */ + public static void uploadPPTVPlayRecord(Context context, String cid, String vid, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + String uid = UserUtil.getUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + if (uid != null) + params.put("Uid", uid); + params.put("Cid", cid); + params.put("Vid", vid); + commonPost(context, BASE_URL + "video/play/pptvPlay", params, handler); + } + + public static LinkedHashMap<String, String> validateParams( LinkedHashMap<String, String> params, Context context) { params.put("System", "1"); @@ -1376,7 +1440,11 @@ int version = PackageUtils2.getVersionCode(context); params.put("Version", version + ""); params.put("Device", getDeviceId(context)); + try { + params.put("UtdId", UTDevice.getUtdid(context)); + } catch (Exception e) { + } LinkedHashMap<String, String> map = validateParams(params, context); FormBody.Builder builder = new FormBody.Builder(); for (String key : map.keySet()) { @@ -1438,6 +1506,11 @@ int version = PackageUtils2.getVersionCode(context); params.put("Version", version + ""); params.put("Device", getDeviceId(context)); + try { + params.put("UtdId", UTDevice.getUtdid(context)); + } catch (Exception e) { + + } LinkedHashMap<String, String> map = validateParams(params, context); RequestParams requestParams = new RequestParams(map); if (BuildConfig.DEBUG) { diff --git a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java index 33a561d..7856b82 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoApplication.java @@ -31,16 +31,18 @@ import com.umeng.commonsdk.UMConfigure; import com.umeng.socialize.PlatformConfig; import com.umeng.socialize.UMShareAPI; +import com.weikou.beibeivideo.ui.push.PushOpenClickActivity; import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.CrashHandler; import com.weikou.beibeivideo.util.FunshionConstant; import com.weikou.beibeivideo.util.ad.TTAdManagerHolder; import com.weikou.beibeivideo.util.downutil.StringUtils; +import com.yeshi.push.PushUtil; import org.apache.http.Header; +import org.json.JSONException; import org.json.JSONObject; -import cn.jpush.android.api.JPushInterface; public class BeibeiVideoApplication extends Application { @@ -166,10 +168,31 @@ } catch (Exception e) { } - //鏋佸厜鎺ㄩ�� - JPushInterface.setDebugMode(true); - JPushInterface.init(this); + //鎺ㄩ�� + PushUtil.inintPush(this, new PushUtil.ITokenListener() { + @Override + public void onToken(String romType, String regId) { + BeibeiVideoAPI.pushBindToken(application, romType, regId, new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + + } + },true); + } + }); + + Intent intent = new Intent(this, PushOpenClickActivity.class); + intent.putExtra("activity", "test"); + JSONObject params = new JSONObject(); + try { + params.put("id", "123123"); + } catch (JSONException e) { + e.printStackTrace(); + } + intent.putExtra("params", params.toString()); + String uriString = intent.toUri(Intent.URI_INTENT_SCHEME); + Log.i(TAG, uriString); } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/receiver/MZPushMessageReceiver.java b/BuWanVideo/src/com/weikou/beibeivideo/receiver/MZPushMessageReceiver.java new file mode 100644 index 0000000..580a90a --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/receiver/MZPushMessageReceiver.java @@ -0,0 +1,130 @@ +package com.weikou.beibeivideo.receiver; + +import android.app.Activity; +import android.app.ActivityManager; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +import com.meizu.cloud.pushsdk.MzPushMessageReceiver; +import com.meizu.cloud.pushsdk.PushManager; +import com.meizu.cloud.pushsdk.handler.MzPushMessage; +import com.meizu.cloud.pushsdk.platform.message.PushSwitchStatus; +import com.meizu.cloud.pushsdk.platform.message.RegisterStatus; +import com.meizu.cloud.pushsdk.platform.message.SubAliasStatus; +import com.meizu.cloud.pushsdk.platform.message.SubTagsStatus; +import com.meizu.cloud.pushsdk.platform.message.UnRegisterStatus; +import com.weikou.beibeivideo.BasicTextHttpResponseHandler; +import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.ui.SplashActivity; +import com.xiaomi.mipush.sdk.ErrorCode; +import com.xiaomi.mipush.sdk.MiPushClient; +import com.xiaomi.mipush.sdk.MiPushCommandMessage; +import com.xiaomi.mipush.sdk.MiPushMessage; +import com.xiaomi.mipush.sdk.PushMessageReceiver; + +import org.apache.http.Header; +import org.json.JSONObject; + +import java.util.List; + +public class MZPushMessageReceiver extends MzPushMessageReceiver { + private final String TAG=MZPushMessageReceiver.class.getSimpleName(); + /** + * 璋冪敤璁㈤槄鏂规硶鍚庯紝浼氬湪姝ゆ柟娉曞洖璋冪粨鏋� + * 璁㈤槄鏂规硶锛歅ushManager.register(context, appId, appKey) + * + * @param context + * @param registerStatus + */ + @Override + public void onRegisterStatus(Context context, RegisterStatus registerStatus) { + Log.i(TAG,"onRegisterStatus"); + String pushId = registerStatus.getPushId(); + BeibeiVideoAPI.pushBindToken(context, "mz", pushId, new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + + } + },true); + } + + /** + * 璋冪敤鍙栨秷璁㈤槄鏂规硶鍚庯紝浼氬湪姝ゆ柟娉曞洖璋冪粨鏋� + * 鍙栨秷璁㈤槄鏂规硶锛歅ushManager.unRegister(context, appId, appKey) + * + * @param context + * @param unRegisterStatus + */ + @Override + public void onUnRegisterStatus(Context context, UnRegisterStatus unRegisterStatus) { + Log.i(TAG,"onUnRegisterStatus"); + } + + /** + * 璋冪敤寮�鍏宠浆鎹㈡垨妫�鏌ュ紑鍏崇姸鎬佹柟娉曞悗锛屼細鍦ㄦ鏂规硶鍥炶皟寮�鍏崇姸鎬� + * 閫氱煡鏍忓紑鍏宠浆鎹㈡柟娉曪細PushManager.switchPush(context, appId, appKey, pushId, pushType, switcher) + * 妫�鏌ュ紑鍏崇姸鎬佹柟娉曪細PushManager.checkPush(context, appId, appKey, pushId) + * + * @param context + * @param pushSwitchStatus + */ + @Override + public void onPushStatus(Context context, PushSwitchStatus pushSwitchStatus) { + Log.i(TAG,"onPushStatus"); + } + + /** + * 璋冪敤鏍囩璁㈤槄銆佸彇娑堟爣绛捐闃呫�佸彇娑堟墍鏈夋爣绛捐闃呭拰鑾峰彇鏍囩鍒楄〃鏂规硶鍚庯紝浼氬湪姝ゆ柟娉曞洖璋冩爣绛剧浉鍏充俊鎭� + * 鏍囩璁㈤槄鏂规硶锛歅ushManager.subScribeTags(context, appId, appKey, pushId, tags) + * 鍙栨秷鏍囩璁㈤槄鏂规硶锛歅ushManager.unSubScribeTags(context, appId, appKey, pushId,tags) + * 鍙栨秷鎵�鏈夋爣绛捐闃呮柟娉曪細PushManager.unSubScribeAllTags(context, appId, appKey, pushId) + * 鑾峰彇鏍囩鍒楄〃鏂规硶锛歅ushManager.checkSubScribeTags(context, appId, appKey, pushId) + * + * @param context + * @param subTagsStatus + */ + @Override + public void onSubTagsStatus(Context context, SubTagsStatus subTagsStatus) { + Log.i(TAG,"onSubTagsStatus"); + } + + /** + * 璋冪敤鍒悕璁㈤槄銆佸彇娑堝埆鍚嶈闃呭拰鑾峰彇鍒悕鏂规硶鍚庯紝浼氬湪姝ゆ柟娉曞洖璋冨埆鍚嶇浉鍏充俊鎭� + * 鍒悕璁㈤槄鏂规硶锛歅ushManager.subScribeAlias(context, appId, appKey, pushId, alias) + * 鍙栨秷鍒悕璁㈤槄鏂规硶锛歅ushManager.unSubScribeAlias(context, appId, appKey, pushId, alias) + * 鑾峰彇鍒悕鏂规硶锛歅ushManager.checkSubScribeAlias(context, appId, appKey, pushId) + * + * @param context + * @param subAliasStatus + */ + @Override + public void onSubAliasStatus(Context context, SubAliasStatus subAliasStatus) { + Log.i(TAG,"onSubAliasStatus"); + } + + /** + * 褰撶敤鎴风偣鍑婚�氱煡鏍忔秷鎭悗浼氬湪姝ゆ柟娉曞洖璋� + * + * @param context + * @param mzPushMessage + */ + @Override + public void onNotificationClicked(Context context, MzPushMessage mzPushMessage) { + Log.i(TAG,"onNotificationClicked"); + + PushManager.getPushId(context); + + } + + /** + * 褰撴帹閫佺殑閫氱煡鏍忔秷鎭睍绀哄悗涓斿簲鐢ㄨ繘绋嬪瓨鍦ㄦ椂浼氬湪姝ゆ柟娉曞洖璋� + * + * @param context + * @param mzPushMessage + */ + @Override + public void onNotificationArrived(Context context, MzPushMessage mzPushMessage) { + Log.i(TAG,"onNotificationArrived"); + } +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/receiver/MyJPushReceiver.java b/BuWanVideo/src/com/weikou/beibeivideo/receiver/MyJPushReceiver.java deleted file mode 100644 index 9880d03..0000000 --- a/BuWanVideo/src/com/weikou/beibeivideo/receiver/MyJPushReceiver.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.weikou.beibeivideo.receiver; - -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; - -import com.TagAliasOperatorHelper; -import com.weikou.beibeivideo.ui.push.OpenClickActivity; - -import cn.jpush.android.api.CmdMessage; -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 MyJPushReceiver - extends JPushMessageReceiver { - private static final String TAG = "MyJPushReceiver"; - - @Override - public void onMessage(Context context, CustomMessage customMessage) { - Log.e(TAG, "[onMessage] " + customMessage); -// processCustomMessage(context, customMessage); - } - - @Override - public void onNotifyMessageOpened(Context context, NotificationMessage message) { - - Log.e(TAG, "[onNotifyMessageOpened] " + message); - - Log.i(TAG, "[notificationExtras] " + message.notificationExtras); - - try { - //鎵撳紑鑷畾涔夌殑Activity - Intent i = new Intent(context, OpenClickActivity.class); - Bundle bundle = new Bundle(); - bundle.putString(JPushInterface.EXTRA_NOTIFICATION_TITLE, message.notificationTitle); - bundle.putString(JPushInterface.EXTRA_ALERT, message.notificationContent); - i.putExtras(bundle); - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); -// i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP ); - context.startActivity(i); - } catch (Throwable throwable) { - - } - } - - @Override - public void onMultiActionClicked(Context context, Intent intent) { - Log.e(TAG, "[onMultiActionClicked] 鐢ㄦ埛鐐瑰嚮浜嗛�氱煡鏍忔寜閽�"); - String nActionExtra = intent.getExtras().getString(JPushInterface.EXTRA_NOTIFICATION_ACTION_EXTRA); - - //寮�鍙戣�呮牴鎹笉鍚� Action 鎼哄甫鐨� extra 瀛楁鏉ュ垎閰嶄笉鍚岀殑鍔ㄤ綔銆� - if (nActionExtra == null) { - Log.d(TAG, "ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null"); - return; - } - if (nActionExtra.equals("my_extra1")) { - Log.e(TAG, "[onMultiActionClicked] 鐢ㄦ埛鐐瑰嚮閫氱煡鏍忔寜閽竴"); - } else if (nActionExtra.equals("my_extra2")) { - Log.e(TAG, "[onMultiActionClicked] 鐢ㄦ埛鐐瑰嚮閫氱煡鏍忔寜閽簩"); - } else if (nActionExtra.equals("my_extra3")) { - Log.e(TAG, "[onMultiActionClicked] 鐢ㄦ埛鐐瑰嚮閫氱煡鏍忔寜閽笁"); - } else { - Log.e(TAG, "[onMultiActionClicked] 鐢ㄦ埛鐐瑰嚮閫氱煡鏍忔寜閽湭瀹氫箟"); - } - } - - @Override - public void onNotifyMessageArrived(Context context, NotificationMessage message) { - Log.e(TAG, "[onNotifyMessageArrived] " + message); - } - - @Override - public void onNotifyMessageDismiss(Context context, NotificationMessage message) { - Log.e(TAG, "[onNotifyMessageDismiss] " + message); - } - - @Override - public void onRegister(Context context, String registrationId) { - Log.e(TAG, "[onRegister] " + registrationId); - } - - @Override - public void onConnected(Context context, boolean isConnected) { - Log.e(TAG, "[onConnected] " + isConnected); - } - - @Override - public void onCommandResult(Context context, CmdMessage cmdMessage) { - Log.e(TAG, "[onCommandResult] " + cmdMessage); - } - - @Override - public void onTagOperatorResult(Context context, JPushMessage jPushMessage) { - TagAliasOperatorHelper.getInstance().onTagOperatorResult(context, jPushMessage); - super.onTagOperatorResult(context, jPushMessage); - } - - @Override - public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) { - TagAliasOperatorHelper.getInstance().onCheckTagOperatorResult(context, jPushMessage); - super.onCheckTagOperatorResult(context, jPushMessage); - } - - @Override - public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) { - TagAliasOperatorHelper.getInstance().onAliasOperatorResult(context, jPushMessage); - super.onAliasOperatorResult(context, jPushMessage); - } - - @Override - public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) { - TagAliasOperatorHelper.getInstance().onMobileNumberOperatorResult(context, jPushMessage); - super.onMobileNumberOperatorResult(context, jPushMessage); - } - - @Override - public void onNotificationSettingsCheck(Context context, boolean isOn, int source) { - super.onNotificationSettingsCheck(context, isOn, source); - Log.e(TAG, "[onNotificationSettingsCheck] isOn:" + isOn + ",source:" + source); - } -} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/receiver/VIVOPushMessageReceiver.java b/BuWanVideo/src/com/weikou/beibeivideo/receiver/VIVOPushMessageReceiver.java new file mode 100644 index 0000000..d3708ac --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/receiver/VIVOPushMessageReceiver.java @@ -0,0 +1,28 @@ +package com.weikou.beibeivideo.receiver; + +import android.app.Activity; +import android.app.ActivityManager; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +import com.vivo.push.model.UnvarnishedMessage; +import com.vivo.push.sdk.OpenClientPushMessageReceiver; +import com.weikou.beibeivideo.ui.SplashActivity; +import com.xiaomi.mipush.sdk.ErrorCode; +import com.xiaomi.mipush.sdk.MiPushClient; +import com.xiaomi.mipush.sdk.MiPushCommandMessage; +import com.xiaomi.mipush.sdk.MiPushMessage; +import com.xiaomi.mipush.sdk.PushMessageReceiver; + +import java.util.List; + +public class VIVOPushMessageReceiver extends OpenClientPushMessageReceiver { + public static MiPushMessage miPushMessage = null; + + @Override + public void onReceiveRegId(Context context, String regId) { + super.onReceiveRegId(context, regId); + } + +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/receiver/XMPushMessageReceiver.java b/BuWanVideo/src/com/weikou/beibeivideo/receiver/XMPushMessageReceiver.java new file mode 100644 index 0000000..5596b41 --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/receiver/XMPushMessageReceiver.java @@ -0,0 +1,100 @@ +package com.weikou.beibeivideo.receiver; + +import android.app.Activity; +import android.app.ActivityManager; +import android.content.Context; +import android.content.Intent; +import android.os.Handler; +import android.os.Message; +import android.util.Log; + +import com.weikou.beibeivideo.BasicTextHttpResponseHandler; +import com.weikou.beibeivideo.BeibeiVideoAPI; +import com.weikou.beibeivideo.ui.SplashActivity; +import com.weikou.beibeivideo.util.downutil.StringUtils; +import com.xiaomi.mipush.sdk.ErrorCode; +import com.xiaomi.mipush.sdk.MiPushClient; +import com.xiaomi.mipush.sdk.MiPushCommandMessage; +import com.xiaomi.mipush.sdk.MiPushMessage; +import com.xiaomi.mipush.sdk.PushMessageReceiver; + +import org.apache.http.Header; +import org.json.JSONObject; + +import java.util.List; + +public class XMPushMessageReceiver extends PushMessageReceiver { + + private String TAG = XMPushMessageReceiver.class.getSimpleName(); + + public static MiPushMessage miPushMessage = null; + + @Override + public void onReceivePassThroughMessage(Context context, MiPushMessage message) { + message.getContent(); + } + + @Override + public void onNotificationMessageClicked(Context context, MiPushMessage message) { + Log.i(TAG, "onNotificationMessageClicked"); + if (!isAppRunning(context, context.getPackageName())) { + miPushMessage = message; + Intent intent = new Intent(context, SplashActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + } else { + startActivity(context, null, message); + } + } + + @Override + public void onNotificationMessageArrived(Context context, MiPushMessage msg) { + + } + + @Override + public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) { + String command = message.getCommand(); + List<String> arguments = message.getCommandArguments(); + String cmdArg1 = ((arguments != null && arguments.size() > 0) ? arguments.get(0) : null); + if (MiPushClient.COMMAND_REGISTER.equals(command)) { + Log.i("mResult", "娉ㄥ唽缁撴灉鐮�--" + message.getResultCode()); + if (message.getResultCode() == ErrorCode.SUCCESS) { + Log.i("mResult", "娉ㄥ唽鎴愬姛"); + String mRegId = cmdArg1; + Log.i(TAG, mRegId); + if (!StringUtils.isNullOrEmpty(mRegId)) { + + BeibeiVideoAPI.pushBindToken(context, "xm", mRegId, new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + + } + },false); + } + } + } + } + + public static void startActivity(Context context, Activity activity, MiPushMessage message) { + + } + + public boolean isAppRunning(Context context, String packageName) { + Log.i("mResult", "isAppRunning()"); + ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + List<ActivityManager.RunningTaskInfo> list = am.getRunningTasks(100); + boolean isAppRunning = false; + //100琛ㄧず鍙栫殑鏈�澶х殑浠诲姟鏁帮紝info.topActivity琛ㄧず褰撳墠姝e湪杩愯鐨凙ctivity锛宨nfo.baseActivity琛ㄧ郴缁熷悗鍙版湁姝よ繘绋嬪湪杩愯 + for (ActivityManager.RunningTaskInfo info : list) { + if (info.topActivity.getPackageName().equals(packageName) || info.baseActivity.getPackageName().equals(packageName)) { + isAppRunning = true; + Log.i("ActivityService isRun()", info.topActivity.getPackageName() + " info.baseActivity.getPackageName()=" + info.baseActivity.getPackageName()); + break; + } + } + Log.i("ActivityService isRun()", "com.ad 绋嬪簭 ...isAppRunning......" + isAppRunning); + return isAppRunning; + } + +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/service/HWPushService.java b/BuWanVideo/src/com/weikou/beibeivideo/service/HWPushService.java new file mode 100644 index 0000000..c25cf21 --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/service/HWPushService.java @@ -0,0 +1,192 @@ +package com.weikou.beibeivideo.service; + +import android.content.Intent; +import android.text.TextUtils; +import android.util.Log; + +import com.huawei.hms.push.HmsMessageService; +import com.huawei.hms.push.RemoteMessage; +import com.huawei.hms.push.SendException; +import com.weikou.beibeivideo.BasicTextHttpResponseHandler; +import com.weikou.beibeivideo.BeibeiVideoAPI; + +import org.apache.http.Header; +import org.json.JSONObject; + +import java.util.Arrays; + +public class HWPushService extends HmsMessageService { + + private static final String TAG = "HWPushService"; + private final static String CODELABS_ACTION = "com.huawei.codelabpush.action"; + + @Override + public void onCreate() { + Log.i(TAG, "onCreate"); + super.onCreate(); + } + + /** + * When an app calls the getToken method to apply for a token from the server, + * if the server does not return the token during current method calling, the server can return the token through this method later. + * This method callback must be completed in 10 seconds. Otherwise, you need to start a new Job for callback processing. + * + * @param token token + */ + @Override + public void onNewToken(String token) { + BeibeiVideoAPI.pushBindToken(getApplicationContext(), "hw", token, new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + + } + },true); + } + + private void refreshedTokenToServer(String token) { + Log.i(TAG, "sending token to server. token:" + token); + } + + /** + * This method is used to receive downstream data messages. + * This method callback must be completed in 10 seconds. Otherwise, you need to start a new Job for callback processing. + * + * @param message RemoteMessage + */ + @Override + public void onMessageReceived(RemoteMessage message) { + Log.i(TAG, "onMessageReceived is called"); + if (message == null) { + Log.e(TAG, "Received message entity is null!"); + return; + } + // getCollapseKey() Obtains the classification identifier (collapse key) of a message. + // getData() Obtains valid content data of a message. + // getMessageId() Obtains the ID of a message. + // getMessageType() Obtains the type of a message. + // getNotification() Obtains the notification data instance from a message. + // getOriginalUrgency() Obtains the original priority of a message. + // getSentTime() Obtains the time when a message is sent from the server. + // getTo() Obtains the recipient of a message. + + Log.i(TAG, "getCollapseKey: " + message.getCollapseKey() + + "\n getData: " + message.getData() + + "\n getFrom: " + message.getFrom() + + "\n getTo: " + message.getTo() + + "\n getMessageId: " + message.getMessageId() + + "\n getMessageType: " + message.getMessageType() + + "\n getSendTime: " + message.getSentTime() + + "\n getTtl: " + message.getTtl() + + "\n getSendMode: " + message.getSendMode() + + "\n getReceiptMode: " + message.getReceiptMode() + + "\n getOriginalUrgency: " + message.getOriginalUrgency() + + "\n getUrgency: " + message.getUrgency() + + "\n getToken: " + message.getToken()); + + // getBody() Obtains the displayed content of a message + // getTitle() Obtains the title of a message + // getTitleLocalizationKey() Obtains the key of the displayed title of a notification message + // getTitleLocalizationArgs() Obtains variable parameters of the displayed title of a message + // getBodyLocalizationKey() Obtains the key of the displayed content of a message + // getBodyLocalizationArgs() Obtains variable parameters of the displayed content of a message + // getIcon() Obtains icons from a message + // getSound() Obtains the sound from a message + // getTag() Obtains the tag from a message for message overwriting + // getColor() Obtains the colors of icons in a message + // getClickAction() Obtains actions triggered by message tapping + // getChannelId() Obtains IDs of channels that support the display of messages + // getImageUrl() Obtains the image URL from a message + // getLink() Obtains the URL to be accessed from a message + // getNotifyId() Obtains the unique ID of a message + + RemoteMessage.Notification notification = message.getNotification(); + if (notification != null) { + Log.i(TAG, "\n getTitle: " + notification.getTitle() + + "\n getTitleLocalizationKey: " + notification.getTitleLocalizationKey() + + "\n getTitleLocalizationArgs: " + Arrays.toString(notification.getTitleLocalizationArgs()) + + "\n getBody: " + notification.getBody() + + "\n getBodyLocalizationKey: " + notification.getBodyLocalizationKey() + + "\n getBodyLocalizationArgs: " + Arrays.toString(notification.getBodyLocalizationArgs()) + + "\n getIcon: " + notification.getIcon() + + "\n getImageUrl: " + notification.getImageUrl() + + "\n getSound: " + notification.getSound() + + "\n getTag: " + notification.getTag() + + "\n getColor: " + notification.getColor() + + "\n getClickAction: " + notification.getClickAction() + + "\n getIntentUri: " + notification.getIntentUri() + + "\n getChannelId: " + notification.getChannelId() + + "\n getLink: " + notification.getLink() + + "\n getNotifyId: " + notification.getNotifyId() + + "\n isDefaultLight: " + notification.isDefaultLight() + + "\n isDefaultSound: " + notification.isDefaultSound() + + "\n isDefaultVibrate: " + notification.isDefaultVibrate() + + "\n getWhen: " + notification.getWhen() + + "\n getLightSettings: " + Arrays.toString(notification.getLightSettings()) + + "\n isLocalOnly: " + notification.isLocalOnly() + + "\n getBadgeNumber: " + notification.getBadgeNumber() + + "\n isAutoCancel: " + notification.isAutoCancel() + + "\n getImportance: " + notification.getImportance() + + "\n getTicker: " + notification.getTicker() + + "\n getVibrateConfig: " + Arrays.toString(notification.getVibrateConfig()) + + "\n getVisibility: " + notification.getVisibility()); + } + + Intent intent = new Intent(); + intent.setAction(CODELABS_ACTION); + intent.putExtra("method", "onMessageReceived"); + intent.putExtra("msg", "onMessageReceived called, message id:" + message.getMessageId() + ", payload data:" + + message.getData()); + + sendBroadcast(intent); + + Boolean judgeWhetherIn10s = false; + + // If the messages are not processed in 10 seconds, the app needs to use WorkManager for processing. + if (judgeWhetherIn10s) { + startWorkManagerJob(message); + } else { + // Process message within 10s + processWithin10s(message); + } + } + + private void startWorkManagerJob(RemoteMessage message) { + Log.d(TAG, "Start new Job processing."); + } + + private void processWithin10s(RemoteMessage message) { + Log.d(TAG, "Processing now."); + } + + @Override + public void onMessageSent(String msgId) { + Log.i(TAG, "onMessageSent called, Message id:" + msgId); + Intent intent = new Intent(); + intent.setAction(CODELABS_ACTION); + intent.putExtra("method", "onMessageSent"); + intent.putExtra("msg", "onMessageSent called, Message id:" + msgId); + + sendBroadcast(intent); + } + + @Override + public void onSendError(String msgId, Exception exception) { + Log.i(TAG, "onSendError called, message id:" + msgId + ", ErrCode:" + + ((SendException) exception).getErrorCode() + ", description:" + exception.getMessage()); + + Intent intent = new Intent(); + intent.setAction(CODELABS_ACTION); + intent.putExtra("method", "onSendError"); + intent.putExtra("msg", "onSendError called, message id:" + msgId + ", ErrCode:" + + ((SendException) exception).getErrorCode() + ", description:" + exception.getMessage()); + + sendBroadcast(intent); + } + + @Override + public void onTokenError(Exception e) { + super.onTokenError(e); + } + + +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/service/JPushService.java b/BuWanVideo/src/com/weikou/beibeivideo/service/JPushService.java deleted file mode 100644 index e2daf16..0000000 --- a/BuWanVideo/src/com/weikou/beibeivideo/service/JPushService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.weikou.beibeivideo.service; - -import cn.jpush.android.service.JCommonService; - -public class JPushService - extends JCommonService { -} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java index bc6c902..35f6f0b 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/SplashActivity.java @@ -78,10 +78,10 @@ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (!this.isTaskRoot()) {// 鍒ゆ柇鏈琣ctivity鏄笉鏄换鍔$┖闂寸殑婧恆ctivity,false灏辨槸涓嶆槸绯荤粺閲嶆柊瀹炰緥鍖栧嚭鏉ョ殑 - finish(); - return; - } +// if (!this.isTaskRoot()) {// 鍒ゆ柇鏈琣ctivity鏄笉鏄换鍔$┖闂寸殑婧恆ctivity,false灏辨槸涓嶆槸绯荤粺閲嶆柊瀹炰緥鍖栧嚭鏉ョ殑 +// finish(); +// return; +// } setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.activity_splash); initStatusBar(); @@ -269,6 +269,7 @@ GDTConstant.PID_2_VIDEO_LIST_SMALL_AD_COLUMN3 = BeibeiConstant.GDT_DOWNLOAD_HINT_ID; GDTConstant.PID_2_VIDEO_LIST_SMALL_AD_COLUMN2 = BeibeiConstant.GDT_DOWNLOAD_HINT_ID; GDTConstant.PID_HOME_RECOMMEND_BIG_IMG = BeibeiConstant.GDT_DOWNLOAD_HINT_ID; + GDTConstant.PID_2_VIDEO_DETAIL_PLAYER_PRE_PPTV = BeibeiConstant.GDT_DOWNLOAD_HINT_ID; CSJConstant.RECOMMEND_BIG_IMG_AD = CSJConstant.INVALID_AD; } @@ -485,7 +486,6 @@ //鐧惧害鍐呭鑱旂洘 // MobadsPermissionSettings.setPermissionReadDeviceID(true); getUid(); - new WebView(this); vg_ad.postDelayed(new Runnable() { @Override diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java index e8c6e45..efc4548 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/login/PhoneLoginActivity.java @@ -392,7 +392,6 @@ if (jsonObject.optBoolean("IsPost")) { //缁戝畾鎴愬姛 Toast.makeText(PhoneLoginActivity.this, "缁戝畾鎴愬姛", Toast.LENGTH_SHORT).show(); - mPhoneNumberAuthHelper.quitLoginPage(); PhoneLoginActivity.this.finish(); } else { Toast.makeText(PhoneLoginActivity.this, jsonObject.optString("Error"), Toast.LENGTH_SHORT).show(); @@ -403,6 +402,7 @@ public void onFinish() { super.onFinish(); DialogUtil.dismiss(loadingDialog); + mPhoneNumberAuthHelper.quitLoginPage(); } }); diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java index f83a0be..de45140 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/main/MainActivity.java @@ -21,11 +21,8 @@ import android.support.v4.content.Loader; import android.view.KeyEvent; import android.view.View; -import android.view.Window; -import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.ImageView; -import android.widget.LinearLayout; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; @@ -50,7 +47,6 @@ import com.umeng.socialize.media.UMImage; import com.weikou.beibeivideo.BasicTextHttpResponseHandler; import com.weikou.beibeivideo.BeibeiVideoAPI; -import com.weikou.beibeivideo.BeibeiVideoApplication; import com.weikou.beibeivideo.R; import com.weikou.beibeivideo.db.MessageTable; import com.weikou.beibeivideo.entity.NewComment; @@ -58,14 +54,13 @@ import com.weikou.beibeivideo.ui.BaseActivity; import com.weikou.beibeivideo.ui.baidu.BaiDuNewsFragment; import com.weikou.beibeivideo.ui.baidu.BaiDuVideosFragment; -import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; import com.weikou.beibeivideo.ui.login.LoginActivity; import com.weikou.beibeivideo.ui.login.PersonInfoActivity; -import com.weikou.beibeivideo.ui.login.PhoneLoginActivity; import com.weikou.beibeivideo.ui.media.VideoDetailActivity2; import com.weikou.beibeivideo.ui.mine.BrowserActivity; import com.weikou.beibeivideo.ui.mine.SystemMessageActivity; import com.weikou.beibeivideo.ui.mine.WatchHistoryActivity; +import com.weikou.beibeivideo.ui.push.PushOpenClickActivity; import com.weikou.beibeivideo.ui.recommend.SearchActivity; import com.weikou.beibeivideo.util.BeibeiConstant; import com.weikou.beibeivideo.util.ExitDialog; @@ -134,14 +129,17 @@ WifiManager wifi = (WifiManager) this.getApplicationContext().getSystemService(Context.WIFI_SERVICE); WifiInfo info = wifi.getConnectionInfo(); - Editor editor = mPre.edit(); - if (StringUtils.isEmpty(getMacAddress())) { - editor.putString("mac", info.getMacAddress()); - } else { - editor.putString("mac", getMacAddress()); - } - editor.commit(); + try { + Editor editor = mPre.edit(); + if (StringUtils.isEmpty(getMacAddress())) { + editor.putString("mac", info.getMacAddress()); + } else { + editor.putString("mac", getMacAddress()); + } + editor.commit(); + } catch (Exception e) { + } tv_search = findViewById(R.id.tv_activity_main_search); iv_msg_dot = findViewById(R.id.iv_msg_dot); @@ -345,6 +343,8 @@ addDownloadBuxin(preferences.getString("shopurl", "")); } EventBus.getDefault().register(this); + + PushOpenClickActivity.resumeJumpActivity(this); } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayFragment.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayFragment.java index 6952903..0d7e39c 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayFragment.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/mine/PPTVPlayFragment.java @@ -51,6 +51,9 @@ import org.apache.http.Header; import org.json.JSONObject; +import java.util.HashMap; +import java.util.Map; + public class PPTVPlayFragment extends RetainViewFragment implements OnClickListener { private final static int REQUEST_CODE_LOGIN = 1001; @@ -69,17 +72,49 @@ private boolean showAd = true; + private void getPPVideoInfo(String url) { + if (url.contains("cid=") && url.contains("vid=")) { + String[] sts = url.split("\\?"); + if (sts.length > 1) { + String params = sts[1]; + String[] ps = params.split("&"); + Map<String, String> map = new HashMap<>(); + for (String p : ps) { + map.put(p.split("=")[0], p.split("=")[1]); + } + String cid = map.get("cid"); + String vid = map.get("vid"); + //PPTV鎾斁涓婁紶 + BeibeiVideoAPI.uploadPPTVPlayRecord(getContext(), cid, vid, new BasicTextHttpResponseHandler() { + @Override + public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { + + } + }); + + } + } + } + private void initWebView(View view) { fl_ad = view.findViewById(R.id.fl_ad); webview = view.findViewById(R.id.webview); webview.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { + Log.i(TAG, "shouldOverrideUrlLoading:" + url); if (url != null && (!url.startsWith("http"))) { return true; } + + try { + getPPVideoInfo(url); + } catch (Exception e) { + + } return super.shouldOverrideUrlLoading(view, url); } + @Override public void onPageFinished(WebView webView, String s) { @@ -150,7 +185,7 @@ webSetting.setJavaScriptEnabled(true); webSetting.setTextZoom(100); webSetting.setBlockNetworkImage(false); - if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { webSetting.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); } webview.addJavascriptInterface(new PPJavaInterface(BeibeiVideoApplication.application, new PPJavaInterface.IEventListener() { @@ -309,8 +344,9 @@ public void onClick(View v) { switch (v.getId()) { case R.id.tv_top_bar_left: { - if (getActivity().getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { + if (webview != null) + webview.loadUrl("javascript:exitFullScreenPlay();"); getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); WindowManager.LayoutParams attrs = getActivity().getWindow().getAttributes(); attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN; @@ -318,7 +354,6 @@ } else { getActivity().finish(); } - } break; case R.id.iv_add_to_favourite: diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/push/OpenClickActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/push/OpenClickActivity.java deleted file mode 100644 index e34952a..0000000 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/push/OpenClickActivity.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.weikou.beibeivideo.ui.push; - -import android.app.Activity; -import android.os.Bundle; -import android.text.TextUtils; -import android.util.Log; -import android.widget.TextView; - -import org.json.JSONException; -import org.json.JSONObject; - -/** - * Created by jiguang on 17/7/5. - */ - -public class OpenClickActivity extends Activity { - private static final String TAG = "OpenClickActivity"; - /**娑堟伅Id**/ - private static final String KEY_MSGID = "msg_id"; - /**璇ラ�氱煡鐨勪笅鍙戦�氶亾**/ - private static final String KEY_WHICH_PUSH_SDK = "rom_type"; - /**閫氱煡鏍囬**/ - private static final String KEY_TITLE = "n_title"; - /**閫氱煡鍐呭**/ - private static final String KEY_CONTENT = "n_content"; - /**閫氱煡闄勫姞瀛楁**/ - private static final String KEY_EXTRAS = "n_extras"; - private TextView mTextView; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - mTextView = new TextView(this); - setContentView(mTextView); - handleOpenClick(); - } - - /** - * 澶勭悊鐐瑰嚮浜嬩欢锛屽綋鍓嶅惎鍔ㄩ厤缃殑Activity閮芥槸浣跨敤 - * Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK - * 鏂瑰紡鍚姩锛屽彧闇�瑕佸湪onCreat涓皟鐢ㄦ鏂规硶杩涜澶勭悊 - */ - private void handleOpenClick() { - Log.d(TAG, "鐢ㄦ埛鐐瑰嚮鎵撳紑浜嗛�氱煡"); - String data = null; - //鑾峰彇鍗庝负骞冲彴闄勫甫鐨刯push淇℃伅 - if (getIntent().getData() != null) { - data = getIntent().getData().toString(); - } - - //鑾峰彇fcm銆乷ppo銆乿ivo銆佸崕纭曘�佸皬绫冲钩鍙伴檮甯︾殑jpush淇℃伅 - if (TextUtils.isEmpty(data) && getIntent().getExtras() != null) { - data = getIntent().getExtras().getString("JMessageExtra"); - } - - Log.w(TAG, "msg content is " + String.valueOf(data)); - if (TextUtils.isEmpty(data)) return; - try { - JSONObject jsonObject = new JSONObject(data); - String msgId = jsonObject.optString(KEY_MSGID); - byte whichPushSDK = (byte) jsonObject.optInt(KEY_WHICH_PUSH_SDK); - String title = jsonObject.optString(KEY_TITLE); - String content = jsonObject.optString(KEY_CONTENT); - String extras = jsonObject.optString(KEY_EXTRAS); - StringBuilder sb = new StringBuilder(); - sb.append("msgId:"); - sb.append(String.valueOf(msgId)); - sb.append("\n"); - sb.append("title:"); - sb.append(String.valueOf(title)); - sb.append("\n"); - sb.append("content:"); - sb.append(String.valueOf(content)); - sb.append("\n"); - sb.append("extras:"); - sb.append(String.valueOf(extras)); - sb.append("\n"); - sb.append("platform:"); - sb.append(getPushSDKName(whichPushSDK)); - mTextView.setText(sb.toString()); - - //涓婃姤鐐瑰嚮浜嬩欢 -// JPushInterface.reportNotificationOpened(this, msgId, whichPushSDK); - } catch (JSONException e) { - Log.w(TAG, "parse notification error"); - } - } - - private String getPushSDKName(byte whichPushSDK) { - String name; - switch (whichPushSDK) { - case 0: - name = "jpush"; - break; - case 1: - name = "xiaomi"; - break; - case 2: - name = "huawei"; - break; - case 3: - name = "meizu"; - break; - case 4: - name = "oppo"; - break; - case 5: - name = "vivo"; - break; - case 6: - name = "asus"; - break; - case 8: - name = "fcm"; - break; - default: - name = "jpush"; - } - return name; - } - -} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/push/PushOpenClickActivity.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/push/PushOpenClickActivity.java new file mode 100644 index 0000000..0e590e9 --- /dev/null +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/push/PushOpenClickActivity.java @@ -0,0 +1,180 @@ +package com.weikou.beibeivideo.ui.push; + +import android.app.Activity; +import android.app.ActivityManager; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.webkit.WebChromeClient; +import android.webkit.WebViewClient; +import android.widget.TextView; +import android.widget.Toast; + +import com.alibaba.baichuan.android.trade.AlibcTrade; +import com.alibaba.baichuan.android.trade.AlibcTradeSDK; +import com.alibaba.baichuan.android.trade.callback.AlibcTradeCallback; +import com.alibaba.baichuan.android.trade.model.AlibcShowParams; +import com.alibaba.baichuan.android.trade.model.OpenType; +import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType; +import com.alibaba.baichuan.trade.biz.context.AlibcTradeResult; +import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeParams; +import com.ut.device.UTDevice; +import com.weikou.beibeivideo.ui.SplashActivity; +import com.weikou.beibeivideo.ui.main.MainActivity; +import com.weikou.beibeivideo.util.AlibcTradeUtil; +import com.weikou.beibeivideo.util.BeibeiConstant; +import com.weikou.beibeivideo.util.downutil.StringUtils; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +/** + * Created by jiguang on 17/7/5. + */ + +public class PushOpenClickActivity extends Activity { + + public static PushData pushData = null; + + private static final String TAG = "OpenClickActivity"; + private TextView mTextView; + + + private static void jump(Activity context, String type, String activity, String params) throws ClassNotFoundException, JSONException { + pushData = null; + Log.i(TAG,String.format("%s:%s:%s",type,activity,params)); + if (!"baichuan".equalsIgnoreCase(type)) { + Intent intent = new Intent(context, Class.forName(activity)); + if (!StringUtils.isNullOrEmpty(params)) { + JSONObject paramsJson = new JSONObject(params); + for (Iterator<String> its = paramsJson.keys(); its.hasNext(); ) { + String key = its.next(); + String value = paramsJson.getString(key); + intent.putExtra(key, value); + } + } + context.startActivity(intent); + } else { + JSONObject paramsJson = new JSONObject(params); + String url = paramsJson.optString("url"); + AlibcShowParams alibcShowParams = new AlibcShowParams(); + alibcShowParams.setOpenType(OpenType.Auto); + alibcShowParams.setNativeOpenFailedMode(AlibcFailModeType.AlibcNativeFailModeJumpBROWER); + AlibcTaokeParams alibcTaokeParams = new AlibcTaokeParams("", "", ""); + alibcTaokeParams.setPid(BeibeiConstant.BAICHUAN_PID); + alibcTaokeParams.setAdzoneid(BeibeiConstant.BAICHUAN_ADZONE_ID); + alibcTaokeParams.pid = BeibeiConstant.BAICHUAN_PID; + alibcTaokeParams.adzoneid = BeibeiConstant.BAICHUAN_ADZONE_ID; + alibcTaokeParams.extraParams = new HashMap<>(); + alibcTaokeParams.extraParams.put("taokeAppkey", BeibeiConstant.BAICHUAN_APPKEY); + + AlibcTradeSDK.setTaokeParams(alibcTaokeParams); + AlibcTradeUtil.openByUrl(context, + url, null, new WebViewClient(), new WebChromeClient(), + alibcShowParams, alibcTaokeParams, null); + } + } + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + mTextView = new TextView(this); + setContentView(mTextView); + String activity = getIntent().getStringExtra("activity"); + String params = getIntent().getStringExtra("params"); + String type = getIntent().getStringExtra("type"); + StringBuilder builder = new StringBuilder(); + builder.append("activity:" + activity); + builder.append("\n"); + builder.append("params:" + params); + mTextView.setText(builder.toString()); + if (!isAppRunning(getApplicationContext(), getPackageName())) { + //鏆傚瓨鏁版嵁 + pushData = new PushData(type, activity, params); + Intent intent = new Intent(this, MainActivity.class); + startActivity(intent); + finish(); + } else { + try { + jump(this, type, activity, params); + finish(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + } + + + private boolean isAppRunning(Context context, String packageName) { + ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); + ActivityManager.RunningTaskInfo info = manager.getRunningTasks(1).get(0); + Log.i(TAG, "numActivities:" + info.numActivities); + Log.i(TAG, "numRunning:" + info.numRunning); + + if (info.numActivities < 2) + return false; + else + return true; + } + + public static void resumeJumpActivity(Activity context) { + if (pushData != null) { + try { + jump(context, pushData.type, pushData.getActivity(), pushData.getParams()); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + } + + class PushData { + private String activity; + private String params; + //activity,baichuan + private String type; + + public PushData(String type,String activity, String params) { + this.activity = activity; + this.params = params; + this.type = type; + } + + public String getActivity() { + return activity; + } + + public void setActivity(String activity) { + this.activity = activity; + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + } + +} diff --git a/BuWanVideo/src/com/weikou/beibeivideo/ui/video/SearchResultAdapter.java b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/SearchResultAdapter.java index 282154f..2f13525 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/ui/video/SearchResultAdapter.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/ui/video/SearchResultAdapter.java @@ -108,6 +108,11 @@ albumVideoHolder.tv_name.setText(info.getName() + ""); albumVideoHolder.tv_type.setText(info.getTag()); albumVideoHolder.tv_actors.setText(info.getMainActor()); + if (info.getFree() == 1) { + albumVideoHolder.iv_vip.setVisibility(View.VISIBLE); + } else { + albumVideoHolder.iv_vip.setVisibility(View.GONE); + } albumVideoHolder.tv_play.setOnClickListener(new View.OnClickListener() { @@ -205,6 +210,11 @@ } simpleVideoHolder.tv_movie_title.setText(info.getName() + ""); + if (info.getFree() == 1) { + simpleVideoHolder.iv_vip.setVisibility(View.VISIBLE); + } else { + simpleVideoHolder.iv_vip.setVisibility(View.GONE); + } if (!StringUtils.isBlank(info.getTag())) simpleVideoHolder.tv_tag.setText(info.getTag()); @@ -308,6 +318,7 @@ class AlbumVideoHolder extends RecyclerView.ViewHolder { ImageView iv_picture; + ImageView iv_vip; TextView tv_name; TextView tv_type; TextView tv_actors; @@ -330,11 +341,14 @@ tv_video_3 = view.findViewById(R.id.tv_video_3); tv_video_4 = view.findViewById(R.id.tv_video_4); tv_video_5 = view.findViewById(R.id.tv_video_5); + iv_vip = view.findViewById(R.id.iv_vip); } } class SimpleVideoHolder extends RecyclerView.ViewHolder { ImageView iv_movie_cover; + ImageView iv_vip; + TextView tv_movie_title, tv_tag; View view; @@ -344,6 +358,7 @@ iv_movie_cover = view.findViewById(R.id.iv_movie_cover); tv_movie_title = view.findViewById(R.id.tv_movie_title); tv_tag = view.findViewById(R.id.tv_tag); + iv_vip = view.findViewById(R.id.iv_vip); } } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java b/BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java index be95b96..a499fb8 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/BeibeiConstant.java @@ -18,7 +18,7 @@ public static final String ABOUT_US = "http://bwweb.yeshitv.com/abountOur/index.html"; - public static final String HOST = "http://cb.ysdq.yeshitv.com";//姝e紡涓婄嚎鐗堟湰 + public static final String HOST = "http://api.ysdq.yeshitv.com:8089";//姝e紡涓婄嚎鐗堟湰 public static final String BAICHUAN_APPKEY = "24980167"; diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java index 71690be..fa2f1ec 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/UserUtil.java @@ -2,20 +2,18 @@ import android.content.Context; import android.content.SharedPreferences; -import android.view.View; -import com.bumptech.glide.Glide; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.weikou.beibeivideo.BasicTextHttpResponseHandler; import com.weikou.beibeivideo.BeibeiVideoAPI; -import com.weikou.beibeivideo.R; import com.weikou.beibeivideo.entity.UserInfo; import com.weikou.beibeivideo.entity.vo.UserInfoVO; import com.weikou.beibeivideo.util.downutil.StringUtils; import org.apache.http.Header; import org.json.JSONObject; + import static android.content.Context.MODE_PRIVATE; @@ -37,6 +35,8 @@ return false; else return true; + + } diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java b/BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java index 8b8be79..58cb8bf 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/browser/PPJavaInterface.java @@ -29,6 +29,7 @@ import org.json.JSONException; import org.json.JSONObject; +import java.net.URLEncoder; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; diff --git a/build.gradle b/build.gradle index 48e3424..c1f44f1 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ dependencies { classpath 'com.android.tools.build:gradle:4.1.1' - classpath 'com.huawei.agconnect:agcp:1.2.1.301' + classpath 'com.huawei.agconnect:agcp:1.4.1.300' } } diff --git a/library-common/src/com/lcjian/library/util/ManifestDataUtil.java b/library-common/src/com/lcjian/library/util/ManifestDataUtil.java index c4f50ac..7f94e84 100644 --- a/library-common/src/com/lcjian/library/util/ManifestDataUtil.java +++ b/library-common/src/com/lcjian/library/util/ManifestDataUtil.java @@ -3,17 +3,23 @@ import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; +import android.os.Bundle; import android.text.TextUtils; +import android.util.Log; + +import java.util.Iterator; /** * Created by weikou2015 on 2018/7/26. */ public class ManifestDataUtil { + private static final String TAG ="ManifestDataUtil" ; + /** * 鑾峰彇application涓寚瀹氱殑meta-data銆傛湰渚嬩腑锛岃皟鐢ㄦ柟娉曟椂key灏辨槸UMENG_CHANNEL * - * @return 濡傛灉娌℃湁鑾峰彇鎴愬姛(娌℃湁瀵瑰簲鍊硷紝鎴栬�呭紓甯�)锛屽垯杩斿洖鍊间负绌� + * @return 濡傛灉娌℃湁鑾峰彇鎴愬姛(娌℃湁瀵瑰簲鍊� 锛� 鎴栬�呭紓甯�)锛屽垯杩斿洖鍊间负绌� */ public static String getAppMetaData(Context ctx, String key) { if (ctx == null || TextUtils.isEmpty(key)) { @@ -29,7 +35,6 @@ resultData = applicationInfo.metaData.getString(key); } } - } } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); diff --git a/library-jpush/.gitignore b/library-jpush/.gitignore deleted file mode 100644 index 46d8627..0000000 --- a/library-jpush/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ - -# Built application files -*.apk -*.ap_ - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ -out/ - -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ - -# Intellij -*.iml -*.iws.idea/ -.idea/ -# Keystore files -*.jks \ No newline at end of file diff --git a/library-jpush/build.gradle b/library-jpush/build.gradle deleted file mode 100644 index 1076ee3..0000000 --- a/library-jpush/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 29 - buildToolsVersion "29.0.0" - - defaultConfig { - minSdkVersion 17 - targetSdkVersion 27 - versionCode 1 - versionName "1.0" - - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - repositories { - flatDir { - dirs 'libs' - } - } - - sourceSets { - main { - jniLibs.srcDirs = ['libs'] - } - } - -} - -dependencies { - api fileTree(dir: 'libs', include: ['*.jar']) - - - //huawei_dependencies_start - //鍗庝负璇锋寜鐓у巶鍟嗘枃妗i厤缃富 gradle 鍗庝负闀滃儚渚濊禆鍜屾坊鍔� agconnect-services.json 鍚庡啀鎵撳紑姝や緷璧� - implementation 'com.huawei.hms:push:5.0.2.300' - //huawei_dependencies_end - - //oppo_dependencies_start - compileOnly(name: 'com.heytap.msp-push-2.1.0', ext: 'aar') - //oppo_dependencies_end -} - diff --git a/library-jpush/libs/arm64-v8a/libjcore260.so b/library-jpush/libs/arm64-v8a/libjcore260.so deleted file mode 100644 index 02cdcef..0000000 --- a/library-jpush/libs/arm64-v8a/libjcore260.so +++ /dev/null Binary files differ diff --git a/library-jpush/libs/armeabi-v7a/libjcore260.so b/library-jpush/libs/armeabi-v7a/libjcore260.so deleted file mode 100644 index 4441428..0000000 --- a/library-jpush/libs/armeabi-v7a/libjcore260.so +++ /dev/null Binary files differ diff --git a/library-jpush/libs/armeabi/libjcore260.so b/library-jpush/libs/armeabi/libjcore260.so deleted file mode 100644 index ceb14cd..0000000 --- a/library-jpush/libs/armeabi/libjcore260.so +++ /dev/null Binary files differ diff --git a/library-jpush/libs/jcore-android-2.6.0.jar b/library-jpush/libs/jcore-android-2.6.0.jar deleted file mode 100644 index d5c1472..0000000 --- a/library-jpush/libs/jcore-android-2.6.0.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/jpush-android-3.9.1.jar b/library-jpush/libs/jpush-android-3.9.1.jar deleted file mode 100644 index b9d13f3..0000000 --- a/library-jpush/libs/jpush-android-3.9.1.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/jpush-android-plugin-huawei-v3.9.1.jar b/library-jpush/libs/jpush-android-plugin-huawei-v3.9.1.jar deleted file mode 100644 index 9adefdb..0000000 --- a/library-jpush/libs/jpush-android-plugin-huawei-v3.9.1.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/jpush-android-plugin-meizu-v3.9.1.jar b/library-jpush/libs/jpush-android-plugin-meizu-v3.9.1.jar deleted file mode 100644 index 88475eb..0000000 --- a/library-jpush/libs/jpush-android-plugin-meizu-v3.9.1.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/jpush-android-plugin-oppo-v3.9.1.jar b/library-jpush/libs/jpush-android-plugin-oppo-v3.9.1.jar deleted file mode 100644 index 291d237..0000000 --- a/library-jpush/libs/jpush-android-plugin-oppo-v3.9.1.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/jpush-android-plugin-vivo-v3.9.1.jar b/library-jpush/libs/jpush-android-plugin-vivo-v3.9.1.jar deleted file mode 100644 index d544255..0000000 --- a/library-jpush/libs/jpush-android-plugin-vivo-v3.9.1.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/jpush-android-plugin-xiaomi-v3.9.1.jar b/library-jpush/libs/jpush-android-plugin-xiaomi-v3.9.1.jar deleted file mode 100644 index 1d0f401..0000000 --- a/library-jpush/libs/jpush-android-plugin-xiaomi-v3.9.1.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/meizu-push-4.0.2.jar b/library-jpush/libs/meizu-push-4.0.2.jar deleted file mode 100644 index 740e7c5..0000000 --- a/library-jpush/libs/meizu-push-4.0.2.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/mips/libjcore260.so b/library-jpush/libs/mips/libjcore260.so deleted file mode 100644 index 89a8f63..0000000 --- a/library-jpush/libs/mips/libjcore260.so +++ /dev/null Binary files differ diff --git a/library-jpush/libs/mips64/libjcore260.so b/library-jpush/libs/mips64/libjcore260.so deleted file mode 100644 index 35d104d..0000000 --- a/library-jpush/libs/mips64/libjcore260.so +++ /dev/null Binary files differ diff --git a/library-jpush/libs/push_sdk_v3.0.0.jar b/library-jpush/libs/push_sdk_v3.0.0.jar deleted file mode 100644 index 9c87567..0000000 --- a/library-jpush/libs/push_sdk_v3.0.0.jar +++ /dev/null Binary files differ diff --git a/library-jpush/libs/x86/libjcore260.so b/library-jpush/libs/x86/libjcore260.so deleted file mode 100644 index 8cf739f..0000000 --- a/library-jpush/libs/x86/libjcore260.so +++ /dev/null Binary files differ diff --git a/library-jpush/libs/x86_64/libjcore260.so b/library-jpush/libs/x86_64/libjcore260.so deleted file mode 100644 index d86fcb7..0000000 --- a/library-jpush/libs/x86_64/libjcore260.so +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/AndroidManifest.xml b/library-jpush/src/main/AndroidManifest.xml deleted file mode 100644 index 24cc3c8..0000000 --- a/library-jpush/src/main/AndroidManifest.xml +++ /dev/null @@ -1,281 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - package="cn.jiguang.sdk"> - - <uses-sdk - tools:ignore="MultipleUsesSdk" - tools:overrideLibrary="com.heytap.mcssdk" /> - <!-- 鏋佸厜鎺ㄩ�佹潈闄� --> - <uses-permission android:name="android.permission.BROADCAST_STICKY" /> - <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" /> - <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" /> - <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> - - <permission - android:name="${applicationId}.permission.JPUSH_MESSAGE" - android:protectionLevel="signature" /> - <uses-permission android:name="${applicationId}.permission.JPUSH_MESSAGE" /> - - - <!-- 鍗庝负瑙掓爣 --> - <uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE" /> - - - <!--xiaomi_permission_start--> - <permission - android:name="${applicationId}.permission.MIPUSH_RECEIVE" - android:protectionLevel="signature" /> - <uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" /> - <!--xiaomi_permission_end--> - <!--oppo_permission_start--> - <uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" /> - <uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE" /> - <!--oppo_permission_end--> - - <application> - - <service - android:name="cn.jpush.android.service.PushService" - android:enabled="true" - android:exported="false"> - <intent-filter> - <action android:name="cn.jpush.android.intent.REGISTER" /> - <action android:name="cn.jpush.android.intent.REPORT" /> - <action android:name="cn.jpush.android.intent.PushService" /> - <action android:name="cn.jpush.android.intent.PUSH_TIME" /> - </intent-filter> - </service> - - - <provider - android:name="cn.jpush.android.service.DataProvider" - android:authorities="${applicationId}.DataProvider" - android:exported="true" /> - - <provider - android:name="cn.jpush.android.service.DownloadProvider" - android:authorities="${applicationId}.DownloadProvider" - android:exported="true" /> - - <receiver - android:name="cn.jpush.android.service.PushReceiver" - android:enabled="true"> - <intent-filter android:priority="1000"> - <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> - <category android:name="${applicationId}" /> - </intent-filter> - <intent-filter> - <action android:name="android.intent.action.USER_PRESENT" /> - <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> - </intent-filter> - <!-- Optional --> - <intent-filter> - <action android:name="android.intent.action.PACKAGE_ADDED" /> - <action android:name="android.intent.action.PACKAGE_REMOVED" /> - - <data android:scheme="package" /> - </intent-filter> - </receiver> - - <!-- Required SDK 鏍稿績鍔熻兘--> - <activity - android:name="cn.jpush.android.ui.PushActivity" - android:configChanges="orientation|keyboardHidden" - android:exported="false" - android:theme="@android:style/Theme.NoTitleBar"> - <intent-filter> - <action android:name="cn.jpush.android.ui.PushActivity" /> - - <category android:name="android.intent.category.DEFAULT" /> - <category android:name="${applicationId}" /> - </intent-filter> - </activity> - <!-- SDK 鏍稿績鍔熻兘--> - <activity - android:name="cn.jpush.android.ui.PopWinActivity" - android:configChanges="orientation|keyboardHidden" - android:exported="false" - android:theme="@style/MyDialogStyle"> - <intent-filter> - <category android:name="android.intent.category.DEFAULT" /> - <category android:name="${applicationId}" /> - </intent-filter> - </activity> - - - <receiver android:name="cn.jpush.android.service.AlarmReceiver" /> - - <activity - android:name="cn.jpush.android.service.JNotifyActivity" - android:exported="true" - android:taskAffinity="jpush.custom" - android:theme="@android:style/Theme.Translucent.NoTitleBar"> - <intent-filter> - <action android:name="cn.jpush.android.intent.JNotifyActivity" /> - <category android:name="${applicationId}" /> - </intent-filter> - </activity> - - - <!--xiaomi_config_start--> - <service - android:name="com.xiaomi.push.service.XMJobService" - android:enabled="true" - android:exported="false" - android:permission="android.permission.BIND_JOB_SERVICE" - android:process=":pushcore" /> - <service - android:name="com.xiaomi.push.service.XMPushService" - android:enabled="true" - android:process=":pushcore" /> - <service - android:name="com.xiaomi.mipush.sdk.PushMessageHandler" - android:enabled="true" - android:exported="true" /> - <service - android:name="com.xiaomi.mipush.sdk.MessageHandleService" - android:enabled="true" /> - - <receiver - android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver" - android:exported="true"> - <intent-filter> - <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> - - <category android:name="android.intent.category.DEFAULT" /> - </intent-filter> - </receiver> - <receiver - android:name="com.xiaomi.push.service.receivers.PingReceiver" - android:exported="false" - android:process=":pushcore"> - <intent-filter> - <action android:name="com.xiaomi.push.PING_TIMER" /> - </intent-filter> - </receiver> - <receiver - android:name="cn.jpush.android.service.PluginXiaomiPlatformsReceiver" - android:exported="true"> - <intent-filter> - <action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" /> - </intent-filter> - <intent-filter> - <action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" /> - </intent-filter> - <intent-filter> - <action android:name="com.xiaomi.mipush.ERROR" /> - </intent-filter> - </receiver> - - <meta-data - android:name="XIAOMI_APPKEY" - android:value="${XIAOMI_APPKEY}" /> - <meta-data - android:name="XIAOMI_APPID" - android:value="${XIAOMI_APPID}" /> - <!--xiaomi_config_end--> - - <!--huawei_config_start--> - <service - android:name="cn.jpush.android.service.PluginHuaweiPlatformsService" - android:exported="false" - tools:ignore="Instantiatable"> - <intent-filter> - <action android:name="com.huawei.push.action.MESSAGING_EVENT" /> - </intent-filter> - </service> - <!--huawei_config_end--> - - <!--meizu_config_start--> - <receiver android:name="cn.jpush.android.service.PluginMeizuPlatformsReceiver"> - <intent-filter> - <!-- 鎺ユ敹 push 娑堟伅 --> - <action android:name="com.meizu.flyme.push.intent.MESSAGE" /> - <!-- 鎺ユ敹 register 娑堟伅 --> - <action android:name="com.meizu.flyme.push.intent.REGISTER.FEEDBACK" /> - <!-- 鎺ユ敹 unregister 娑堟伅--> - <action android:name="com.meizu.flyme.push.intent.UNREGISTER.FEEDBACK" /> - <!-- 鍏煎浣庣増鏈� Flyme3 鎺ㄩ�佹湇鍔¢厤缃� --> - <action android:name="com.meizu.c2dm.intent.REGISTRATION" /> - <action android:name="com.meizu.c2dm.intent.RECEIVE" /> - - <category android:name="${applicationId}" /> - </intent-filter> - </receiver> - - <meta-data - android:name="MEIZU_APPKEY" - android:value="${MEIZU_APPKEY}" /> - <meta-data - android:name="MEIZU_APPID" - android:value="${MEIZU_APPID}" /> - <!--meizu_config_end--> - - - <!--oppo_config_start--> - <service - android:name="cn.jpush.android.service.PluginOppoPushService" - android:permission="com.coloros.mcs.permission.SEND_MCS_MESSAGE"> - <intent-filter> - <action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE" /> - </intent-filter> - </service> - <!-- since JPushv3.6.8 锛宱ppov2.1.0 oppo 鏍稿績鍔熻兘--> - <service - android:name="com.heytap.msp.push.service.DataMessageCallbackService" - android:permission="com.heytap.mcs.permission.SEND_PUSH_MESSAGE"> - - <intent-filter> - <action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE" /> - - <action android:name="com.heytap.msp.push.RECEIVE_MCS_MESSAGE" /> - </intent-filter> - </service> <!--鍏煎Q鐗堟湰--> - <meta-data - android:name="OPPO_APPKEY" - android:value="${OPPO_APPKEY}" /> - <meta-data - android:name="OPPO_APPID" - android:value="${OPPO_APPID}" /> - <meta-data - android:name="OPPO_APPSECRET" - android:value="${OPPO_APPSECRET}" /> - <!--oppo_config_end--> - - <!--vivo_config_start--> - <receiver android:name="cn.jpush.android.service.PluginVivoMessageReceiver"> - <intent-filter> - <!-- 鎺ユ敹 push 娑堟伅 --> - <action android:name="com.vivo.pushclient.action.RECEIVE" /> - </intent-filter> - </receiver> - <service - android:name="com.vivo.push.sdk.service.CommandClientService" - android:exported="true" /> - <activity - android:name="com.vivo.push.sdk.LinkProxyClientActivity" - android:exported="false" - android:screenOrientation="portrait" - android:theme="@android:style/Theme.Translucent.NoTitleBar" /> - - <meta-data - android:name="com.vivo.push.api_key" - android:value="${VIVO_APPKEY}" /> - <meta-data - android:name="com.vivo.push.app_id" - android:value="${VIVO_APPID}" /> - <!--vivo_config_end--> - - - <!--Required_config--> - <meta-data - android:name="JPUSH_CHANNEL" - android:value="${JPUSH_CHANNEL}" /> - <meta-data - android:name="JPUSH_APPKEY" - android:value="${JPUSH_APPKEY}" /> <!-- </>鍊兼潵鑷紑鍙戣�呭钩鍙板彇寰楃殑AppKey --> - - </application> -</manifest> - diff --git a/library-jpush/src/main/java/com/ExampleUtil.java b/library-jpush/src/main/java/com/ExampleUtil.java deleted file mode 100644 index aefb133..0000000 --- a/library-jpush/src/main/java/com/ExampleUtil.java +++ /dev/null @@ -1,134 +0,0 @@ -package com; - -import android.content.Context; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.PackageManager.NameNotFoundException; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.os.Bundle; -import android.os.Looper; -import android.telephony.TelephonyManager; -import android.text.TextUtils; -import android.widget.Toast; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import cn.jpush.android.api.JPushInterface; -import cn.jpush.android.helper.Logger; - -public class ExampleUtil { - public static final String PREFS_NAME = "JPUSH_EXAMPLE"; - public static final String PREFS_DAYS = "JPUSH_EXAMPLE_DAYS"; - public static final String PREFS_START_TIME = "PREFS_START_TIME"; - public static final String PREFS_END_TIME = "PREFS_END_TIME"; - public static final String KEY_APP_KEY = "JPUSH_APPKEY"; - - public static boolean isEmpty(String s) { - if (null == s) - return true; - if (s.length() == 0) - return true; - if (s.trim().length() == 0) - return true; - return false; - } - /** - * 鍙兘浠� 鈥�+鈥� 鎴栬�� 鏁板瓧寮�澶达紱鍚庨潰鐨勫唴瀹瑰彧鑳藉寘鍚� 鈥�-鈥� 鍜� 鏁板瓧銆� - * */ - private final static String MOBILE_NUMBER_CHARS = "^[+0-9][-0-9]{1,}$"; - public static boolean isValidMobileNumber(String s) { - if(TextUtils.isEmpty(s)) return true; - Pattern p = Pattern.compile(MOBILE_NUMBER_CHARS); - Matcher m = p.matcher(s); - return m.matches(); - } - // 鏍¢獙Tag Alias 鍙兘鏄暟瀛�,鑻辨枃瀛楁瘝鍜屼腑鏂� - public static boolean isValidTagAndAlias(String s) { - Pattern p = Pattern.compile("^[\u4E00-\u9FA50-9a-zA-Z_!@#$&*+=.|]+$"); - Matcher m = p.matcher(s); - return m.matches(); - } - - // 鍙栧緱AppKey - public static String getAppKey(Context context) { - Bundle metaData = null; - String appKey = null; - try { - ApplicationInfo ai = context.getPackageManager().getApplicationInfo( - context.getPackageName(), PackageManager.GET_META_DATA); - if (null != ai) - metaData = ai.metaData; - if (null != metaData) { - appKey = metaData.getString(KEY_APP_KEY); - if ((null == appKey) || appKey.length() != 24) { - appKey = null; - } - } - } catch (NameNotFoundException e) { - - } - return appKey; - } - - // 鍙栧緱鐗堟湰鍙� - public static String GetVersion(Context context) { - try { - PackageInfo manager = context.getPackageManager().getPackageInfo( - context.getPackageName(), 0); - return manager.versionName; - } catch (NameNotFoundException e) { - return "Unknown"; - } - } - - public static void showToast(final String toast, final Context context) - { - new Thread(new Runnable() { - - @Override - public void run() { - Looper.prepare(); - Toast.makeText(context, toast, Toast.LENGTH_SHORT).show(); - Looper.loop(); - } - }).start(); - } - - public static boolean isConnected(Context context) { - ConnectivityManager conn = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo info = conn.getActiveNetworkInfo(); - return (info != null && info.isConnected()); - } - - public static String getImei(Context context, String imei) { - String ret = null; - try { - TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); - ret = telephonyManager.getDeviceId(); - } catch (Exception e) { - Logger.e(ExampleUtil.class.getSimpleName(), e.getMessage()); - } - if (isReadableASCII(ret)){ - return ret; - } else { - return imei; - } - } - - private static boolean isReadableASCII(CharSequence string){ - if (TextUtils.isEmpty(string)) return false; - try { - Pattern p = Pattern.compile("[\\x20-\\x7E]+"); - return p.matcher(string).matches(); - } catch (Throwable e){ - return true; - } - } - - public static String getDeviceId(Context context) { - return JPushInterface.getUdid(context); - } -} diff --git a/library-jpush/src/main/java/com/TagAliasOperatorHelper.java b/library-jpush/src/main/java/com/TagAliasOperatorHelper.java deleted file mode 100644 index 55566d5..0000000 --- a/library-jpush/src/main/java/com/TagAliasOperatorHelper.java +++ /dev/null @@ -1,339 +0,0 @@ -package com; - -import android.content.Context; -import android.os.Handler; -import android.os.Message; -import android.util.SparseArray; - -import java.util.Locale; -import java.util.Set; - -import cn.jpush.android.api.JPushInterface; -import cn.jpush.android.api.JPushMessage; -import cn.jpush.android.helper.Logger; - -/** - * 澶勭悊tagalias鐩稿叧鐨勯�昏緫 - * */ -public class TagAliasOperatorHelper { - private static final String TAG = "JIGUANG-TagAliasHelper"; - public static int sequence = 1; - /**澧炲姞*/ - public static final int ACTION_ADD = 1; - /**瑕嗙洊*/ - public static final int ACTION_SET = 2; - /**鍒犻櫎閮ㄥ垎*/ - public static final int ACTION_DELETE = 3; - /**鍒犻櫎鎵�鏈�*/ - public static final int ACTION_CLEAN = 4; - /**鏌ヨ*/ - public static final int ACTION_GET = 5; - - public static final int ACTION_CHECK = 6; - - public static final int DELAY_SEND_ACTION = 1; - - public static final int DELAY_SET_MOBILE_NUMBER_ACTION = 2; - - private Context context; - - private static TagAliasOperatorHelper mInstance; - private TagAliasOperatorHelper(){ - } - public static TagAliasOperatorHelper getInstance(){ - if(mInstance == null){ - synchronized (TagAliasOperatorHelper.class){ - if(mInstance == null){ - mInstance = new TagAliasOperatorHelper(); - } - } - } - return mInstance; - } - public void init(Context context){ - if(context != null) { - this.context = context.getApplicationContext(); - } - } - private SparseArray<Object> setActionCache = new SparseArray<Object>(); - - public Object get(int sequence){ - return setActionCache.get(sequence); - } - public Object remove(int sequence){ - return setActionCache.get(sequence); - } - public void put(int sequence,Object tagAliasBean){ - setActionCache.put(sequence,tagAliasBean); - } - private Handler delaySendHandler = new Handler(){ - @Override - public void handleMessage(Message msg) { - switch (msg.what){ - case DELAY_SEND_ACTION: - if(msg.obj !=null && msg.obj instanceof TagAliasBean){ - Logger.i(TAG,"on delay time"); - sequence++; - TagAliasBean tagAliasBean = (TagAliasBean) msg.obj; - setActionCache.put(sequence, tagAliasBean); - if(context!=null) { - handleAction(context, sequence, tagAliasBean); - }else{ - Logger.e(TAG,"#unexcepted - context was null"); - } - }else{ - Logger.w(TAG,"#unexcepted - msg obj was incorrect"); - } - break; - case DELAY_SET_MOBILE_NUMBER_ACTION: - if(msg.obj !=null && msg.obj instanceof String) { - Logger.i(TAG, "retry set mobile number"); - sequence++; - String mobileNumber = (String) msg.obj; - setActionCache.put(sequence, mobileNumber); - if(context !=null) { - handleAction(context, sequence, mobileNumber); - }else { - Logger.e(TAG, "#unexcepted - context was null"); - } - }else{ - Logger.w(TAG,"#unexcepted - msg obj was incorrect"); - } - break; - } - } - }; - public void handleAction(Context context,int sequence,String mobileNumber){ - put(sequence,mobileNumber); - Logger.d(TAG,"sequence:"+sequence+",mobileNumber:"+mobileNumber); - JPushInterface.setMobileNumber(context,sequence,mobileNumber); - } - /** - * 澶勭悊璁剧疆tag - * */ - public void handleAction(Context context,int sequence, TagAliasBean tagAliasBean){ - init(context); - if(tagAliasBean == null){ - Logger.w(TAG,"tagAliasBean was null"); - return; - } - put(sequence,tagAliasBean); - if(tagAliasBean.isAliasAction){ - switch (tagAliasBean.action){ - case ACTION_GET: - JPushInterface.getAlias(context,sequence); - break; - case ACTION_DELETE: - JPushInterface.deleteAlias(context,sequence); - break; - case ACTION_SET: - JPushInterface.setAlias(context,sequence,tagAliasBean.alias); - break; - default: - Logger.w(TAG,"unsupport alias action type"); - return; - } - }else { - switch (tagAliasBean.action) { - case ACTION_ADD: - JPushInterface.addTags(context, sequence, tagAliasBean.tags); - break; - case ACTION_SET: - JPushInterface.setTags(context, sequence, tagAliasBean.tags); - break; - case ACTION_DELETE: - JPushInterface.deleteTags(context, sequence, tagAliasBean.tags); - break; - case ACTION_CHECK: - //涓�娆″彧鑳絚heck涓�涓猼ag - String tag = (String)tagAliasBean.tags.toArray()[0]; - JPushInterface.checkTagBindState(context,sequence,tag); - break; - case ACTION_GET: - JPushInterface.getAllTags(context, sequence); - break; - case ACTION_CLEAN: - JPushInterface.cleanTags(context, sequence); - break; - default: - Logger.w(TAG,"unsupport tag action type"); - return; - } - } - } - private boolean RetryActionIfNeeded(int errorCode,TagAliasBean tagAliasBean){ - if(!ExampleUtil.isConnected(context)){ - Logger.w(TAG,"no network"); - return false; - } - //杩斿洖鐨勯敊璇爜涓�6002 瓒呮椂,6014 鏈嶅姟鍣ㄧ箒蹇�,閮藉缓璁欢杩熼噸璇� - if(errorCode == 6002 || errorCode == 6014){ - Logger.d(TAG,"need retry"); - if(tagAliasBean!=null){ - Message message = new Message(); - message.what = DELAY_SEND_ACTION; - message.obj = tagAliasBean; - delaySendHandler.sendMessageDelayed(message,1000*60); - String logs =getRetryStr(tagAliasBean.isAliasAction, tagAliasBean.action,errorCode); - ExampleUtil.showToast(logs, context); - return true; - } - } - return false; - } - private boolean RetrySetMObileNumberActionIfNeeded(int errorCode,String mobileNumber){ - if(!ExampleUtil.isConnected(context)){ - Logger.w(TAG,"no network"); - return false; - } - //杩斿洖鐨勯敊璇爜涓�6002 瓒呮椂,6024 鏈嶅姟鍣ㄥ唴閮ㄩ敊璇�,寤鸿绋嶅悗閲嶈瘯 - if(errorCode == 6002 || errorCode == 6024){ - Logger.d(TAG,"need retry"); - Message message = new Message(); - message.what = DELAY_SET_MOBILE_NUMBER_ACTION; - message.obj = mobileNumber; - delaySendHandler.sendMessageDelayed(message,1000*60); - String str = "Failed to set mobile number due to %s. Try again after 60s."; - str = String.format(Locale.ENGLISH,str,(errorCode == 6002 ? "timeout" : "server internal error鈥�")); - ExampleUtil.showToast(str, context); - return true; - } - return false; - - } - private String getRetryStr(boolean isAliasAction,int actionType,int errorCode){ - String str = "Failed to %s %s due to %s. Try again after 60s."; - str = String.format(Locale.ENGLISH,str,getActionStr(actionType),(isAliasAction? "alias" : " tags") ,(errorCode == 6002 ? "timeout" : "server too busy")); - return str; - } - - private String getActionStr(int actionType){ - switch (actionType){ - case ACTION_ADD: - return "add"; - case ACTION_SET: - return "set"; - case ACTION_DELETE: - return "delete"; - case ACTION_GET: - return "get"; - case ACTION_CLEAN: - return "clean"; - case ACTION_CHECK: - return "check"; - } - return "unkonw operation"; - } - public void onTagOperatorResult(Context context, JPushMessage jPushMessage) { - int sequence = jPushMessage.getSequence(); - Logger.i(TAG,"action - onTagOperatorResult, sequence:"+sequence+",tags:"+jPushMessage.getTags()); - Logger.i(TAG,"tags size:"+jPushMessage.getTags().size()); - init(context); - //鏍规嵁sequence浠庝箣鍓嶆搷浣滅紦瀛樹腑鑾峰彇缂撳瓨璁板綍 - TagAliasBean tagAliasBean = (TagAliasBean)setActionCache.get(sequence); - if(tagAliasBean == null){ - ExampleUtil.showToast("鑾峰彇缂撳瓨璁板綍澶辫触", context); - return; - } - if(jPushMessage.getErrorCode() == 0){ - Logger.i(TAG,"action - modify tag Success,sequence:"+sequence); - setActionCache.remove(sequence); - String logs = getActionStr(tagAliasBean.action)+" tags success"; - Logger.i(TAG,logs); - ExampleUtil.showToast(logs, context); - }else{ - String logs = "Failed to " + getActionStr(tagAliasBean.action)+" tags"; - if(jPushMessage.getErrorCode() == 6018){ - //tag鏁伴噺瓒呰繃闄愬埗,闇�瑕佸厛娓呴櫎涓�閮ㄥ垎鍐峚dd - logs += ", tags is exceed limit need to clean"; - } - logs += ", errorCode:" + jPushMessage.getErrorCode(); - Logger.e(TAG, logs); - if(!RetryActionIfNeeded(jPushMessage.getErrorCode(),tagAliasBean)) { - ExampleUtil.showToast(logs, context); - } - } - } - public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage){ - int sequence = jPushMessage.getSequence(); - Logger.i(TAG,"action - onCheckTagOperatorResult, sequence:"+sequence+",checktag:"+jPushMessage.getCheckTag()); - init(context); - //鏍规嵁sequence浠庝箣鍓嶆搷浣滅紦瀛樹腑鑾峰彇缂撳瓨璁板綍 - TagAliasBean tagAliasBean = (TagAliasBean)setActionCache.get(sequence); - if(tagAliasBean == null){ - ExampleUtil.showToast("鑾峰彇缂撳瓨璁板綍澶辫触", context); - return; - } - if(jPushMessage.getErrorCode() == 0){ - Logger.i(TAG,"tagBean:"+tagAliasBean); - setActionCache.remove(sequence); - String logs = getActionStr(tagAliasBean.action)+" tag "+jPushMessage.getCheckTag() + " bind state success,state:"+jPushMessage.getTagCheckStateResult(); - Logger.i(TAG,logs); - ExampleUtil.showToast(logs, context); - }else{ - String logs = "Failed to " + getActionStr(tagAliasBean.action)+" tags, errorCode:" + jPushMessage.getErrorCode(); - Logger.e(TAG, logs); - if(!RetryActionIfNeeded(jPushMessage.getErrorCode(),tagAliasBean)) { - ExampleUtil.showToast(logs, context); - } - } - } - public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) { - int sequence = jPushMessage.getSequence(); - Logger.i(TAG,"action - onAliasOperatorResult, sequence:"+sequence+",alias:"+jPushMessage.getAlias()); - init(context); - //鏍规嵁sequence浠庝箣鍓嶆搷浣滅紦瀛樹腑鑾峰彇缂撳瓨璁板綍 - TagAliasBean tagAliasBean = (TagAliasBean)setActionCache.get(sequence); - if(tagAliasBean == null){ - ExampleUtil.showToast("鑾峰彇缂撳瓨璁板綍澶辫触", context); - return; - } - if(jPushMessage.getErrorCode() == 0){ - Logger.i(TAG,"action - modify alias Success,sequence:"+sequence); - setActionCache.remove(sequence); - String logs = getActionStr(tagAliasBean.action)+" alias success"; - Logger.i(TAG,logs); - ExampleUtil.showToast(logs, context); - }else{ - String logs = "Failed to " + getActionStr(tagAliasBean.action)+" alias, errorCode:" + jPushMessage.getErrorCode(); - Logger.e(TAG, logs); - if(!RetryActionIfNeeded(jPushMessage.getErrorCode(),tagAliasBean)) { - ExampleUtil.showToast(logs, context); - } - } - } - //璁剧疆鎵嬫満鍙风爜鍥炶皟 - public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) { - int sequence = jPushMessage.getSequence(); - Logger.i(TAG,"action - onMobileNumberOperatorResult, sequence:"+sequence+",mobileNumber:"+jPushMessage.getMobileNumber()); - init(context); - if(jPushMessage.getErrorCode() == 0){ - Logger.i(TAG,"action - set mobile number Success,sequence:"+sequence); - setActionCache.remove(sequence); - }else{ - String logs = "Failed to set mobile number, errorCode:" + jPushMessage.getErrorCode(); - Logger.e(TAG, logs); - if(!RetrySetMObileNumberActionIfNeeded(jPushMessage.getErrorCode(),jPushMessage.getMobileNumber())){ - ExampleUtil.showToast(logs, context); - } - } - } - public static class TagAliasBean{ - int action; - Set<String> tags; - String alias; - boolean isAliasAction; - - @Override - public String toString() { - return "TagAliasBean{" + - "action=" + action + - ", tags=" + tags + - ", alias='" + alias + '\'' + - ", isAliasAction=" + isAliasAction + - '}'; - } - } - - -} diff --git a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_cancle.png b/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_cancle.png deleted file mode 100644 index 473abfe..0000000 --- a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_cancle.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_close.png b/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_close.png deleted file mode 100644 index 4c6e670..0000000 --- a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_close.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_close2.png b/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_close2.png deleted file mode 100644 index bcedf3c..0000000 --- a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_action_close2.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png b/library-jpush/src/main/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png deleted file mode 100644 index c9f4e4d..0000000 --- a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png b/library-jpush/src/main/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png deleted file mode 100644 index f289651..0000000 --- a/library-jpush/src/main/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-hdpi/jpush_richpush_btn_selector.xml b/library-jpush/src/main/res/drawable-hdpi/jpush_richpush_btn_selector.xml deleted file mode 100644 index c6dd002..0000000 --- a/library-jpush/src/main/res/drawable-hdpi/jpush_richpush_btn_selector.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?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/jpush_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/jpush_ic_richpush_actionbar_back" /> -</selector> \ No newline at end of file diff --git a/library-jpush/src/main/res/drawable-hdpi/jpush_richpush_progressbar.xml b/library-jpush/src/main/res/drawable-hdpi/jpush_richpush_progressbar.xml deleted file mode 100644 index a1d9b8f..0000000 --- a/library-jpush/src/main/res/drawable-hdpi/jpush_richpush_progressbar.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > - - <!-- 鑳屾櫙 gradient鏄笎鍙�,corners瀹氫箟鐨勬槸鍦嗚 --> - <item android:id="@android:id/background"> - <shape> - <solid android:color="#ffffff" /> - </shape> - </item> - - <!-- 杩涘害鏉� --> - <item android:id="@android:id/progress"> - <clip> - <shape> - <solid android:color="#4393ea" /> - </shape> - </clip> - </item> - -</layer-list> \ No newline at end of file diff --git a/library-jpush/src/main/res/drawable-nodpi-v4/stat_sys_third_app_notify.png b/library-jpush/src/main/res/drawable-nodpi-v4/stat_sys_third_app_notify.png deleted file mode 100644 index 1f5f1b3..0000000 --- a/library-jpush/src/main/res/drawable-nodpi-v4/stat_sys_third_app_notify.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-xhdpi-v4/push_pure_close.png b/library-jpush/src/main/res/drawable-xhdpi-v4/push_pure_close.png deleted file mode 100644 index 8161978..0000000 --- a/library-jpush/src/main/res/drawable-xhdpi-v4/push_pure_close.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-xhdpi-v4/stat_sys_third_app_notify.png b/library-jpush/src/main/res/drawable-xhdpi-v4/stat_sys_third_app_notify.png deleted file mode 100644 index 143a08d..0000000 --- a/library-jpush/src/main/res/drawable-xhdpi-v4/stat_sys_third_app_notify.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-xxhdpi-v4/push_pure_close.png b/library-jpush/src/main/res/drawable-xxhdpi-v4/push_pure_close.png deleted file mode 100644 index 2cf462f..0000000 --- a/library-jpush/src/main/res/drawable-xxhdpi-v4/push_pure_close.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-xxhdpi-v4/stat_sys_third_app_notify.png b/library-jpush/src/main/res/drawable-xxhdpi-v4/stat_sys_third_app_notify.png deleted file mode 100644 index dfb1d45..0000000 --- a/library-jpush/src/main/res/drawable-xxhdpi-v4/stat_sys_third_app_notify.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-xxxhdpi-v4/push_pure_close.png b/library-jpush/src/main/res/drawable-xxxhdpi-v4/push_pure_close.png deleted file mode 100644 index 03c37b6..0000000 --- a/library-jpush/src/main/res/drawable-xxxhdpi-v4/push_pure_close.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/drawable-xxxhdpi-v4/stat_sys_third_app_notify.png b/library-jpush/src/main/res/drawable-xxxhdpi-v4/stat_sys_third_app_notify.png deleted file mode 100644 index ecd4f14..0000000 --- a/library-jpush/src/main/res/drawable-xxxhdpi-v4/stat_sys_third_app_notify.png +++ /dev/null Binary files differ diff --git a/library-jpush/src/main/res/layout-v21/push_notification.xml b/library-jpush/src/main/res/layout-v21/push_notification.xml deleted file mode 100644 index 630ab7b..0000000 --- a/library-jpush/src/main/res/layout-v21/push_notification.xml +++ /dev/null @@ -1,296 +0,0 @@ -<?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"> - - <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="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:weightSum="1" - 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: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: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="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> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout-v21/push_notification_large.xml b/library-jpush/src/main/res/layout-v21/push_notification_large.xml deleted file mode 100644 index a779f1f..0000000 --- a/library-jpush/src/main/res/layout-v21/push_notification_large.xml +++ /dev/null @@ -1,298 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout-v21/push_notification_middle.xml b/library-jpush/src/main/res/layout-v21/push_notification_middle.xml deleted file mode 100644 index e856534..0000000 --- a/library-jpush/src/main/res/layout-v21/push_notification_middle.xml +++ /dev/null @@ -1,298 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/jpush_inapp_banner.xml b/library-jpush/src/main/res/layout/jpush_inapp_banner.xml deleted file mode 100644 index a2f16df..0000000 --- a/library-jpush/src/main/res/layout/jpush_inapp_banner.xml +++ /dev/null @@ -1,85 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/jpush_popwin_layout.xml b/library-jpush/src/main/res/layout/jpush_popwin_layout.xml deleted file mode 100644 index f43e478..0000000 --- a/library-jpush/src/main/res/layout/jpush_popwin_layout.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/jpush_webview_layout.xml b/library-jpush/src/main/res/layout/jpush_webview_layout.xml deleted file mode 100644 index bebdd61..0000000 --- a/library-jpush/src/main/res/layout/jpush_webview_layout.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?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/jpush_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/jpush_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_marginRight="5dp" - android:layout_toRightOf="@id/imgView" - android:clickable="false" - android:text=" " - android:textSize="20sp" - android:textColor="#ffffff" /> - </RelativeLayout> - - <ProgressBar - android:id="@+id/pushPrograssBar" - android:layout_width="match_parent" - android:layout_height="1dp" - android:progress="0" - android:progressDrawable="@drawable/jpush_richpush_progressbar" - style="?android:attr/progressBarStyleHorizontal" /> - <WebView - android:layout_width="match_parent" - android:layout_height="match_parent" - android:id="@+id/fullWebView" - android:background="#000000" /> - -</cn.jpush.android.ui.FullScreenView> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/push_expandable_big_image_notification.xml b/library-jpush/src/main/res/layout/push_expandable_big_image_notification.xml deleted file mode 100644 index c3df87b..0000000 --- a/library-jpush/src/main/res/layout/push_expandable_big_image_notification.xml +++ /dev/null @@ -1,122 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@android:color/transparent"> - - - <RelativeLayout - android:id="@+id/push_big_pic_default_Content" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:visibility="visible" - android:background="@android:color/transparent"> - <RelativeLayout - android:id="@+id/push_big_defaultView" - android:layout_width="match_parent" - android:layout_height="64dp" > - - <ImageView - android:id="@+id/push_big_notification_icon" - android:layout_width="42dp" - android:layout_height="42dp" - android:layout_alignParentLeft="true" - android:layout_centerVertical="true" - android:layout_marginLeft="10dp" - android:scaleType="centerInside" /> - - <ImageView - android:id="@+id/push_big_notification_icon2" - android:layout_width="22dp" - android:layout_height="22dp" - android:layout_alignBottom="@id/push_big_notification_icon" - android:layout_alignParentRight="true" - android:layout_marginRight="5dp" - android:scaleType="centerInside" /> - - <RelativeLayout - android:id="@+id/push_big_notification" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginLeft="16dp" - android:layout_marginRight="0dp" - android:layout_toRightOf="@id/push_big_notification_icon" - android:gravity="center_vertical" - android:orientation="vertical"> - - <DateTimeView - android:id="@+id/push_big_notification_date" - style="@android:style/TextAppearance.StatusBar.EventContent" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_alignParentTop="true" - android:layout_marginRight="10dp" - android:layout_marginTop="0dp" - android:textSize="12sp" - android:textColor="#ffffff" - android:alpha="0.6"/> - - <TextView - android:id="@+id/push_big_notification_title" - style="@android:style/TextAppearance.StatusBar.EventContent.Title" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:singleLine="true" - android:textSize="18sp" - android:layout_toLeftOf="@id/push_big_notification_date" - android:textStyle="normal" - android:textColor="#ffffff"/> - - <TextView - android:id="@+id/push_big_notification_content" - style="@android:style/TextAppearance.StatusBar.EventContent" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/push_big_notification_title" - android:layout_marginTop="0dp" - android:layout_marginRight="10dp" - android:singleLine="true" - android:textSize="14sp" - android:textStyle="normal" - android:textColor="#ffffff"/> - </RelativeLayout> - - </RelativeLayout> - - <LinearLayout - android:id="@+id/push_big_text_notification_area" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="69dp" - android:layout_marginRight="13dp" - android:layout_marginTop="34dp" - android:layout_marginBottom="10dp" - android:gravity="center_vertical" - android:orientation="vertical"> - <TextView - android:id="@+id/push_big_bigtext_defaultView" - style="@android:style/TextAppearance.StatusBar.EventContent" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:maxHeight="192dp" - android:textColor="#ffffff" - android:alpha="0.9" - android:visibility="gone" - android:textStyle="normal" - android:ellipsize = "end" - android:textSize="14sp" /> - </LinearLayout> - - <ImageView - android:id="@+id/push_big_bigview_defaultView" - android:layout_width="match_parent" - android:layout_height="192dp" - android:scaleType="centerCrop" - android:layout_below="@+id/push_big_defaultView" - android:visibility="gone"/> - - </RelativeLayout> - - -</RelativeLayout> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/push_expandable_big_text_notification.xml b/library-jpush/src/main/res/layout/push_expandable_big_text_notification.xml deleted file mode 100644 index fdbc924..0000000 --- a/library-jpush/src/main/res/layout/push_expandable_big_text_notification.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@android:color/transparent"> - - - <RelativeLayout - android:id="@+id/push_big_pic_default_Content" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:visibility="visible" - android:background="@android:color/transparent"> - <RelativeLayout - android:id="@+id/push_big_defaultView" - android:layout_width="match_parent" - android:layout_height="65dp" > - - <ImageView - android:id="@+id/push_big_notification_icon" - android:layout_width="42dp" - android:layout_height="42dp" - android:layout_alignParentLeft="true" - android:layout_centerVertical="true" - android:layout_marginLeft="10dp" - android:scaleType="centerInside" /> - - - <ImageView - android:id="@+id/push_big_notification_icon2" - android:layout_width="22dp" - android:layout_height="22dp" - android:layout_alignBottom="@id/push_big_notification_icon" - android:layout_alignParentRight="true" - android:layout_marginRight="5dp" - android:scaleType="centerInside" /> - - <RelativeLayout - android:id="@+id/push_big_notification" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginLeft="16dp" - android:layout_marginRight="0dp" - android:layout_toRightOf="@id/push_big_notification_icon" - android:gravity="center_vertical" - android:orientation="vertical"> - - <DateTimeView - android:id="@+id/push_big_notification_date" - style="@android:style/TextAppearance.StatusBar.EventContent" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_alignParentTop="true" - android:layout_marginRight="10dp" - android:layout_marginTop="0dp" - android:textSize="12sp" - android:textColor="#ffffff" - android:alpha="0.6"/> - - <TextView - android:id="@+id/push_big_notification_title" - style="@android:style/TextAppearance.StatusBar.EventContent.Title" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:singleLine="true" - android:textSize="18sp" - android:layout_toLeftOf="@id/push_big_notification_date" - android:textStyle="normal" - android:textColor="#ffffff"/> - - <TextView - android:id="@+id/push_big_notification_content" - style="@android:style/TextAppearance.StatusBar.EventContent" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/push_big_notification_title" - android:layout_marginTop="0dp" - android:layout_marginRight="10dp" - android:singleLine="true" - android:textSize="14sp" - android:textStyle="normal" - android:textColor="#ffffff"/> - </RelativeLayout> - - </RelativeLayout> - - <LinearLayout - android:id="@+id/push_big_text_notification_area" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="69dp" - android:layout_marginRight="13dp" - android:layout_marginTop="34dp" - android:layout_marginBottom="10dp" - android:gravity="center_vertical" - android:orientation="vertical"> - <TextView - android:id="@+id/push_big_bigtext_defaultView" - style="@android:style/TextAppearance.StatusBar.EventContent" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:maxHeight="192dp" - android:textColor="#ffffff" - android:alpha="0.9" - android:visibility="gone" - android:textStyle="normal" - android:ellipsize = "end" - android:textSize="14sp" /> - </LinearLayout> - - </RelativeLayout> - - -</RelativeLayout> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/push_notification.xml b/library-jpush/src/main/res/layout/push_notification.xml deleted file mode 100644 index 1642235..0000000 --- a/library-jpush/src/main/res/layout/push_notification.xml +++ /dev/null @@ -1,297 +0,0 @@ -<?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"> - - <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="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> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/push_notification_large.xml b/library-jpush/src/main/res/layout/push_notification_large.xml deleted file mode 100644 index c93a22c..0000000 --- a/library-jpush/src/main/res/layout/push_notification_large.xml +++ /dev/null @@ -1,297 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/push_notification_middle.xml b/library-jpush/src/main/res/layout/push_notification_middle.xml deleted file mode 100644 index 2ca2deb..0000000 --- a/library-jpush/src/main/res/layout/push_notification_middle.xml +++ /dev/null @@ -1,297 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-jpush/src/main/res/layout/push_pure_pic_notification.xml b/library-jpush/src/main/res/layout/push_pure_pic_notification.xml deleted file mode 100644 index 38ec4d5..0000000 --- a/library-jpush/src/main/res/layout/push_pure_pic_notification.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingLeft="11dp" - android:paddingTop="10dp" - android:paddingRight="11dp" - android:paddingBottom="10dp" - android:background="@android:color/transparent"> - <ImageView - android:id="@+id/push_pure_bigview_expanded" - android:layout_width="match_parent" - android:layout_height="192dp" - android:scaleType="centerCrop" - android:visibility="gone"/> - - - <ImageView - android:id="@+id/push_pure_bigview_banner" - android:layout_width="match_parent" - android:layout_height="64dp" - android:scaleType="centerCrop" - android:visibility="gone"/> - - <ImageView - android:id="@+id/push_pure_close" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_marginTop="6dp" - android:layout_marginRight="6dp" - android:visibility="gone" - android:src="@drawable/push_pure_close"/> - -</RelativeLayout> \ No newline at end of file diff --git a/library-jpush/src/main/res/values-zh/jpush_string.xml b/library-jpush/src/main/res/values-zh/jpush_string.xml deleted file mode 100644 index 069b6f4..0000000 --- a/library-jpush/src/main/res/values-zh/jpush_string.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-jpush/src/main/res/values/jpush_string.xml b/library-jpush/src/main/res/values/jpush_string.xml deleted file mode 100644 index 70a4ea7..0000000 --- a/library-jpush/src/main/res/values/jpush_string.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-jpush/src/main/res/values/jpush_style.xml b/library-jpush/src/main/res/values/jpush_style.xml deleted file mode 100644 index 81dfdbb..0000000 --- a/library-jpush/src/main/res/values/jpush_style.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?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> \ No newline at end of file diff --git a/library-push/.gitignore b/library-push/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/library-push/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/library-push/build.gradle b/library-push/build.gradle new file mode 100644 index 0000000..4e4ecfc --- /dev/null +++ b/library-push/build.gradle @@ -0,0 +1,37 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.0" + + defaultConfig { + minSdkVersion 17 + targetSdkVersion 27 + versionCode 1 + versionName "1.0" + + consumerProguardFiles 'consumer-rules.pro' + } + + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + api 'com.huawei.hms:push:5.0.4.302' + api files('libs\\com.heytap.msp.aar') + api files('libs\\MiPush_SDK_Client_3_8_5.jar') + api files('libs\\vivo_pushsdk_v3.0.0.0_480.aar') + api 'com.meizu.flyme.internet:push-internal:4.0.4' + + implementation project(path: ':library-common') +} \ No newline at end of file diff --git a/library-jpush/consumer-rules.pro b/library-push/consumer-rules.pro similarity index 100% rename from library-jpush/consumer-rules.pro rename to library-push/consumer-rules.pro diff --git a/library-jpush/libs/MiPush_SDK_Client_3_8_5.jar b/library-push/libs/MiPush_SDK_Client_3_8_5.jar similarity index 100% rename from library-jpush/libs/MiPush_SDK_Client_3_8_5.jar rename to library-push/libs/MiPush_SDK_Client_3_8_5.jar Binary files differ diff --git a/library-jpush/libs/com.heytap.msp-push-2.1.0.aar b/library-push/libs/com.heytap.msp.aar similarity index 100% rename from library-jpush/libs/com.heytap.msp-push-2.1.0.aar rename to library-push/libs/com.heytap.msp.aar Binary files differ diff --git a/library-push/libs/vivo_pushsdk_v3.0.0.0_480.aar b/library-push/libs/vivo_pushsdk_v3.0.0.0_480.aar new file mode 100644 index 0000000..52ec109 --- /dev/null +++ b/library-push/libs/vivo_pushsdk_v3.0.0.0_480.aar Binary files differ diff --git a/library-jpush/proguard-rules.pro b/library-push/proguard-rules.pro similarity index 99% rename from library-jpush/proguard-rules.pro rename to library-push/proguard-rules.pro index f1b4245..481bb43 100644 --- a/library-jpush/proguard-rules.pro +++ b/library-push/proguard-rules.pro @@ -18,4 +18,4 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/library-push/src/androidTest/java/com/yeshi/ec/push/ExampleInstrumentedTest.java b/library-push/src/androidTest/java/com/yeshi/ec/push/ExampleInstrumentedTest.java new file mode 100644 index 0000000..7b936ce --- /dev/null +++ b/library-push/src/androidTest/java/com/yeshi/ec/push/ExampleInstrumentedTest.java @@ -0,0 +1,25 @@ +package com.yeshi.ec.push; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.yeshi.ec.library_push.test", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/library-push/src/main/AndroidManifest.xml b/library-push/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9020688 --- /dev/null +++ b/library-push/src/main/AndroidManifest.xml @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + package="com.yeshi.ec.push"> + + <uses-sdk + tools:ignore="MultipleUsesSdk" + tools:overrideLibrary="com.heytap.mcssdk" /> + + <!-- 灏忕背鎺ㄩ�佹潈闄� --> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />鈥� + <uses-permission android:name="android.permission.INTERNET" /> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> + <uses-permission android:name="android.permission.READ_PHONE_STATE" /> + <uses-permission android:name="android.permission.VIBRATE" /> + + <permission + android:name="${applicationId}.permission.MIPUSH_RECEIVE" + android:protectionLevel="signature" /> + + <uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" /> + + <!--OPPO鎺ㄩ�佹潈闄� --> + <!-- 濡傛灉搴旂敤鏃犻�忎紶鏉冮檺锛屽垯涓嶇敤閰嶇疆--> + <!-- <uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" />--> + <!-- <uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE" />--> + + <!-- 榄呮棌鎺ㄩ�佹潈闄� --> + + <!-- 鍏煎 Flyme5 鐨勬潈闄愰厤缃�--> + <uses-permission android:name="com.meizu.flyme.push.permission.RECEIVE" /> + <uses-permission android:name="com.meizu.flyme.permission.PUSH" /> + <permission + android:name="${applicationId}.push.permission.MESSAGE" + android:protectionLevel="signature" /> + <uses-permission android:name="${applicationId}.push.permission.MESSAGE" /> + <!-- 鍏煎 Flyme3 鐨勬潈闄愰厤缃�--> + <uses-permission android:name="com.meizu.c2dm.permission.RECEIVE" /> + <permission + android:name="${applicationId}.permission.C2D_MESSAGE" + android:protectionLevel="signature" /> + <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /> + + + <application> + + + <!-- 灏忕背鎺ㄩ�� --> + <service + android:name="com.xiaomi.push.service.XMPushService" + android:enabled="true" + android:process=":pushservice" /> + + <!--娉細姝ervice蹇呴』鍦�3.0.1鐗堟湰浠ュ悗锛堝寘鎷�3.0.1鐗堟湰锛夊姞鍏�--> + <service + android:name="com.xiaomi.push.service.XMJobService" + android:enabled="true" + android:exported="false" + android:permission="android.permission.BIND_JOB_SERVICE" + android:process=":pushservice" /> + + <service + android:name="com.xiaomi.mipush.sdk.PushMessageHandler" + android:enabled="true" + android:exported="true" /> + + <!--娉細姝ervice蹇呴』鍦�2.2.5鐗堟湰浠ュ悗锛堝寘鎷�2.2.5鐗堟湰锛夊姞鍏�--> + <service + android:name="com.xiaomi.mipush.sdk.MessageHandleService" + android:enabled="true" /> + + <receiver + android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver" + android:exported="true"> + <intent-filter> + <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </receiver> + + <receiver + android:name="com.xiaomi.push.service.receivers.PingReceiver" + android:exported="false" + android:process=":pushservice"> + <intent-filter> + <action android:name="com.xiaomi.push.PING_TIMER" /> + </intent-filter> + </receiver> + + + + <!--Vivo Push闇�瑕侀厤缃殑service銆乤ctivity--> + <service + android:name="com.vivo.push.sdk.service.CommandClientService" + android:exported="true" + android:permission="com.push.permission.UPSTAGESERVICE" /> + + + </application> + +</manifest> \ No newline at end of file diff --git a/library-push/src/main/java/com/yeshi/push/PushUtil.java b/library-push/src/main/java/com/yeshi/push/PushUtil.java new file mode 100644 index 0000000..8659cf5 --- /dev/null +++ b/library-push/src/main/java/com/yeshi/push/PushUtil.java @@ -0,0 +1,125 @@ +package com.yeshi.push; + +import android.app.ActivityManager; +import android.app.Application; +import android.content.Context; +import android.os.Build; +import android.os.Process; +import android.util.Log; + +import com.heytap.msp.push.HeytapPushManager; +import com.heytap.msp.push.callback.ICallBackResultService; +import com.lcjian.library.util.ManifestDataUtil; +import com.lcjian.library.util.common.StringUtils; +import com.meizu.cloud.pushsdk.PushManager; +import com.vivo.push.IPushActionListener; +import com.vivo.push.PushClient; +import com.xiaomi.mipush.sdk.MiPushClient; + +import java.util.List; + +public class PushUtil { + + static String TAG = "PushUtil"; + + /** + * 鎺ㄩ�� 娉ㄥ唽 + */ + public static void inintPush(Application context, ITokenListener tokenListener) { + if (context != null) { + String xmRegId = null; + switch (Build.BRAND.toLowerCase()) { + case "huawei": + case "honor": + //鍗庝负鏄嚜鍔ㄥ垵濮嬪寲 + return; + case "oppo"://涓婇潰瀹樻柟鍒ゆ柇 + /***OPPO瀹樻柟鍒ゆ柇鏂规硶*/ + HeytapPushManager.init(context, true); + if (HeytapPushManager.isSupportPush()) { + String appKey = ManifestDataUtil.getAppMetaData(context, "OPPO_APPKEY").replace("OPPO-", ""); + String appSecret = ManifestDataUtil.getAppMetaData(context, "OPPO_APPSECRET").replace("OPPO-", ""); + HeytapPushManager.register(context, appKey, appSecret, new ICallBackResultService() { + + @Override + public void onRegister(int i, String s) { + //娉ㄥ唽鎴愬姛 + Log.i(TAG, "OPPO娉ㄥ唽缁撴灉:" + i); + Log.i(TAG, "OPPO娉ㄥ唽鎴愬姛:" + s); + if (i == 0) { + tokenListener.onToken("oppo", s); + } + } + + @Override + public void onUnRegister(int i) { + + } + + @Override + public void onSetPushTime(int i, String s) { + + } + + @Override + public void onGetPushStatus(int i, int i1) { + + } + + @Override + public void onGetNotificationStatus(int i, int i1) { + + } + }); + HeytapPushManager.requestNotificationPermission(); + return; + } + break; + case "vivo"://涓婇潰瀹樻柟鍒ゆ柇 + /***VIVO瀹樻柟鍒ゆ柇鏂规硶**/ + // 鍦ㄥ綋鍓嶅伐绋嬪叆鍙e嚱鏁帮紝寤鸿鍦� Application 鐨� onCreate 鍑芥暟涓紝娣诲姞浠ヤ笅浠g爜锛� + PushClient.getInstance(context).initialize(); + if (PushClient.getInstance(context).isSupport()) { + //骞朵笖鎵撳紑鎺ㄩ�佹湇鍔� + PushClient.getInstance(context).turnOnPush(new IPushActionListener() { + @Override + public void onStateChanged(int i) { + if (i == 0) { + String regId = PushClient.getInstance(context).getRegId(); + Log.i(TAG, "VIVO娉ㄥ唽鎴愬姛:" + regId); + tokenListener.onToken("vivo", regId); + } + } + }); + return; + } + break; + case "meizu"://榄呮棌 + { + String appId = ManifestDataUtil.getAppMetaData(context, "MEIZU_APPID").replace("MEIZU-", ""); + String appKey = ManifestDataUtil.getAppMetaData(context, "MEIZU_APPKEY").replace("MEIZU-", ""); + PushManager.register(context, appId, appKey); + return; + } + } + + String appId = ManifestDataUtil.getAppMetaData(context, "XIAOMI_APPID").replace("XIAOMI-", ""); + String appKey = ManifestDataUtil.getAppMetaData(context, "XIAOMI_APPKEY").replace("XIAOMI-", ""); + MiPushClient.registerPush(context, appId, appKey);//娉ㄥ唽灏忕背鎺ㄩ�� + xmRegId = MiPushClient.getRegId(context); + Log.i(TAG, "灏忕背娉ㄥ唽鎴愬姛:" + xmRegId); + if (!StringUtils.isEmpty(xmRegId)) { + tokenListener.onToken("xm", xmRegId); + } + + + } + } + + + public interface ITokenListener { + public void onToken(String romType, String regId); + + } + +} diff --git a/library-push/src/test/java/com/yeshi/ec/push/ExampleUnitTest.java b/library-push/src/test/java/com/yeshi/ec/push/ExampleUnitTest.java new file mode 100644 index 0000000..6f25294 --- /dev/null +++ b/library-push/src/test/java/com/yeshi/ec/push/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.yeshi.ec.push; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 22ad669..bd918df 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,4 @@ +include ':library-push' include ':library-BaiduCPU' include ':library-VideoPlayer' include ':library-GDTSDK' @@ -8,5 +9,4 @@ include ':library-DownloadProvider' include ':library-common' include ':library-APPUpdate' -include ':library-jpush' include ':BuWanVideo' -- Gitblit v1.8.0