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
3c713327
Commit
3c713327
authored
Oct 30, 2018
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPDATE
parent
8740170d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
1225 additions
and
80 deletions
+1225
-80
build.gradle
+10
-0
libs/android_shujumohe_sdk_beta_20180907_1.0.8.2.aar
+0
-0
proguard-rules.pro
+306
-0
src/main/AndroidManifest.xml
+11
-0
src/main/java/tech/starwin/LibConfig.java
+15
-5
src/main/java/tech/starwin/base/BaseActivity.java
+37
-11
src/main/java/tech/starwin/base/BaseFragment.java
+5
-0
src/main/java/tech/starwin/mvp/api/LoanApi.java
+10
-2
src/main/java/tech/starwin/mvp/beans/PersonalInfoServerBean.java
+5
-4
src/main/java/tech/starwin/mvp/beans/ProductBean.java
+19
-0
src/main/java/tech/starwin/mvp/presenter/LoanPresenter.java
+7
-0
src/main/java/tech/starwin/mvp/presenter/UserPresenter.java
+2
-0
src/main/java/tech/starwin/mvp/ui/fragment/RegionFragment.java
+9
-6
src/main/java/tech/starwin/utils/BitmapUtils.java
+11
-0
src/main/java/tech/starwin/utils/DataFormat.java
+4
-1
src/main/java/tech/starwin/utils/FileUtils.java
+12
-0
src/main/java/tech/starwin/utils/InfoTranslator.java
+203
-0
src/main/java/tech/starwin/utils/PreferencesManager.java
+23
-20
src/main/java/tech/starwin/utils/TDChannelCode.java
+22
-0
src/main/java/tech/starwin/utils/context_utils/ActivityJumper.java
+1
-1
src/main/java/tech/starwin/utils/context_utils/PermissionsHelper.java
+108
-22
src/main/java/tech/starwin/utils/ui_utils/DialogFactory.java
+3
-1
src/main/java/tech/starwin/utils/ui_utils/QMUIHelper.java
+18
-0
src/main/java/tech/starwin/utils/ui_utils/UIHelper.java
+7
-6
src/main/java/tech/starwin/widget/SpanButton.java
+105
-0
src/main/java/tech/starwin/widget/TitleSpan.java
+67
-0
src/main/res/drawable/style_grayborder_round.xml
+9
-0
src/main/res/drawable/style_graysolid_round.xml
+7
-0
src/main/res/drawable/style_mainsolid_round.xml
+7
-0
src/main/res/layout/base_activity_drawer.xml
+2
-1
src/main/res/layout/fragment_region.xml
+1
-0
src/main/res/values-en-rUS/strings.xml
+0
-0
src/main/res/values-zh-rCN/strings.xml
+0
-0
src/main/res/values/colors.xml
+4
-0
src/main/res/values/strings.xml
+0
-0
src/main/res/values/styles.xml
+175
-0
No files found.
build.gradle
View file @
3c713327
...
...
@@ -25,6 +25,12 @@ android {
jniLibs
.
srcDirs
=
[
'libs'
]
}
}
repositories
{
flatDir
{
dirs
'libs'
}
}
}
dependencies
{
...
...
@@ -39,6 +45,10 @@ dependencies {
api
"com.android.support:support-v4:$rootProject.ext.supportLibraryVersion"
api
"com.android.support:recyclerview-v7:$rootProject.ext.supportLibraryVersion"
//同盾
api
(
name:
'android_shujumohe_sdk_beta_20180907_1.0.8.2'
,
ext:
'aar'
)
api
'com.alibaba:fastjson:1.1.58.android'
//QMUI
api
'com.qmuiteam:qmui:1.1.3'
...
...
libs/android_shujumohe_sdk_beta_20180907_1.0.8.2.aar
0 → 100644
View file @
3c713327
File added
proguard-rules.pro
View file @
3c713327
...
...
@@ -418,3 +418,308 @@
-keep class com.fasterxml.jackson.databind.
*
* { *; }
-dontwarn org.codehaus.jackson.
*
*
-keep class org.codehaus.jackson.
*
* { *; }
#同盾
-dontoptimize
-dontusemixedcaseclassnames
-verbose
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontwarn dalvik.
*
*
-dontwarn com.tencent.smtt.
*
*
#-overloadaggressively
# --------------------------------------------------------------------------
# Addidional for x5.sdk classes for apps
-keep class com.tencent.smtt.export.external.
*
*{
*;
}
-keep class com.tencent.tbs.video.interfaces.IUserStateChangedListener {
*;
}
-keep class com.tencent.smtt.sdk.CacheManager {
public *;
}
-keep class com.tencent.smtt.sdk.CookieManager {
public *;
}
-keep class com.tencent.smtt.sdk.WebHistoryItem {
public *;
}
-keep class com.tencent.smtt.sdk.WebViewDatabase {
public *;
}
-keep class com.tencent.smtt.sdk.WebBackForwardList {
public *;
}
-keep public class com.tencent.smtt.sdk.WebView {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.WebView$HitTestResult {
public static final <fields>;
public java.lang.String getExtra();
public int getType();
}
-keep public class com.tencent.smtt.sdk.WebView$WebViewTransport {
public <methods>;
}
-keep public class com.tencent.smtt.sdk.WebView$PictureListener {
public <fields>;
public <methods>;
}
-keepattributes InnerClasses
-keep public enum com.tencent.smtt.sdk.WebSettings$
*
* {
*;
}
-keep public enum com.tencent.smtt.sdk.QbSdk$
*
* {
*;
}
-keep public class com.tencent.smtt.sdk.WebSettings {
public *;
}
-keepattributes Signature
-keep public class com.tencent.smtt.sdk.ValueCallback {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.WebViewClient {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.DownloadListener {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.WebChromeClient {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.WebChromeClient$FileChooserParams {
public <fields>;
public <methods>;
}
-keep class com.tencent.smtt.sdk.SystemWebChromeClient{
public *;
}
# 1. extension interfaces should be apparent
-keep public class com.tencent.smtt.export.external.extension.interfaces.* {
public protected *;
}
# 2. interfaces should be apparent
-keep public class com.tencent.smtt.export.external.interfaces.* {
public protected *;
}
-keep public class com.tencent.smtt.sdk.WebViewCallbackClient {
public protected *;
}
-keep public class com.tencent.smtt.sdk.WebStorage$QuotaUpdater {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.WebIconDatabase {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.WebStorage {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.DownloadListener {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.QbSdk {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.QbSdk$PreInitCallback {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.CookieSyncManager {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.Tbs* {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.utils.LogFileUtils {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.utils.TbsLog {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.utils.TbsLogClient {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.CookieSyncManager {
public <fields>;
public <methods>;
}
# Added for game demos
-keep public class com.tencent.smtt.sdk.TBSGamePlayer {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.TBSGamePlayerClient* {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.TBSGamePlayerClientExtension {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.TBSGamePlayerService* {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.utils.Apn {
public <fields>;
public <methods>;
}
-keep class com.tencent.smtt.
*
* {
*;
}
# end
-keep public class com.tencent.smtt.export.external.extension.proxy.ProxyWebViewClientExtension {
public <fields>;
public <methods>;
}
-keep class MTT.ThirdAppInfoNew {
*;
}
-keep class com.tencent.mtt.MttTraceEvent {
*;
}
# Game related
-keep public class com.tencent.smtt.gamesdk.* {
public protected *;
}
-keep public class com.tencent.smtt.sdk.TBSGameBooter {
public <fields>;
public <methods>;
}
-keep public class com.tencent.smtt.sdk.TBSGameBaseActivity {
public protected *;
}
-keep public class com.tencent.smtt.sdk.TBSGameBaseActivityProxy {
public protected *;
}
-keep public class com.tencent.smtt.gamesdk.internal.TBSGameServiceClient {
public *;
}
#---------------------------------------------------------------------------
#------------------ 下方是android平台自带的排除项,这里不要动 ----------------
-keep public class * extends android.app.Activity{
public <fields>;
public <methods>;
}
-keep public class * extends android.app.Application{
public <fields>;
public <methods>;
}
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keepclassmembers enum * {
public static
*
*[] values();
public static
*
* valueOf(java.lang.String);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepattributes *Annotation*
-keepclasseswithmembernames class *{
native <methods>;
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
#------------------ 下方是共性的排除项目 ----------------
# 方法名中含有“JNI”字符的,认定是Java Native Interface方法,自动排除
# 方法名中含有“JRI”字符的,认定是Java Reflection Interface方法,自动排除
-keepclasseswithmembers class * {
... *JNI*(...);
}
-keepclasseswithmembernames class * {
... *JRI*(...);
}
-keep class
*
*JNI* {*;}
-keep class com.alibaba.fastjson.
*
* { *; }
-dontwarn com.alibaba.fastjson.
*
*
-keep class cn.fraudmetrix.octopus.aspirit.bean.
*
* { *; }
\ No newline at end of file
src/main/AndroidManifest.xml
View file @
3c713327
...
...
@@ -55,7 +55,17 @@
<uses-permission
android:name=
"android.permission.VIBRATE"
/>
<!--读取系统设置-->
<uses-permission
android:name=
"android.permission.READ_SETTINGS"
/>
<!-- 网络定位-->
<permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
<!-- GPS定位-->
<permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.RECORD_VIDEO"
/>
<uses-permission
android:name=
"android.permission.RECORD_AUDIO"
/>
<uses-feature
android:name=
"android.hardware.camera"
/>
<uses-feature
android:name=
"android.hardware.camera.autofocus"
/>
<application>
<!--适应全面屏-->
...
...
@@ -92,6 +102,7 @@
<meta-data
android:name=
"com.facebook.accountkit.ClientToken"
android:value=
"@string/ACCOUNT_KIT_CLIENT_TOKEN"
/>
<activity
android:name=
"com.facebook.accountkit.ui.AccountKitActivity"
android:screenOrientation=
"portrait"
/>
...
...
src/main/java/tech/starwin/LibConfig.java
View file @
3c713327
...
...
@@ -17,6 +17,7 @@ import com.scwang.smartrefresh.layout.header.ClassicsHeader;
import
com.tencent.bugly.crashreport.CrashReport
;
import
cn.fraudmetrix.octopus.aspirit.main.OctopusManager
;
import
tech.starwin.network.Gateway
;
import
tech.starwin.utils.FireBaseHelper
;
import
tech.starwin.utils.PreferencesManager
;
...
...
@@ -34,7 +35,7 @@ public class LibConfig {
/**
* 存储 App Module的 BuildConfig 数据
*
*
/
*/
private
static
Context
CONTEXT
;
public
static
boolean
DEBUG
;
public
static
String
APPLICATION_ID
;
...
...
@@ -60,9 +61,12 @@ public class LibConfig {
public
static
String
ZENDESK_URL
;
public
static
String
ZENDESK_APP_ID
;
public
static
String
ZENDESK_OAUTH_CLIENT_ID
;
public
static
String
TONGDUN_PARENT_CODE
;
public
static
String
TONGDUN_PARENT_KEY
;
public
static
int
HARVESTER_PORT
;
public
static
int
LOADING_ICON
;
//loading图标
public
static
int
LOADING_BACKGROUND
;
//loading旋转背景
public
static
int
HARVESTER_PORT
;
public
static
int
MAIN_COLOR
;
//主题色
public
static
ButterKnifeBinder
butterKnifeBinder
;
...
...
@@ -100,8 +104,14 @@ public class LibConfig {
//init zendesk
Zendesk
.
INSTANCE
.
init
(
application
,
ZENDESK_URL
,
ZENDESK_APP_ID
,
ZENDESK_OAUTH_CLIENT_ID
);
Support
.
INSTANCE
.
init
(
Zendesk
.
INSTANCE
);
//匿名
Zendesk
.
INSTANCE
.
setIdentity
(
new
AnonymousIdentity
());
Zendesk
.
INSTANCE
.
setIdentity
(
new
AnonymousIdentity
());
//匿名身份
//同盾
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
);
OctopusManager
.
getInstance
().
setStatusBarBg
(
MAIN_COLOR
);
}
}
...
...
@@ -142,7 +152,7 @@ public class LibConfig {
SmartRefreshLayout
.
setDefaultRefreshHeaderCreator
(
new
DefaultRefreshHeaderCreator
()
{
@Override
public
RefreshHeader
createRefreshHeader
(
Context
context
,
RefreshLayout
layout
)
{
layout
.
setPrimaryColorsId
(
R
.
color
.
color_main
,
android
.
R
.
color
.
white
);
//全局设置主题颜色
layout
.
setPrimaryColorsId
(
R
.
color
.
qmui_config_color_gray_9
,
R
.
color
.
qmui_config_color_50_pure_black
);
//全局设置主题颜色
return
new
ClassicsHeader
(
context
);
//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header
}
});
...
...
src/main/java/tech/starwin/base/BaseActivity.java
View file @
3c713327
...
...
@@ -73,6 +73,7 @@ public abstract class BaseActivity extends AppCompatActivity implements IView {
private
final
BehaviorSubject
<
ActivityEvent
>
lifecycleSubject
=
BehaviorSubject
.
create
();
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -97,6 +98,10 @@ public abstract class BaseActivity extends AppCompatActivity implements IView {
lifecycleSubject
.
onNext
(
ActivityEvent
.
START
);
}
public
ViewGroup
getContentView
()
{
return
rootLayout
;
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
...
...
@@ -184,6 +189,7 @@ public abstract class BaseActivity extends AppCompatActivity implements IView {
drawerLayout
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
base_activity_drawer
,
rootLayout
,
true
).
findViewById
(
R
.
id
.
root_drawer_layout
);
FrameLayout
content
=
drawerLayout
.
findViewById
(
R
.
id
.
root_content
);
FrameLayout
drawer
=
drawerLayout
.
findViewById
(
R
.
id
.
root_drawer
);
drawer
.
setClickable
(
true
);
LayoutInflater
.
from
(
this
).
inflate
(
bindLayout
(),
content
,
true
);
LayoutInflater
.
from
(
this
).
inflate
(
bindDrawerLayout
(),
drawer
,
true
);
}
else
{
...
...
@@ -235,6 +241,12 @@ public abstract class BaseActivity extends AppCompatActivity implements IView {
});
}
public
void
setTopBarTitle
(
String
title
)
{
if
(
title
!=
null
&&
mTopBar
!=
null
)
{
mTopBar
.
setTitle
(
title
);
}
}
@IdRes
public
int
bindFragmentLayout
()
{
return
0
;
...
...
@@ -247,24 +259,23 @@ public abstract class BaseActivity extends AppCompatActivity implements IView {
return
fragmentLauncher
;
}
/**
* 左侧打开抽屉
*/
public
void
openDrawerLeft
()
{
if
(
drawerLayout
!=
null
)
{
public
boolean
isDrawerOpen
()
{
return
drawerLayout
.
isDrawerOpen
(
Gravity
.
LEFT
);
}
public
void
openDrawer
()
{
if
(
drawerLayout
!=
null
&&
!
drawerLayout
.
isDrawerOpen
(
Gravity
.
LEFT
))
{
drawerLayout
.
openDrawer
(
Gravity
.
LEFT
);
}
}
/**
* 右侧打开抽屉
*/
public
void
openDrawerRight
()
{
if
(
drawerLayout
!=
null
)
{
drawerLayout
.
openDrawer
(
Gravity
.
RIGHT
);
public
void
closeDrawer
()
{
if
(
drawerLayout
!=
null
&&
drawerLayout
.
isDrawerOpen
(
Gravity
.
LEFT
))
{
drawerLayout
.
closeDrawer
(
Gravity
.
LEFT
);
}
}
//----------------------------------- Presenter ----------------------------------------
/**
...
...
@@ -308,4 +319,19 @@ public abstract class BaseActivity extends AppCompatActivity implements IView {
}
}
public
void
pendingTransition
()
{
overridePendingTransition
(
R
.
anim
.
slide_in_left
,
R
.
anim
.
slide_out_right
);
}
@Override
public
void
finish
()
{
super
.
finish
();
pendingTransition
();
}
@Override
public
void
onBackPressed
()
{
super
.
onBackPressed
();
pendingTransition
();
}
}
src/main/java/tech/starwin/base/BaseFragment.java
View file @
3c713327
...
...
@@ -2,6 +2,7 @@ package tech.starwin.base;
import
android.os.Bundle
;
import
android.support.annotation.CheckResult
;
import
android.support.annotation.IdRes
;
import
android.support.annotation.LayoutRes
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
...
...
@@ -170,6 +171,10 @@ public abstract class BaseFragment extends Fragment implements IView {
presenterHelper
.
onDestory
();
}
public
View
findViewById
(
@IdRes
int
id
){
return
mContentView
.
findViewById
(
id
);
}
@Override
@NonNull
@CheckResult
...
...
src/main/java/tech/starwin/mvp/api/LoanApi.java
View file @
3c713327
...
...
@@ -21,6 +21,7 @@ import tech.starwin.mvp.beans.DepositResponseBean;
import
tech.starwin.mvp.beans.HistoryLoanAppInfoBean
;
import
tech.starwin.mvp.beans.LatestLoanAppBean
;
import
tech.starwin.mvp.beans.LoanRange
;
import
tech.starwin.mvp.beans.LoaningAmoutBean
;
import
tech.starwin.mvp.beans.ProductBean
;
import
tech.starwin.mvp.beans.ProgressBean
;
import
tech.starwin.mvp.beans.ResponseErrorBody
;
...
...
@@ -69,6 +70,15 @@ public interface LoanApi {
@Header
(
"X-AUTH-TOKEN"
)
String
token
);
/**
* 贷款详情
*/
@GET
(
"loanapp/repayment-amount-detail"
)
Observable
<
LoaningAmoutBean
>
getLoanAmoutData
(
@Query
(
"principal"
)
double
amount
,
@Query
(
"period"
)
int
day
,
@Query
(
"periodUnit"
)
String
periodUnit
,
@Query
(
"productId"
)
long
productId
);
/**
* 我的贷款记录
*/
@GET
(
"loanapp/all/v2"
)
...
...
@@ -114,6 +124,4 @@ public interface LoanApi {
@Query
(
"couponId"
)
long
couponId
,
@Header
(
"X-AUTH-TOKEN"
)
String
token
);
}
src/main/java/tech/starwin/mvp/beans/PersonalInfoServerBean.java
View file @
3c713327
...
...
@@ -43,10 +43,11 @@ public class PersonalInfoServerBean implements Serializable {
public
String
getRegion
()
{
StringBuffer
buffer
=
new
StringBuffer
();
buffer
.
append
(
province
+
" "
);
buffer
.
append
(
city
+
" "
);
buffer
.
append
(
district
+
" "
);
buffer
.
append
(
area
);
buffer
.
append
(
province
==
null
?
""
:
province
+
" "
);
buffer
.
append
(
city
==
null
?
""
:
city
+
" "
);
buffer
.
append
(
district
==
null
?
""
:
district
+
" "
);
buffer
.
append
(
area
==
null
?
""
:
area
);
return
buffer
.
toString
();
}
...
...
src/main/java/tech/starwin/mvp/beans/ProductBean.java
View file @
3c713327
...
...
@@ -28,6 +28,25 @@ public class ProductBean implements Serializable {
private
String
certProgress
=
""
;
private
boolean
choose
;
private
double
checkedAmount
;
private
int
checkedPeriod
;
public
double
getCheckedAmount
()
{
return
checkedAmount
;
}
public
void
setCheckedAmount
(
double
checkedAmount
)
{
this
.
checkedAmount
=
checkedAmount
;
}
public
int
getCheckedPeriod
()
{
return
checkedPeriod
;
}
public
void
setCheckedPeriod
(
int
checkedPeriod
)
{
this
.
checkedPeriod
=
checkedPeriod
;
}
public
Double
getInterestRate
()
{
return
interestRate
;
...
...
src/main/java/tech/starwin/mvp/presenter/LoanPresenter.java
View file @
3c713327
...
...
@@ -6,6 +6,7 @@ import android.text.TextUtils;
import
tech.starwin.base.BasePresenter
;
import
tech.starwin.mvp.api.LoanApi
;
import
tech.starwin.mvp.beans.LatestLoanAppBean
;
import
tech.starwin.mvp.beans.ProductBean
;
import
tech.starwin.utils.LoginManager
;
/**
...
...
@@ -37,6 +38,12 @@ public class LoanPresenter extends BasePresenter<LoanApi> {
handleRequest
(
action
,
apiService
.
getCertifyProgress
(
LoginManager
.
get
().
getToken
()));
}
/**
* 获取贷款详情
*/
public
void
getLoanDetail
(
String
action
,
ProductBean
productBean
)
{
handleRequest
(
action
,
apiService
.
getLoanAmoutData
(
productBean
.
getCheckedAmount
(),
productBean
.
getCheckedPeriod
(),
productBean
.
getPeriodUnit
(),
productBean
.
getId
()));
}
/**
* 获取最新的贷款申请信息
...
...
src/main/java/tech/starwin/mvp/presenter/UserPresenter.java
View file @
3c713327
...
...
@@ -15,6 +15,7 @@ import io.reactivex.functions.Function;
import
io.reactivex.functions.Function4
;
import
io.reactivex.functions.Predicate
;
import
okhttp3.ResponseBody
;
import
retrofit2.http.Query
;
import
tech.starwin.base.BasePresenter
;
import
tech.starwin.impl.HttpObserver
;
import
tech.starwin.mvp.api.LoanApi
;
...
...
@@ -183,6 +184,7 @@ public class UserPresenter extends BasePresenter<UserApi> {
});
}
public
void
getBankAndLoanAmout
(
String
action
,
LatestLoanAppBean
loanBean
)
{
Observable
<
LoanInfo
>
observable
=
Observable
.
zip
(
getService
(
LoanApi
.
class
).
getLatestLoanApp
(
LoginManager
.
get
().
getToken
()),
...
...
src/main/java/tech/starwin/mvp/ui/fragment/RegionFragment.java
View file @
3c713327
...
...
@@ -37,14 +37,17 @@ public class RegionFragment extends BaseFragment {
* 当前选好的地址
*/
public
static
class
RegionInfo
implements
Serializable
{
public
String
province
=
""
;
public
String
city
=
""
;
public
String
district
=
""
;
public
String
area
=
""
;
public
String
province
;
public
String
city
;
public
String
district
;
public
String
area
;
@Override
public
String
toString
()
{
return
province
+
" "
+
city
+
" "
+
district
+
" "
+
area
;
return
(
province
==
null
?
""
:
province
)
+
" "
+
(
city
==
null
?
""
:
city
)
+
" "
+
(
district
==
null
?
""
:
district
)
+
" "
+
(
district
==
null
?
""
:
district
);
}
}
...
...
@@ -148,7 +151,7 @@ public class RegionFragment extends BaseFragment {
//下一级
RegionFragment
fragment
=
create
(
regionsBean
);
fragment
.
getArguments
().
putSerializable
(
"region_info"
,
regionInfo
);
startFragmentAndDestroyCurrent
(
fragment
,
true
);
startFragmentAndDestroyCurrent
(
fragment
,
true
);
}
});
}
...
...
src/main/java/tech/starwin/utils/BitmapUtils.java
View file @
3c713327
...
...
@@ -3,6 +3,8 @@ package tech.starwin.utils;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.Matrix
;
import
android.graphics.drawable.BitmapDrawable
;
import
android.graphics.drawable.Drawable
;
import
android.media.ExifInterface
;
import
java.io.ByteArrayInputStream
;
...
...
@@ -256,4 +258,13 @@ public class BitmapUtils {
return
result
.
get
();
}
/**
* Drawable转Bitmap
*/
public
static
Bitmap
drawableToBmp
(
Drawable
drawable
)
{
BitmapDrawable
bitmapDrawable
=
(
BitmapDrawable
)
drawable
;
return
bitmapDrawable
.
getBitmap
();
}
}
src/main/java/tech/starwin/utils/DataFormat.java
View file @
3c713327
...
...
@@ -68,7 +68,7 @@ public class DataFormat {
days
=
days
%
365
;
}
if
(
days
>
30
)
{
if
(
days
>
30
)
{
int
month
=
days
/
30
;
result
.
append
(
month
+
context
.
getString
(
R
.
string
.
months
));
days
=
days
&
30
;
...
...
@@ -83,6 +83,9 @@ public class DataFormat {
* 序列化对象
*/
public
static
String
fromBean
(
Object
obj
)
{
if
(
obj
==
null
)
{
return
""
;
}
try
{
ByteArrayOutputStream
byteArrayOutputStream
=
new
ByteArrayOutputStream
();
ObjectOutputStream
objectOutputStream
=
null
;
...
...
src/main/java/tech/starwin/utils/FileUtils.java
View file @
3c713327
...
...
@@ -20,6 +20,7 @@ import tech.starwin.LibConfig;
* Created by SiKang on 2018/9/25.
*/
public
class
FileUtils
{
public
static
String
IMAGE_CACHE
=
"/image_cache"
;
/**
* 判断sd卡是否存在
...
...
@@ -58,6 +59,17 @@ public class FileUtils {
}
/**
* 创建图片文件
*/
public
static
File
getImageFile
(
Context
context
,
String
fileName
)
{
File
file
=
new
File
(
getAppDir
(
context
).
getAbsoluteFile
()
+
IMAGE_CACHE
);
if
(!
file
.
exists
())
{
file
.
mkdirs
();
}
return
new
File
(
file
.
getAbsoluteFile
()
+
"/"
+
fileName
);
}
/**
* 获取文件MIME类型
*/
public
static
String
getMimeType
(
File
file
)
{
...
...
src/main/java/tech/starwin/utils/InfoTranslator.java
0 → 100644
View file @
3c713327
package
tech
.
starwin
.
utils
;
import
android.content.Context
;
import
tech.starwin.R
;
/**
* Created by SiKang on 2018/10/17.
* 与服务器通信的文本 和 展示给用户的文本,相互转换
*/
public
class
InfoTranslator
{
/**
* 性别text
*/
public
static
StringAdapter
getGenderAdapter
(
Context
context
)
{
StringAdapter
adapter
=
new
StringAdapter
();
adapter
.
addItem
(
newItem
(
context
,
"MALE"
,
R
.
string
.
enum_gender_male
));
adapter
.
addItem
(
newItem
(
context
,
"FEMALE"
,
R
.
string
.
enum_gender_female
));
return
adapter
;
}
public
static
String
getGenderValue
(
Context
context
,
String
info
)
{
return
getGenderAdapter
(
context
).
getItemValue
(
info
);
}
public
static
String
getGenderInfo
(
Context
context
,
String
value
)
{
return
getGenderAdapter
(
context
).
getItemInfoStr
(
value
);
}
/**
* 婚姻
*/
public
static
StringAdapter
getMaritalAdapter
(
Context
context
)
{
StringAdapter
adapter
=
new
StringAdapter
();
adapter
.
addItem
(
newItem
(
context
,
"SINGLE"
,
R
.
string
.
enum_marriage_single
));
adapter
.
addItem
(
newItem
(
context
,
"MARRIED"
,
R
.
string
.
enum_marriage_married
));
adapter
.
addItem
(
newItem
(
context
,
"DIVORCED"
,
R
.
string
.
enum_marriage_divorced
));
adapter
.
addItem
(
newItem
(
context
,
"WIDOWED"
,
R
.
string
.
enum_marriage_widowed
));
return
adapter
;
}
public
static
String
getMaritalValue
(
Context
context
,
String
info
)
{
return
getMaritalAdapter
(
context
).
getItemValue
(
info
);
}
public
static
String
getMaritalInfo
(
Context
context
,
String
value
)
{
return
getMaritalAdapter
(
context
).
getItemInfoStr
(
value
);
}
/**
* 生育
*/
public
static
StringAdapter
getChildrenCountAdapter
(
Context
context
)
{
StringAdapter
adapter
=
new
StringAdapter
();
adapter
.
addItem
(
newItem
(
context
,
"ZERO"
,
R
.
string
.
enum_children_zero
));
adapter
.
addItem
(
newItem
(
context
,
"ONE"
,
R
.
string
.
enum_children_one
));
adapter
.
addItem
(
newItem
(
context
,
"TWO"
,
R
.
string
.
enum_children_two
));
adapter
.
addItem
(
newItem
(
context
,
"THREE"
,
R
.
string
.
enum_children_three
));
adapter
.
addItem
(
newItem
(
context
,
"FOUR"
,
R
.
string
.
enum_children_four
));
adapter
.
addItem
(
newItem
(
context
,
"OVER_FOUR"
,
R
.
string
.
enum_children_overfour
));
return
adapter
;
}
public
static
String
getChildrenCountValue
(
Context
context
,
String
info
)
{
return
getChildrenCountAdapter
(
context
).
getItemValue
(
info
);
}
public
static
String
getChildrenCountInfo
(
Context
context
,
String
value
)
{
return
getChildrenCountAdapter
(
context
).
getItemInfoStr
(
value
);
}
/**
* 学历
*/
public
static
StringAdapter
getDurationAdapter
(
Context
context
)
{
StringAdapter
adapter
=
new
StringAdapter
();
adapter
.
addItem
(
newItem
(
context
,
"THREE_MONTH"
,
R
.
string
.
enum_period_three_month
));
adapter
.
addItem
(
newItem
(
context
,
"SIX_MONTH"
,
R
.
string
.
enum_period_six_month
));
adapter
.
addItem
(
newItem
(
context
,
"ONE_YEAR"
,
R
.
string
.
enum_period_one_year
));
adapter
.
addItem
(
newItem
(
context
,
"TWO_YEAR"
,
R
.
string
.
enum_period_two_year
));
adapter
.
addItem
(
newItem
(
context
,
"OVER_TWO_YEAR"
,
R
.
string
.
enum_period_over_two_year
));
return
adapter
;
}
public
static
String
getDurationValue
(
Context
context
,
String
info
)
{
return
getDurationAdapter
(
context
).
getItemValue
(
info
);
}
public
static
String
getDurationInfo
(
Context
context
,
String
value
)
{
return
getDurationAdapter
(
context
).
getItemInfoStr
(
value
);
}
/**
* 薪水
*/
public
static
StringAdapter
getSalaryAdapter
(
Context
context
)
{
StringAdapter
adapter
=
new
StringAdapter
();
adapter
.
addItem
(
newItem
(
context
,
"BELOW_2M"
,
R
.
string
.
enum_salary_below_2b
));
adapter
.
addItem
(
newItem
(
context
,
"BETWEEN_2M_4M"
,
R
.
string
.
enum_salary_between_2b_4b
));
adapter
.
addItem
(
newItem
(
context
,
"BETWEEN_4M_8M"
,
R
.
string
.
enum_salary_between_4b_8b
));
adapter
.
addItem
(
newItem
(
context
,
"OVER_8M"
,
R
.
string
.
enum_salary_over_8b
));
return
adapter
;
}
public
static
String
getSalaryValue
(
Context
context
,
String
info
)
{
return
getSalaryAdapter
(
context
).
getItemValue
(
info
);
}
public
static
String
getSalaryInfo
(
Context
context
,
String
value
)
{
return
getSalaryAdapter
(
context
).
getItemInfoStr
(
value
);
}
/**
* 工作状态
*/
public
static
StringAdapter
getJobStatusAdapter
(
Context
context
)
{
StringAdapter
adapter
=
new
StringAdapter
();
adapter
.
addItem
(
newItem
(
context
,
"ACCOUNTING"
,
R
.
string
.
enum_job_accounting
));
adapter
.
addItem
(
newItem
(
context
,
"WAITER"
,
R
.
string
.
enum_job_waiter
));
adapter
.
addItem
(
newItem
(
context
,
"ENGINEER"
,
R
.
string
.
enum_job_engineer
));
adapter
.
addItem
(
newItem
(
context
,
"EXECUTIVE"
,
R
.
string
.
enum_job_executive
));
adapter
.
addItem
(
newItem
(
context
,
"GENERAL_ADMINISTRATION"
,
R
.
string
.
enum_job_general_administration
));
adapter
.
addItem
(
newItem
(
context
,
"INFORMATION_TECHNOLOGY"
,
R
.
string
.
enum_job_information_technology
));
adapter
.
addItem
(
newItem
(
context
,
"CONSULTANT"
,
R
.
string
.
enum_job_consultant
));
adapter
.
addItem
(
newItem
(
context
,
"MARKETING"
,
R
.
string
.
enum_job_marketing
));
adapter
.
addItem
(
newItem
(
context
,
"TEACHER"
,
R
.
string
.
enum_job_teacher
));
adapter
.
addItem
(
newItem
(
context
,
"MILITARY"
,
R
.
string
.
enum_job_military
));
adapter
.
addItem
(
newItem
(
context
,
"RETIRED"
,
R
.
string
.
enum_job_retired
));
adapter
.
addItem
(
newItem
(
context
,
"STUDENT"
,
R
.
string
.
enum_job_student
));
adapter
.
addItem
(
newItem
(
context
,
"ENTREPRENEUR"
,
R
.
string
.
enum_job_entrepreneur
));
adapter
.
addItem
(
newItem
(
context
,
"POLICE"
,
R
.
string
.
enum_job_police
));
adapter
.
addItem
(
newItem
(
context
,
"FARMER"
,
R
.
string
.
enum_job_farmer
));
adapter
.
addItem
(
newItem
(
context
,
"FISHERMAN"
,
R
.
string
.
enum_job_fisherman
));
adapter
.
addItem
(
newItem
(
context
,
"BREEDER"
,
R
.
string
.
enum_job_breeder
));
adapter
.
addItem
(
newItem
(
context
,
"DOCTOR"
,
R
.
string
.
enum_job_doctor
));
adapter
.
addItem
(
newItem
(
context
,
"MEDICAL_PERSONNEL"
,
R
.
string
.
enum_job_medical_personal
));
adapter
.
addItem
(
newItem
(
context
,
"LAWYER"
,
R
.
string
.
enum_job_lawyer
));
adapter
.
addItem
(
newItem
(
context
,
"CHEF"
,
R
.
string
.
enum_job_chef
));
adapter
.
addItem
(
newItem
(
context
,
"RESEARCHER"
,
R
.
string
.
enum_job_research
));
adapter
.
addItem
(
newItem
(
context
,
"DESIGNER"
,
R
.
string
.
enum_job_designer
));
adapter
.
addItem
(
newItem
(
context
,
"ARCHITECT"
,
R
.
string
.
enum_job_architect
));
adapter
.
addItem
(
newItem
(
context
,
"WORKERS_ART"
,
R
.
string
.
enum_job_workers_art
));
adapter
.
addItem
(
newItem
(
context
,
"SECURITY"
,
R
.
string
.
enum_job_security
));
adapter
.
addItem
(
newItem
(
context
,
"BROKER"
,
R
.
string
.
enum_job_broker
));
adapter
.
addItem
(
newItem
(
context
,
"DISTRIBUTOR"
,
R
.
string
.
enum_job_distributor
));
adapter
.
addItem
(
newItem
(
context
,
"AIR_TRANSPORTATION"
,
R
.
string
.
enum_job_air_transportation
));
adapter
.
addItem
(
newItem
(
context
,
"SEA_TRANSPORTATION"
,
R
.
string
.
enum_job_sea_transportation
));
adapter
.
addItem
(
newItem
(
context
,
"LAND_TRANSPORTATION"
,
R
.
string
.
enum_job_land_transportation
));
adapter
.
addItem
(
newItem
(
context
,
"LABOR"
,
R
.
string
.
enum_job_labor
));
adapter
.
addItem
(
newItem
(
context
,
"CRAFTSMAN"
,
R
.
string
.
enum_job_craftsman
));
adapter
.
addItem
(
newItem
(
context
,
"HOUSEWIFE"
,
R
.
string
.
enum_job_housewife
));
adapter
.
addItem
(
newItem
(
context
,
"STATE_OFFICIALS"
,
R
.
string
.
enum_job_state_officials
));
adapter
.
addItem
(
newItem
(
context
,
"GOVERNMENT_EMPLOYEE"
,
R
.
string
.
enum_job_government_employment
));
adapter
.
addItem
(
newItem
(
context
,
"INFORMAL_WORKERS"
,
R
.
string
.
enum_job_information_worker
));
adapter
.
addItem
(
newItem
(
context
,
"OTHER"
,
R
.
string
.
enum_job_other
));
return
adapter
;
}
public
static
String
getJobSatusValue
(
Context
context
,
String
info
)
{
return
getJobStatusAdapter
(
context
).
getItemValue
(
info
);
}
public
static
String
getJobStatusInfo
(
Context
context
,
String
value
)
{
return
getJobStatusAdapter
(
context
).
getItemInfoStr
(
value
);
}
/**
* 还款方式
*/
public
static
StringAdapter
getRepayMethodAdapter
(
Context
context
)
{
StringAdapter
adapter
=
new
StringAdapter
();
adapter
.
addItem
(
newItem
(
context
,
"ALFAMART"
,
R
.
string
.
pay_in_alfamart_title
));
adapter
.
addItem
(
newItem
(
context
,
"BCA"
,
R
.
string
.
bca_title
));
adapter
.
addItem
(
newItem
(
context
,
"MANDIRI"
,
R
.
string
.
mandiri_title
));
adapter
.
addItem
(
newItem
(
context
,
"BNI"
,
R
.
string
.
bni_title
));
adapter
.
addItem
(
newItem
(
context
,
"BRI"
,
R
.
string
.
bri_title
));
adapter
.
addItem
(
newItem
(
context
,
"OTHERS"
,
R
.
string
.
other_banks_title
));
return
adapter
;
}
public
static
String
getRepayMethodValue
(
Context
context
,
String
info
)
{
return
getRepayMethodAdapter
(
context
).
getItemValue
(
info
);
}
public
static
String
getRepayMethodInfo
(
Context
context
,
String
value
)
{
return
getRepayMethodAdapter
(
context
).
getItemInfoStr
(
value
);
}
private
static
StringAdapter
.
Item
newItem
(
Context
context
,
String
value
,
int
info
)
{
return
new
StringAdapter
.
Item
(
value
,
context
.
getString
(
info
));
}
}
src/main/java/tech/starwin/utils/PreferencesManager.java
View file @
3c713327
...
...
@@ -9,6 +9,7 @@ import java.util.Map;
import
tech.starwin.mvp.beans.GatewayInfoBean
;
import
tech.starwin.mvp.beans.LoanInfo
;
import
tech.starwin.mvp.beans.OcrResultBean
;
import
tech.starwin.mvp.beans.PersonalInfoServerBean
;
import
tech.starwin.mvp.beans.TokenInfoBean
;
import
tech.starwin.mvp.beans.UserBean
;
...
...
@@ -49,53 +50,58 @@ public class PreferencesManager {
}
/**
*
保存
登录信息
*
存取
登录信息
*/
public
void
saveTokenInfo
(
TokenInfoBean
tokenInfoBean
)
{
saveData
(
"token_info"
,
DataFormat
.
fromBean
(
tokenInfoBean
));
}
/**
* 获取登录信息
*/
public
TokenInfoBean
getTokenInfo
()
{
String
token
Str
=
getString
(
"token_info"
,
""
);
return
TextUtils
.
isEmpty
(
tokenStr
)
?
null
:
(
TokenInfoBean
)
DataFormat
.
toBean
(
token
Str
);
String
obj
Str
=
getString
(
"token_info"
,
""
);
return
TextUtils
.
isEmpty
(
objStr
)
?
null
:
(
TokenInfoBean
)
DataFormat
.
toBean
(
obj
Str
);
}
/**
*
保存
用户信息
*
存取
用户信息
*/
public
void
saveUserInfo
(
UserBean
userInfo
)
{
saveData
(
"user_info"
,
DataFormat
.
fromBean
(
userInfo
));
}
public
UserBean
getUserInfo
()
{
String
objStr
=
getString
(
"user_info"
,
""
);
return
TextUtils
.
isEmpty
(
objStr
)
?
null
:
(
UserBean
)
DataFormat
.
toBean
(
objStr
);
}
/**
*
获取用户
信息
*
存取KTP
信息
*/
public
UserBean
getUserInfo
()
{
String
userStr
=
getString
(
"user_info"
,
""
);
return
TextUtils
.
isEmpty
(
userStr
)
?
null
:
(
UserBean
)
DataFormat
.
toBean
(
userStr
);
public
void
saveKTPInfo
(
OcrResultBean
.
KTP
ktpInfo
)
{
saveData
(
"ktp_info"
,
DataFormat
.
fromBean
(
ktpInfo
));
}
public
OcrResultBean
.
KTP
getKTPInfo
()
{
String
objStr
=
getString
(
"ktp_info"
,
""
);
return
TextUtils
.
isEmpty
(
objStr
)
?
null
:
(
OcrResultBean
.
KTP
)
DataFormat
.
toBean
(
objStr
);
}
/**
*
保存
Gateway信息
*
存取
Gateway信息
*/
public
void
saveGatewayInfo
(
GatewayInfoBean
gatewayInfo
)
{
saveData
(
"gateway_info"
,
DataFormat
.
fromBean
(
gatewayInfo
));
}
/**
* 获取Gateway信息
*/
public
GatewayInfoBean
getGatewayInfo
()
{
String
objStr
=
getString
(
"gateway_info"
,
""
);
return
TextUtils
.
isEmpty
(
objStr
)
?
null
:
(
GatewayInfoBean
)
DataFormat
.
toBean
(
objStr
);
}
/**
*
保存
活体识别截图
*
存取
活体识别截图
*/
public
void
saveVerificationData
(
byte
[]
data
)
{
if
(
data
==
null
)
{
...
...
@@ -105,14 +111,11 @@ public class PreferencesManager {
}
}
/**
* 获取活体识别截图
*/
public
String
getVerificationData
()
{
return
getString
(
"verification_data"
,
null
);
}
/**
* 更新政策 是否同意 状态
*/
...
...
src/main/java/tech/starwin/utils/TDChannelCode.java
0 → 100644
View file @
3c713327
package
tech
.
starwin
.
utils
;
/**
* Created by SiKang on 2018/10/26.
* 同盾ChannelCode
*/
public
class
TDChannelCode
{
public
static
final
String
FACEBOOK
=
"103001"
;
public
static
final
String
INSTAGRAM
=
"103002"
;
public
static
final
String
LINKEDIN
=
"903004"
;
public
static
final
String
LAZADA
=
"101001"
;
public
static
final
String
TOKOPEDIA
=
"101002"
;
public
static
final
String
SIM
=
"106001"
;
public
static
final
String
NPWP
=
"105001"
;
public
static
final
String
BPJS
=
"105002"
;
public
static
final
String
GOJEK
=
"104001"
;
public
static
final
String
GRAB
=
"104002"
;
public
static
final
String
TELKOMSEL
=
"102001"
;
public
static
final
String
XL
=
"102002"
;
public
static
final
String
INDOSAT
=
"102003"
;
}
src/main/java/tech/starwin/utils/context_utils/ActivityJumper.java
View file @
3c713327
...
...
@@ -35,7 +35,7 @@ public class ActivityJumper {
}
context
.
startActivity
(
intent
);
if
(
context
instanceof
Activity
)
{
((
Activity
)
context
).
overridePendingTransition
(
R
.
anim
.
slide_in_right
,
R
.
anim
.
slide_out_left
);
((
Activity
)
context
).
overridePendingTransition
(
tech
.
starwin
.
R
.
anim
.
slide_in_right
,
tech
.
starwin
.
R
.
anim
.
slide_out_left
);
}
}
...
...
src/main/java/tech/starwin/utils/context_utils/PermissionsHelper.java
View file @
3c713327
...
...
@@ -3,11 +3,13 @@ package tech.starwin.utils.context_utils;
import
android.Manifest
;
import
android.annotation.SuppressLint
;
import
android.app.AppOpsManager
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.ApplicationInfo
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.provider.Settings
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentActivity
;
...
...
@@ -16,8 +18,11 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.List
;
import
io.reactivex.functions.Consumer
;
import
tech.starwin.BuildConfig
;
/**
* Created by SiKang on 2018/9/20.
...
...
@@ -25,17 +30,12 @@ import io.reactivex.functions.Consumer;
*/
public
class
PermissionsHelper
{
/**
* 需要在首页获取的主要权限
*/
public
static
String
[]
MAIN_PERMISSIONS
=
new
String
[]{
Manifest
.
permission
.
READ_CONTACTS
,
Manifest
.
permission
.
READ_CALL_LOG
,
Manifest
.
permission
.
READ_SMS
,
Manifest
.
permission
.
ACCESS_COARSE_LOCATION
,
//粗精度定位
Manifest
.
permission
.
ACCESS_FINE_LOCATION
,
//卫星定位
Manifest
.
permission
.
READ_PHONE_STATE
};
public
static
void
checkCameraPermission
(
FragmentActivity
activity
,
OnPermissionListener
listener
)
{
checkPermission
(
activity
,
new
String
[]{
Manifest
.
permission
.
CAMERA
,
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
Manifest
.
permission
.
RECORD_AUDIO
},
listener
);
}
/**
* 检查权限
...
...
@@ -53,25 +53,30 @@ public class PermissionsHelper {
rxPermissions
.
requestEach
(
permissions
)
.
subscribe
(
new
Consumer
<
Permission
>()
{
int
index
=
0
;
int
refuseCount
=
0
;
List
<
Permission
>
allowed
=
new
ArrayList
<>();
List
<
Permission
>
refused
=
new
ArrayList
<>();
List
<
Permission
>
neverAsk
=
new
ArrayList
<>();
@Override
public
void
accept
(
Permission
permission
)
throws
Exception
{
if
(
permission
.
granted
)
{
if
(
index
==
permissions
.
length
-
1
&&
refuseCount
==
0
)
{
listener
.
onAllow
(
permission
,
true
);
}
else
{
listener
.
onAllow
(
permission
,
false
);
}
allowed
.
add
(
permission
);
listener
.
onAllow
(
permission
);
}
else
if
(
permission
.
shouldShowRequestPermissionRationale
)
{
refuse
Count
++
;
refuse
d
.
add
(
permission
)
;
listener
.
onRefuse
(
permission
);
}
else
{
refuseCount
++
;
neverAsk
.
add
(
permission
)
;
listener
.
onRefuseAndNeverAskAgain
(
permission
);
}
index
++;
if
(
allowed
.
size
()
+
refused
.
size
()
+
neverAsk
.
size
()
==
permissions
.
length
)
{
listener
.
onFinish
(
allowed
.
toArray
(
new
Permission
[
allowed
.
size
()]),
refused
.
toArray
(
new
Permission
[
refused
.
size
()]),
neverAsk
.
toArray
(
new
Permission
[
neverAsk
.
size
()]));
}
}
});
}
...
...
@@ -129,11 +134,78 @@ public class PermissionsHelper {
return
false
;
}
public
static
void
gotoPermissionSetting
(
Context
context
)
{
try
{
Intent
intent
=
null
;
switch
(
Build
.
MANUFACTURER
.
toUpperCase
())
{
case
"HUAWEI"
:
intent
=
new
Intent
();
intent
.
setComponent
(
new
ComponentName
(
"com.huawei.systemmanager"
,
"com.huawei.permissionmanager.ui.MainActivity"
));
break
;
case
"XIAOMI"
:
intent
=
new
Intent
(
"miui.intent.action.APP_PERM_EDITOR"
);
intent
.
setComponent
(
new
ComponentName
(
"com.miui.securitycenter"
,
"com.miui.permcenter.permissions.AppPermissionsEditorActivity"
));
break
;
case
"SONY"
:
intent
=
new
Intent
();
intent
.
setComponent
(
new
ComponentName
(
"com.sonymobile.cta"
,
"com.sonymobile.cta.SomcCTAMainActivity"
));
break
;
case
"OPPO"
:
intent
=
new
Intent
();
intent
.
setComponent
(
new
ComponentName
(
"com.color.safecenter"
,
"com.color.safecenter.permission.PermissionManagerActivity"
));
break
;
case
"LG"
:
intent
=
new
Intent
(
"android.intent.action.MAIN"
);
intent
.
setComponent
(
new
ComponentName
(
"com.android.settings"
,
"com.android.settings.Settings$AccessLockSummaryActivity"
));
break
;
case
"LETV"
:
intent
=
new
Intent
();
intent
.
setComponent
(
new
ComponentName
(
"com.letv.android.letvsafe"
,
"com.letv.android.letvsafe.PermissionAndApps"
));
break
;
case
"360"
:
case
"QIKU"
:
intent
=
new
Intent
(
"android.intent.action.MAIN"
);
ComponentName
comp
=
new
ComponentName
(
"com.qihoo360.mobilesafe"
,
"com.qihoo360.mobilesafe.ui.index.AppEnterActivity"
);
intent
.
setComponent
(
comp
);
break
;
// case "ZTE":
//
// break;
// case "LENOVO":
//
// break;
// case "VIVO":
//
// break;
// case "SAMSUNG":
//
// break;
case
"MEIZU"
:
intent
=
new
Intent
(
"com.meizu.safe.security.SHOW_APPSEC"
);
intent
.
addCategory
(
Intent
.
CATEGORY_DEFAULT
);
break
;
default
:
intent
=
new
Intent
(
Settings
.
ACTION_SETTINGS
);
break
;
}
intent
.
putExtra
(
"packageName"
,
BuildConfig
.
APPLICATION_ID
);
context
.
startActivity
(
intent
);
}
catch
(
Exception
e
)
{
context
.
startActivity
(
new
Intent
(
Settings
.
ACTION_SETTINGS
));
}
}
public
interface
OnPermissionListener
{
/**
* 允许权限
*/
void
onAllow
(
Permission
permission
,
boolean
allAllowed
);
void
onAllow
(
Permission
permission
);
/**
* 拒绝权限,下次再问
...
...
@@ -144,10 +216,24 @@ public class PermissionsHelper {
* 拒绝权限,且不要再问
*/
void
onRefuseAndNeverAskAgain
(
Permission
permission
);
/**
* 操作结束
*
* @param allowed 被授权的权限
* @param refused 被拒绝的权限
* @param neverAsk 被拒绝且选中不要再问的权限
*/
void
onFinish
(
Permission
[]
allowed
,
Permission
[]
refused
,
Permission
[]
neverAsk
);
}
public
abstract
static
class
OnSimplePermissionListener
implements
OnPermissionListener
{
@Override
public
void
onAllow
(
Permission
permission
)
{
}
@Override
public
void
onRefuse
(
Permission
permission
)
{
}
...
...
src/main/java/tech/starwin/utils/ui_utils/DialogFactory.java
View file @
3c713327
...
...
@@ -62,7 +62,7 @@ public class DialogFactory {
* 创建一个带有文本提示和两个含义相对按钮的对话框
*/
public
static
Dialog
createYesOrNoDialog
(
Context
context
,
String
title
,
String
msg
,
String
yesBtnText
,
String
noBtnText
,
final
OnYesOrNoListener
onYesOrNoListener
)
{
return
new
QMUIDialog
.
MessageDialogBuilder
(
context
)
final
Dialog
dialog
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
)
.
setTitle
(
title
)
.
setMessage
(
msg
)
.
addAction
(
0
,
noBtnText
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
new
QMUIDialogAction
.
ActionListener
()
{
...
...
@@ -78,6 +78,8 @@ public class DialogFactory {
}
})
.
create
();
return
dialog
;
}
/**
...
...
src/main/java/tech/starwin/utils/ui_utils/QMUIHelper.java
View file @
3c713327
...
...
@@ -10,12 +10,18 @@ import android.support.annotation.DrawableRes;
import
android.support.annotation.StringRes
;
import
android.support.v4.content.ContextCompat
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.ImageButton
;
import
android.widget.ImageView
;
import
android.widget.RelativeLayout
;
import
com.qmuiteam.qmui.widget.QMUIEmptyView
;
import
com.qmuiteam.qmui.widget.QMUITabSegment
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView
;
import
com.qmuiteam.qmui.widget.grouplist.QMUIGroupListView
;
import
tech.starwin.R
;
import
tech.starwin.utils.BitmapUtils
;
import
tech.starwin.widget.PageStateLayout
;
...
...
@@ -26,6 +32,18 @@ import tech.starwin.widget.PageStateLayout;
public
class
QMUIHelper
{
/**
* 重新设置topbarimagebutton的图片尺寸
* 当没有合适尺寸的图片使用时,将图片强制缩放到适合的尺寸
*/
public
static
ImageButton
resizeTopbarBtn
(
ImageButton
imageButton
)
{
int
width
=
(
int
)
imageButton
.
getContext
().
getResources
().
getDimension
(
R
.
dimen
.
x_50
);
Bitmap
bmp
=
BitmapUtils
.
drawableToBmp
(
imageButton
.
getDrawable
());
imageButton
.
setImageBitmap
(
BitmapUtils
.
scaleBitmap
(
bmp
,
width
,
width
));
imageButton
.
setScaleType
(
ImageView
.
ScaleType
.
CENTER_INSIDE
);
return
imageButton
;
}
/**
* 为一个View 套一个 EmptyView外壳,用于展示无数据和重试的情况
*
* @param targetView 需要套壳,加入状态显示的View
...
...
src/main/java/tech/starwin/utils/ui_utils/UIHelper.java
View file @
3c713327
...
...
@@ -72,9 +72,9 @@ public class UIHelper {
view
.
setOnClickListener
(
listener
);
}
}
}
/**
* 按默认配置初始化RecylerView 并绑定Adapter
*/
...
...
@@ -87,12 +87,15 @@ public class UIHelper {
public
static
boolean
hasEmptyValue
(
View
...
views
)
{
for
(
View
view
:
views
)
{
if
(
view
==
null
)
{
return
true
;
}
if
(
view
instanceof
TextView
)
{
if
(
TextUtils
.
isEmpty
(((
TextView
)
view
).
getText
().
toString
()))
{
if
(
TextUtils
.
isEmpty
(((
TextView
)
view
).
getText
().
toString
()
.
replace
(
" "
,
""
)
))
{
return
true
;
}
}
else
if
(
view
instanceof
EditText
)
{
if
(
TextUtils
.
isEmpty
(((
EditText
)
view
).
getText
().
toString
()))
{
if
(
TextUtils
.
isEmpty
(((
EditText
)
view
).
getText
().
toString
()
.
replace
(
" "
,
""
)
))
{
return
true
;
}
}
...
...
@@ -147,6 +150,7 @@ public class UIHelper {
v
.
setSelected
(
false
);
}
}
public
static
void
selectedViews
(
View
view
,
View
...
views
)
{
view
.
setSelected
(
false
);
for
(
View
v
:
views
)
{
...
...
@@ -155,9 +159,6 @@ public class UIHelper {
}
/**
* 字符串高亮显示部分文字
*
...
...
src/main/java/tech/starwin/widget/SpanButton.java
0 → 100644
View file @
3c713327
package
tech
.
starwin
.
widget
;
import
android.content.Context
;
import
android.support.annotation.Nullable
;
import
android.text.TextUtils
;
import
android.text.TextWatcher
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
/**
* Created by SiKang on 2018/10/24.
* 行按钮
*/
public
class
SpanButton
extends
LinearLayout
{
private
TextWatcher
watcher
;
public
SpanButton
(
Context
context
)
{
super
(
context
);
init
(
null
);
}
public
SpanButton
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
init
(
attrs
);
}
public
SpanButton
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
init
(
attrs
);
}
private
void
init
(
AttributeSet
attrs
)
{
setOrientation
(
HORIZONTAL
);
}
@Override
public
void
setOnClickListener
(
@Nullable
OnClickListener
l
)
{
super
.
setOnClickListener
(
l
);
for
(
int
i
=
0
;
i
<
getChildCount
();
i
++)
{
getChildAt
(
i
).
setClickable
(
false
);
}
}
@Override
public
void
onViewAdded
(
View
child
)
{
super
.
onViewAdded
(
child
);
bindTextWatcher
(
child
);
}
public
void
setText
(
String
text
)
{
if
(!
TextUtils
.
isEmpty
(
text
))
{
for
(
int
i
=
0
;
i
<
getChildCount
();
i
++)
{
View
view
=
getChildAt
(
i
);
if
(
view
instanceof
TextView
)
{
((
TextView
)
view
).
setText
(
text
);
return
;
}
}
}
}
public
CharSequence
getText
()
{
for
(
int
i
=
0
;
i
<
getChildCount
();
i
++)
{
View
view
=
getChildAt
(
i
);
if
(
view
instanceof
TextView
)
{
return
((
TextView
)
view
).
getText
();
}
}
return
""
;
}
public
TextView
getCotentView
()
{
for
(
int
i
=
0
;
i
<
getChildCount
();
i
++)
{
View
view
=
getChildAt
(
i
);
if
(
view
instanceof
TextView
)
{
return
(
TextView
)
view
;
}
}
return
null
;
}
public
void
addTextChangedListener
(
TextWatcher
watcher
)
{
this
.
watcher
=
watcher
;
for
(
int
i
=
0
;
i
<
getChildCount
();
i
++)
{
bindTextWatcher
(
getChildAt
(
i
));
}
}
public
void
bindTextWatcher
(
View
child
)
{
if
(
watcher
!=
null
)
{
if
(
child
instanceof
TextView
)
{
((
TextView
)
child
).
addTextChangedListener
(
watcher
);
}
else
if
(
child
instanceof
EditText
)
{
((
EditText
)
child
).
addTextChangedListener
(
watcher
);
}
}
}
}
src/main/java/tech/starwin/widget/TitleSpan.java
0 → 100644
View file @
3c713327
package
tech
.
starwin
.
widget
;
import
android.content.Context
;
import
android.support.annotation.Nullable
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.text.TextWatcher
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
/**
* Created by SiKang on 2018/10/25.
* 标题 + 文本 布局
* 第一个Child 默认为Title
* 当EditText/TextView中有内容输入时,显示Title, 反之隐藏(无输入内容时直接用hintText展示)
*/
public
class
TitleSpan
extends
LinearLayout
{
public
TitleSpan
(
Context
context
)
{
super
(
context
);
}
public
TitleSpan
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
TitleSpan
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
@Override
public
void
onViewAdded
(
final
View
child
)
{
super
.
onViewAdded
(
child
);
TextWatcher
textWatcher
=
new
TextWatcher
()
{
@Override
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
}
@Override
public
void
onTextChanged
(
CharSequence
s
,
int
start
,
int
before
,
int
count
)
{
if
(
getChildCount
()
>
1
&&
indexOfChild
(
child
)
!=
0
)
{
if
(
TextUtils
.
isEmpty
(
s
.
toString
().
replace
(
" "
,
""
)))
{
getChildAt
(
0
).
setVisibility
(
GONE
);
}
else
{
getChildAt
(
0
).
setVisibility
(
VISIBLE
);
}
}
}
@Override
public
void
afterTextChanged
(
Editable
s
)
{
}
};
if
(
child
instanceof
EditText
)
{
((
EditText
)
child
).
addTextChangedListener
(
textWatcher
);
}
else
if
(
child
instanceof
TextView
)
{
((
TextView
)
child
).
addTextChangedListener
(
textWatcher
);
}
else
if
(
child
instanceof
SpanButton
)
{
((
SpanButton
)
child
).
addTextChangedListener
(
textWatcher
);
}
}
}
src/main/res/drawable/style_grayborder_round.xml
0 → 100644
View file @
3c713327
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"5dp"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/qmui_config_color_gray_5"
/>
</shape>
\ No newline at end of file
src/main/res/drawable/style_graysolid_round.xml
0 → 100644
View file @
3c713327
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"5dp"
/>
<solid
android:color=
"@color/gray_bg"
/>
</shape>
\ No newline at end of file
src/main/res/drawable/style_mainsolid_round.xml
0 → 100644
View file @
3c713327
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"5dp"
/>
<solid
android:color=
"@color/main_color"
/>
</shape>
\ No newline at end of file
src/main/res/layout/base_activity_drawer.xml
View file @
3c713327
...
...
@@ -11,7 +11,7 @@
<FrameLayout
android:id=
"@+id/root_drawer"
android:layout_width=
"
@dimen/x_600
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"match_parent"
android:layout_gravity=
"left"
/>
</android.support.v4.widget.DrawerLayout>
\ No newline at end of file
src/main/res/layout/fragment_region.xml
View file @
3c713327
...
...
@@ -2,6 +2,7 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<android.support.v7.widget.RecyclerView
...
...
src/main/res/values-en-rUS/strings.xml
View file @
3c713327
This diff is collapsed.
Click to expand it.
src/main/res/values-zh-rCN/strings.xml
View file @
3c713327
This diff is collapsed.
Click to expand it.
src/main/res/values/colors.xml
View file @
3c713327
...
...
@@ -5,11 +5,15 @@
<color
name=
"colorPrimary"
>
@color/theme
</color>
<color
name=
"colorPrimaryDark"
>
@color/theme_d
</color>
<color
name=
"colorAccent"
>
@color/accent
</color>
<color
name=
"colorBackground"
>
@color/page_background
</color>
<color
name=
"colorBackground_d"
>
#f2f2f2
</color>
<color
name=
"red"
>
#ef4e4e
</color>
<color
name=
"hover"
>
#0ea26c
</color>
<!--背景灰-->
<color
name=
"gray_bg"
>
#F7F7F7
</color>
<!--text color-->
<color
name=
"textDeep"
>
#272637
</color>
<color
name=
"textNormal"
>
#262536
</color>
...
...
src/main/res/values/strings.xml
View file @
3c713327
This diff is collapsed.
Click to expand it.
src/main/res/values/styles.xml
View file @
3c713327
<resources>
<style
name=
"AppTheme"
parent=
"Theme.AppCompat.Light.DarkActionBar"
>
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
</style>
<style
name=
"style_bg_transparent_dialog"
parent=
"Base.Theme.AppCompat.Light.Dialog"
>
<item
name=
"android:windowBackground"
>
@android:color/transparent
</item>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
</style>
<style
name=
"QMTheme"
parent=
"QMUI.Compat.NoActionBar"
>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
<!-- toolbar(actionbar)颜色 -->
<item
name=
"colorPrimary"
>
@color/main_color
</item>
<!-- 状态栏颜色 -->
<item
name=
"colorPrimaryDark"
>
@color/main_color
</item>
<item
name=
"colorAccent"
>
@color/main_color
</item>
<!-- 窗口的背景颜色 -->
<!-- 配置Android提供的theme -->
<item
name=
"android:textAppearanceListItemSmall"
>
@style/QDTextAppearanceListItemSmall
</item>
<item
name=
"android:textAppearanceListItem"
>
@style/QDtextAppearanceListItem
</item>
<item
name=
"android:listPreferredItemHeight"
>
?attr/qmui_list_item_height_higher
</item>
<item
name=
"android:listPreferredItemHeightSmall"
>
?attr/qmui_list_item_height
</item>
<!-- 配置qmui提供的theme -->
<item
name=
"qmui_config_color_blue"
>
@color/main_color
</item>
<item
name=
"qmui_content_spacing_horizontal"
>
20dp
</item>
<item
name=
"qmui_content_padding_horizontal"
>
@dimen/qmui_content_spacing_horizontal
</item>
<item
name=
"QMUITopBarStyle"
>
@style/QDTopBar
</item>
</style>
<style
name=
"ThemeWhite"
parent=
"QMTheme"
>
<item
name=
"android:windowBackground"
>
@android:color/white
</item>
</style>
<style
name=
"ThemeTransparent"
parent=
"QMTheme"
>
<item
name=
"android:windowBackground"
>
@android:color/transparent
</item>
</style>
<style
name=
"QDtextAppearanceListItem"
>
<item
name=
"android:textColor"
>
?attr/qmui_config_color_black
</item>
<item
name=
"android:textSize"
>
18sp
</item>
<item
name=
"android:background"
>
?attr/qmui_s_list_item_bg_with_border_bottom_inset_left
</item>
</style>
<style
name=
"QDTextAppearanceListItemSmall"
>
<item
name=
"android:textColor"
>
?attr/qmui_config_color_gray_4
</item>
<item
name=
"android:textSize"
>
16sp
</item>
<item
name=
"android:background"
>
?attr/qmui_s_list_item_bg_with_border_bottom_inset_left
</item>
</style>
<style
name=
"QDTopBar"
parent=
"QMUI.TopBar"
>
<item
name=
"qmui_topbar_bg_color"
>
@color/main_color
</item>
<item
name=
"qmui_topbar_title_color"
>
@color/main_text_color
</item>
<item
name=
"qmui_topbar_separator_height"
>
0px
</item>
<item
name=
"qmui_topbar_subtitle_color"
>
@color/main_text_color
</item>
<item
name=
"qmui_topbar_text_btn_color_state_list"
>
@color/main_text_color
</item>
</style>
<!--行按钮-->
<style
name=
"span_button"
>
<item
name=
"android:orientation"
>
horizontal
</item>
<item
name=
"android:paddingTop"
>
12dp
</item>
<item
name=
"android:paddingBottom"
>
12dp
</item>
<item
name=
"android:gravity"
>
center_vertical
</item>
</style>
<style
name=
"span_text"
>
<item
name=
"android:textSize"
>
14sp
</item>
<item
name=
"android:textColor"
>
@color/qmui_config_color_gray_1
</item>
<item
name=
"android:gravity"
>
center_vertical
</item>
<item
name=
"android:background"
>
@color/translateColor
</item>
</style>
<!--分割线-->
<style
name=
"gray_line_vertical"
>
<item
name=
"android:layout_width"
>
@dimen/x_3
</item>
<item
name=
"android:layout_height"
>
match_parent
</item>
<item
name=
"android:background"
>
@color/qmui_config_color_gray_9
</item>
</style>
<style
name=
"gray_line"
>
<item
name=
"android:layout_width"
>
match_parent
</item>
<item
name=
"android:layout_height"
>
@dimen/x_3
</item>
<item
name=
"android:background"
>
@color/qmui_config_color_gray_9
</item>
</style>
<!--行标题-->
<style
name=
"text_8"
>
<item
name=
"android:layout_width"
>
wrap_content
</item>
<item
name=
"android:layout_height"
>
wrap_content
</item>
<item
name=
"android:textSize"
>
@dimen/x_38
</item>
</style>
<!--行标题-->
<style
name=
"span_title"
>
<item
name=
"android:layout_width"
>
wrap_content
</item>
<item
name=
"android:layout_height"
>
wrap_content
</item>
<item
name=
"android:drawablePadding"
>
10dp
</item>
<item
name=
"android:textColor"
>
@color/qmui_config_color_gray_2
</item>
</style>
<!--行标题-->
<style
name=
"span_title1"
parent=
"span_title"
>
<item
name=
"android:textSize"
>
17sp
</item>
</style>
<!--行标题-->
<style
name=
"span_title2"
parent=
"span_title"
>
<item
name=
"android:textSize"
>
15sp
</item>
</style>
<!--行标题-->
<style
name=
"span_title3"
parent=
"span_title"
>
<item
name=
"android:textSize"
>
13sp
</item>
</style>
<!--主色调按钮-->
<style
name=
"main_color_btn"
>
<item
name=
"android:textColor"
>
@color/white
</item>
<item
name=
"android:background"
>
@color/main_color
</item>
</style>
<style
name=
"main_color_roundBtn"
>
<item
name=
"android:textColor"
>
@color/white
</item>
<item
name=
"android:background"
>
@drawable/style_mainsolid_round
</item>
</style>
<style
name=
"vertical_padding_10dp"
>
<item
name=
"android:paddingTop"
>
10dp
</item>
<item
name=
"android:paddingBottom"
>
10dp
</item>
</style>
<style
name=
"vertical_padding_20dp"
>
<item
name=
"android:paddingTop"
>
20dp
</item>
<item
name=
"android:paddingBottom"
>
20dp
</item>
</style>
<style
name=
"vertical_padding_30dp"
>
<item
name=
"android:paddingTop"
>
20dp
</item>
<item
name=
"android:paddingBottom"
>
20dp
</item>
</style>
<style
name=
"vertical_padding_40dp"
>
<item
name=
"android:paddingTop"
>
20dp
</item>
<item
name=
"android:paddingBottom"
>
20dp
</item>
</style>
<style
name=
"vertical_padding_50dp"
>
<item
name=
"android:paddingTop"
>
20dp
</item>
<item
name=
"android:paddingBottom"
>
20dp
</item>
</style>
<!--权重1-->
<style
name=
"horizontal_weight_1"
>
<item
name=
"android:layout_width"
>
0dp
</item>
<item
name=
"android:layout_height"
>
wrap_content
</item>
<item
name=
"android:layout_weight"
>
1
</item>
</style>
<!--权重1-->
<style
name=
"vertical_weight_1"
>
<item
name=
"android:layout_width"
>
0dp
</item>
<item
name=
"android:layout_height"
>
wrap_content
</item>
<item
name=
"android:layout_weight"
>
1
</item>
</style>
</resources>
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