Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
2ab6d2ba
Commit
2ab6d2ba
authored
Jan 26, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化来电秀,平台分红等
parent
0c737d5a
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
74 additions
and
589 deletions
+74
-589
ITelephony.aidl
.../main/aidl/com/android/internal/telephony/ITelephony.aidl
+0
-3
VideoAdingManager.java
.../java/com/mints/goodmoney/ad/video/VideoAdingManager.java
+3
-2
RingtoneHelper.java
...ava/com/mints/goodmoney/call/business/RingtoneHelper.java
+1
-1
OpEntry.java
...ain/java/com/mints/goodmoney/call/preference/OpEntry.java
+0
-177
PreferenceUtil.java
...a/com/mints/goodmoney/call/preference/PreferenceUtil.java
+0
-10
SharedPreferenceProvider.java
...s/goodmoney/call/preference/SharedPreferenceProvider.java
+0
-235
Util.java
...app/src/main/java/com/mints/goodmoney/call/util/Util.java
+0
-66
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+2
-1
UserManager.java
...rc/main/java/com/mints/goodmoney/manager/UserManager.java
+1
-1
AboutusActivity.kt
.../java/com/mints/goodmoney/ui/activitys/AboutusActivity.kt
+3
-3
KylVideoActivity.kt
...java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
+12
-12
SettingsActivity.kt
...java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
+8
-8
WrapperActivity.kt
.../java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
+10
-0
XmlyPlayActivity.kt
...java/com/mints/goodmoney/ui/activitys/XmlyPlayActivity.kt
+0
-1
FriendsFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
+2
-2
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+5
-26
PanFragment.kt
.../main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
+4
-6
activity_kyl_video.xml
GoodMoney/app/src/main/res/layout/activity_kyl_video.xml
+9
-5
activity_settings.xml
GoodMoney/app/src/main/res/layout/activity_settings.xml
+1
-2
fragment_main_friends.xml
GoodMoney/app/src/main/res/layout/fragment_main_friends.xml
+2
-1
item_fragment_main_my_title.xml
...y/app/src/main/res/layout/item_fragment_main_my_title.xml
+11
-26
item_settings.xml
GoodMoney/app/src/main/res/layout/item_settings.xml
+0
-1
ic_setting_vedio.png
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_setting_vedio.png
+0
-0
No files found.
GoodMoney/app/src/main/aidl/com/android/internal/telephony/ITelephony.aidl
View file @
2ab6d2ba
package
com
.
android
.
internal
.
telephony
;
interface
ITelephony
{
boolean
endCall
();
void
answerRingingCall
();
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/VideoAdingManager.java
View file @
2ab6d2ba
...
...
@@ -3,11 +3,13 @@ package com.mints.goodmoney.ad.video;
import
android.app.Activity
;
import
android.text.TextUtils
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.mvp.model.VideoAdingBean
;
import
com.mints.goodmoney.mvp.model.WeightBean
;
import
com.mints.goodmoney.utils.LogUtil
;
import
com.mints.goodmoney.utils.ToastUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.ArrayList
;
...
...
@@ -246,9 +248,8 @@ public class VideoAdingManager {
Random
r
=
new
Random
();
int
randomWeight
=
r
.
nextInt
(
weight
)
+
1
;
LogUtil
.
d
(
TAG
,
"2、权重随机值:"
+
randomWeight
);
ToastUtil
.
show
(
MintsApplication
.
getContext
(),
"权重随机值:"
+
randomWeight
);
for
(
WeightBean
weightBean
:
weightList
)
{
// LogUtil.d(TAG, weightBean.getType() + " -> " + weightBean.getWeight());
randomWeight
-=
weightBean
.
getWeight
();
if
(
randomWeight
<=
0
)
{
LogUtil
.
d
(
TAG
,
"3、权重结果:"
+
weightBean
.
getType
());
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/call/business/RingtoneHelper.java
View file @
2ab6d2ba
...
...
@@ -80,6 +80,6 @@ public class RingtoneHelper {
}
RingtoneManager
.
setActualDefaultRingtoneUri
(
context
,
RingtoneManager
.
TYPE_RINGTONE
,
newUri
);
// ToastUtil.show(context,"设置来电
铃声
成功!");
// ToastUtil.show(context,"设置来电
秀
成功!");
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/call/preference/OpEntry.java
deleted
100644 → 0
View file @
0c737d5a
package
com
.
mints
.
goodmoney
.
call
.
preference
;
import
android.os.Bundle
;
import
androidx.annotation.NonNull
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.Set
;
class
OpEntry
{
static
final
int
OP_TYPE_GET
=
1
;
static
final
int
OP_TYPE_PUT
=
2
;
static
final
int
OP_TYPE_CLEAR
=
3
;
static
final
int
OP_TYPE_REMOVE
=
4
;
static
final
int
OP_TYPE_COMMIT
=
5
;
static
final
int
OP_TYPE_APPLY
=
6
;
static
final
int
VALUE_TYPE_STRING
=
1
;
static
final
int
VALUE_TYPE_INT
=
2
;
static
final
int
VALUE_TYPE_LONG
=
3
;
static
final
int
VALUE_TYPE_FLOAT
=
4
;
static
final
int
VALUE_TYPE_BOOLEAN
=
5
;
static
final
int
VALUE_TYPE_STRING_SET
=
6
;
static
final
String
KEY_KEY
=
"key_key"
;
static
final
String
KEY_VALUE
=
"key_value"
;
static
final
String
KEY_VALUE_TYPE
=
"key_value_type"
;
static
final
String
KEY_OP_TYPE
=
"key_op_type"
;
@NonNull
private
Bundle
bundle
;
private
OpEntry
()
{
this
.
bundle
=
new
Bundle
();
}
public
OpEntry
(
@NonNull
Bundle
bundle
)
{
this
.
bundle
=
bundle
;
}
public
String
getKey
()
{
return
bundle
.
getString
(
KEY_KEY
,
null
);
}
public
OpEntry
setKey
(
String
key
)
{
bundle
.
putString
(
KEY_KEY
,
key
);
return
this
;
}
public
int
getValueType
()
{
return
bundle
.
getInt
(
KEY_VALUE_TYPE
,
0
);
}
public
OpEntry
setValueType
(
int
valueType
)
{
bundle
.
putInt
(
KEY_VALUE_TYPE
,
valueType
);
return
this
;
}
public
int
getOpType
()
{
return
bundle
.
getInt
(
KEY_OP_TYPE
,
0
);
}
public
OpEntry
setOpType
(
int
opType
)
{
bundle
.
putInt
(
KEY_OP_TYPE
,
opType
);
return
this
;
}
public
String
getStringValue
(
String
defValue
)
{
return
bundle
.
getString
(
KEY_VALUE
,
defValue
);
}
public
OpEntry
setStringValue
(
String
value
)
{
bundle
.
putInt
(
KEY_VALUE_TYPE
,
VALUE_TYPE_STRING
);
bundle
.
putString
(
KEY_VALUE
,
value
);
return
this
;
}
public
int
getIntValue
(
int
defValue
)
{
return
bundle
.
getInt
(
KEY_VALUE
,
defValue
);
}
public
OpEntry
setIntValue
(
int
value
)
{
bundle
.
putInt
(
KEY_VALUE_TYPE
,
VALUE_TYPE_INT
);
bundle
.
putInt
(
KEY_VALUE
,
value
);
return
this
;
}
public
long
getLongValue
(
long
defValue
)
{
return
bundle
.
getLong
(
KEY_VALUE
,
defValue
);
}
public
OpEntry
setLongValue
(
long
value
)
{
bundle
.
putInt
(
KEY_VALUE_TYPE
,
VALUE_TYPE_LONG
);
bundle
.
putLong
(
KEY_VALUE
,
value
);
return
this
;
}
public
float
getFloatValue
(
float
defValue
)
{
return
bundle
.
getFloat
(
KEY_VALUE
);
}
public
OpEntry
setFloatValue
(
float
value
)
{
bundle
.
putInt
(
KEY_VALUE_TYPE
,
VALUE_TYPE_FLOAT
);
bundle
.
putFloat
(
KEY_VALUE
,
value
);
return
this
;
}
public
boolean
getBooleanValue
(
boolean
defValue
)
{
return
bundle
.
getBoolean
(
KEY_VALUE
,
defValue
);
}
public
OpEntry
setBooleanValue
(
boolean
value
)
{
bundle
.
putInt
(
KEY_VALUE_TYPE
,
VALUE_TYPE_BOOLEAN
);
bundle
.
putBoolean
(
KEY_VALUE
,
value
);
return
this
;
}
public
Set
<
String
>
getStringSet
()
{
ArrayList
<
String
>
list
=
bundle
.
getStringArrayList
(
KEY_VALUE
);
return
list
==
null
?
null
:
new
HashSet
<>(
list
);
}
public
Bundle
getBundle
()
{
return
bundle
;
}
public
OpEntry
setStringSettingsValue
(
Set
<
String
>
value
)
{
bundle
.
putInt
(
KEY_VALUE_TYPE
,
VALUE_TYPE_STRING_SET
);
bundle
.
putStringArrayList
(
KEY_VALUE
,
value
==
null
?
null
:
new
ArrayList
<>(
value
));
return
this
;
}
static
OpEntry
obtainGetOperation
(
String
key
)
{
return
new
OpEntry
()
.
setKey
(
key
)
.
setOpType
(
OP_TYPE_GET
);
}
static
OpEntry
obtainPutOperation
(
String
key
)
{
return
new
OpEntry
()
.
setKey
(
key
)
.
setOpType
(
OP_TYPE_PUT
);
}
static
OpEntry
obtainRemoveOperation
(
String
key
)
{
return
new
OpEntry
()
.
setKey
(
key
)
.
setOpType
(
OP_TYPE_REMOVE
);
}
static
OpEntry
obtainClear
()
{
return
new
OpEntry
()
.
setOpType
(
OP_TYPE_CLEAR
);
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/call/preference/PreferenceUtil.java
View file @
2ab6d2ba
package
com
.
mints
.
goodmoney
.
call
.
preference
;
import
android.content.Context
;
import
android.content.SharedPreferences
;
import
android.net.Uri
;
import
androidx.annotation.NonNull
;
import
com.mints.goodmoney.common.Constant
;
public
class
PreferenceUtil
{
public
static
final
String
METHOD_CONTAIN_KEY
=
"method_contain_key"
;
public
static
final
String
AUTHORITY
=
Constant
.
MINTS_PKG_NAME
;
public
static
final
Uri
URI
=
Uri
.
parse
(
"content://"
+
AUTHORITY
);
public
static
final
String
METHOD_QUERY_VALUE
=
"method_query_value"
;
public
static
final
String
METHOD_EIDIT_VALUE
=
"method_edit"
;
public
static
final
String
METHOD_QUERY_PID
=
"method_query_pid"
;
public
static
final
String
KEY_VALUES
=
"key_result"
;
}
GoodMoney/app/src/main/java/com/mints/goodmoney/call/preference/SharedPreferenceProvider.java
deleted
100644 → 0
View file @
0c737d5a
package
com
.
mints
.
goodmoney
.
call
.
preference
;
import
android.content.ContentProvider
;
import
android.content.ContentValues
;
import
android.content.Context
;
import
android.content.SharedPreferences
;
import
android.database.Cursor
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Process
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.collection.ArrayMap
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.Map
;
import
java.util.Set
;
public
class
SharedPreferenceProvider
extends
ContentProvider
{
private
Map
<
String
,
MethodProcess
>
processerMap
=
new
ArrayMap
<>();
@Override
public
boolean
onCreate
()
{
processerMap
.
put
(
PreferenceUtil
.
METHOD_QUERY_VALUE
,
methodQueryValues
);
processerMap
.
put
(
PreferenceUtil
.
METHOD_CONTAIN_KEY
,
methodContainKey
);
processerMap
.
put
(
PreferenceUtil
.
METHOD_EIDIT_VALUE
,
methodEditor
);
processerMap
.
put
(
PreferenceUtil
.
METHOD_QUERY_PID
,
methodQueryPid
);
return
true
;
}
@Nullable
@Override
public
Cursor
query
(
@NonNull
Uri
uri
,
@Nullable
String
[]
projection
,
@Nullable
String
selection
,
@Nullable
String
[]
selectionArgs
,
@Nullable
String
sortOrder
)
{
throw
new
UnsupportedOperationException
();
}
@Nullable
@Override
public
String
getType
(
@NonNull
Uri
uri
)
{
throw
new
UnsupportedOperationException
();
}
@Nullable
@Override
public
Uri
insert
(
@NonNull
Uri
uri
,
@Nullable
ContentValues
values
)
{
throw
new
UnsupportedOperationException
();
}
@Override
public
int
delete
(
@NonNull
Uri
uri
,
@Nullable
String
selection
,
@Nullable
String
[]
selectionArgs
)
{
throw
new
UnsupportedOperationException
();
}
@Override
public
int
update
(
@NonNull
Uri
uri
,
@Nullable
ContentValues
values
,
@Nullable
String
selection
,
@Nullable
String
[]
selectionArgs
)
{
throw
new
UnsupportedOperationException
();
}
@Nullable
@Override
public
Bundle
call
(
@NonNull
String
method
,
@Nullable
String
arg
,
@Nullable
Bundle
extras
)
{
MethodProcess
processer
=
processerMap
.
get
(
method
);
return
processer
==
null
?
null
:
processer
.
process
(
arg
,
extras
);
}
public
interface
MethodProcess
{
Bundle
process
(
@Nullable
String
arg
,
@Nullable
Bundle
extras
);
}
private
MethodProcess
methodQueryPid
=
new
MethodProcess
()
{
@Override
public
Bundle
process
(
@Nullable
String
arg
,
@Nullable
Bundle
extras
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
PreferenceUtil
.
KEY_VALUES
,
Process
.
myPid
());
return
bundle
;
}
};
private
MethodProcess
methodQueryValues
=
new
MethodProcess
()
{
@Override
public
Bundle
process
(
@Nullable
String
arg
,
@Nullable
Bundle
extras
)
{
if
(
extras
==
null
)
{
throw
new
IllegalArgumentException
(
"methodQueryValues, extras is null!"
);
}
Context
ctx
=
getContext
();
if
(
ctx
==
null
)
{
throw
new
IllegalArgumentException
(
"methodQueryValues, ctx is null!"
);
}
String
key
=
extras
.
getString
(
OpEntry
.
KEY_KEY
);
SharedPreferences
preferences
=
ctx
.
getSharedPreferences
(
arg
,
Context
.
MODE_PRIVATE
);
int
valueType
=
extras
.
getInt
(
OpEntry
.
KEY_VALUE_TYPE
);
switch
(
valueType
)
{
case
OpEntry
.
VALUE_TYPE_BOOLEAN
:{
boolean
value
=
preferences
.
getBoolean
(
key
,
extras
.
getBoolean
(
OpEntry
.
KEY_VALUE
));
extras
.
putBoolean
(
OpEntry
.
KEY_VALUE
,
value
);
return
extras
;
}
case
OpEntry
.
VALUE_TYPE_FLOAT
:{
float
value
=
preferences
.
getFloat
(
key
,
extras
.
getFloat
(
OpEntry
.
KEY_VALUE
));
extras
.
putFloat
(
OpEntry
.
KEY_VALUE
,
value
);
return
extras
;
}
case
OpEntry
.
VALUE_TYPE_INT
:{
int
value
=
preferences
.
getInt
(
key
,
extras
.
getInt
(
OpEntry
.
KEY_VALUE
));
extras
.
putInt
(
OpEntry
.
KEY_VALUE
,
value
);
return
extras
;
}
case
OpEntry
.
VALUE_TYPE_LONG
:{
long
value
=
preferences
.
getLong
(
key
,
extras
.
getLong
(
OpEntry
.
KEY_VALUE
));
extras
.
putLong
(
OpEntry
.
KEY_VALUE
,
value
);
return
extras
;
}
case
OpEntry
.
VALUE_TYPE_STRING
:{
String
value
=
preferences
.
getString
(
key
,
extras
.
getString
(
OpEntry
.
KEY_VALUE
));
extras
.
putString
(
OpEntry
.
KEY_VALUE
,
value
);
return
extras
;
}
case
OpEntry
.
VALUE_TYPE_STRING_SET
:{
Set
<
String
>
value
=
preferences
.
getStringSet
(
key
,
null
);
extras
.
putStringArrayList
(
OpEntry
.
KEY_VALUE
,
value
==
null
?
null
:
new
ArrayList
<>(
value
));
return
extras
;
}
default
:{
throw
new
IllegalArgumentException
(
"unknown valueType:"
+
valueType
);
}
}
}
};
private
MethodProcess
methodContainKey
=
new
MethodProcess
()
{
@Override
public
Bundle
process
(
@Nullable
String
arg
,
@Nullable
Bundle
extras
)
{
if
(
extras
==
null
)
{
throw
new
IllegalArgumentException
(
"methodQueryValues, extras is null!"
);
}
Context
ctx
=
getContext
();
if
(
ctx
==
null
)
{
throw
new
IllegalArgumentException
(
"methodQueryValues, ctx is null!"
);
}
String
key
=
extras
.
getString
(
OpEntry
.
KEY_KEY
);
SharedPreferences
preferences
=
ctx
.
getSharedPreferences
(
arg
,
Context
.
MODE_PRIVATE
);
extras
.
putBoolean
(
PreferenceUtil
.
KEY_VALUES
,
preferences
.
contains
(
key
));
return
extras
;
}
};
private
MethodProcess
methodEditor
=
new
MethodProcess
()
{
@Override
public
Bundle
process
(
@Nullable
String
arg
,
@Nullable
Bundle
extras
)
{
if
(
extras
==
null
)
{
throw
new
IllegalArgumentException
(
"methodQueryValues, extras is null!"
);
}
Context
ctx
=
getContext
();
if
(
ctx
==
null
)
{
throw
new
IllegalArgumentException
(
"methodQueryValues, ctx is null!"
);
}
SharedPreferences
preferences
=
ctx
.
getSharedPreferences
(
arg
,
Context
.
MODE_PRIVATE
);
ArrayList
<
Bundle
>
ops
=
extras
.
getParcelableArrayList
(
PreferenceUtil
.
KEY_VALUES
);
if
(
ops
==
null
)
{
ops
=
new
ArrayList
<>();
}
SharedPreferences
.
Editor
editor
=
preferences
.
edit
();
for
(
Bundle
opBundler
:
ops
)
{
int
opType
=
opBundler
.
getInt
(
OpEntry
.
KEY_OP_TYPE
);
switch
(
opType
)
{
case
OpEntry
.
OP_TYPE_PUT
:
{
editor
=
editValue
(
editor
,
opBundler
);
break
;
}
case
OpEntry
.
OP_TYPE_REMOVE
:
{
editor
=
editor
.
remove
(
opBundler
.
getString
(
OpEntry
.
KEY_KEY
));
break
;
}
case
OpEntry
.
OP_TYPE_CLEAR
:
{
editor
=
editor
.
clear
();
break
;
}
default
:
{
throw
new
IllegalArgumentException
(
"unkonw op type:"
+
opType
);
}
}
}
int
applyOrCommit
=
extras
.
getInt
(
OpEntry
.
KEY_OP_TYPE
);
if
(
applyOrCommit
==
OpEntry
.
OP_TYPE_APPLY
)
{
editor
.
apply
();
return
null
;
}
else
if
(
applyOrCommit
==
OpEntry
.
OP_TYPE_COMMIT
)
{
boolean
res
=
editor
.
commit
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putBoolean
(
PreferenceUtil
.
KEY_VALUES
,
res
);
return
bundle
;
}
else
{
throw
new
IllegalArgumentException
(
"unknown applyOrCommit:"
+
applyOrCommit
);
}
}
private
SharedPreferences
.
Editor
editValue
(
SharedPreferences
.
Editor
editor
,
Bundle
opBundle
)
{
String
key
=
opBundle
.
getString
(
OpEntry
.
KEY_KEY
);
int
valueType
=
opBundle
.
getInt
(
OpEntry
.
KEY_VALUE_TYPE
);
switch
(
valueType
)
{
case
OpEntry
.
VALUE_TYPE_BOOLEAN
:
{
return
editor
.
putBoolean
(
key
,
opBundle
.
getBoolean
(
OpEntry
.
KEY_VALUE
));
}
case
OpEntry
.
VALUE_TYPE_FLOAT
:
{
return
editor
.
putFloat
(
key
,
opBundle
.
getFloat
(
OpEntry
.
KEY_VALUE
));
}
case
OpEntry
.
VALUE_TYPE_INT
:
{
return
editor
.
putInt
(
key
,
opBundle
.
getInt
(
OpEntry
.
KEY_VALUE
));
}
case
OpEntry
.
VALUE_TYPE_LONG
:
{
return
editor
.
putLong
(
key
,
opBundle
.
getLong
(
OpEntry
.
KEY_VALUE
));
}
case
OpEntry
.
VALUE_TYPE_STRING
:
{
return
editor
.
putString
(
key
,
opBundle
.
getString
(
OpEntry
.
KEY_VALUE
));
}
case
OpEntry
.
VALUE_TYPE_STRING_SET
:
{
ArrayList
<
String
>
list
=
opBundle
.
getStringArrayList
(
OpEntry
.
KEY_VALUE
);
if
(
list
==
null
)
{
return
editor
.
putStringSet
(
key
,
null
);
}
return
editor
.
putStringSet
(
key
,
new
HashSet
<>(
list
));
}
default
:
{
throw
new
IllegalArgumentException
(
"unknown valueType:"
+
valueType
);
}
}
}
};
}
GoodMoney/app/src/main/java/com/mints/goodmoney/call/util/Util.java
deleted
100644 → 0
View file @
0c737d5a
package
com
.
mints
.
goodmoney
.
call
.
util
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Util
{
/**
* 复制asset文件到指定目录
*
* @param oldPath asset下的路径
* @param newPath SD卡下保存路径
*/
public
static
void
CopyAssets
(
Context
context
,
String
oldPath
,
String
newPath
)
{
try
{
String
[]
fileNames
=
context
.
getAssets
().
list
(
oldPath
);
// 获取assets目录下的所有文件及目录名
if
(
fileNames
.
length
>
0
)
{
// 如果是目录
File
file
=
new
File
(
newPath
);
file
.
mkdirs
();
// 如果文件夹不存在,则递归
for
(
String
fileName
:
fileNames
)
{
CopyAssets
(
context
,
oldPath
+
"/"
+
fileName
,
newPath
+
"/"
+
fileName
);
}
}
else
{
// 如果是文件
InputStream
is
=
context
.
getAssets
().
open
(
oldPath
);
FileOutputStream
fos
=
new
FileOutputStream
(
new
File
(
newPath
));
byte
[]
buffer
=
new
byte
[
1024
];
int
byteCount
;
while
((
byteCount
=
is
.
read
(
buffer
))
!=
-
1
)
{
// 循环从输入流读取
// buffer字节
fos
.
write
(
buffer
,
0
,
byteCount
);
// 将读取的输入流写入到输出流
}
fos
.
flush
();
// 刷新缓冲区
is
.
close
();
fos
.
close
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
static
List
<
String
>
getAllName
(
String
path
)
{
if
(
TextUtils
.
isEmpty
(
path
))
{
return
null
;
}
File
pathFile
=
new
File
(
path
);
if
(
pathFile
.
exists
()
&&
pathFile
.
isDirectory
())
{
File
[]
files
=
pathFile
.
listFiles
();
if
(
files
==
null
)
{
return
null
;
}
List
<
String
>
result
=
new
ArrayList
<>();
for
(
File
file
:
files
)
{
result
.
add
(
file
.
getName
());
}
return
result
;
}
return
null
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
2ab6d2ba
...
...
@@ -212,10 +212,11 @@ object Constant {
const
val
MERGE_KEY
=
"merge_key"
// wrapper type 0-新闻 1-小说
// wrapper type 0-新闻 1-小说
2-平台分红
const
val
WRAPPER_TYPE
=
"wrapper_type"
const
val
WRAPPER_TYPE_NEWS
=
0
const
val
WRAPPER_TYPE_BOOK
=
1
const
val
WRAPPER_TYPE_FRIENDS
=
2
//1登录,2提现,3任务
const
val
RISK_EVENT_ID_LOGIN
=
1
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/UserManager.java
View file @
2ab6d2ba
...
...
@@ -391,7 +391,7 @@ public class UserManager {
return
;
}
ps
.
removeByKey
(
USER_ID
);
//
ps.removeByKey(CODE_ID);
ps
.
removeByKey
(
CODE_ID
);
ps
.
removeByKey
(
TOKEN_ID
);
ps
.
removeByKey
(
REAL_NAME
);
ps
.
removeByKey
(
IS_TEMP_USER
);
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AboutusActivity.kt
View file @
2ab6d2ba
...
...
@@ -8,6 +8,7 @@ import com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.TtCsjAdManager
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.utils.ToastUtil
import
com.mints.library.utils.CommonUtils
...
...
@@ -35,9 +36,8 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
ivAboutasIcon
.
setOnLongClickListener
{
ToastUtil
.
showLong
(
MintsApplication
.
getContext
(),
"自有渠道:"
+
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
+
"\n\n 广告代码位:"
+
AppConfig
.
user_channel_ad
+
"\n\n 头条渠道:"
+
HumeSDK
.
getChannel
(
context
)
+
"\n\n 头条version:"
+
HumeSDK
.
getVersion
())
"\n 广告代码位:"
+
AppConfig
.
user_channel_ad
+
"\n 头条渠道:"
+
HumeSDK
.
getChannel
(
context
))
true
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
View file @
2ab6d2ba
...
...
@@ -17,7 +17,6 @@ import com.mints.goodmoney.mvp.model.VideoAdingBean
import
com.mints.goodmoney.mvp.presenters.KylVideoPresenter
import
com.mints.goodmoney.mvp.views.KylVideoView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.utils.CacheUtil
import
com.mints.goodmoney.utils.MD5
import
com.tbruyelle.rxpermissions.RxPermissions
import
kotlinx.android.synthetic.main.activity_kyl_video.*
...
...
@@ -66,24 +65,24 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
}
private
fun
loadVedio
(
vedioUrl
:
String
)
{
jzvdStd
.
setOnPreparedListener
{
mp
:
MediaPlayer
->
cvvVedio
.
setOnPreparedListener
{
mp
:
MediaPlayer
->
mp
.
start
()
mp
.
isLooping
=
true
}
jzvdStd
?.
setVideoPath
(
vedioUrl
)
jzvdStd
?.
start
()
cvvVedio
?.
setVideoPath
(
vedioUrl
)
cvvVedio
?.
start
()
}
override
fun
onResume
()
{
super
.
onResume
()
jzvdStd
.
resume
()
cvvVedio
.
resume
()
}
override
fun
onPause
()
{
super
.
onPause
()
jzvdStd
.
pause
()
cvvVedio
.
pause
()
}
override
fun
onDestroy
()
{
...
...
@@ -91,10 +90,8 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
if
(
downloadId
!=
-
1
)
{
PRDownloader
.
cancel
(
downloadId
)
}
//删除缓存文件
CacheUtil
.
clearAllCache
(
context
)
videoAdingManager
.
setVideoAdingListener
(
null
)
videoAdingManager
.
onDestory
()
kylVideoPresenter
.
detachView
()
}
...
...
@@ -194,8 +191,11 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
}
private
fun
vedioAdingSuccess
(
adType
:
String
)
{
if
(
downloadVedioSucFlag
&&
!
TextUtils
.
isEmpty
(
vedioPathName
))
{
DetailActivity
.
startSelf
(
this
@KylVideoActivity
,
vedioPathName
)
if
(!
downloadVedioSucFlag
||
TextUtils
.
isEmpty
(
vedioPathName
))
{
showToast
(
"视频处理中,请稍候"
)
return
}
DetailActivity
.
startSelf
(
this
@KylVideoActivity
,
vedioPathName
)
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
View file @
2ab6d2ba
...
...
@@ -74,7 +74,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_phone
.
setOnClickListener
(
this
)
item_wechat
.
setOnClickListener
(
this
)
item_invitedCode
.
setOnClickListener
(
this
)
//
item_invitedCode.setOnClickListener(this)
item_cleanCache
.
setOnClickListener
(
this
)
item_userAgree
.
setOnClickListener
(
this
)
item_privacyAgree
.
setOnClickListener
(
this
)
...
...
@@ -106,13 +106,13 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_wechat
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
"未授权"
}
//
item_invitedCode.findViewById<TextView>(R.id.tv_title).text = "邀请码"
//
val invitedCode = resources.getDrawable(R.mipmap.icon_settings_invite)
//
invitedCode.setBounds(0, 0, 56, 56)
//
item_invitedCode.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(invitedCode, null, null, null)
//
item_invitedCode.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
//
item_invitedCode.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
// item_invitedCode.findViewById<TextView>(R.id.tv_right).text = "填写邀请码 海量金币等你拿"
item_invitedCode
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
text
=
"邀请码"
val
invitedCode
=
resources
.
getDrawable
(
R
.
mipmap
.
icon_settings_invite
)
invitedCode
.
setBounds
(
0
,
0
,
56
,
56
)
item_invitedCode
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
setCompoundDrawables
(
invitedCode
,
null
,
null
,
null
)
item_invitedCode
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
visibility
=
View
.
VISIBLE
item_invitedCode
.
findViewById
<
ImageView
>(
R
.
id
.
iv_right
).
visibility
=
View
.
GONE
item_invitedCode
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
UserManager
.
getInstance
().
codeID
item_cleanCache
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
text
=
"清理缓存"
val
cleanCache
=
ContextCompat
.
getDrawable
(
this
,
R
.
mipmap
.
icon_settings_clean
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
View file @
2ab6d2ba
...
...
@@ -5,6 +5,7 @@ import android.view.View
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.FriendsFragment
import
com.mints.goodmoney.ui.fragment.MyZhangyueFragment
import
com.mints.goodmoney.ui.fragment.RsNewsFragment
import
com.mints.goodmoney.ui.fragment.ZhangyueFragment
...
...
@@ -64,6 +65,15 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
.
add
(
R
.
id
.
flWrapper
,
zhangyueFragment
).
commit
()
}
}
Constant
.
WRAPPER_TYPE_FRIENDS
->
{
tv_title
.
text
=
"瓜分百万现金福利"
val
friendsFragment
=
FriendsFragment
()
if
(!
friendsFragment
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
flWrapper
,
friendsFragment
).
commit
()
}
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/XmlyPlayActivity.kt
View file @
2ab6d2ba
...
...
@@ -197,7 +197,6 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
*/
private
fun
getDataSuc
(
list
:
List
<
Track
>)
{
if
(
::
xmlyPlayAdapter
.
isInitialized
)
{
xmlyData
.
clear
()
xmlyData
.
addAll
(
list
)
if
(
xmlyPage
==
1
)
{
srl_xmly
.
finishRefresh
(
true
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
View file @
2ab6d2ba
...
...
@@ -161,7 +161,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_FOUR
)
{
// if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FRIENDS
) {
if
(!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
userID
))
{
// 刷新分红数据
friendsPresenter
.
getFriendHallMsg
()
...
...
@@ -184,7 +184,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
showRedbox
(
btn_get_bonus
)
}
}
}
//
}
}
override
fun
onPause
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
2ab6d2ba
...
...
@@ -415,11 +415,6 @@ class MyFragment : BaseFragment(),
}
var
userGold
=
"0.00"
if
(
userConfig
!=
null
)
{
if
(
BuildConfig
.
DEBUG
)
{
item_title_invitecode
.
text
=
"-邀请码:"
+
userConfig
!!
.
userMsg
.
idcode
}
else
{
item_title_invitecode
.
text
=
"邀请码:"
+
userConfig
!!
.
userMsg
.
idcode
}
val
allcoinBig
=
BigDecimal
(
userConfig
!!
.
userMsg
.
coin
.
toString
())
val
rateBig
=
BigDecimal
(
"10000"
)
val
cashStr
:
String
=
allcoinBig
.
divide
(
rateBig
).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
).
toString
()
...
...
@@ -763,25 +758,10 @@ class MyFragment : BaseFragment(),
readyGo
(
CoinRecordActivity
::
class
.
java
)
}
R
.
id
.
item_title_invitecode
->
{
if
(
userConfig
!=
null
)
{
val
invitedCode
=
userConfig
!!
.
userMsg
.
idcode
if
(!
TextUtils
.
isEmpty
(
invitedCode
))
{
showToast
(
"复制成功"
)
val
clipboardManager
=
mContext
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
clipboardManager
.
setPrimaryClip
(
ClipData
.
newPlainText
(
"invitecode_copy"
,
invitedCode
))
}
}
}
R
.
id
.
item_title_invitecode_copy
->
{
if
(
userConfig
!=
null
)
{
val
invitedCode
=
userConfig
!!
.
userMsg
.
idcode
if
(!
TextUtils
.
isEmpty
(
invitedCode
))
{
showToast
(
"复制成功"
)
val
clipboardManager
=
mContext
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
clipboardManager
.
setPrimaryClip
(
ClipData
.
newPlainText
(
"invitecode_copy"
,
invitedCode
))
}
}
R
.
id
.
item_title_friends
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_FRIENDS
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
}
}
...
...
@@ -1048,8 +1028,7 @@ class MyFragment : BaseFragment(),
iv_right_icon
.
setOnClickListener
(
this
)
btn_withdraw
.
setOnClickListener
(
this
)
btn_coinRecord
.
setOnClickListener
(
this
)
item_title_invitecode
.
setOnClickListener
(
this
)
item_title_invitecode_copy
.
setOnClickListener
(
this
)
item_title_friends
.
setOnClickListener
(
this
)
ll_my_login
.
setOnClickListener
(
this
)
item_customer_service
.
setOnClickListener
(
this
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
View file @
2ab6d2ba
...
...
@@ -16,10 +16,7 @@ import com.mints.goodmoney.mvp.model.PanActionInfo
import
com.mints.goodmoney.mvp.model.TurntableBean
import
com.mints.goodmoney.mvp.presenters.PanPresenter
import
com.mints.goodmoney.mvp.views.PanView
import
com.mints.goodmoney.ui.activitys.AwardActivity
import
com.mints.goodmoney.ui.activitys.MainActivity
import
com.mints.goodmoney.ui.activitys.TaskActivity
import
com.mints.goodmoney.ui.activitys.WxLoginActivity
import
com.mints.goodmoney.ui.activitys.*
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.library.utils.json.JsonUtil
import
com.xiangzi.articlesdk.callback.IXzArticleSdkInitCallback
...
...
@@ -148,8 +145,9 @@ class PanFragment : BaseFragment(), PanView {
return
}
val
activity
:
MainActivity
?
=
activity
as
MainActivity
?
activity
?.
clickTab4Layout
()
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_FRIENDS
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
3
->
{
if
(!
userManager
.
userIsLogin
())
{
...
...
GoodMoney/app/src/main/res/layout/activity_kyl_video.xml
View file @
2ab6d2ba
...
...
@@ -6,7 +6,7 @@
android:background=
"@color/black"
>
<com.mints.goodmoney.call.widget.CustomVideoView
android:id=
"@+id/
jzvdStd
"
android:id=
"@+id/
cvvVedio
"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
...
...
@@ -21,13 +21,17 @@
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<
Image
View
<
Text
View
android:id=
"@+id/ivSetting"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"100dp"
android:src=
"@mipmap/ic_launcher_main"
android:layout_marginRight=
"10dp"
android:layout_marginBottom=
"120dp"
android:drawableTop=
"@mipmap/ic_setting_vedio"
android:drawablePadding=
"4dp"
android:text=
"设置来电秀"
android:textColor=
"@color/color_FF9837"
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
...
...
GoodMoney/app/src/main/res/layout/activity_settings.xml
View file @
2ab6d2ba
...
...
@@ -26,8 +26,7 @@
<include
android:id=
"@+id/item_invitedCode"
layout=
"@layout/item_settings"
android:visibility=
"gone"
/>
layout=
"@layout/item_settings"
/>
<include
android:id=
"@+id/item_cleanCache"
...
...
GoodMoney/app/src/main/res/layout/fragment_main_friends.xml
View file @
2ab6d2ba
...
...
@@ -5,7 +5,8 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<include
layout=
"@layout/header_layout"
/>
<include
layout=
"@layout/header_layout"
android:visibility=
"gone"
/>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/srl_my"
...
...
GoodMoney/app/src/main/res/layout/item_fragment_main_my_title.xml
View file @
2ab6d2ba
...
...
@@ -13,7 +13,7 @@
android:layout_width=
"70dp"
android:layout_height=
"70dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraint
Start_toStar
tOf=
"parent"
app:layout_constraint
Left_toLef
tOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
...
...
@@ -28,37 +28,22 @@
android:textColor=
"@color/black"
android:textSize=
"20sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toTopOf=
"@id/item_title_invitecode"
app:layout_constraintStart_toEndOf=
"@id/item_title_avatar"
app:layout_constraintTop_toTopOf=
"@id/item_title_avatar"
/>
<TextView
android:id=
"@+id/item_title_invitecode"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:textColor=
"@color/color_333"
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraint
Start_toEndOf=
"@
id/item_title_avatar"
app:layout_constraintTop_to
BottomOf=
"@id/item_title_id
"
/>
app:layout_constraint
Left_toRightOf=
"@+
id/item_title_avatar"
app:layout_constraintTop_to
TopOf=
"parent
"
/>
<TextView
android:id=
"@+id/item_title_
invitecode_copy
"
android:id=
"@+id/item_title_
friends
"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginStart=
"6dp"
android:background=
"@drawable/shape_tv_gold_gury"
android:paddingLeft=
"10dp"
android:paddingTop=
"2dp"
android:paddingRight=
"10dp"
android:paddingBottom=
"2dp"
android:text=
"复制"
android:textColor=
"@color/color_666"
android:textSize=
"12sp"
android:drawableLeft=
"@mipmap/ic_friends_enable"
android:drawablePadding=
"2dp"
android:text=
"平台分红"
android:textColor=
"@color/color_FF9837"
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraint
Start_toEndOf=
"@id/item_title_invitecode
"
app:layout_constraintTop_to
BottomOf=
"@id/item_title_id
"
/>
app:layout_constraint
Right_toRightOf=
"parent
"
app:layout_constraintTop_to
TopOf=
"parent
"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
GoodMoney/app/src/main/res/layout/item_settings.xml
View file @
2ab6d2ba
...
...
@@ -3,7 +3,6 @@
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"20dp"
>
<TextView
...
...
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_setting_vedio.png
0 → 100644
View file @
2ab6d2ba
3.26 KB
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