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
c77f79de
authored
Jan 16, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加kotlin支持
parent
e85544c8
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
62 additions
and
42 deletions
.idea/gradle.xml
app/build.gradle
app/src/main/java/com/dayu/bigfish/Constants.java
app/src/main/java/com/dayu/bigfish/InitializeActivity.java
app/src/main/java/com/dayu/bigfish/presenter/homeorder/HomeOrderContract.java
app/src/main/java/com/dayu/bigfish/presenter/message/messagePresenter.java
app/src/main/java/com/dayu/bigfish/presenter/orderdoing/OrderDoingPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/orderdoing/orderDoingContract.java
app/src/main/java/com/dayu/bigfish/presenter/setting/SettingPresenter.java
build.gradle
gradle/wrapper/gradle-wrapper.properties
.idea/gradle.xml
View file @
c77f79de
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<component
name=
"GradleSettings"
>
<component
name=
"GradleSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
<GradleProjectSettings>
<option
name=
"distributionType"
value=
"
LOCAL
"
/>
<option
name=
"distributionType"
value=
"
DEFAULT_WRAPPED
"
/>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
<option
name=
"gradleHome"
value=
"$APPLICATION_HOME_DIR$/gradle/gradle-4.1"
/>
<option
name=
"gradleHome"
value=
"$APPLICATION_HOME_DIR$/gradle/gradle-4.1"
/>
<option
name=
"modules"
>
<option
name=
"modules"
>
...
...
app/build.gradle
View file @
c77f79de
apply
plugin:
'com.android.application'
apply
plugin:
'com.android.application'
apply
plugin:
'org.greenrobot.greendao'
apply
plugin:
'org.greenrobot.greendao'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-kapt'
apply
plugin:
'kotlin-android-extensions'
android
{
android
{
...
@@ -71,6 +74,9 @@ android {
...
@@ -71,6 +74,9 @@ android {
preDexLibraries
=
false
preDexLibraries
=
false
}
}
}
}
kapt
{
generateStubs
=
true
}
greendao
{
greendao
{
schemaVersion
2
schemaVersion
2
daoPackage
'com.dayu.bigfish.greendao'
daoPackage
'com.dayu.bigfish.greendao'
...
@@ -110,7 +116,10 @@ dependencies {
...
@@ -110,7 +116,10 @@ dependencies {
//jsbridge
//jsbridge
compile
'com.github.lzyzsd:jsbridge:1.0.4'
compile
'com.github.lzyzsd:jsbridge:1.0.4'
annotationProcessor
project
(
':apt'
)
kapt
project
(
':apt'
)
compile
project
(
':annotation_lib'
)
compile
project
(
':annotation_lib'
)
compile
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
kapt
"com.android.databinding:compiler:$gradle_version"
}
}
app/src/main/java/com/dayu/bigfish/Constants.java
View file @
c77f79de
...
@@ -20,20 +20,20 @@ public class Constants {
...
@@ -20,20 +20,20 @@ public class Constants {
public
static
final
String
BASE_COUNT
=
"https://47.94.101.239:7500/"
;
public
static
final
String
BASE_COUNT
=
"https://47.94.101.239:7500/"
;
/***********************测试环境配置**********************************/
/***********************测试环境配置**********************************/
public
static
final
int
DEBUGLEVEL
=
LogUtils
.
LEVEL_ALL
;
//
public static final int DEBUGLEVEL = LogUtils.LEVEL_ALL;
public
static
final
String
BASE_URL
=
"http://47.94.101.239:3112"
;
//
public static final String BASE_URL = "http://47.94.101.239:3112";
public
final
static
String
UP_PHOTO
=
"/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"
;
//
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
public
final
static
String
WEB_SOP
=
"http://47.94.101.239:9004/#/sop"
;
//
public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
public
static
final
boolean
UM_DEBUG
=
true
;
//
public static final boolean UM_DEBUG = true;
// public final static String WEB_SOP = "http://192.168.1.132:8080/#/sop";
// public final static String WEB_SOP = "http://192.168.1.132:8080/#/sop";
/**************************正式环境*******************************/
/**************************正式环境*******************************/
//
public static final int DEBUGLEVEL = LogUtils.LEVEL_OFF;
public
static
final
int
DEBUGLEVEL
=
LogUtils
.
LEVEL_OFF
;
//
public static final String BASE_URL = "https://mobile.dayu.ai";
public
static
final
String
BASE_URL
=
"https://mobile.dayu.ai"
;
//
public final static String UP_PHOTO = "/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply";
public
final
static
String
UP_PHOTO
=
"/file/uploadMore?targetPath=online/sp/mobile/android/business/checkApply"
;
//
public final static String WEB_SOP = "https://sop.kf.ai/#/sop";
public
final
static
String
WEB_SOP
=
"https://sop.kf.ai/#/sop"
;
//
public static final boolean UM_DEBUG = false;
public
static
final
boolean
UM_DEBUG
=
false
;
/*****************/
/*****************/
/**
/**
* 登录.
* 登录.
...
@@ -139,7 +139,7 @@ public class Constants {
...
@@ -139,7 +139,7 @@ public class Constants {
//订单详情
//订单详情
public
final
static
String
ORDER_DETAIL
=
"order_detail"
;
public
final
static
String
ORDER_DETAIL
=
"order_detail"
;
//数据返回失败标识
//数据返回失败标识
public
final
static
int
FAILED
=
1
;
public
final
static
int
FAILED
=
-
1
;
//相册选择照片删除时传递的key
//相册选择照片删除时传递的key
public
final
static
String
BUNDLE_KEY_ID
=
"BUNDLE_KEY_ID"
;
public
final
static
String
BUNDLE_KEY_ID
=
"BUNDLE_KEY_ID"
;
//工程师的账户余额
//工程师的账户余额
...
...
app/src/main/java/com/dayu/bigfish/InitializeActivity.java
View file @
c77f79de
...
@@ -73,13 +73,6 @@ public class InitializeActivity extends AppCompatActivity {
...
@@ -73,13 +73,6 @@ public class InitializeActivity extends AppCompatActivity {
);
);
}
}
@TargetApi
(
23
)
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
MPermissionUtils
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
}
public
void
showPerMissionDialog
()
{
public
void
showPerMissionDialog
()
{
CustomDialog
dialog
=
new
CustomDialog
(
mActivity
,
R
.
style
.
CustomDialog
,
getString
(
R
.
string
.
please_open__permission
)
CustomDialog
dialog
=
new
CustomDialog
(
mActivity
,
R
.
style
.
CustomDialog
,
getString
(
R
.
string
.
please_open__permission
)
,
(
dialog1
,
confirm
)
->
{
,
(
dialog1
,
confirm
)
->
{
...
@@ -121,5 +114,12 @@ public class InitializeActivity extends AppCompatActivity {
...
@@ -121,5 +114,12 @@ public class InitializeActivity extends AppCompatActivity {
mDisposable
.
dispose
();
mDisposable
.
dispose
();
}
}
}
}
@TargetApi
(
23
)
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
MPermissionUtils
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
}
}
}
app/src/main/java/com/dayu/bigfish/presenter/homeorder/HomeOrderContract.java
View file @
c77f79de
...
@@ -15,6 +15,11 @@ public interface HomeOrderContract {
...
@@ -15,6 +15,11 @@ public interface HomeOrderContract {
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
/**
* 获得tab数量.
* @param userId
* @param siteId
*/
public
abstract
void
getTabNum
(
int
userId
,
int
siteId
);
public
abstract
void
getTabNum
(
int
userId
,
int
siteId
);
public
abstract
void
dumpToOrderRecordActivity
();
public
abstract
void
dumpToOrderRecordActivity
();
...
...
app/src/main/java/com/dayu/bigfish/presenter/message/messagePresenter.java
View file @
c77f79de
...
@@ -119,8 +119,4 @@ public class messagePresenter extends messageContract.Presenter {
...
@@ -119,8 +119,4 @@ public class messagePresenter extends messageContract.Presenter {
mActivity
.
startActivity
(
intent
);
mActivity
.
startActivity
(
intent
);
MobclickAgent
.
onEvent
(
MyApplication
.
getContext
(),
"read_message"
);
MobclickAgent
.
onEvent
(
MyApplication
.
getContext
(),
"read_message"
);
}
}
public
int
getmCategory
()
{
return
mCategory
;
}
}
}
app/src/main/java/com/dayu/bigfish/presenter/orderdoing/OrderDoingPresenter.java
View file @
c77f79de
...
@@ -70,24 +70,20 @@ public class OrderDoingPresenter extends orderDoingContract.Presenter {
...
@@ -70,24 +70,20 @@ public class OrderDoingPresenter extends orderDoingContract.Presenter {
@Override
@Override
public
void
getOrders
(
int
state
,
int
userId
,
int
siteId
,
int
page
,
int
pageSize
)
{
public
void
getOrders
(
int
state
,
int
userId
,
int
siteId
,
int
page
,
int
pageSize
)
{
ApiFactory
.
getOrders
(
state
,
userId
,
siteId
,
page
,
pageSize
).
subscribe
(
baseObserver
(
new
Consumer
<
BasePageBean
<
Order
>>()
{
ApiFactory
.
getOrders
(
state
,
userId
,
siteId
,
page
,
pageSize
).
subscribe
(
@Override
baseObserver
((
Consumer
<
BasePageBean
<
Order
>>)
orderBasePageBean
->
{
public
void
accept
(
BasePageBean
<
Order
>
orderBasePageBean
)
throws
Exception
{
datas
.
set
(
orderBasePageBean
);
datas
.
set
(
orderBasePageBean
);
mPage
++;
mPage
++;
EventBus
.
getDefault
().
post
(
new
RefreshTab
(-
1
));
EventBus
.
getDefault
().
post
(
new
RefreshTab
(-
1
));
}
},
responeThrowable
->
datas
.
set
(
Constants
.
FAILED
)));
},
responeThrowable
->
datas
.
set
(
Constants
.
FAILED
)));
}
}
@Override
@Override
public
void
getErrorOrder
()
{
public
void
getErrorOrder
()
{
ApiFactory
.
getErrorOrders
(
mUserId
,
mSiteId
).
subscribe
(
baseObserver
(
new
Consumer
<
List
<
ErrorOrder
>>()
{
ApiFactory
.
getErrorOrders
(
mUserId
,
mSiteId
).
subscribe
(
@Override
baseObserver
((
Consumer
<
List
<
ErrorOrder
>>)
errorOrder
->
{
public
void
accept
(
List
<
ErrorOrder
>
errorOrder
)
throws
Exception
{
datas
.
set
(
errorOrder
);
datas
.
set
(
errorOrder
);
EventBus
.
getDefault
().
post
(
new
RefreshTab
(-
1
));
EventBus
.
getDefault
().
post
(
new
RefreshTab
(-
1
));
}
},
responeThrowable
->
datas
.
set
(
Constants
.
FAILED
)));
},
responeThrowable
->
datas
.
set
(
Constants
.
FAILED
)));
}
}
...
...
app/src/main/java/com/dayu/bigfish/presenter/orderdoing/orderDoingContract.java
View file @
c77f79de
...
@@ -22,10 +22,27 @@ public interface orderDoingContract {
...
@@ -22,10 +22,27 @@ public interface orderDoingContract {
abstract
class
Presenter
extends
BaseOrderPresenter
<
View
>
{
abstract
class
Presenter
extends
BaseOrderPresenter
<
View
>
{
/**
* 获取异常订单.
*/
public
abstract
void
getErrorOrder
();
public
abstract
void
getErrorOrder
();
/**
* 开始出发.
* @param orderId
* @param latitude
* @param longitude
* @return
*/
public
abstract
Observable
<
Integer
>
startOrder
(
int
orderId
,
double
latitude
,
double
longitude
);
public
abstract
Observable
<
Integer
>
startOrder
(
int
orderId
,
double
latitude
,
double
longitude
);
/**
* 开始服务.
* @param orderId
* @param latitude
* @param longitude
* @return
*/
public
abstract
Observable
<
Integer
>
startServer
(
int
orderId
,
double
latitude
,
double
longitude
);
public
abstract
Observable
<
Integer
>
startServer
(
int
orderId
,
double
latitude
,
double
longitude
);
}
}
...
...
app/src/main/java/com/dayu/bigfish/presenter/setting/SettingPresenter.java
View file @
c77f79de
package
com
.
dayu
.
bigfish
.
presenter
.
setting
;
package
com
.
dayu
.
bigfish
.
presenter
.
setting
;
import
android.app.Dialog
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.databinding.ObservableBoolean
;
import
android.databinding.ObservableBoolean
;
import
android.net.Uri
;
import
android.net.Uri
;
...
@@ -16,7 +15,6 @@ import com.dayu.bigfish.bean.UserInfo;
...
@@ -16,7 +15,6 @@ import com.dayu.bigfish.bean.UserInfo;
import
com.dayu.bigfish.ui.AboutUsActivity
;
import
com.dayu.bigfish.ui.AboutUsActivity
;
import
com.dayu.bigfish.ui.FeedBackActivity
;
import
com.dayu.bigfish.ui.FeedBackActivity
;
import
com.dayu.bigfish.ui.LoginActivity
;
import
com.dayu.bigfish.ui.LoginActivity
;
import
com.dayu.bigfish.ui.views.CustomDialog
;
import
com.dayu.bigfish.utils.AppUtils
;
import
com.dayu.bigfish.utils.AppUtils
;
import
com.dayu.bigfish.utils.DataCleanManager
;
import
com.dayu.bigfish.utils.DataCleanManager
;
import
com.dayu.bigfish.utils.SPUtils
;
import
com.dayu.bigfish.utils.SPUtils
;
...
@@ -103,9 +101,7 @@ public class SettingPresenter extends SettingContract.Presenter {
...
@@ -103,9 +101,7 @@ public class SettingPresenter extends SettingContract.Presenter {
@Override
@Override
public
void
clearCach
()
{
public
void
clearCach
()
{
mView
.
showCachDialog
(
new
CustomDialog
.
OnCloseListener
()
{
mView
.
showCachDialog
((
dialog
,
confirm
)
->
{
@Override
public
void
onClick
(
Dialog
dialog
,
boolean
confirm
)
{
if
(
confirm
)
{
if
(
confirm
)
{
mView
.
showDialog
(
mActivity
.
getString
(
R
.
string
.
on_clear
));
mView
.
showDialog
(
mActivity
.
getString
(
R
.
string
.
on_clear
));
Observable
.
timer
(
2
,
TimeUnit
.
SECONDS
).
subscribe
(
Observable
.
timer
(
2
,
TimeUnit
.
SECONDS
).
subscribe
(
...
@@ -115,7 +111,6 @@ public class SettingPresenter extends SettingContract.Presenter {
...
@@ -115,7 +111,6 @@ public class SettingPresenter extends SettingContract.Presenter {
});
});
DataCleanManager
.
deleteFolderFile
(
Environment
.
getExternalStorageDirectory
()
+
"/Android/data/com.dayu.bigfish/cache"
,
false
);
DataCleanManager
.
deleteFolderFile
(
Environment
.
getExternalStorageDirectory
()
+
"/Android/data/com.dayu.bigfish/cache"
,
false
);
}
}
}
});
});
MobclickAgent
.
onEvent
(
mActivity
,
"clear_cach"
);
MobclickAgent
.
onEvent
(
mActivity
,
"clear_cach"
);
}
}
...
...
build.gradle
View file @
c77f79de
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
buildscript
{
ext
.
kotlin_version
=
'1.2.10'
ext
.
gradle_version
=
'3.0.1'
repositories
{
repositories
{
jcenter
()
jcenter
()
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools.build:gradle:3.0.1'
classpath
"com.android.tools.build:gradle:$gradle_version"
classpath
'org.greenrobot:greendao-gradle-plugin:3.2.0'
classpath
'org.greenrobot:greendao-gradle-plugin:3.2.0'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// in the individual module build.gradle files
}
}
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
c77f79de
#
Fri Nov 17 09:40:30 CST 2017
#
Tue Jan 16 09:59:38 CST 2018
distributionBase
=
GRADLE_USER_HOME
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.4-all.zip
\ No newline at end of file
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