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
b70dd4d1
Commit
b70dd4d1
authored
Apr 09, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear litepel
parent
0dbe840e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 additions
and
64 deletions
+1
-64
build.gradle
+0
-2
src/main/assets/litepal.xml
+0
-9
src/main/java/com/common/Collector.java
+0
-42
src/main/java/com/common/bean/CollectInfoEntity.java
+1
-7
src/main/java/tech/starwin/LibConfig.java
+0
-4
No files found.
build.gradle
View file @
b70dd4d1
...
...
@@ -63,8 +63,6 @@ dependencies {
api
"com.google.protobuf:protobuf-java:3.5.1"
// stream
api
'com.annimon:stream:1.1.4'
// litepal
api
'org.litepal.android:core:2.0.0'
// api 'me.jessyan:autosize:1.0.6'
...
...
src/main/assets/litepal.xml
deleted
100644 → 0
View file @
0dbe840e
<?xml version="1.0" encoding="utf-8"?>
<litepal>
<dbname
value=
"collect_info"
/>
<version
value=
"1"
/>
<list>
<mapping
class=
"com.common.bean.CollectInfoEntity"
/>
</list>
</litepal>
\ No newline at end of file
src/main/java/com/common/Collector.java
View file @
b70dd4d1
...
...
@@ -167,48 +167,6 @@ public class Collector {
}
/**
* location有可能没有,需要搜集多次才可能搜集到
*/
@SuppressLint
(
"CheckResult"
)
public
static
void
collectAndSaveLocation
(
Context
context
)
{
Observable
.
interval
(
1
,
TimeUnit
.
MINUTES
)
.
startWith
(
0L
)
.
flatMap
(
new
io
.
reactivex
.
functions
.
Function
<
Long
,
ObservableSource
<
InfoType
>>()
{
@Override
public
ObservableSource
<
InfoType
>
apply
(
Long
aLong
)
throws
Exception
{
return
Observable
.
just
(
InfoType
.
LOCATION
);
}
})
.
map
(
new
io
.
reactivex
.
functions
.
Function
<
InfoType
,
Pair
<
InfoType
,
Boolean
>>()
{
@Override
public
Pair
<
InfoType
,
Boolean
>
apply
(
InfoType
type
)
throws
Exception
{
Pair
<
InfoType
,
Boolean
>
pair
=
Pair
.
create
(
type
,
DataBaseHelper
.
permissionGranted
(
InfoType
.
toPermission
(
type
),
context
));
return
pair
;
}
})
.
filter
(
new
Predicate
<
Pair
<
InfoType
,
Boolean
>>()
{
@Override
public
boolean
test
(
Pair
<
InfoType
,
Boolean
>
pair
)
throws
Exception
{
return
pair
.
second
;
}
})
.
map
(
new
io
.
reactivex
.
functions
.
Function
<
Pair
<
InfoType
,
Boolean
>,
CollectInfoEntity
>()
{
@Override
public
CollectInfoEntity
apply
(
Pair
<
InfoType
,
Boolean
>
pair
)
throws
Exception
{
return
Collector
.
getStoreEntity
(
pair
.
first
,
context
,
null
);
}
})
.
subscribe
(
new
Consumer
<
CollectInfoEntity
>()
{
@Override
public
void
accept
(
CollectInfoEntity
collect
)
throws
Exception
{
if
(
collect
!=
null
)
{
collect
.
saveOrUpdate
(
"type=?"
,
collect
.
getType
());
}
}
});
}
/**
* 查询指定类型的数据
*/
public
static
CollectInfoEntity
getStoreEntity
(
InfoType
type
,
Context
context
,
List
<
ContactEntity
>
contactList
)
{
...
...
src/main/java/com/common/bean/CollectInfoEntity.java
View file @
b70dd4d1
package
com
.
common
.
bean
;
import
org.litepal.crud.LitePalSupport
;
public
class
CollectInfoEntity
extends
LitePalSupport
{
public
class
CollectInfoEntity
{
private
String
type
;
private
String
body
;
private
long
update_time
;
...
...
@@ -39,11 +38,6 @@ public class CollectInfoEntity extends LitePalSupport {
&&
entity
instanceof
CollectInfoEntity
&&
((
CollectInfoEntity
)
entity
).
getType
()
!=
null
&&
type
.
equals
(((
CollectInfoEntity
)
entity
).
getType
());
}
@Override
public
int
hashCode
(){
return
type
.
hashCode
();
}
@Override
public
String
toString
()
{
...
...
src/main/java/tech/starwin/LibConfig.java
View file @
b70dd4d1
...
...
@@ -15,10 +15,8 @@ import com.scwang.smartrefresh.layout.api.RefreshFooter;
import
com.scwang.smartrefresh.layout.api.RefreshHeader
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.footer.ClassicsFooter
;
import
com.scwang.smartrefresh.layout.header.ClassicsHeader
;
import
org.litepal.LitePal
;
//SDK-TD-START
import
cn.fraudmetrix.octopus.aspirit.main.OctopusManager
;
...
...
@@ -124,8 +122,6 @@ public class LibConfig {
//屏幕适配(360dp宽度限定)
ScreenAutoSize
.
resizeDensity
(
CONTEXT
,
360
f
);
LitePal
.
initialize
(
CONTEXT
);
SQLiteDatabase
db
=
LitePal
.
getDatabase
();
//上传工具
UploadManager
.
init
(
CONTEXT
);
...
...
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