Commit 9bd644f6 authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :修改包名,加入facebooksdk
[实现方案] :
parent 079c6cb0
# faceshow # faceshow
#### 介绍 #### 介绍
星光聊天 StarLight
#### 软件架构 #### 软件架构
软件架构说明 软件架构说明
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"project_id":"737518067794092079", "project_id":"737518067794092079",
"app_id":"105341515", "app_id":"105341515",
"api_key":"DAEDAFK0yOwTzCGbzXTi5/NB6gwaCba4BfMGQV53l26bMh4kzftQZM3zhmV8GMXTphyl4Z/bxjhTInV/0tmE1au9BfwSiwhYPRSImw==", "api_key":"DAEDAFK0yOwTzCGbzXTi5/NB6gwaCba4BfMGQV53l26bMh4kzftQZM3zhmV8GMXTphyl4Z/bxjhTInV/0tmE1au9BfwSiwhYPRSImw==",
"package_name":"com.zx.starlightchat" "package_name":"com.zhangxin.starlight"
}, },
"oauth_client":{ "oauth_client":{
"client_id":"105341515", "client_id":"105341515",
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
}, },
"app_info":{ "app_info":{
"app_id":"105341515", "app_id":"105341515",
"package_name":"com.zx.starlightchat" "package_name":"com.zhangxin.starlight"
}, },
"service":{ "service":{
"analytics":{ "analytics":{
...@@ -57,12 +57,12 @@ ...@@ -57,12 +57,12 @@
"configuration_version":"3.0", "configuration_version":"3.0",
"appInfos":[ "appInfos":[
{ {
"package_name":"com.zx.starlightchat", "package_name":"com.zhangxin.starlight",
"client":{ "client":{
"app_id":"105341515" "app_id":"105341515"
}, },
"app_info":{ "app_info":{
"package_name":"com.zx.starlightchat", "package_name":"com.zhangxin.starlight",
"app_id":"105341515" "app_id":"105341515"
}, },
"oauth_client":{ "oauth_client":{
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.zx.starlightchat"> package="com.zhangxin.starlight">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!--必要权限,解决安全风险漏洞,发送和注册广播事件需要调用带有传递权限的接口--> <!--必要权限,解决安全风险漏洞,发送和注册广播事件需要调用带有传递权限的接口-->
<permission <permission
android:name="com.zx.starlightchat.openadsdk.permission.TT_PANGOLIN" android:name="com.zhangxin.starlight.openadsdk.permission.TT_PANGOLIN"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
<uses-permission android:name="com.zx.starlightchat.openadsdk.permission.TT_PANGOLIN" /> <uses-permission android:name="com.zhangxin.starlight.openadsdk.permission.TT_PANGOLIN" />
<uses-sdk tools:overrideLibrary="com.bun.miitmdid" /> <uses-sdk tools:overrideLibrary="com.bun.miitmdid" />
<permission <permission
android:name="com.zx.starlightchat.permission.MIPUSH_RECEIVE" android:name="com.zhangxin.starlight.permission.MIPUSH_RECEIVE"
android:protectionLevel="signature" /> <!--这里com.xiaomi.mipushdemo改成app的包名--> android:protectionLevel="signature" /> <!--这里com.xiaomi.mipushdemo改成app的包名-->
<uses-permission android:name="com.zx.starlightchat.permission.MIPUSH_RECEIVE" /> <uses-permission android:name="com.zhangxin.starlight.permission.MIPUSH_RECEIVE" />
<application <application
android:name="com.zx.starlightchat.Appli" android:name="com.zhangxin.starlight.Appli"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<service android:name="com.zlw.main.recorderlib.recorder.RecordService" /> <service android:name="com.zlw.main.recorderlib.recorder.RecordService" />
<activity <activity
android:name="com.zx.starlightchat.activity.MainActivity" android:name="com.zhangxin.starlight.activity.MainActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<data <data
android:host="main" android:host="main"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
...@@ -80,26 +80,6 @@ ...@@ -80,26 +80,6 @@
android:resource="@xml/file_paths" /> android:resource="@xml/file_paths" />
</provider> </provider>
<activity
android:name="com.zx.starlightchat.wxapi.WXEntryActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="com.zx.starlightchat.wxapi.WXPayEntryActivity"
android:exported="true"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="wx7fc1506d059d5ac1" />
</intent-filter>
</activity>
<provider <provider
android:name="com.bytedance.sdk.openadsdk.TTFileProvider" android:name="com.bytedance.sdk.openadsdk.TTFileProvider"
...@@ -194,7 +174,7 @@ ...@@ -194,7 +174,7 @@
<action android:name="com.meizu.c2dm.intent.REGISTRATION" /> <action android:name="com.meizu.c2dm.intent.REGISTRATION" />
<action android:name="com.meizu.c2dm.intent.RECEIVE" /> <action android:name="com.meizu.c2dm.intent.RECEIVE" />
<category android:name="com.zx.starlightchat" /> <category android:name="com.zhangxin.starlight" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<!-- 其他安卓组件--> <!-- 其他安卓组件-->
......
package com.zx.starlightchat package com.zhangxin.starlight
import android.app.Activity import android.app.Activity
import android.app.Application import android.app.Application
...@@ -25,7 +25,7 @@ import com.vivo.push.PushClient ...@@ -25,7 +25,7 @@ import com.vivo.push.PushClient
import com.xiaomi.mipush.sdk.MiPushClient import com.xiaomi.mipush.sdk.MiPushClient
import com.ym.chat.utils.TUIUtils import com.ym.chat.utils.TUIUtils
import com.zlw.main.recorderlib.RecordManager import com.zlw.main.recorderlib.RecordManager
import com.zx.starlightchat.utils.AndroidDeviceUtils import com.zhangxin.starlight.utils.AndroidDeviceUtils
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.common.ApplicationAsLibrary import com.zxhl.cms.common.ApplicationAsLibrary
import com.zxhl.cms.common.Config import com.zxhl.cms.common.Config
...@@ -250,8 +250,8 @@ class Appli : Application() { ...@@ -250,8 +250,8 @@ class Appli : Application() {
// Create the NotificationChannel, but only on API 26+ because // Create the NotificationChannel, but only on API 26+ because
// the NotificationChannel class is new and not in the support library // the NotificationChannel class is new and not in the support library
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val name: CharSequence = "星光聊天" val name: CharSequence = "StarLight"
val description = "星光聊天" val description = "StarLight"
val importance: Int = NotificationManager.IMPORTANCE_DEFAULT val importance: Int = NotificationManager.IMPORTANCE_DEFAULT
val channel = NotificationChannel("starlightchattuikit", name, importance) val channel = NotificationChannel("starlightchattuikit", name, importance)
channel.description = description channel.description = description
......
package com.zx.starlightchat.activity; package com.zhangxin.starlight.activity;
import android.Manifest; import android.Manifest;
import android.app.Activity; import android.app.Activity;
...@@ -33,9 +33,9 @@ import com.vivo.push.PushClient; ...@@ -33,9 +33,9 @@ import com.vivo.push.PushClient;
import com.xiaomi.mipush.sdk.MiPushClient; import com.xiaomi.mipush.sdk.MiPushClient;
import com.ym.chat.fragment.ChatFragment; import com.ym.chat.fragment.ChatFragment;
import com.ym.chat.utils.TUIUtils; import com.ym.chat.utils.TUIUtils;
import com.zx.starlightchat.R; import com.zhangxin.starlight.R;
import com.zx.starlightchat.entity.HWPushBean; import com.zhangxin.starlight.entity.HWPushBean;
import com.zx.starlightchat.utils.AndroidDeviceUtils; import com.zhangxin.starlight.utils.AndroidDeviceUtils;
import com.zxhl.cms.AppContext; import com.zxhl.cms.AppContext;
import com.zxhl.cms.ad.upload.model.NewsEntity; import com.zxhl.cms.ad.upload.model.NewsEntity;
import com.zxhl.cms.common.Constant; import com.zxhl.cms.common.Constant;
......
package com.zx.starlightchat.entity; package com.zhangxin.starlight.entity;
import java.io.Serializable; import java.io.Serializable;
......
package com.zx.starlightchat.receiver; package com.zhangxin.starlight.receiver;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import com.huawei.android.hms.tpns.HWHmsMessageService; import com.huawei.android.hms.tpns.HWHmsMessageService;
import com.huawei.hms.push.RemoteMessage; import com.huawei.hms.push.RemoteMessage;
import com.zx.starlightchat.entity.HWPushBean; import com.zhangxin.starlight.entity.HWPushBean;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
......
package com.zx.starlightchat.receiver; package com.zhangxin.starlight.receiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
...@@ -7,7 +7,7 @@ import android.text.TextUtils; ...@@ -7,7 +7,7 @@ import android.text.TextUtils;
import com.xiaomi.mipush.sdk.MiPushCommandMessage; import com.xiaomi.mipush.sdk.MiPushCommandMessage;
import com.xiaomi.mipush.sdk.MiPushMessage; import com.xiaomi.mipush.sdk.MiPushMessage;
import com.xiaomi.mipush.sdk.PushMessageReceiver; import com.xiaomi.mipush.sdk.PushMessageReceiver;
import com.zx.starlightchat.activity.MainActivity; import com.zhangxin.starlight.activity.MainActivity;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
......
package com.zx.starlightchat.receiver; package com.zhangxin.starlight.receiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
...@@ -11,7 +11,7 @@ import com.meizu.cloud.pushsdk.platform.message.RegisterStatus; ...@@ -11,7 +11,7 @@ import com.meizu.cloud.pushsdk.platform.message.RegisterStatus;
import com.meizu.cloud.pushsdk.platform.message.SubAliasStatus; import com.meizu.cloud.pushsdk.platform.message.SubAliasStatus;
import com.meizu.cloud.pushsdk.platform.message.SubTagsStatus; import com.meizu.cloud.pushsdk.platform.message.SubTagsStatus;
import com.meizu.cloud.pushsdk.platform.message.UnRegisterStatus; import com.meizu.cloud.pushsdk.platform.message.UnRegisterStatus;
import com.zx.starlightchat.activity.MainActivity; import com.zhangxin.starlight.activity.MainActivity;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
......
package com.zx.starlightchat.receiver; package com.zhangxin.starlight.receiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
...@@ -6,7 +6,7 @@ import android.text.TextUtils; ...@@ -6,7 +6,7 @@ import android.text.TextUtils;
import com.vivo.push.model.UPSNotificationMessage; import com.vivo.push.model.UPSNotificationMessage;
import com.vivo.push.sdk.OpenClientPushMessageReceiver; import com.vivo.push.sdk.OpenClientPushMessageReceiver;
import com.zx.starlightchat.activity.MainActivity; import com.zhangxin.starlight.activity.MainActivity;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
......
package com.zx.starlightchat.utils; package com.zhangxin.starlight.utils;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.content.Context; import android.content.Context;
......
package com.zx.starlightchat.wxapi;
/**
* Created by gaoleichao on 2019/6/11
*/
import com.umeng.socialize.weixin.view.WXCallbackActivity;
public class WXEntryActivity extends WXCallbackActivity {
// @Override
// public void onResp(BaseResp resp) {
// String result;
// switch (resp.errCode) {
// case BaseResp.ErrCode.ERR_OK:
// result = "分享成功";
// break;
// case BaseResp.ErrCode.ERR_USER_CANCEL:
// result = "分享取消";
// break;
// default:
// result = "分享失败";
// break;
// }
// if (result != null) {
// Utils.showToast(AppliContext.get(),result);
// }
//
// super.onResp(resp);
// }
}
package com.zx.starlightchat.wxapi;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.tencent.mm.opensdk.constants.ConstantsAPI;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.zxhl.cms.common.Constant;
import com.zxhl.cms.utils.EventUtils;
import com.zxhl.cms.utils.RxBus;
import com.zxhl.cms.utils.Utils;
import com.zxhl.novel.utils.server.PayResultEntity;
public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
private String TAG = "PAY_GET";
private IWXAPI api;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.pay_result);
System.out.println("WXPayEntryActivity:$Constant.WX_APPID");
api = WXAPIFactory.createWXAPI(this, Constant.WX_APPID);
api.handleIntent(getIntent(), this);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
System.out.println("WXPayEntryActivity:$onNewIntent");
api.handleIntent(intent, this);
}
@Override
public void onReq(BaseReq req) {
System.out.println("WXPayEntryActivity onReq:"+req.openId);
}
@Override
public void onResp(BaseResp resp) {
Log.d(TAG, "onPayFinish, errCode = " + resp.errCode);
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
// AlertDialog.Builder builder = new AlertDialog.Builder(this);
// builder.setTitle(resp.openId);
// builder.setMessage(String.valueOf(resp.errCode));
// builder.show();
try{
Log.d(TAG,"onPayFinish, resp.openId = " + Utils.obj2Str(resp));
// JSONObject json = new JSONObject(Utils.obj2Str(resp));
// String extData = json.getString("extData");
// String prepayId =json.getString("prepayId");
if(resp.errCode== BaseResp.ErrCode.ERR_OK){
result(true, Utils.obj2Str(resp));
}else{
EventUtils.INSTANCE.onEvent("member_page_pay_fail","code:"+resp.errCode+" str:"+resp.errStr);
result(false, Utils.obj2Str(resp));
}
}catch (Exception e){
EventUtils.INSTANCE.onEvent("member_page_pay_fail","code:"+resp.errCode+" str:"+resp.errStr);
result(false,resp.errStr);
}
}else if(resp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM){
WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) resp;
String extraData =launchMiniProResp.extMsg;
} else{
EventUtils.INSTANCE.onEvent("member_page_pay_fail","code:"+resp.errCode+" str:"+resp.errStr);
result(false,resp.errStr);
}
}
public void result(Boolean isPaysuc, String txt){
PayResultEntity entity = new PayResultEntity();
entity.setPaySuc(isPaysuc);
entity.setTxt(txt);
entity.setPayType(2);//微信支付类型
RxBus.get().post(Constant.PAY_RESULT,entity);
finish();
}
}
\ No newline at end of file
<resources> <resources>
<string name="app_name">星光聊天</string> <string name="app_name" translatable="false">StarLight</string>
</resources> </resources>
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<paths xmlns:android="http://schemas.android.com/apk/res/android"> <paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path <external-path
name="cache" name="cache"
path="Android/data/com.zx.starlightchat/" /> path="Android/data/com.zhangxin.starlight/" />
<external-path <external-path
name="downloadfile" name="downloadfile"
path="com.zx.starlightchat/" /> path="com.zhangxin.starlight/" />
<!--项目中用到的--> <!--项目中用到的-->
<external-path <external-path
name="beta_external_files_path" name="beta_external_files_path"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.zx.starlightchat"> package="com.zhangxin.starlight">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!--必要权限,解决安全风险漏洞,发送和注册广播事件需要调用带有传递权限的接口--> <!--必要权限,解决安全风险漏洞,发送和注册广播事件需要调用带有传递权限的接口-->
<permission <permission
android:name="com.zx.starlightchat.openadsdk.permission.TT_PANGOLIN" android:name="com.zhangxin.starlight.openadsdk.permission.TT_PANGOLIN"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
<uses-permission android:name="com.zx.starlightchat.openadsdk.permission.TT_PANGOLIN" /> <uses-permission android:name="com.zhangxin.starlight.openadsdk.permission.TT_PANGOLIN" />
<uses-sdk tools:overrideLibrary="com.bun.miitmdid" /> <uses-sdk tools:overrideLibrary="com.bun.miitmdid" />
<permission <permission
android:name="com.zx.starlightchat.permission.MIPUSH_RECEIVE" android:name="com.zhangxin.starlight.permission.MIPUSH_RECEIVE"
android:protectionLevel="signature" /> <!--这里com.xiaomi.mipushdemo改成app的包名--> android:protectionLevel="signature" /> <!--这里com.xiaomi.mipushdemo改成app的包名-->
<uses-permission android:name="com.zx.starlightchat.permission.MIPUSH_RECEIVE" /> <uses-permission android:name="com.zhangxin.starlight.permission.MIPUSH_RECEIVE" />
<application <application
android:name="com.zx.starlightchat.Appli" android:name="com.zhangxin.starlight.Appli"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<service android:name="com.zlw.main.recorderlib.recorder.RecordService" /> <service android:name="com.zlw.main.recorderlib.recorder.RecordService" />
<activity <activity
android:name="com.zx.starlightchat.activity.MainActivity" android:name="com.zhangxin.starlight.activity.MainActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<data <data
android:host="main" android:host="main"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
...@@ -80,27 +80,6 @@ ...@@ -80,27 +80,6 @@
android:resource="@xml/file_paths" /> android:resource="@xml/file_paths" />
</provider> </provider>
<activity
android:name="com.zx.starlightchat.wxapi.WXEntryActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="com.zx.starlightchat.wxapi.WXPayEntryActivity"
android:exported="true"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="wx7fc1506d059d5ac1" />
</intent-filter>
</activity>
<provider <provider
android:name="com.bytedance.sdk.openadsdk.TTFileProvider" android:name="com.bytedance.sdk.openadsdk.TTFileProvider"
android:authorities="${applicationId}.TTFileProvider" android:authorities="${applicationId}.TTFileProvider"
...@@ -194,7 +173,7 @@ ...@@ -194,7 +173,7 @@
<action android:name="com.meizu.c2dm.intent.REGISTRATION" /> <action android:name="com.meizu.c2dm.intent.REGISTRATION" />
<action android:name="com.meizu.c2dm.intent.RECEIVE" /> <action android:name="com.meizu.c2dm.intent.RECEIVE" />
<category android:name="com.zx.starlightchat" /> <category android:name="com.zhangxin.starlight" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<!-- 其他安卓组件--> <!-- 其他安卓组件-->
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"access_id": "1580009203", "access_id": "1580009203",
"access_key": "AAJYD383S95K" "access_key": "AAJYD383S95K"
}, },
"com.zx.starlightchat": { "com.zhangxin.starlight": {
"channel": { "channel": {
"enable": true, "enable": true,
"huawei": { "huawei": {
......
PACKAGE_NAME=com.zx.starlightchat PACKAGE_NAME=com.zhangxin.starlight
VERSION_CODE=6 VERSION_CODE=1
VERSION_NAME=1.0.5 VERSION_NAME=1.0.0
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="visitor" android:host="visitor"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.ym.chat.activity.SystemMessageActivity"> <activity android:name="com.ym.chat.activity.SystemMessageActivity">
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="systemmsg" android:host="systemmsg"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="videocalldemo" android:host="videocalldemo"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
......
...@@ -70,7 +70,7 @@ dependencies { ...@@ -70,7 +70,7 @@ dependencies {
api 'com.umeng.umsdk:common:9.4.2'// 必选 api 'com.umeng.umsdk:common:9.4.2'// 必选
api 'com.umeng.umsdk:asms:1.4.1'// 必选 api 'com.umeng.umsdk:asms:1.4.1'// 必选
api 'com.umeng.umsdk:share-core:7.1.6'//分享核心库,必选 api 'com.umeng.umsdk:share-core:7.1.6'//分享核心库,必选
api 'com.umeng.umsdk:share-wx:7.1.6' //微信完整版 // api 'com.umeng.umsdk:share-wx:7.1.6' //微信完整版
//glide配置 //glide配置
// api "com.github.bumptech.glide:glide:${glide_need_version}" // api "com.github.bumptech.glide:glide:${glide_need_version}"
...@@ -104,4 +104,20 @@ dependencies { ...@@ -104,4 +104,20 @@ dependencies {
api project(':tuicore') api project(':tuicore')
api 'org.greenrobot:eventbus:3.2.0' api 'org.greenrobot:eventbus:3.2.0'
//FaceBookLogin
api 'com.facebook.android:facebook-login:latest.release'
//GoogleLogin
implementation 'com.google.android.gms:play-services-auth:20.1.0'
//GooglePay
implementation("com.android.billingclient:billing:4.1.0")
//PayPal支付
api 'com.paypal.checkout:android-sdk:0.6.0'
// api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10"
// api "androidx.core:core-ktx:1.6.0"
//归因
api 'com.appsflyer:af-android-sdk:6.3.2'
api("com.android.installreferrer:installreferrer:2.2")
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="web" android:host="web"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="pay" android:host="pay"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="memberrecord" android:host="memberrecord"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="coinpayrecord" android:host="coinpayrecord"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="starcoinpay" android:host="starcoinpay"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -61,5 +61,28 @@ ...@@ -61,5 +61,28 @@
<meta-data <meta-data
android:name="UMENG_CHANNEL" android:name="UMENG_CHANNEL"
android:value="${UMENG_CHANNEL_VALUE}" /> <!-- QQ配置 --> android:value="${UMENG_CHANNEL_VALUE}" /> <!-- QQ配置 -->
<!-- FaceBook-->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="@string/facebook_client_token" />
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!-- FaceBook END-->
</application> </application>
</manifest> </manifest>
...@@ -13,7 +13,7 @@ public class Constant { ...@@ -13,7 +13,7 @@ public class Constant {
String s = "D0EV7FZL45A5DVKD"; String s = "D0EV7FZL45A5DVKD";
public static final String scheme = "xglt"; public static final String scheme = "hwxg";
public static int UPLOADMAXSIZE = 50; public static int UPLOADMAXSIZE = 50;
...@@ -131,6 +131,7 @@ public class Constant { ...@@ -131,6 +131,7 @@ public class Constant {
public static class Switch { public static class Switch {
public static boolean isShowUpdateDialoging = false; public static boolean isShowUpdateDialoging = false;
public static boolean isLogin = false;
} }
public static final String UPDATE_TAB_INFO = "update_tab_info"; public static final String UPDATE_TAB_INFO = "update_tab_info";
...@@ -224,7 +225,7 @@ public class Constant { ...@@ -224,7 +225,7 @@ public class Constant {
public static class Param { public static class Param {
public static final String mPacketName = "com.zx.starlightchat"; public static final String mPacketName = "com.zhangxin.starlight";
public static boolean isLocal = mPacketName.equals("com.zx.localnews"); public static boolean isLocal = mPacketName.equals("com.zx.localnews");
public static String APPLS = "e9c509214aba55b8"; public static String APPLS = "e9c509214aba55b8";
public static String androidId = ""; public static String androidId = "";
......
...@@ -151,6 +151,10 @@ public class NetConfig { ...@@ -151,6 +151,10 @@ public class NetConfig {
public static final String USER_PHONE_CODE_LOGIN = "app/v3/auth/phoneCodeLogin";//验证码登录 public static final String USER_PHONE_CODE_LOGIN = "app/v3/auth/phoneCodeLogin";//验证码登录
public static final String URL_VERSION = "app/v1/version"; public static final String URL_VERSION = "app/v1/version";
public static final String URL_AUTH_LOGOUT = "app/v2/auth/logout";//注销登录 public static final String URL_AUTH_LOGOUT = "app/v2/auth/logout";//注销登录
public static final String URL_AUTH_GOOGLE_LOGIN = "app/v1/auth/googleLogin";//绑定谷歌登录
public static final String URL_AUTH_FACEBOOK_LOGIN = "app/v1/auth/facebookLogin";//绑定FaceBook登录
} }
public static class Task { public static class Task {
...@@ -198,17 +202,17 @@ public class NetConfig { ...@@ -198,17 +202,17 @@ public class NetConfig {
} }
public static class H5 { public static class H5 {
public static String WEB_URL_USER = "https://newspool.zhangxinhulian.com//sspapiNovel/su/custom/xgchat/user_service.html?version=1.0.0&appName=星光聊天&company=北京志信博文科技发展有限公司"; public static String WEB_URL_USER = "https://newspool.zhangxinhulian.com//sspapiNovel/su/custom/xgchat/user_service.html?version="+ Constant.Param.vn+"&appName=StarLight&company=北京志信博文科技发展有限公司";
public static String WEB_URL_PRIVACY = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xgchat/privacy.html?version=1.0.0&appName=星光聊天&company=北京志信博文科技发展有限公司"; public static String WEB_URL_PRIVACY = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xgchat/privacy.html?version="+ Constant.Param.vn+"&appName=StarLight&company=北京志信博文科技发展有限公司";
public static String WEB_URL_ABOUT_US = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/aboutMe.html?version=1.0.0&appName=星光聊天&company=北京志信博文科技发展有限公司"; public static String WEB_URL_ABOUT_US = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/aboutMe.html?version="+ Constant.Param.vn+"&appName=StarLight&company=北京志信博文科技发展有限公司";
//public static String WEB_URL_CUSTOMER_SERVICE = "https://1568685.s4.udesk.cn/im_client/?web_plugin_id=25351"; //public static String WEB_URL_CUSTOMER_SERVICE = "https://1568685.s4.udesk.cn/im_client/?web_plugin_id=25351";
public static String WEB_URL_BUYER_KNOW = "https://newspool.zhangxinhulian.com//sspapiNovel/su/custom/xgchat/add_value.html?version=1.0.0&appName=星光聊天&company=北京志信博文科技发展有限公司"; public static String WEB_URL_BUYER_KNOW = "https://newspool.zhangxinhulian.com//sspapiNovel/su/custom/xgchat/add_value.html?version="+ Constant.Param.vn+"&appName=StarLight&company=北京志信博文科技发展有限公司";
public static String WEB_URL_INVITE; public static String WEB_URL_INVITE;
public static String WEB_URL_CUSTOMER_SERVICE="http://cdn-apph5.zhangxinzhixun.com/favorite/newService?pkg=com.zx.starlightchat"; public static String WEB_URL_CUSTOMER_SERVICE="http://cdn-apph5.zhangxinzhixun.com/favorite/newService?pkg=com.zhangxin.starlight";
public static String WEB_URL_WINTER_RULE="https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/winter_mh_activity_ruleV1.0.6.html"; public static String WEB_URL_WINTER_RULE="https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/winter_mh_activity_ruleV1.0.6.html";
} }
......
package com.zxhl.cms.common.base;
import android.content.Intent;
import android.view.View;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMAuthListener;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.UMShareConfig;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.zxhl.cms.R;
import com.zxhl.cms.common.Constant;
import com.zxhl.cms.widget.LoadingDialog;
import java.util.Map;
/**
* Created by gaoleichao on 2018/6/20.
*/
public abstract class WxImpl extends BaseActivity implements UMAuthListener {
protected UMShareAPI mShareAPI;
protected LoadingDialog mLoading;
@Override
public int layoutID() {
return 0;
}
@Override
public void init() {
// PlatformConfig.setWeixin(Constant.Key.WX_LOGIN_APP_ID, Constant.Key.WX_LOGIN_KEY);
mShareAPI = UMShareAPI.get(getApplicationContext());
mLoading = LoadingDialog.getLoadingDialog(this, getString(R.string.wait_ing), false, false);
}
@Override
public void onClick(View v) {
}
protected void onWxLogin() {
mLoading.setLoading(getString(R.string.login_ing));
mLoading.show();
UMShareConfig config = new UMShareConfig();
config.isNeedAuthOnGetUserInfo(true);
mShareAPI.setShareConfig(config);
mShareAPI.getPlatformInfo(this, SHARE_MEDIA.WEIXIN, this);
}
protected void onAuth() {
mLoading.setLoading(getString(R.string.auth_ing));
mLoading.show();
UMShareConfig config = new UMShareConfig();
config.isNeedAuthOnGetUserInfo(true);
mShareAPI.getPlatformInfo(this, SHARE_MEDIA.WEIXIN, this);
}
@Override
public void onStart(SHARE_MEDIA share_media) {
}
@Override
public void onComplete(SHARE_MEDIA share_media, int i, Map<String, String> data) {
onWxSuccess(data.get("access_token"), data.get("openid"));
}
@Override
public void onError(SHARE_MEDIA share_media, int i, Throwable throwable) {
mLoading.setResult(false, "没有安装微信", 1000);
}
@Override
public void onCancel(SHARE_MEDIA share_media, int i) {
mLoading.setResult(false, "授权取消", 1000);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
try {
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
}catch (Exception ex){
}
}
public abstract void onWxSuccess(String token, String openid);
}
...@@ -240,4 +240,20 @@ interface IHomeApi { ...@@ -240,4 +240,20 @@ interface IHomeApi {
@GET(NetConfig.User.URL_AUTH_LOGOUT) @GET(NetConfig.User.URL_AUTH_LOGOUT)
fun authLogout(): Observable<Response<Any?>> fun authLogout(): Observable<Response<Any?>>
@POST(NetConfig.User.URL_AUTH_GOOGLE_LOGIN)
fun authGoogleLogin(
@Query("userID") userID: String?,
@Query("nickname") nickname: String?,
@Query("picture") picture: String?
): Observable<Response<WxBindEntity?>>
@POST(NetConfig.User.URL_AUTH_FACEBOOK_LOGIN)
fun authFaceBookLogin(
@Query("userID") userID: String?,
@Query("nickname") nickname: String?,
@Query("picture") picture: String?
): Observable<Response<WxBindEntity?>>
} }
\ No newline at end of file
...@@ -171,11 +171,11 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -171,11 +171,11 @@ class PayActivity : BaseActivity(), PayContract.View,
}, Consumer<Throwable> { }) }, Consumer<Throwable> { })
id_activity_member_pri?.setOnClickListener { id_activity_member_pri?.setOnClickListener {
JumpUtils.webJump("隐私协议", NetConfig.H5.WEB_URL_PRIVACY) JumpUtils.webJump(R.string.PrivacyAgreement.toString(), NetConfig.H5.WEB_URL_PRIVACY)
} }
id_activity_member_user?.setOnClickListener { id_activity_member_user?.setOnClickListener {
JumpUtils.webJump("用户协议", NetConfig.H5.WEB_URL_USER) JumpUtils.webJump(R.string.UserAgreement.toString(), NetConfig.H5.WEB_URL_USER)
} }
EventUtils.onEvent("member_page_show") EventUtils.onEvent("member_page_show")
......
...@@ -129,11 +129,11 @@ class StarCoinPayActivity : BaseActivity(), PayContract.View, ...@@ -129,11 +129,11 @@ class StarCoinPayActivity : BaseActivity(), PayContract.View,
}, Consumer<Throwable> { }) }, Consumer<Throwable> { })
id_activity_member_pri?.setOnClickListener { id_activity_member_pri?.setOnClickListener {
JumpUtils.webJump("隐私协议", NetConfig.H5.WEB_URL_PRIVACY) JumpUtils.webJump(R.string.PrivacyAgreement.toString(), NetConfig.H5.WEB_URL_PRIVACY)
} }
id_activity_member_user?.setOnClickListener { id_activity_member_user?.setOnClickListener {
JumpUtils.webJump("用户协议", NetConfig.H5.WEB_URL_USER) JumpUtils.webJump(R.string.UserAgreement.toString(), NetConfig.H5.WEB_URL_USER)
} }
EventUtils.onEvent("member_page_show") EventUtils.onEvent("member_page_show")
......
...@@ -30,7 +30,7 @@ public class NotificationUtil { ...@@ -30,7 +30,7 @@ public class NotificationUtil {
//准备intent //准备intent
try { try {
Class clazz = Class clazz =
Class.forName("com.zx.starlightchat.activity.MainActivity"); Class.forName("com.zhangxin.starlight.activity.MainActivity");
// val clazz = Class.forName("jd.overseas.market.local_push.app.SecondActivity") // val clazz = Class.forName("jd.overseas.market.local_push.app.SecondActivity")
......
...@@ -51,7 +51,7 @@ public class TTAdManagerHolder { ...@@ -51,7 +51,7 @@ public class TTAdManagerHolder {
return new TTAdConfig.Builder() return new TTAdConfig.Builder()
.appId("5229735") .appId("5229735")
.useTextureView(true) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView .useTextureView(true) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView
.appName("星光聊天") .appName("StarLight")
.allowShowNotify(true) //是否允许sdk展示通知栏提示 .allowShowNotify(true) //是否允许sdk展示通知栏提示
.debug(true) //测试阶段打开,可以通过日志排查问题,上线时去除该调用 .debug(true) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
.directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合 .directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
......
...@@ -68,7 +68,7 @@ object WeChatPay { ...@@ -68,7 +68,7 @@ object WeChatPay {
api = getIWXAPI() api = getIWXAPI()
} }
Log.d("PAY_GET", "api sendReq") Log.d("PAY_GET", "api sendReq")
var path:String="/pages/pay/index?token=" + entity?.token + "&pkg_name=com.zx.starlightchat" var path:String="/pages/pay/index?token=" + entity?.token + "&pkg_name=com.zhangxin.starlight"
val req = WXLaunchMiniProgram.Req() val req = WXLaunchMiniProgram.Req()
val g = Gson() val g = Gson()
val obj: JsonObject = g.fromJson(entity?.payload, JsonObject::class.java) val obj: JsonObject = g.fromJson(entity?.payload, JsonObject::class.java)
......
package com.zxhl.cms.utils
import android.app.Activity
import android.content.Context
import android.util.Log
import android.widget.Toast
import com.umeng.socialize.ShareAction
import com.umeng.socialize.UMAuthListener
import com.umeng.socialize.UMShareAPI
import com.umeng.socialize.UMShareListener
import com.umeng.socialize.bean.SHARE_MEDIA
import com.umeng.socialize.media.UMWeb
import com.zxhl.cms.AppContext
import com.zxhl.cms.R
import com.zxhl.cms.common.Constant
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.other.IsWeChatLoginEntity
import com.zxhl.cms.net.model.other.WxBindEntity
class WeChatUtils {
private var callBack: WeChatLoginSuccessCallBall
private var isLogin: Boolean? = false
private var mContext: Context? = null
private var lottery:String?=""
constructor(context: Context, mCallBack: WeChatLoginSuccessCallBall) : super() {
mContext = context
this.callBack = mCallBack
}
fun isWechatLogin(): Boolean? {
ApiClient.homeApi.isWxLogin().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<IsWeChatLoginEntity>() {
override fun onSuccess(result: IsWeChatLoginEntity?) {
isLogin = result?.status.equals("1")
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
return isLogin
}
fun wechatLogin(context: Context, str: String) {
lottery=str
mContext = context
UMShareAPI.get(mContext)
.getPlatformInfo(mContext as Activity, SHARE_MEDIA.WEIXIN, object :
UMAuthListener {
override fun onStart(share_media: SHARE_MEDIA) {}
override fun onComplete(
share_media: SHARE_MEDIA,
i: Int,
map: Map<String, String>
) {
val uid = map["uid"]
val access_token = map["access_token"]
val openid = map["openid"] //微博没有
bindWx(access_token.toString(), openid.toString(), str)
}
override fun onError(share_media: SHARE_MEDIA, i: Int, throwable: Throwable) {
Log.e("MXL", "i" + i + throwable.message)
Toast.makeText(AppContext.get(), "登录出错,请稍后重试", Toast.LENGTH_SHORT).show()
}
override fun onCancel(share_media: SHARE_MEDIA, i: Int) {
Toast.makeText(AppContext.get(), "登录已取消", Toast.LENGTH_SHORT).show()
}
})
}
fun getShareContent(context: Context?) {
// ApiClient.userInfoAPi.getWxShare().compose(RxSchedulers.observableIO2Main())
// .subscribe(object : BaseObserver<ShareEntity>() {
// override fun onSuccess(result: ShareEntity) {
// share(mContext as Activity, result)
// }
//
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
//
// }
//
// })
}
// fun share(context: Context, result: ShareEntity) {
// //执行分享操作
// if (result.type.equals("0")) {
// val webUrl: UMWeb = UMWeb(result.url)
// webUrl.description = result.desc
// webUrl.title = result.title
// ShareAction(context as Activity)
// .setPlatform(SHARE_MEDIA.WEIXIN)//传入平台
// .withText(result.title)
// .withSubject(result.desc)//分享内容
// .withMedia(webUrl)
// // .withMedia(UMImage(activity, bp))
// .setCallback(shareListener)//回调监听器
// .share()
// } else {
// ShareAction(context as Activity)
// .setPlatform(SHARE_MEDIA.WEIXIN)//传入平台
// .withText(result.title + "\n" + result.desc + "\n" + result.url)
// // .withMedia(UMImage(activity, bp))
// .setCallback(shareListener)//回调监听器
// .share()
// }
//
// }
fun bindWx(accesstoken: String, opid: String, str: String) {
//执行微信绑定
//成功后调
ApiClient.homeApi.bindWx(opid, accesstoken)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<WxBindEntity>() {
override fun onSuccess(result: WxBindEntity?) {
SettingPreference.saveToken(result?.token)
// getShareCon tent(mContext)
callBack.loginSuccess(lottery)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
private val shareListener: UMShareListener =
object : UMShareListener {
/**
* @descrption 分享开始的回调
* @param platform 平台类型
*/
override fun onStart(platform: SHARE_MEDIA) {}
/**
* @descrption 分享成功的回调
* @param platform 平台类型
*/
override fun onResult(platform: SHARE_MEDIA) {
//toast吐司
Toast.makeText(AppContext.get(), "分享成功", Toast.LENGTH_SHORT).show()
}
/**
* @descrption 分享失败的回调
* @param platform 平台类型
* @param t 错误原因
*/
override fun onError(
platform: SHARE_MEDIA,
t: Throwable
) {
Toast.makeText(AppContext.get(), "分享失败", Toast.LENGTH_SHORT).show()
}
/**
* @descrption 分享取消的回调
* @param platform 平台类型
*/
override fun onCancel(platform: SHARE_MEDIA) {
Utils.showToast(AppContext.get(), "分享取消")
}
}
}
\ No newline at end of file
...@@ -479,14 +479,14 @@ object CenterDialog { ...@@ -479,14 +479,14 @@ object CenterDialog {
// if(TextUtils.isEmpty(Constant.Param.phoneLogin)){ // if(TextUtils.isEmpty(Constant.Param.phoneLogin)){
// JumpUtils.h5Jump("用户协议", Constant.Param.NuserAgreementUrl) // JumpUtils.h5Jump("用户协议", Constant.Param.NuserAgreementUrl)
// }else{ // }else{
JumpUtils.webJump("用户协议", NetConfig.H5.WEB_URL_USER) JumpUtils.webJump(R.string.UserAgreement.toString(), NetConfig.H5.WEB_URL_USER)
// } // }
} }
} }
val clickPrivat: ClickableSpan = object : ClickableSpan() { val clickPrivat: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) { override fun onClick(widget: View) {
JumpUtils.webJump("隐私协议", NetConfig.H5.WEB_URL_PRIVACY) JumpUtils.webJump(R.string.PrivacyAgreement.toString(), NetConfig.H5.WEB_URL_PRIVACY)
} }
} }
val descStr = SpannableStringBuilder("你可阅读《隐私政策》及《用户协议》了解详细信息。如你同意,请点击“同意”开始接收我们的服务。") val descStr = SpannableStringBuilder("你可阅读《隐私政策》及《用户协议》了解详细信息。如你同意,请点击“同意”开始接收我们的服务。")
......
...@@ -305,7 +305,7 @@ ...@@ -305,7 +305,7 @@
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="用户协议" android:text="@string/UserAgreement"
android:textColor="#ff555555" android:textColor="#ff555555"
android:textSize="12sp" /> android:textSize="12sp" />
......
...@@ -328,7 +328,7 @@ ...@@ -328,7 +328,7 @@
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="用户协议" android:text="@string/UserAgreement"
android:textColor="#ff555555" android:textColor="#ff555555"
android:textSize="12sp" /> android:textSize="12sp" />
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginRight="19dp" android:layout_marginRight="19dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="不同意《星光聊天用户协议》和《星光聊天隐私政策》将无法使用星光聊天产品和服务,请您退出App" android:text="不同意《StarLight用户协议》和《StarLight隐私政策》将无法使用StarLight产品和服务,请您退出App"
android:textColor="@color/color_666666" android:textColor="@color/color_666666"
android:textSize="12sp" /> android:textSize="12sp" />
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="感谢您信任并使用星光聊天" android:text="感谢您信任并使用StarLight"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="14sp" android:textSize="14sp"
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="这是我们的《星光聊天隐私政策》,特向您 android:text="这是我们的《StarLight隐私政策》,特向您
展示本提示。星光聊天会根据您使用服务的 展示本提示。StarLight会根据您使用服务的
具体功能之需要,进行信息的收集与使用( 具体功能之需要,进行信息的收集与使用(
可能涉及账户、交易、设备等);我们不会 可能涉及账户、交易、设备等);我们不会
向任何第三方提供您的信息,除非得到您的 向任何第三方提供您的信息,除非得到您的
......
<resources> <resources>
<string name="app_name">ad_upload</string> <string name="facebook_app_id">513478837099392</string>
<string name="fb_login_protocol_scheme">fb513478837099392</string>
<string name="facebook_client_token">aa6ea776d9a022f796e63c83dcbba4ea</string>
<string name="app_name">ad_upload</string>
<string name="login_faild">登录失败</string> <string name="login_faild">登录失败</string>
<string name="login_success">登录成功</string> <string name="login_success">登录成功</string>
<string name="reset_success">修改成功</string> <string name="reset_success">修改成功</string>
...@@ -26,7 +29,12 @@ ...@@ -26,7 +29,12 @@
<string name="permission_soarse_location_str">访问范围性的定位权限\n</string> <string name="permission_soarse_location_str">访问范围性的定位权限\n</string>
<string name="permission_fine_location_str">访问精良的定位权限\n</string> <string name="permission_fine_location_str">访问精良的定位权限\n</string>
<string name="i_konw">我知道了</string> <string name="i_konw">我知道了</string>
<string name="first_dialog_content">这是我们的《星光聊天隐私政策》,特向您展示本提示。星光聊天会根据您使用服务的具体功能之需要,进行信息的收集与使用(可能涉及账户、交易、设备等);我们不会向任何第三方提供您的信息,除非得到您的授权或许可;针对特定的应用场景需求,我们会单独征求您的权限授予同意。我们将会尽最大可能采取先进的安全防护措施来保障您的信息安全。您也可以通过阅读完整版</string> <string name="first_dialog_content">这是我们的《StarLight隐私政策》,特向您展示本提示。StarLight会根据您使用服务的具体功能之需要,进行信息的收集与使用(可能涉及账户、交易、设备等);我们不会向任何第三方提供您的信息,除非得到您的授权或许可;针对特定的应用场景需求,我们会单独征求您的权限授予同意。我们将会尽最大可能采取先进的安全防护措施来保障您的信息安全。您也可以通过阅读完整版</string>
<string name="owner_notice_one">1.房主应道履行对房间的监督管理职责,\n严格依据相关法律法规、用户协议等相\n关规定规范房间成员的行为和信息发布;</string> <string name="owner_notice_one">1.房主应道履行对房间的监督管理职责,\n严格依据相关法律法规、用户协议等相\n关规定规范房间成员的行为和信息发布;</string>
<string name="owner_notice_two">2.房主应当积极维护房间内聊天秩序,\n营造良好交流氛围,提供积极健康的聊\n天话题,并及时处理房内成员间的矛盾,\n以维护房间安全、健康,保证成员的体验。</string> <string name="owner_notice_two">2.房主应当积极维护房间内聊天秩序,\n营造良好交流氛围,提供积极健康的聊\n天话题,并及时处理房内成员间的矛盾,\n以维护房间安全、健康,保证成员的体验。</string>
<string name="PrivacyAgreement">隐私协议</string>
<string name="UserAgreement">用户协议</string>
</resources> </resources>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="login" android:host="login"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="loginbefore" android:host="loginbefore"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="settinginfo" android:host="settinginfo"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.MyFollowActivity"> <activity android:name="com.zxhl.main.page.activity.MyFollowActivity">
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="myfollow" android:host="myfollow"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.MyFansActivity"> <activity android:name="com.zxhl.main.page.activity.MyFansActivity">
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="myfans" android:host="myfans"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.MyLikesActivity"> <activity android:name="com.zxhl.main.page.activity.MyLikesActivity">
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="mylikes" android:host="mylikes"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="userdetail" android:host="userdetail"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.UserInfoActivity"> <activity android:name="com.zxhl.main.page.activity.UserInfoActivity">
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="userinfo" android:host="userinfo"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.VoiceActivity"> <activity android:name="com.zxhl.main.page.activity.VoiceActivity">
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="voice" android:host="voice"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.ReportActivity"> <activity android:name="com.zxhl.main.page.activity.ReportActivity">
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="report" android:host="report"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="feedback" android:host="feedback"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.BannerDetailActivity"> <activity android:name="com.zxhl.main.page.activity.BannerDetailActivity">
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="banner_detail" android:host="banner_detail"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.CreatRoomActivity"> <activity android:name="com.zxhl.main.page.activity.CreatRoomActivity">
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="createroom" android:host="createroom"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.main.page.activity.WinterBoxActivity"> <activity android:name="com.zxhl.main.page.activity.WinterBoxActivity">
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="winterbox" android:host="winterbox"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
<data <data
android:host="splash" android:host="splash"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
......
...@@ -4,13 +4,12 @@ import android.text.Editable ...@@ -4,13 +4,12 @@ import android.text.Editable
import android.text.InputType import android.text.InputType
import android.text.TextUtils import android.text.TextUtils
import android.text.TextWatcher import android.text.TextWatcher
import android.util.Log
import android.view.View import android.view.View
import com.badoo.mobile.util.WeakHandler import com.badoo.mobile.util.WeakHandler
import com.tencent.imsdk.v2.* import com.tencent.imsdk.v2.*
import com.ym.chat.utils.TUIUtils import com.ym.chat.utils.TUIUtils
import com.zxhl.cms.common.NetConfig import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.common.base.WxImpl import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.SettingPreference import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.router.RounterApi import com.zxhl.cms.router.RounterApi
import com.zxhl.cms.router.RounterBus import com.zxhl.cms.router.RounterBus
...@@ -31,7 +30,7 @@ import java.util.concurrent.TimeUnit ...@@ -31,7 +30,7 @@ import java.util.concurrent.TimeUnit
* Created by gaoleichao on 2018/12/28 * Created by gaoleichao on 2018/12/28
*/ */
class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { class LoginActivity : BaseActivity(), LoginContract.View, AdCallback<String> {
private var TYPE: Int = 0 private var TYPE: Int = 0
private val CODE = 1001 private val CODE = 1001
...@@ -52,9 +51,8 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -52,9 +51,8 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
} }
var ifchoose:Boolean=false var ifchoose:Boolean=false
override fun init() { override fun init() {
super.init()
id_tv_yonghu?.setOnClickListener { id_tv_yonghu?.setOnClickListener {
JumpUtils.webJump("用户协议", NetConfig.H5.WEB_URL_USER) JumpUtils.webJump(R.string.UserAgreement.toString(), NetConfig.H5.WEB_URL_USER)
} }
id_tv_yinsi?.setOnClickListener { id_tv_yinsi?.setOnClickListener {
JumpUtils.webJump("隐私政策", NetConfig.H5.WEB_URL_PRIVACY) JumpUtils.webJump("隐私政策", NetConfig.H5.WEB_URL_PRIVACY)
...@@ -132,7 +130,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -132,7 +130,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
R.id.id_activity_login_close -> finish() R.id.id_activity_login_close -> finish()
R.id.id_activity_login_wx -> { R.id.id_activity_login_wx -> {
isWx = true isWx = true
onWxLogin()
} }
R.id.id_activity_login_switch_type -> swtichLayout() R.id.id_activity_login_switch_type -> swtichLayout()
R.id.id_activity_login_edit_phone_getcode -> checkPhone() R.id.id_activity_login_edit_phone_getcode -> checkPhone()
...@@ -146,8 +143,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -146,8 +143,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
} }
private fun checkPhone() { private fun checkPhone() {
mLoading.setLoadText(getString(R.string.wait_ing))
mLoading.show()
val phone = id_activity_login_edit_phone?.text.toString().trim { it <= ' ' } val phone = id_activity_login_edit_phone?.text.toString().trim { it <= ' ' }
if (phone.length == 11) { if (phone.length == 11) {
// if (PhoneNumUtils.isChinaPhoneLegal(phone) && PhoneNumUtils.isMobile(phone)) { // if (PhoneNumUtils.isChinaPhoneLegal(phone) && PhoneNumUtils.isMobile(phone)) {
...@@ -157,12 +152,10 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -157,12 +152,10 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
// } // }
} else { } else {
mLoading.setResult(false, "手机号码错误", 1000)
} }
} }
override fun smsCodeFaild(msg: String) { override fun smsCodeFaild(msg: String) {
mLoading.setResult(false, msg, 1000)
} }
override fun loginSuc() { override fun loginSuc() {
...@@ -172,7 +165,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -172,7 +165,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
override fun smsCodeSuccess() { override fun smsCodeSuccess() {
startTimer(60) startTimer(60)
mLoading.setResult(true, getString(R.string.get_sms_code_success), 1000)
} }
override fun getSignSuc(sign: String) { override fun getSignSuc(sign: String) {
...@@ -216,7 +208,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -216,7 +208,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
} }
override fun onSuccess() { override fun onSuccess() {
mLoading.setResult(true, "登录成功", 1000)
if (TextUtils.equals(SettingPreference.getUserHasData(), "1")) { if (TextUtils.equals(SettingPreference.getUserHasData(), "1")) {
JumpUtils.activityJump( JumpUtils.activityJump(
RounterBus.getRounter(RounterApi::class.java).getIntentActivityMain() RounterBus.getRounter(RounterApi::class.java).getIntentActivityMain()
...@@ -230,10 +221,7 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -230,10 +221,7 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
}) })
} }
override fun onWxSuccess(token: String, openid: String) {
isWx = false
// mPresenter?.wxLogin(token, openid)
}
private fun swtichLayout() { private fun swtichLayout() {
if (TYPE == CODE) { if (TYPE == CODE) {
...@@ -287,26 +275,16 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -287,26 +275,16 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
if (isStartTimer) { if (isStartTimer) {
startTimer(SECONDS) startTimer(SECONDS)
} }
if (isWx) {
mHandler?.postDelayed({
if (isWx && mLoading.isShowing) {
isWx = false
mLoading.setResult(false, "取消登录", 1000)
}
}, 2000)
}
} }
override fun loginFaild(msg: String) { override fun loginFaild(msg: String) {
mLoading?.dismiss()
// mLoading.setResult(false, msg, 1000) // mLoading.setResult(false, msg, 1000)
// JumpUtils.homeJump() // JumpUtils.homeJump()
} }
fun oneKeyLogin() { fun oneKeyLogin() {
mLoading.setLoading(getString(R.string.login_ing))
mLoading.show()
// mPresenter?.oneKeyLogin() // mPresenter?.oneKeyLogin()
} }
...@@ -317,26 +295,20 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -317,26 +295,20 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
return return
} }
val phone = id_activity_login_edit_phone?.text.toString().trim { it <= ' ' } val phone = id_activity_login_edit_phone?.text.toString().trim { it <= ' ' }
mLoading.setLoading(getString(R.string.login_ing))
mLoading.show()
if (TextUtils.isEmpty(phone)) { if (TextUtils.isEmpty(phone)) {
mLoading.setResult(false, "手机号不能为空", 1000)
return return
} }
if (TYPE == CODE) { if (TYPE == CODE) {
val code = id_activity_login_edit_code?.text.toString().trim { it <= ' ' } val code = id_activity_login_edit_code?.text.toString().trim { it <= ' ' }
if (TextUtils.isEmpty(code)) { if (TextUtils.isEmpty(code)) {
mLoading.setResult(false, "验证码不能为空", 1000)
return return
} }
mPresenter?.codeLogin(phone, code) mPresenter?.codeLogin(phone, code)
} else { } else {
val password = id_activity_login_edit_password?.text.toString().trim { it <= ' ' } val password = id_activity_login_edit_password?.text.toString().trim { it <= ' ' }
if (TextUtils.isEmpty(password)) { if (TextUtils.isEmpty(password)) {
mLoading.setResult(false, "密码不能为空", 1000)
return return
} else if (password.length < 6) { } else if (password.length < 6) {
mLoading.setResult(false, "密码少于6位", 1000)
return return
} }
// mPresenter?.passwordLogin(phone, password) // mPresenter?.passwordLogin(phone, password)
...@@ -379,9 +351,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> { ...@@ -379,9 +351,6 @@ class LoginActivity : WxImpl(), LoginContract.View, AdCallback<String> {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
if (mLoading != null) {
mLoading = null
}
} }
override fun onRequestPermissionsResult( override fun onRequestPermissionsResult(
......
package com.zxhl.main.page.activity package com.zxhl.main.page.activity
import android.graphics.Color
import android.text.SpannableString
import android.text.Spanned
import android.text.TextPaint
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.text.style.ForegroundColorSpan
import android.view.View import android.view.View
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.common.NetConfig import com.zxhl.cms.common.NetConfig
...@@ -9,17 +16,47 @@ import com.zxhl.cms.utils.Utils ...@@ -9,17 +16,47 @@ import com.zxhl.cms.utils.Utils
import com.zxhl.main.R import com.zxhl.main.R
import kotlinx.android.synthetic.main.activity_layout_login_before.* import kotlinx.android.synthetic.main.activity_layout_login_before.*
class LoginBeforeActivity:BaseActivity() {
class LoginBeforeActivity : BaseActivity() {
override fun init() { override fun init() {
id_tv_yinsi?.setOnClickListener { val spannableString =
JumpUtils.webJump("隐私政策", NetConfig.H5.WEB_URL_PRIVACY) SpannableString("By signing up, you confirm that you agree to our Terms of service and have read and understand our Privacy policy. ")
} val userAgreement =
id_tv_user_xieyi?.setOnClickListener { object : ClickableSpan() {
JumpUtils.webJump("用户服务协议", NetConfig.H5.WEB_URL_USER) override fun onClick(widget: View) {
JumpUtils.webJump("Terms Of Service", NetConfig.H5.WEB_URL_USER)
}
override fun updateDrawState(ds: TextPaint) {
ds.isUnderlineText = false;
ds.color = Color.parseColor("#FF772E")
}
}
val privacyPolicy =
object : ClickableSpan() {
override fun onClick(widget: View) {
JumpUtils.webJump("PrivacyPolicy", NetConfig.H5.WEB_URL_PRIVACY)
}
override fun updateDrawState(ds: TextPaint) {
ds.isUnderlineText = false;
ds.color = Color.parseColor("#FF772E")
}
}
// spannableString.setSpan(tvColor1, 49, 65, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
// spannableString.setSpan(tvColor2, 99, 114, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
spannableString.setSpan(userAgreement, 49, 65, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
spannableString.setSpan(privacyPolicy, 99, 114, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
id_tv_login_desc.movementMethod = LinkMovementMethod.getInstance()
// 点击时的背景色
id_tv_login_desc.highlightColor = Color.parseColor("#00000000");
id_tv_login_desc.text = spannableString
id_tv_google_login?.setOnClickListener {
} }
id_tv_login?.setOnClickListener {
JumpUtils.loginJump() id_tv_facebook_login?.setOnClickListener {
finish()
} }
} }
...@@ -27,6 +64,7 @@ class LoginBeforeActivity:BaseActivity() { ...@@ -27,6 +64,7 @@ class LoginBeforeActivity:BaseActivity() {
super.before() super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent)) setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
} }
...@@ -34,16 +72,18 @@ class LoginBeforeActivity:BaseActivity() { ...@@ -34,16 +72,18 @@ class LoginBeforeActivity:BaseActivity() {
override fun layoutID(): Int { override fun layoutID(): Int {
return R.layout.activity_layout_login_before return R.layout.activity_layout_login_before
} }
override fun onBackPressed() { override fun onBackPressed() {
// super.onBackPressed(); // super.onBackPressed();
exitBy2Click() exitBy2Click()
} }
private var mPrepareExit = false private var mPrepareExit = false
private fun exitBy2Click() { private fun exitBy2Click() {
if (!mPrepareExit) { if (!mPrepareExit) {
mPrepareExit = true // 准备退出 mPrepareExit = true // 准备退出
Utils.showToast(this, resources.getString(R.string.nav_back_again_finish)) Utils.showToast(this, resources.getString(R.string.nav_back_again_finish))
id_tv_user_xieyi.postDelayed(Runnable { id_tv_login_desc.postDelayed(Runnable {
mPrepareExit = false // 取消退出 mPrepareExit = false // 取消退出
}, 1500) }, 1500)
} else { } else {
......
...@@ -98,14 +98,6 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -98,14 +98,6 @@ class SplashPresenter : SplashContract.Presenter {
val token =SettingPreference.getUserToken() val token =SettingPreference.getUserToken()
if (user == null&&TextUtils.isEmpty(token)) { if (user == null&&TextUtils.isEmpty(token)) {
getAds() getAds()
// if(TextUtils.equals( Utils.getChannel(AppContext.get()), "toutiao_h5")){
// // deviceLogin()
// getAds()
// }else{
// deviceLogin()
// }
} else { } else {
UserDataUtils.updateUserInfo(null) UserDataUtils.updateUserInfo(null)
getAds() getAds()
...@@ -142,6 +134,8 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -142,6 +134,8 @@ class SplashPresenter : SplashContract.Presenter {
val data = result[0] val data = result[0]
if (TextUtils.equals(data.adPlatform, "chuanshanjia")) { if (TextUtils.equals(data.adPlatform, "chuanshanjia")) {
loadToutiao(data, 0, "splash") loadToutiao(data, 0, "splash")
}else{
mView.jumpMainPage()
} }
} else { } else {
mView.jumpMainPage() mView.jumpMainPage()
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="MissingDefaultResource">
<gradient
android:angle="180"
android:endColor="#00FFFFFF"
android:startColor="#FFFFFFFF"
android:type="linear"
android:useLevel="true" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="MissingDefaultResource">
<gradient
android:angle="180"
android:endColor="#FFFFFFFF"
android:startColor="#00FFFFFF"
android:type="linear"
android:useLevel="true" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/bj_splash"> android:background="@drawable/bj_login"
android:gravity="center"
android:orientation="vertical">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/yuan_1" android:src="@drawable/app_name_icon" />
android:layout_marginTop="110dp"
android:layout_marginLeft="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="118dp"
android:text="欢迎来到星光聊天"
android:textColor="@color/white"
android:textStyle="bold"
android:textSize="30sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/yuan_2"
android:layout_above="@+id/id_tv_login"
android:layout_alignParentRight="true"
android:layout_marginRight="36dp"/>
<TextView
android:id="@+id/id_tv_login"
android:layout_width="300dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="110dp"
android:background="@drawable/shape_ffffff_r25"
android:gravity="center"
android:text="手机号注册/登录"
android:textColor="@color/color_aa60ff"
android:textSize="20sp"
android:textStyle="bold" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_marginTop="140dp"
android:layout_marginBottom="60dp" android:gravity="center_vertical"
android:gravity="center"> android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:src="@drawable/icon_xuanzhong_2" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="87dp"
android:layout_height="wrap_content" android:layout_height="1dp"
android:text="登录即代表同意" android:background="@drawable/shape_ffffff_0" />
android:textColor="@color/color_d2d2d2"
android:textSize="13sp"
android:textStyle="bold"
android:includeFontPadding="false"/>
<TextView <TextView
android:id="@+id/id_tv_user_xieyi"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="《用户服务协议》" android:text="Sign up/Login"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="13sp" /> android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:layout_width="87dp"
android:layout_height="1dp"
android:background="@drawable/shape_ffffff_1" />
</LinearLayout>
<LinearLayout
android:id="@+id/id_ll_login_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView <TextView
android:id="@+id/id_tv_google_login"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="和" android:drawableTop="@drawable/icon_google"
android:textColor="@color/color_d2d2d2" android:gravity="center"
android:textSize="13sp" android:text="Google"
android:textStyle="bold" android:textColor="@color/white"
android:includeFontPadding="false"/> android:textSize="15sp"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/id_tv_yinsi" android:id="@+id/id_tv_facebook_login"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="《隐私政策》" android:layout_marginLeft="50dp"
android:drawableTop="@drawable/icon_facebook"
android:gravity="center"
android:text="Facebook"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="13sp" android:textSize="15sp"
android:textStyle="bold" android:textStyle="bold" />
android:includeFontPadding="false"/>
</LinearLayout> </LinearLayout>
</RelativeLayout> <TextView
\ No newline at end of file android:id="@+id/id_tv_login_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="70dp"
android:layout_marginBottom="20dp"
android:gravity="center|bottom"
android:text=""
android:textColor="@color/white"
android:textSize="13sp" />
</LinearLayout>
\ No newline at end of file
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="登录即代表同意" android:text="登录即代表同意 "
android:textColor="@color/color_d2d2d2" android:textColor="@color/color_d2d2d2"
android:textSize="13sp" /> android:textSize="13sp" />
...@@ -343,14 +343,14 @@ ...@@ -343,14 +343,14 @@
android:id="@+id/id_tv_yonghu" android:id="@+id/id_tv_yonghu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text=" 用户协议 " android:text="@string/UserAgreement"
android:textColor="@color/color_aa60ff" android:textColor="@color/color_aa60ff"
android:textSize="13sp" /> android:textSize="13sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="和" android:text=" 和"
android:textColor="@color/color_d2d2d2" android:textColor="@color/color_d2d2d2"
android:textSize="13sp" /> android:textSize="13sp" />
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="星光聊天" android:text="StarLight"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
android:text="星光聊天小秘书赠送给你的新人福利" android:text="StarLight小秘书赠送给你的新人福利"
android:textColor="@color/color_666666" android:textColor="@color/color_666666"
android:textSize="14sp" /> android:textSize="14sp" />
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:text="星光聊天" android:text="StarLight"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="18sp" /> android:textSize="18sp" />
......
<resources> <resources>
<string name="app_name">ModuleMain</string> <string name="app_name" translatable="false">ModuleMain</string>
<string name="reward_for_reporting">举报有奖</string> <string name="reward_for_reporting" translatable="false">举报有奖</string>
<string name="create_room">创建房间</string> <string name="create_room" translatable="false">创建房间</string>
<string name="select_room_type">选择一个房间类型</string> <string name="select_room_type" translatable="false">选择一个房间类型</string>
<string name="room_topics">房间话题将展示在房间列表上</string> <string name="room_topics" translatable="false">房间话题将展示在房间列表上</string>
<string name="random">随机</string> <string name="random" translatable="false">随机</string>
<string name="apply_to_become_super_homeowner">申请成为超级房主</string> <string name="apply_to_become_super_homeowner" translatable="false">申请成为超级房主</string>
</resources> </resources>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="setting" android:host="setting"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.zxhl.uc.page.fragment.AboutUsActivity"> <activity android:name="com.zxhl.uc.page.fragment.AboutUsActivity">
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="aboutus" android:host="aboutus"
android:scheme="xglt" /> android:scheme="hwxg" />
</intent-filter> </intent-filter>
</activity> </activity>
</application> </application>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:text="星光聊天" android:text="StarLight"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment