Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
2979fa4b
Commit
2979fa4b
authored
Feb 27, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加walle
parent
d54fd907
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
build.gradle
+3
-0
src/main/java/tech/starwin/LibConfig.java
+8
-3
src/main/java/tech/starwin/network/DefaultHeaderAddInterceptor.java
+1
-1
No files found.
build.gradle
View file @
2979fa4b
...
...
@@ -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
...
...
src/main/java/tech/starwin/LibConfig.java
View file @
2979fa4b
...
...
@@ -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
);
...
...
src/main/java/tech/starwin/network/DefaultHeaderAddInterceptor.java
View file @
2979fa4b
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment