Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
978834a3
authored
Nov 26, 2017
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base类修改
parent
497683ff
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
74 additions
and
280 deletions
app/build.gradle
app/src/main/java/com/dayu/bigfish/SplashActivity.java
app/src/main/java/com/dayu/bigfish/base/BaseActivity.java
app/src/main/java/com/dayu/bigfish/base/BaseFragment.java
app/src/main/java/com/dayu/bigfish/base/BasePresenter.java
app/src/main/java/com/dayu/bigfish/greendao/DaoMaster.java
app/src/main/java/com/dayu/bigfish/greendao/DaoSession.java
app/src/main/java/com/dayu/bigfish/greendao/MyGreenDaoDao.java
app/src/main/java/com/dayu/bigfish/presenter/homefirsttab/HomeFirstPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/homethiirdtab/HomeThirdPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/worksRecord/WorksRecordPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/worksRecord/WroksRecordContract.java
app/src/main/java/com/dayu/bigfish/sqlbean/MyGreenDao.java
app/src/main/java/com/dayu/bigfish/ui/LoginActivity.java
app/src/main/java/com/dayu/bigfish/ui/SettingActivity.java
app/src/main/java/com/dayu/bigfish/managers/AppManager.java → app/src/main/java/com/dayu/bigfish/utils/managers/AppManager.java
app/src/main/java/com/dayu/bigfish/utils/managers/MemoryCacheManager.java
app/src/main/java/com/dayu/bigfish/managers/UserManager.java → app/src/main/java/com/dayu/bigfish/utils/managers/UserManager.java
apt/src/main/java/com/app/apt/processor/InstanceProcessor.java
lib/build/libs/lib.jar
lib/src/main/java/com/app/annotation/apt/InstanceFactory.java
settings.gradle
app/build.gradle
View file @
978834a3
...
...
@@ -38,7 +38,7 @@ android {
debug
{
signingConfig
android
.
signingConfigs
.
release
minifyEnabled
fals
e
minifyEnabled
tru
e
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
}
}
...
...
@@ -100,6 +100,6 @@ dependencies {
compile
'com.squareup.retrofit2:converter-gson:2.3.0'
compile
'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile
'com.squareup.okhttp3:logging-interceptor:3.8.0'
compile
project
(
':lib'
)
annotationProcessor
project
(
':apt'
)
compile
project
(
':lib'
)
}
app/src/main/java/com/dayu/bigfish/SplashActivity.java
View file @
978834a3
...
...
@@ -21,7 +21,7 @@ import android.view.WindowManager;
import
android.widget.Toast
;
import
com.dayu.bigfish.bean.InformBean
;
import
com.dayu.bigfish.managers.UserManager
;
import
com.dayu.bigfish.
utils.
managers.UserManager
;
import
com.dayu.bigfish.rxbus.RefreReceiveData
;
import
com.dayu.bigfish.rxbus.RefreshTabNum
;
import
com.dayu.bigfish.rxbus.RxBus
;
...
...
app/src/main/java/com/dayu/bigfish/base/BaseActivity.java
View file @
978834a3
...
...
@@ -25,17 +25,18 @@ public abstract class BaseActivity<P extends BasePresenter> extends AppCompatAct
this
.
setContentView
(
this
.
getLayoutId
());
ButterKnife
.
bind
(
this
);
mActivity
=
this
;
// mPresenter = TUtil.getT(this, 0);
// mModel = TUtil.getT(this, 1);
// if (this instanceof BaseView) mPresenter.setVM(this, mModel, mContext);
if
(
this
instanceof
BaseView
&&
this
.
getClass
().
getGenericSuperclass
()
instanceof
ParameterizedType
&&
((
ParameterizedType
)
(
this
.
getClass
().
getGenericSuperclass
())).
getActualTypeArguments
().
length
>
0
)
{
Class
mPresenterClass
=
(
Class
)
((
ParameterizedType
)
(
this
.
getClass
()
.
getGenericSuperclass
())).
getActualTypeArguments
()[
0
];
// if (MemoryCacheManager.get(mPresenterClass.getSimpleName()) != null) {
// mPresenter = (P) MemoryCacheManager.get(mPresenterClass.getSimpleName());
// } else {
mPresenter
=
InstanceUtil
.
getInstance
(
mPresenterClass
);
if
(
mPresenter
!=
null
)
mPresenter
.
setView
(
this
,
this
);
// MemoryCacheManager.add(mPresenterClass.getSimpleName(), mPresenter);
// }
if
(
mPresenter
!=
null
)
mPresenter
.
setView
(
this
,
mActivity
);
}
this
.
initView
();
}
...
...
@@ -68,7 +69,7 @@ public abstract class BaseActivity<P extends BasePresenter> extends AppCompatAct
}
public
void
showDialog
()
{
ProgressUtil
.
startLoad
(
this
,
""
);
ProgressUtil
.
startLoad
(
this
);
}
public
void
hideDialog
()
{
...
...
app/src/main/java/com/dayu/bigfish/base/BaseFragment.java
View file @
978834a3
...
...
@@ -9,6 +9,8 @@ import android.view.View;
import
android.view.ViewGroup
;
import
com.dayu.bigfish.utils.InstanceUtil
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.utils.ToastUtils
;
import
java.lang.reflect.ParameterizedType
;
...
...
@@ -28,16 +30,11 @@ public abstract class BaseFragment<P extends BasePresenter> extends Fragment {
@Override
public
void
onAttach
(
Context
context
)
{
super
.
onAttach
(
context
);
mContext
=
context
;
}
@Override
public
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
isFirstLoad
=
true
;
isPrepared
=
true
;
mContext
=
getActivity
();
if
(
this
instanceof
BaseView
&&
this
.
getClass
().
getGenericSuperclass
()
instanceof
ParameterizedType
&&
((
ParameterizedType
)
(
this
.
getClass
().
getGenericSuperclass
())).
getActualTypeArguments
().
length
>
0
)
{
...
...
@@ -116,4 +113,16 @@ public abstract class BaseFragment<P extends BasePresenter> extends Fragment {
}
protected
abstract
void
lazyLoad
();
public
void
showToast
(
String
msg
)
{
ToastUtils
.
showShortToast
(
msg
);
}
public
void
showDialog
()
{
ProgressUtil
.
startLoad
(
mContext
);
}
public
void
hideDialog
()
{
ProgressUtil
.
stopLoad
();
}
}
app/src/main/java/com/dayu/bigfish/base/BasePresenter.java
View file @
978834a3
...
...
@@ -6,7 +6,7 @@ import android.content.Intent;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.api.APIException
;
import
com.dayu.bigfish.managers.UserManager
;
import
com.dayu.bigfish.
utils.
managers.UserManager
;
import
com.dayu.bigfish.ui.LoginActivity
;
import
com.dayu.bigfish.utils.ProgressUtil
;
import
com.dayu.bigfish.views.CustomDialog
;
...
...
@@ -28,7 +28,6 @@ public abstract class BasePresenter<V> {
protected
V
mView
;
protected
CompositeDisposable
mComDisposable
=
new
CompositeDisposable
();
public
void
setView
(
V
v
,
Activity
activity
)
{
mActivity
=
activity
;
this
.
mView
=
v
;
...
...
@@ -127,8 +126,13 @@ public abstract class BasePresenter<V> {
String
message
=
exception
.
message
;
if
(
code
==
403
)
{
showLoginDialog
();
return
;
}
if
(
mView
instanceof
BaseActivity
)
{
((
BaseActivity
)
mView
).
showToast
(
message
);
}
else
if
(
mView
instanceof
BaseFragment
)
{
((
BaseFragment
)
mView
).
showToast
(
message
);
}
// ((BaseActivity) mView).showToast(message);
}
/**
...
...
app/src/main/java/com/dayu/bigfish/greendao/DaoMaster.java
View file @
978834a3
...
...
@@ -23,7 +23,6 @@ public class DaoMaster extends AbstractDaoMaster {
public
static
void
createAllTables
(
Database
db
,
boolean
ifNotExists
)
{
MessageSysDao
.
createTable
(
db
,
ifNotExists
);
OrderInfoDao
.
createTable
(
db
,
ifNotExists
);
MyGreenDaoDao
.
createTable
(
db
,
ifNotExists
);
MessageBigFishDao
.
createTable
(
db
,
ifNotExists
);
}
...
...
@@ -31,7 +30,6 @@ public class DaoMaster extends AbstractDaoMaster {
public
static
void
dropAllTables
(
Database
db
,
boolean
ifExists
)
{
MessageSysDao
.
dropTable
(
db
,
ifExists
);
OrderInfoDao
.
dropTable
(
db
,
ifExists
);
MyGreenDaoDao
.
dropTable
(
db
,
ifExists
);
MessageBigFishDao
.
dropTable
(
db
,
ifExists
);
}
...
...
@@ -53,7 +51,6 @@ public class DaoMaster extends AbstractDaoMaster {
super
(
db
,
SCHEMA_VERSION
);
registerDaoClass
(
MessageSysDao
.
class
);
registerDaoClass
(
OrderInfoDao
.
class
);
registerDaoClass
(
MyGreenDaoDao
.
class
);
registerDaoClass
(
MessageBigFishDao
.
class
);
}
...
...
app/src/main/java/com/dayu/bigfish/greendao/DaoSession.java
View file @
978834a3
...
...
@@ -10,12 +10,10 @@ import org.greenrobot.greendao.internal.DaoConfig;
import
com.dayu.bigfish.sqlbean.MessageSys
;
import
com.dayu.bigfish.sqlbean.OrderInfo
;
import
com.dayu.bigfish.sqlbean.MyGreenDao
;
import
com.dayu.bigfish.sqlbean.MessageBigFish
;
import
com.dayu.bigfish.greendao.MessageSysDao
;
import
com.dayu.bigfish.greendao.OrderInfoDao
;
import
com.dayu.bigfish.greendao.MyGreenDaoDao
;
import
com.dayu.bigfish.greendao.MessageBigFishDao
;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
...
...
@@ -29,12 +27,10 @@ public class DaoSession extends AbstractDaoSession {
private
final
DaoConfig
messageSysDaoConfig
;
private
final
DaoConfig
orderInfoDaoConfig
;
private
final
DaoConfig
myGreenDaoDaoConfig
;
private
final
DaoConfig
messageBigFishDaoConfig
;
private
final
MessageSysDao
messageSysDao
;
private
final
OrderInfoDao
orderInfoDao
;
private
final
MyGreenDaoDao
myGreenDaoDao
;
private
final
MessageBigFishDao
messageBigFishDao
;
public
DaoSession
(
Database
db
,
IdentityScopeType
type
,
Map
<
Class
<?
extends
AbstractDao
<?,
?>>,
DaoConfig
>
...
...
@@ -47,27 +43,21 @@ public class DaoSession extends AbstractDaoSession {
orderInfoDaoConfig
=
daoConfigMap
.
get
(
OrderInfoDao
.
class
).
clone
();
orderInfoDaoConfig
.
initIdentityScope
(
type
);
myGreenDaoDaoConfig
=
daoConfigMap
.
get
(
MyGreenDaoDao
.
class
).
clone
();
myGreenDaoDaoConfig
.
initIdentityScope
(
type
);
messageBigFishDaoConfig
=
daoConfigMap
.
get
(
MessageBigFishDao
.
class
).
clone
();
messageBigFishDaoConfig
.
initIdentityScope
(
type
);
messageSysDao
=
new
MessageSysDao
(
messageSysDaoConfig
,
this
);
orderInfoDao
=
new
OrderInfoDao
(
orderInfoDaoConfig
,
this
);
myGreenDaoDao
=
new
MyGreenDaoDao
(
myGreenDaoDaoConfig
,
this
);
messageBigFishDao
=
new
MessageBigFishDao
(
messageBigFishDaoConfig
,
this
);
registerDao
(
MessageSys
.
class
,
messageSysDao
);
registerDao
(
OrderInfo
.
class
,
orderInfoDao
);
registerDao
(
MyGreenDao
.
class
,
myGreenDaoDao
);
registerDao
(
MessageBigFish
.
class
,
messageBigFishDao
);
}
public
void
clear
()
{
messageSysDaoConfig
.
clearIdentityScope
();
orderInfoDaoConfig
.
clearIdentityScope
();
myGreenDaoDaoConfig
.
clearIdentityScope
();
messageBigFishDaoConfig
.
clearIdentityScope
();
}
...
...
@@ -79,10 +69,6 @@ public class DaoSession extends AbstractDaoSession {
return
orderInfoDao
;
}
public
MyGreenDaoDao
getMyGreenDaoDao
()
{
return
myGreenDaoDao
;
}
public
MessageBigFishDao
getMessageBigFishDao
()
{
return
messageBigFishDao
;
}
...
...
app/src/main/java/com/dayu/bigfish/greendao/MyGreenDaoDao.java
deleted
100755 → 0
View file @
497683ff
package
com
.
dayu
.
bigfish
.
greendao
;
import
android.database.Cursor
;
import
android.database.sqlite.SQLiteStatement
;
import
org.greenrobot.greendao.AbstractDao
;
import
org.greenrobot.greendao.Property
;
import
org.greenrobot.greendao.internal.DaoConfig
;
import
org.greenrobot.greendao.database.Database
;
import
org.greenrobot.greendao.database.DatabaseStatement
;
import
com.dayu.bigfish.sqlbean.MyGreenDao
;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "MY_GREEN_DAO".
*/
public
class
MyGreenDaoDao
extends
AbstractDao
<
MyGreenDao
,
Long
>
{
public
static
final
String
TABLENAME
=
"MY_GREEN_DAO"
;
/**
* Properties of entity MyGreenDao.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public
static
class
Properties
{
public
final
static
Property
Id
=
new
Property
(
0
,
Long
.
class
,
"id"
,
true
,
"_id"
);
public
final
static
Property
Ids
=
new
Property
(
1
,
int
.
class
,
"ids"
,
false
,
"IDS"
);
public
final
static
Property
Logid
=
new
Property
(
2
,
int
.
class
,
"logid"
,
false
,
"LOGID"
);
public
final
static
Property
Type
=
new
Property
(
3
,
String
.
class
,
"type"
,
false
,
"TYPE"
);
public
final
static
Property
Flag
=
new
Property
(
4
,
String
.
class
,
"flag"
,
false
,
"FLAG"
);
}
public
MyGreenDaoDao
(
DaoConfig
config
)
{
super
(
config
);
}
public
MyGreenDaoDao
(
DaoConfig
config
,
DaoSession
daoSession
)
{
super
(
config
,
daoSession
);
}
/** Creates the underlying database table. */
public
static
void
createTable
(
Database
db
,
boolean
ifNotExists
)
{
String
constraint
=
ifNotExists
?
"IF NOT EXISTS "
:
""
;
db
.
execSQL
(
"CREATE TABLE "
+
constraint
+
"\"MY_GREEN_DAO\" ("
+
//
"\"_id\" INTEGER PRIMARY KEY ,"
+
// 0: id
"\"IDS\" INTEGER NOT NULL ,"
+
// 1: ids
"\"LOGID\" INTEGER NOT NULL ,"
+
// 2: logid
"\"TYPE\" TEXT,"
+
// 3: type
"\"FLAG\" TEXT);"
);
// 4: flag
}
/** Drops the underlying database table. */
public
static
void
dropTable
(
Database
db
,
boolean
ifExists
)
{
String
sql
=
"DROP TABLE "
+
(
ifExists
?
"IF EXISTS "
:
""
)
+
"\"MY_GREEN_DAO\""
;
db
.
execSQL
(
sql
);
}
@Override
protected
final
void
bindValues
(
DatabaseStatement
stmt
,
MyGreenDao
entity
)
{
stmt
.
clearBindings
();
Long
id
=
entity
.
getId
();
if
(
id
!=
null
)
{
stmt
.
bindLong
(
1
,
id
);
}
stmt
.
bindLong
(
2
,
entity
.
getIds
());
stmt
.
bindLong
(
3
,
entity
.
getLogid
());
String
type
=
entity
.
getType
();
if
(
type
!=
null
)
{
stmt
.
bindString
(
4
,
type
);
}
String
flag
=
entity
.
getFlag
();
if
(
flag
!=
null
)
{
stmt
.
bindString
(
5
,
flag
);
}
}
@Override
protected
final
void
bindValues
(
SQLiteStatement
stmt
,
MyGreenDao
entity
)
{
stmt
.
clearBindings
();
Long
id
=
entity
.
getId
();
if
(
id
!=
null
)
{
stmt
.
bindLong
(
1
,
id
);
}
stmt
.
bindLong
(
2
,
entity
.
getIds
());
stmt
.
bindLong
(
3
,
entity
.
getLogid
());
String
type
=
entity
.
getType
();
if
(
type
!=
null
)
{
stmt
.
bindString
(
4
,
type
);
}
String
flag
=
entity
.
getFlag
();
if
(
flag
!=
null
)
{
stmt
.
bindString
(
5
,
flag
);
}
}
@Override
public
Long
readKey
(
Cursor
cursor
,
int
offset
)
{
return
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
);
}
@Override
public
MyGreenDao
readEntity
(
Cursor
cursor
,
int
offset
)
{
MyGreenDao
entity
=
new
MyGreenDao
(
//
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
),
// id
cursor
.
getInt
(
offset
+
1
),
// ids
cursor
.
getInt
(
offset
+
2
),
// logid
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getString
(
offset
+
3
),
// type
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
)
// flag
);
return
entity
;
}
@Override
public
void
readEntity
(
Cursor
cursor
,
MyGreenDao
entity
,
int
offset
)
{
entity
.
setId
(
cursor
.
isNull
(
offset
+
0
)
?
null
:
cursor
.
getLong
(
offset
+
0
));
entity
.
setIds
(
cursor
.
getInt
(
offset
+
1
));
entity
.
setLogid
(
cursor
.
getInt
(
offset
+
2
));
entity
.
setType
(
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getString
(
offset
+
3
));
entity
.
setFlag
(
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
));
}
@Override
protected
final
Long
updateKeyAfterInsert
(
MyGreenDao
entity
,
long
rowId
)
{
entity
.
setId
(
rowId
);
return
rowId
;
}
@Override
public
Long
getKey
(
MyGreenDao
entity
)
{
if
(
entity
!=
null
)
{
return
entity
.
getId
();
}
else
{
return
null
;
}
}
@Override
public
boolean
hasKey
(
MyGreenDao
entity
)
{
return
entity
.
getId
()
!=
null
;
}
@Override
protected
final
boolean
isEntityUpdateable
()
{
return
true
;
}
}
app/src/main/java/com/dayu/bigfish/presenter/homefirsttab/HomeFirstPresenter.java
View file @
978834a3
package
com
.
dayu
.
bigfish
.
presenter
.
homefirsttab
;
import
com.app.annotation.apt.InstanceFactory
;
/**
...
...
app/src/main/java/com/dayu/bigfish/presenter/homethiirdtab/HomeThirdPresenter.java
View file @
978834a3
package
com
.
dayu
.
bigfish
.
presenter
.
homethiirdtab
;
import
com.app.annotation.apt.InstanceFactory
;
/**
...
...
app/src/main/java/com/dayu/bigfish/presenter/worksRecord/WorksRecordPresenter.java
View file @
978834a3
package
com
.
dayu
.
bigfish
.
presenter
.
worksRecord
;
import
com.app.annotation.apt.InstanceFactory
;
import
com.apt.ApiFactory
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.bean.Order
;
...
...
@@ -9,7 +10,7 @@ import io.reactivex.functions.Consumer;
/**
* Created by luofan on 2017/11/8.
*/
@InstanceFactory
public
class
WorksRecordPresenter
extends
WroksRecordContract
.
Presenter
{
@Override
...
...
app/src/main/java/com/dayu/bigfish/presenter/worksRecord/WroksRecordContract.java
View file @
978834a3
package
com
.
dayu
.
bigfish
.
presenter
.
worksRecord
;
import
com.app.annotation.apt.InstanceFactory
;
import
com.dayu.bigfish.base.BaseModel
;
import
com.dayu.bigfish.base.BasePageBean
;
import
com.dayu.bigfish.base.BasePresenter
;
...
...
@@ -13,7 +12,6 @@ import io.reactivex.Observable;
/**
* Created by luo on 2016/8/4.
*/
@InstanceFactory
public
interface
WroksRecordContract
{
interface
Model
extends
BaseModel
{
Observable
<
BasePageBean
<
Order
>>
getWorksRecord
(
int
state
,
int
engineerId
,
int
siteId
,
int
page
,
int
pageSize
);
...
...
app/src/main/java/com/dayu/bigfish/sqlbean/MyGreenDao.java
deleted
100755 → 0
View file @
497683ff
package
com
.
dayu
.
bigfish
.
sqlbean
;
import
org.greenrobot.greendao.annotation.Entity
;
import
org.greenrobot.greendao.annotation.Generated
;
import
org.greenrobot.greendao.annotation.Id
;
/**
* 工程师状态保存的表。
* 我已出发-->开始服务-->处理工单
* 我已出发-->修改预约时间-->开始服务--->需要再次上门-->处理工单
* 1:开始服务之前可以修改预约时间,修改预约时间后开始服务变成我已出发。
* 2:开始服务后可以再次上门,再次上门填写下次预约时间后,处理工单变成我已出发
*
* on 2017/9/18.
*/
@Entity
public
class
MyGreenDao
{
@Id
private
Long
id
;
//自增长的id
private
int
ids
;
//订单orderId
private
int
logid
;
//userId
private
String
type
;
//标志我已出发(0)-开始服务(1)-处理工单(2),
private
String
flag
;
//标志修改预约时间(a)-需要再次上门(b)
public
MyGreenDao
()
{
}
@Generated
(
hash
=
1226745973
)
public
MyGreenDao
(
Long
id
,
int
ids
,
int
logid
,
String
type
,
String
flag
)
{
this
.
id
=
id
;
this
.
ids
=
ids
;
this
.
logid
=
logid
;
this
.
type
=
type
;
this
.
flag
=
flag
;
}
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
int
getIds
()
{
return
this
.
ids
;
}
public
void
setIds
(
int
ids
)
{
this
.
ids
=
ids
;
}
public
int
getLogid
()
{
return
this
.
logid
;
}
public
void
setLogid
(
int
logid
)
{
this
.
logid
=
logid
;
}
public
String
getType
()
{
return
this
.
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getFlag
()
{
return
this
.
flag
;
}
public
void
setFlag
(
String
flag
)
{
this
.
flag
=
flag
;
}
}
app/src/main/java/com/dayu/bigfish/ui/LoginActivity.java
View file @
978834a3
...
...
@@ -11,7 +11,7 @@ import android.widget.TextView;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.managers.UserManager
;
import
com.dayu.bigfish.
utils.
managers.UserManager
;
import
com.dayu.bigfish.presenter.login.LoginContract
;
import
com.dayu.bigfish.presenter.login.LoginPresenter
;
import
com.dayu.bigfish.utils.ProgressUtil
;
...
...
app/src/main/java/com/dayu/bigfish/ui/SettingActivity.java
View file @
978834a3
...
...
@@ -10,7 +10,7 @@ import android.widget.TextView;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseActivity
;
import
com.dayu.bigfish.managers.UserManager
;
import
com.dayu.bigfish.
utils.
managers.UserManager
;
import
com.dayu.bigfish.presenter.setting.SettingContract
;
import
com.dayu.bigfish.presenter.setting.SettingPresenter
;
import
com.dayu.bigfish.utils.DataCleanManager
;
...
...
app/src/main/java/com/dayu/bigfish/managers/AppManager.java
→
app/src/main/java/com/dayu/bigfish/
utils/
managers/AppManager.java
View file @
978834a3
package
com
.
dayu
.
bigfish
.
managers
;
package
com
.
dayu
.
bigfish
.
utils
.
managers
;
import
android.app.Activity
;
import
android.app.ActivityManager
;
...
...
app/src/main/java/com/dayu/bigfish/utils/managers/MemoryCacheManager.java
0 → 100755
View file @
978834a3
package
com
.
dayu
.
bigfish
.
utils
.
managers
;
import
android.util.LruCache
;
/**
* Created by luofan on 2017/11/24.
*/
public
class
MemoryCacheManager
{
private
static
class
Holder
{
public
static
final
MemoryCacheManager
instance
=
new
MemoryCacheManager
();
}
public
static
MemoryCacheManager
getInstance
()
{
return
Holder
.
instance
;
}
private
MemoryCacheManager
()
{
}
final
static
int
cacheSize
=
(
int
)
(
Runtime
.
getRuntime
().
maxMemory
()
/
1024
)
/
8
;
static
LruCache
<
String
,
Object
>
mMemoryCache
=
new
LruCache
<
String
,
Object
>(
cacheSize
);
public
static
void
add
(
String
key
,
Object
mObject
)
{
mMemoryCache
.
put
(
key
,
mObject
);
}
public
static
Object
get
(
String
key
)
{
return
mMemoryCache
.
get
(
key
);
}
}
app/src/main/java/com/dayu/bigfish/managers/UserManager.java
→
app/src/main/java/com/dayu/bigfish/
utils/
managers/UserManager.java
View file @
978834a3
package
com
.
dayu
.
bigfish
.
managers
;
package
com
.
dayu
.
bigfish
.
utils
.
managers
;
import
android.content.Context
;
import
android.text.TextUtils
;
...
...
apt/src/main/java/com/app/apt/processor/InstanceProcessor.java
View file @
978834a3
...
...
@@ -65,6 +65,7 @@ public class InstanceProcessor implements IProcessor {
blockBuilder
.
addStatement
(
"case $S: return new $T()"
,
currentType
.
simpleName
(),
currentType
);
//初始化Presenter
// }
}
// methodBuilder1.returns(ClassName.get("com.dayu.bigfish.base","BasePresenter"));
blockBuilder
.
addStatement
(
"default: return mClass.newInstance()"
);
blockBuilder
.
endControlFlow
();
methodBuilder1
.
addCode
(
blockBuilder
.
build
());
...
...
lib/build/libs/lib.jar
View file @
978834a3
No preview for this file type
lib/src/main/java/com/app/annotation/apt/InstanceFactory.java
View file @
978834a3
...
...
@@ -2,7 +2,7 @@ package com.app.annotation.apt;
/**
* Created by
baixiaokang on 16/10/8
.
* Created by
luofan on 2017/11/24
.
*/
import
java.lang.annotation.ElementType
;
...
...
@@ -10,9 +10,6 @@ import java.lang.annotation.Retention;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* Created by luofan on 2017/11/24.
*/
@Retention
(
RetentionPolicy
.
SOURCE
)
@Target
(
ElementType
.
TYPE
)
...
...
settings.gradle
View file @
978834a3
include
':app'
,
':
lib'
,
':apt
'
include
':app'
,
':
apt'
,
':lib
'
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