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
797d7c78
Commit
797d7c78
authored
Mar 01, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加短信登录
parent
712f7425
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
107 additions
and
2 deletions
+107
-2
src/main/java/com/common/bean/DisplayBean.java
+3
-0
src/main/java/com/common/widget/CountDownButton.java
+94
-0
src/main/java/tech/starwin/impl/OnNoShakeClickListener.java
+0
-1
src/main/java/tech/starwin/mvp/api/LoanApi.java
+1
-1
src/main/java/tech/starwin/mvp/presenter/UserPresenter.java
+9
-0
No files found.
src/main/java/com/common/bean/DisplayBean.java
View file @
797d7c78
...
@@ -6,6 +6,9 @@ import java.io.Serializable;
...
@@ -6,6 +6,9 @@ import java.io.Serializable;
* Created by SiKang on 2018/9/30.
* Created by SiKang on 2018/9/30.
*/
*/
public
class
DisplayBean
implements
Serializable
{
public
class
DisplayBean
implements
Serializable
{
public
static
final
String
ACCOUNTKIT
=
"ACCOUNTKIT"
;
public
static
final
String
SMS
=
"SMS"
;
private
String
description
;
private
String
description
;
private
String
customerMobile
;
private
String
customerMobile
;
//登录方式 SMS:短信登录
//登录方式 SMS:短信登录
...
...
src/main/java/com/common/widget/CountDownButton.java
0 → 100644
View file @
797d7c78
package
com
.
common
.
widget
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.widget.Button
;
import
java.util.Timer
;
import
java.util.TimerTask
;
/**
* Created by SiKang on 2019/3/1.
*/
@SuppressLint
(
"AppCompatCustomView"
)
public
class
CountDownButton
extends
Button
{
private
Timer
mTimer
;
private
OnCountDownListener
onCountDownListener
;
public
CountDownButton
(
Context
context
)
{
super
(
context
);
}
public
CountDownButton
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
/**
* 开始计时
*/
public
void
startCountDown
(
int
count
,
int
period
,
OnCountDownListener
listener
)
{
stop
();
setEnabled
(
false
);
this
.
onCountDownListener
=
listener
;
mTimer
=
new
Timer
();
mTimer
.
schedule
(
new
CountDownTask
(
count
),
0
,
period
);
}
/**
* 取消计时
*/
public
void
stop
()
{
if
(
mTimer
!=
null
)
{
mTimer
.
cancel
();
mTimer
=
null
;
}
if
(
onCountDownListener
!=
null
)
{
onCountDownListener
.
onFinish
();
onCountDownListener
=
null
;
}
setEnabled
(
true
);
}
/**
* 倒计时
*/
class
CountDownTask
extends
TimerTask
{
private
int
count
=
0
;
public
CountDownTask
(
int
count
)
{
this
.
count
=
count
;
}
@Override
public
void
run
()
{
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
count
--;
if
(
onCountDownListener
!=
null
)
{
onCountDownListener
.
onCountDown
(
count
);
}
if
(
count
<=
0
)
{
stop
();
}
}
});
}
}
/**
* 计时回调
*/
public
interface
OnCountDownListener
{
void
onCountDown
(
int
index
);
void
onFinish
();
}
}
src/main/java/tech/starwin/impl/OnNoShakeClickListener.java
View file @
797d7c78
...
@@ -28,7 +28,6 @@ public abstract class OnNoShakeClickListener extends OnEventClickListener {
...
@@ -28,7 +28,6 @@ public abstract class OnNoShakeClickListener extends OnEventClickListener {
v
.
setClickable
(
true
);
v
.
setClickable
(
true
);
}
}
},
lockTime
);
},
lockTime
);
onEventClick
(
v
);
}
}
}
}
src/main/java/tech/starwin/mvp/api/LoanApi.java
View file @
797d7c78
...
@@ -71,7 +71,7 @@ public interface LoanApi {
...
@@ -71,7 +71,7 @@ public interface LoanApi {
* 取消贷款
* 取消贷款
*/
*/
@FormUrlEncoded
@FormUrlEncoded
@POST
(
"loanapp/
cancel
"
)
@POST
(
"loanapp/
stop
"
)
Observable
<
ResponseBody
>
cancelLoan
(
@Field
(
"loanAppId"
)
String
loanAppId
,
Observable
<
ResponseBody
>
cancelLoan
(
@Field
(
"loanAppId"
)
String
loanAppId
,
@Header
(
"X-AUTH-TOKEN"
)
String
token
);
@Header
(
"X-AUTH-TOKEN"
)
String
token
);
...
...
src/main/java/tech/starwin/mvp/presenter/UserPresenter.java
View file @
797d7c78
...
@@ -83,10 +83,19 @@ public class UserPresenter extends BasePresenter<UserApi> {
...
@@ -83,10 +83,19 @@ public class UserPresenter extends BasePresenter<UserApi> {
public
void
accept
(
GatewayInfoBean
gatewayInfoBean
)
throws
Exception
{
public
void
accept
(
GatewayInfoBean
gatewayInfoBean
)
throws
Exception
{
Gateway
.
setGatewayInfoBean
(
gatewayInfoBean
);
Gateway
.
setGatewayInfoBean
(
gatewayInfoBean
);
EventBus
.
getDefault
().
post
(
ActionEnum
.
GATEWAY_UPDATED
);
EventBus
.
getDefault
().
post
(
ActionEnum
.
GATEWAY_UPDATED
);
getCustomerMsg
(
"action_getCustomerMsg"
);
}
}
});
});
}
}
/**
* 发送短信
*/
public
void
sendSms
(
String
action
,
String
mobile
)
{
handleRequest
(
action
,
apiService
.
sendSms
(
mobile
));
}
/**
/**
* 登录
* 登录
* (登录失败超过两次需要生成图像验证码)
* (登录失败超过两次需要生成图像验证码)
...
...
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