Commit 2979fa4b by sikang

添加walle

parent d54fd907
......@@ -56,6 +56,9 @@ dependencies {
api "com.android.support:support-v4:$rootProject.ext.supportLibraryVersion"
api "com.android.support:recyclerview-v7:$rootProject.ext.supportLibraryVersion"
//walle
api 'com.meituan.android.walle:library:1.1.6'
// protobuf
api "com.google.protobuf:protobuf-java:3.5.1"
// stream
......
......@@ -6,6 +6,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import android.view.View;
import com.meituan.android.walle.WalleChannelReader;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator;
import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator;
......@@ -66,8 +67,8 @@ public class LibConfig {
public static String TONGDUN_PARENT_CODE;
public static String TONGDUN_PARENT_KEY;
public static String TONGDUN_DEVICE_PARENT_CODE;
public static String TD_TEST_SERVER="https://idfptest.tongdun.net";
public static String TD_PRODUCT_SERVER="https://idfp.tongdun.net";
public static String TD_TEST_SERVER = "https://idfptest.tongdun.net";
public static String TD_PRODUCT_SERVER = "https://idfp.tongdun.net";
public static String APPSFLYER_DEV_KEY;
public static String XH_CHANNEL_NAME;
public static String TEST_TOKEN;
......@@ -93,6 +94,10 @@ public class LibConfig {
public static void initLib(Application application) {
if (application != null) {
CONTEXT = application;
if (TextUtils.isEmpty(XH_CHANNEL_NAME)) {
XH_CHANNEL_NAME = WalleChannelReader.getChannel(application.getApplicationContext());
}
//APP名字
LibConfig.APP_NAME = AppInfoUtils.getAppName(CONTEXT);
if (TextUtils.isEmpty(LibConfig.ROOT_DIR)) {
......@@ -155,7 +160,7 @@ public class LibConfig {
*/
private static void initTD() {
if (!TextUtils.isEmpty(TONGDUN_PARENT_CODE) && !TextUtils.isEmpty(TONGDUN_PARENT_KEY)) {
OctopusManager.getInstance().init(CONTEXT, TONGDUN_PARENT_CODE, TONGDUN_PARENT_KEY,"");
OctopusManager.getInstance().init(CONTEXT, TONGDUN_PARENT_CODE, TONGDUN_PARENT_KEY, "");
OctopusManager.getInstance().setPrimaryColorResId(MAIN_COLOR);
OctopusManager.getInstance().setTitleColorResId(R.color.white);
OctopusManager.getInstance().setShowWarnDialog(true);
......
......@@ -54,7 +54,7 @@ class DefaultHeaderAddInterceptor implements Interceptor {
requestBuilder.header("Connection", "Keep-Alive");
}
if (TextUtils.isEmpty(LibConfig.XH_CHANNEL_NAME)) {
if (!TextUtils.isEmpty(LibConfig.XH_CHANNEL_NAME)) {
requestBuilder.header("X-APP-SOURCE", LibConfig.XH_CHANNEL_NAME);
}
......
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