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
25089161
Commit
25089161
authored
Nov 30, 2020
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加二维码分享功能
parent
fc12fd52
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
545 additions
and
120 deletions
+545
-120
build.gradle
GoodMoney/app/build.gradle
+2
-2
AndroidManifest.xml
GoodMoney/app/src/main/AndroidManifest.xml
+2
-1
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+26
-0
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+6
-0
TTPreLoadCarrierExpressManager.java
...nts/goodmoney/manager/TTPreLoadCarrierExpressManager.java
+30
-29
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+15
-13
FriendsFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
+42
-18
HorizChannelFragment.kt
...a/com/mints/goodmoney/ui/fragment/HorizChannelFragment.kt
+17
-3
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+28
-8
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+7
-1
CountDownVedioView.java
...va/com/mints/goodmoney/ui/widgets/CountDownVedioView.java
+23
-6
CountDownView.java
...in/java/com/mints/goodmoney/ui/widgets/CountDownView.java
+14
-18
ShareDialog.kt
...c/main/java/com/mints/goodmoney/ui/widgets/ShareDialog.kt
+117
-0
BubbleSeekBar.java
...com/mints/goodmoney/ui/widgets/seekbar/BubbleSeekBar.java
+1
-1
QRCodeUtil.java
...p/src/main/java/com/mints/goodmoney/utils/QRCodeUtil.java
+52
-0
ToastUtil.java
...pp/src/main/java/com/mints/goodmoney/utils/ToastUtil.java
+23
-18
dialog_share.xml
GoodMoney/app/src/main/res/layout/dialog_share.xml
+129
-0
ic_share_wx.png
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_share_wx.png
+0
-0
ic_wx_friends.png
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_wx_friends.png
+0
-0
themes.xml
GoodMoney/app/src/main/res/values/themes.xml
+11
-2
No files found.
GoodMoney/app/build.gradle
View file @
25089161
...
@@ -170,7 +170,8 @@ dependencies {
...
@@ -170,7 +170,8 @@ dependencies {
implementation
'com.romandanylyk:pageindicatorview:1.0.3'
implementation
'com.romandanylyk:pageindicatorview:1.0.3'
// xtablayout
// xtablayout
implementation
'com.androidkun:XTabLayout:1.1.4'
implementation
'com.androidkun:XTabLayout:1.1.4'
// zxing
implementation
'com.king.zxing:zxing-lite:1.1.7-androidx'
// 工具类
// 工具类
// gson
// gson
...
@@ -178,7 +179,6 @@ dependencies {
...
@@ -178,7 +179,6 @@ dependencies {
// BASE64Decoder
// BASE64Decoder
implementation
files
(
'libs/sun.misc.BASE64Decoder.jar'
)
implementation
files
(
'libs/sun.misc.BASE64Decoder.jar'
)
// 三方接入
// 三方接入
// leakcanary
// leakcanary
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
...
...
GoodMoney/app/src/main/AndroidManifest.xml
View file @
25089161
...
@@ -102,7 +102,8 @@
...
@@ -102,7 +102,8 @@
<activity
<activity
android:name=
".ui.activitys.SplashYlhActivity"
android:name=
".ui.activitys.SplashYlhActivity"
android:screenOrientation=
"portrait"
>
android:screenOrientation=
"portrait"
android:theme=
"@style/Theme.NoDisplay"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
25089161
package
com
.
mints
.
goodmoney
;
package
com
.
mints
.
goodmoney
;
import
android.app.ActivityManager
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Build
;
...
@@ -50,10 +51,23 @@ public class MintsApplication extends MultiDexApplication {
...
@@ -50,10 +51,23 @@ public class MintsApplication extends MultiDexApplication {
mContext
=
this
.
getApplicationContext
();
mContext
=
this
.
getApplicationContext
();
// 判断应用是否在前台
// 判断应用是否在前台
ForegroundOrBackground
.
init
(
this
);
ForegroundOrBackground
.
init
(
this
);
// 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前
androidPWebView
();
// 三方配置
// 三方配置
thirdConfig
();
thirdConfig
();
}
}
private
void
androidPWebView
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
String
processName
=
getProcessName
(
this
);
String
packageName
=
this
.
getPackageName
();
if
(!
packageName
.
equals
(
processName
))
{
// 为不同进程webView设置不同目录
WebView
.
setDataDirectorySuffix
(
processName
);
}
}
}
@Override
@Override
public
void
onLowMemory
()
{
public
void
onLowMemory
()
{
android
.
os
.
Process
.
killProcess
(
android
.
os
.
Process
.
myPid
());
android
.
os
.
Process
.
killProcess
(
android
.
os
.
Process
.
myPid
());
...
@@ -161,4 +175,16 @@ public class MintsApplication extends MultiDexApplication {
...
@@ -161,4 +175,16 @@ public class MintsApplication extends MultiDexApplication {
}
}
return
defaultSubscribeScheduler
;
return
defaultSubscribeScheduler
;
}
}
private
String
getProcessName
(
Context
context
)
{
if
(
context
==
null
)
return
null
;
ActivityManager
manager
=
(
ActivityManager
)
context
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
for
(
ActivityManager
.
RunningAppProcessInfo
processInfo
:
manager
.
getRunningAppProcesses
())
{
if
(
processInfo
.
pid
==
android
.
os
.
Process
.
myPid
())
{
return
processInfo
.
processName
;
}
}
return
null
;
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
25089161
...
@@ -77,6 +77,12 @@ object Constant {
...
@@ -77,6 +77,12 @@ object Constant {
const
val
FRAGMENT_CLICK_FRIENDS
=
3
const
val
FRAGMENT_CLICK_FRIENDS
=
3
const
val
FRAGMENT_CLICK_MY
=
4
const
val
FRAGMENT_CLICK_MY
=
4
const
val
FRAGMENT_TAG_MAIN
=
"FRAGMENT_TAG_MAIN"
const
val
FRAGMENT_TAG_CHANNEL
=
"FRAGMENT_TAG_CHANNEL"
const
val
FRAGMENT_TAG_PAN
=
"FRAGMENT_TAG_PAN"
const
val
FRAGMENT_TAG_FRIENDS
=
"FRAGMENT_TAG_FRIENDS"
const
val
FRAGMENT_TAG_MY
=
"FRAGMENT_TAG_MY"
// 协议地址
// 协议地址
var
REGISTER_URL
=
BuildConfig
.
MainIp
+
"gm/register.html"
//服务协议
var
REGISTER_URL
=
BuildConfig
.
MainIp
+
"gm/register.html"
//服务协议
var
PRIVACY_URL
=
BuildConfig
.
MainIp
+
"gm/privacy.html"
//隐私协议
var
PRIVACY_URL
=
BuildConfig
.
MainIp
+
"gm/privacy.html"
//隐私协议
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TTPreLoadCarrierExpressManager.java
View file @
25089161
...
@@ -18,7 +18,7 @@ public class TTPreLoadCarrierExpressManager {
...
@@ -18,7 +18,7 @@ public class TTPreLoadCarrierExpressManager {
private
FrameLayout
ttFrameLayout
;
private
FrameLayout
ttFrameLayout
;
private
TTNativeExpressManager
ttNativeExpressManager
;
private
TTNativeExpressManager
ttNativeExpressManager
;
private
HandlerThread
mHandlerThread
=
new
HandlerThread
(
"TTPreLoadHandlerThread"
)
;
private
HandlerThread
mHandlerThread
;
private
Handler
mWorkHandler
;
private
Handler
mWorkHandler
;
private
Handler
mMainHandler
=
new
Handler
(
Looper
.
getMainLooper
());
private
Handler
mMainHandler
=
new
Handler
(
Looper
.
getMainLooper
());
...
@@ -31,22 +31,20 @@ public class TTPreLoadCarrierExpressManager {
...
@@ -31,22 +31,20 @@ public class TTPreLoadCarrierExpressManager {
return
_inst
;
return
_inst
;
}
}
private
TTPreLoadCarrierExpressManager
()
{
public
void
init
()
{
init
();
}
private
void
init
()
{
ttNativeExpressManager
=
new
TTNativeExpressManager
();
ttNativeExpressManager
=
new
TTNativeExpressManager
();
ttNativeExpressManager
.
initTTAd
(
false
);
ttNativeExpressManager
.
initTTAd
(
false
);
// 启动异步线程
// 启动异步线程
mHandlerThread
=
new
HandlerThread
(
"TTPreLoadHandlerThread"
);
mHandlerThread
.
start
();
mHandlerThread
.
start
();
mWorkHandler
=
new
Handler
(
mHandlerThread
.
getLooper
())
{
mWorkHandler
=
new
Handler
(
mHandlerThread
.
getLooper
())
{
@Override
@Override
public
void
handleMessage
(
@NonNull
Message
msg
)
{
public
void
handleMessage
(
@NonNull
Message
msg
)
{
// 工作线程进行加载数据
super
.
handleMessage
(
msg
);
// 工作线程进行加载数据
if
(
msg
.
what
==
mTTPreLoadWhat
)
{
if
(
msg
.
what
==
mTTPreLoadWhat
)
{
loadTtFrameLayoutInThread
((
String
)
msg
.
obj
);
loadTtFrameLayoutInThread
((
String
)
msg
.
obj
);
}
}
...
@@ -55,11 +53,15 @@ public class TTPreLoadCarrierExpressManager {
...
@@ -55,11 +53,15 @@ public class TTPreLoadCarrierExpressManager {
}
}
public
void
onDestroy
()
{
public
void
onDestroy
()
{
if
(
mHandlerThread
!=
null
)
{
mHandlerThread
.
quit
();
mHandlerThread
.
quit
();
mHandlerThread
=
null
;
mHandlerThread
=
null
;
}
if
(
mWorkHandler
!=
null
)
{
mWorkHandler
.
removeCallbacksAndMessages
(
null
);
mWorkHandler
.
removeCallbacksAndMessages
(
null
);
mWorkHandler
=
null
;
mWorkHandler
=
null
;
}
}
}
public
FrameLayout
getTtFrameLayout
()
{
public
FrameLayout
getTtFrameLayout
()
{
return
ttFrameLayout
;
return
ttFrameLayout
;
...
@@ -71,9 +73,7 @@ public class TTPreLoadCarrierExpressManager {
...
@@ -71,9 +73,7 @@ public class TTPreLoadCarrierExpressManager {
try
{
try
{
ttFrameLayout
=
new
FrameLayout
(
context
);
ttFrameLayout
=
new
FrameLayout
(
context
);
ttNativeExpressManager
.
getNativeExpressInit
(
codeId
,
ttFrameLayout
,
340
,
0
);
ttNativeExpressManager
.
getNativeExpressInit
(
codeId
,
ttFrameLayout
,
340
,
0
);
ttNativeExpressManager
.
setTTNativeExpressManagerListener
(
view
->
{
ttNativeExpressManager
.
setTTNativeExpressManagerListener
(
view
->
mMainHandler
.
post
(()
->
{
mMainHandler
.
post
(()
->
{
// 主线程更新UI操作
// 主线程更新UI操作
if
(
view
==
null
)
{
if
(
view
==
null
)
{
...
@@ -87,8 +87,7 @@ public class TTPreLoadCarrierExpressManager {
...
@@ -87,8 +87,7 @@ public class TTPreLoadCarrierExpressManager {
ttFrameLayout
=
null
;
ttFrameLayout
=
null
;
}
}
}
}
});
}));
});
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -99,9 +98,11 @@ public class TTPreLoadCarrierExpressManager {
...
@@ -99,9 +98,11 @@ public class TTPreLoadCarrierExpressManager {
* 预加载 信息流
* 预加载 信息流
*/
*/
public
void
loadTtFrameLayout
(
String
codeId
)
{
public
void
loadTtFrameLayout
(
String
codeId
)
{
if
(
mWorkHandler
!=
null
)
{
Message
msg
=
Message
.
obtain
();
Message
msg
=
Message
.
obtain
();
msg
.
what
=
mTTPreLoadWhat
;
msg
.
what
=
mTTPreLoadWhat
;
msg
.
obj
=
codeId
;
msg
.
obj
=
codeId
;
mWorkHandler
.
sendMessage
(
msg
);
mWorkHandler
.
sendMessage
(
msg
);
}
}
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
25089161
...
@@ -6,6 +6,7 @@ import android.os.Bundle
...
@@ -6,6 +6,7 @@ import android.os.Bundle
import
android.view.KeyEvent
import
android.view.KeyEvent
import
android.view.View
import
android.view.View
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentManager
import
androidx.fragment.app.FragmentTransaction
import
androidx.fragment.app.FragmentTransaction
import
com.ireader.ireadersdk.IreaderApi
import
com.ireader.ireadersdk.IreaderApi
import
com.mints.goodmoney.R
import
com.mints.goodmoney.R
...
@@ -19,6 +20,7 @@ import com.mints.goodmoney.ui.activitys.base.BaseActivity
...
@@ -19,6 +20,7 @@ import com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.*
import
com.mints.goodmoney.ui.fragment.*
import
kotlinx.android.synthetic.main.activity_main.*
import
kotlinx.android.synthetic.main.activity_main.*
/**
/**
* 描述:main
* 描述:main
* 作者:孟崔广
* 作者:孟崔广
...
@@ -40,7 +42,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -40,7 +42,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
override
fun
initViewsAndEvents
()
{
override
fun
initViewsAndEvents
()
{
ZhangyueManager
.
onCreateIreader
(
baseApplication
)
ZhangyueManager
.
onCreateIreader
(
baseApplication
)
if
(
moneyFragment
==
null
)
{
if
(
moneyFragment
==
null
)
{
...
@@ -124,7 +125,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -124,7 +125,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
if
(
moneyFragment
==
null
)
{
if
(
moneyFragment
==
null
)
{
moneyFragment
=
MoneyFragment
()
moneyFragment
=
MoneyFragment
()
}
}
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
moneyFragment
!!
)
addOrShowFragment
(
supportFragmentManager
,
moneyFragment
!!
,
Constant
.
FRAGMENT_TAG_MAIN
)
tab_iv_main
.
isSelected
=
true
tab_iv_main
.
isSelected
=
true
tab_tv_main
.
isSelected
=
true
tab_tv_main
.
isSelected
=
true
...
@@ -152,7 +153,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -152,7 +153,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
if
(
channelFragment
==
null
)
{
if
(
channelFragment
==
null
)
{
channelFragment
=
HorizChannelFragment
()
channelFragment
=
HorizChannelFragment
()
}
}
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
channelFragment
!!
)
addOrShowFragment
(
supportFragmentManager
,
channelFragment
!!
,
Constant
.
FRAGMENT_TAG_CHANNEL
)
tab_iv_main
.
isSelected
=
false
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
true
tab_iv_channel
.
isSelected
=
true
...
@@ -174,7 +175,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -174,7 +175,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
if
(
friendsFragment
==
null
)
{
if
(
friendsFragment
==
null
)
{
friendsFragment
=
FriendsFragment
()
friendsFragment
=
FriendsFragment
()
}
}
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
friendsFragment
!!
)
addOrShowFragment
(
supportFragmentManager
,
friendsFragment
!!
,
Constant
.
FRAGMENT_TAG_FRIENDS
)
tab_iv_main
.
isSelected
=
false
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
...
@@ -195,7 +196,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -195,7 +196,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
if
(
panFragment
==
null
)
{
if
(
panFragment
==
null
)
{
panFragment
=
PanFragment
()
panFragment
=
PanFragment
()
}
}
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
panFragment
!!
)
addOrShowFragment
(
supportFragmentManager
,
panFragment
!!
,
Constant
.
FRAGMENT_TAG_PAN
)
tab_iv_main
.
isSelected
=
false
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
...
@@ -216,7 +217,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -216,7 +217,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
if
(
myFragment
==
null
)
{
if
(
myFragment
==
null
)
{
myFragment
=
MyFragment
()
myFragment
=
MyFragment
()
}
}
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
myFragment
!!
)
addOrShowFragment
(
supportFragmentManager
,
myFragment
!!
,
Constant
.
FRAGMENT_TAG_MY
)
tab_iv_main
.
isSelected
=
false
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
...
@@ -232,17 +233,18 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -232,17 +233,18 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
/**
/**
* 添加或者显示碎片
* 添加或者显示碎片
*
*
* @param
transaction
* @param
fm
* @param fragment
* @param fragment
*/
*/
private
fun
addOrShowFragment
(
transaction
:
FragmentTransaction
,
private
fun
addOrShowFragment
(
fm
:
FragmentManager
,
fragment
:
Fragment
)
{
fragment
:
Fragment
,
tag
:
String
)
{
if
(
currentFragment
===
fragment
)
return
if
(
currentFragment
===
fragment
)
return
if
(!
fragment
.
isAdded
)
{
// 如果当前fragment未被添加,则添加到Fragment管理器中
val
ft
:
FragmentTransaction
=
fm
.
beginTransaction
()
transaction
.
hide
(
currentFragment
!!
)
if
(!
fragment
.
isAdded
&&
null
==
fm
.
findFragmentByTag
(
tag
))
{
// 如果当前fragment未被添加,则添加到Fragment管理器中
.
add
(
R
.
id
.
content_layout
,
fragment
).
commitAllowingStateLoss
()
ft
.
hide
(
currentFragment
!!
)
.
add
(
R
.
id
.
content_layout
,
fragment
,
tag
).
commitAllowingStateLoss
()
}
else
{
}
else
{
transaction
.
hide
(
currentFragment
!!
).
show
(
fragment
).
commitAllowingStateLoss
()
ft
.
hide
(
currentFragment
!!
).
show
(
fragment
).
commitAllowingStateLoss
()
}
}
currentFragment
=
fragment
currentFragment
=
fragment
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
View file @
25089161
...
@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
...
@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
import
androidx.viewpager.widget.ViewPager
import
androidx.viewpager.widget.ViewPager
import
cn.sharesdk.framework.Platform
import
cn.sharesdk.framework.Platform
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.favorite.WechatFavorite
import
cn.sharesdk.wechat.friends.Wechat
import
cn.sharesdk.wechat.friends.Wechat
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.daimajia.androidanimations.library.YoYo
...
@@ -28,6 +29,7 @@ import com.mints.goodmoney.ui.fragment.base.BaseFragment
...
@@ -28,6 +29,7 @@ import com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.widgets.BonusDialog
import
com.mints.goodmoney.ui.widgets.BonusDialog
import
com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import
com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import
com.mints.goodmoney.ui.widgets.DialogListener
import
com.mints.goodmoney.ui.widgets.DialogListener
import
com.mints.goodmoney.ui.widgets.ShareDialog
import
com.mints.goodmoney.utils.ImageUtil
import
com.mints.goodmoney.utils.ImageUtil
import
com.mints.goodmoney.utils.SpanUtils
import
com.mints.goodmoney.utils.SpanUtils
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.api.RefreshLayout
...
@@ -181,6 +183,21 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -181,6 +183,21 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
}
}
}
}
}
}
mFriendsHallMsgBean
?.
let
{
if
(
it
.
button
==
"戳我分红"
)
{
showRedbox
(
btn_get_bonus
)
}
}
}
}
override
fun
onPause
()
{
super
.
onPause
()
mFriendsHallMsgBean
?.
let
{
if
(
it
.
button
==
"戳我分红"
)
{
stopRedbox
()
}
}
}
}
}
...
@@ -345,24 +362,26 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -345,24 +362,26 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
}
}
R
.
id
.
btn_invite
->
{
R
.
id
.
btn_invite
->
{
// 邀请好友
// 邀请好友
if
(!
ps
.
getBoolean
(
Constant
.
FIRST_SHARE_INVITED
,
false
))
{
// 第一次邀请提示弹框
shareImgDialog
()
firstWeChatInvite
()
// if (!ps.getBoolean(Constant.FIRST_SHARE_INVITED, false)) {
}
else
{
// // 第一次邀请提示弹框
val
wechatSp
=
Platform
.
ShareParams
()
// firstWeChatInvite()
wechatSp
.
shareType
=
Platform
.
SHARE_WEBPAGE
// } else {
wechatSp
.
title
=
Constant
.
SHARE_TITLE
// val wechatSp = Platform.ShareParams()
wechatSp
.
text
=
Constant
.
SHARE_CONTENT
// wechatSp.shareType = Platform.SHARE_WEBPAGE
wechatSp
.
imageData
=
ImageUtil
.
drawableToBitmap
(
ContextCompat
.
getDrawable
(
requireContext
(),
R
.
mipmap
.
ic_launcher
))
// wechatSp.title = Constant.SHARE_TITLE
wechatSp
.
url
=
Constant
.
SHARE_URL
// wechatSp.text = Constant.SHARE_CONTENT
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
// wechatSp.imageData = ImageUtil.drawableToBitmap(ContextCompat.getDrawable(requireContext(), R.mipmap.ic_launcher))
if
(
wechat
.
isClientValid
)
{
// wechatSp.url = Constant.SHARE_URL
// 执行图文分享
// val wechat = ShareSDK.getPlatform(Wechat.NAME)
wechat
.
share
(
wechatSp
)
// if (wechat.isClientValid) {
}
else
{
// // 执行图文分享
showToast
(
"请先安装微信"
)
// wechat.share(wechatSp)
}
// } else {
}
// showToast("请先安装微信")
// }
// }
}
}
R
.
id
.
tv_right_subtitle
->
{
R
.
id
.
tv_right_subtitle
->
{
...
@@ -446,6 +465,11 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -446,6 +465,11 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
}
}
}
}
private
fun
shareImgDialog
()
{
val
shareDialog
=
ShareDialog
(
requireActivity
())
shareDialog
.
show
()
}
/**
/**
* 第一次微信分享弹框
* 第一次微信分享弹框
*/
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/HorizChannelFragment.kt
View file @
25089161
...
@@ -19,9 +19,7 @@ import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
...
@@ -19,9 +19,7 @@ import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import
com.yilan.sdk.ui.category.ChannelFragment
import
com.yilan.sdk.ui.category.ChannelFragment
import
kotlinx.android.synthetic.main.fragment_horiz_channel.cdvvYilanTime
import
kotlinx.android.synthetic.main.fragment_horiz_channel.cdvvYilanTime
import
kotlinx.android.synthetic.main.fragment_horiz_channel.vs_tips
import
kotlinx.android.synthetic.main.fragment_horiz_channel.vs_tips
import
kotlinx.android.synthetic.main.fragment_main_first.*
import
net.grandcentrix.tray.AppPreferences
import
net.grandcentrix.tray.AppPreferences
import
kotlinx.android.synthetic.main.fragment_horiz_channel.*
class
HorizChannelFragment
:
BaseFragment
(),
HorizChannelView
,
View
.
OnClickListener
{
class
HorizChannelFragment
:
BaseFragment
(),
HorizChannelView
,
View
.
OnClickListener
{
...
@@ -73,6 +71,14 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
...
@@ -73,6 +71,14 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
registerPlayerCallBack
()
registerPlayerCallBack
()
channelFragment
?.
onResume
()
channelFragment
?.
onResume
()
if
(
isToCreateReward
)
{
// 防止界面切换 重置红包动画
// 好兔视频已加载 且 红包已转满
if
(!
cdvvYilanTime
.
isPlaying
)
{
cdvvYilanTime
.
startAnim
()
}
}
}
}
}
}
...
@@ -84,12 +90,20 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
...
@@ -84,12 +90,20 @@ class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListe
}
}
pauseDownloadTime
()
pauseDownloadTime
()
channelFragment
?.
onPause
()
channelFragment
?.
onPause
()
if
(
isToCreateReward
)
{
// 防止界面切换 重置红包动画
// 好兔视频已加载 且 红包已转满
if
(!
cdvvYilanTime
.
isPlaying
)
{
cdvvYilanTime
.
stopAnim
()
}
}
}
}
override
fun
onDestroyView
()
{
override
fun
onDestroyView
()
{
cdvvYilanTime
?.
onDestory
()
cdvvYilanTime
?.
setCountDownVedioListener
(
null
)
cdvvYilanTime
?.
setCountDownVedioListener
(
null
)
cdvvYilanTime
?.
onDestory
()
super
.
onDestroyView
()
super
.
onDestroyView
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
25089161
...
@@ -12,6 +12,7 @@ import com.mints.goodmoney.ad.video.VedioAdingManager
...
@@ -12,6 +12,7 @@ import com.mints.goodmoney.ad.video.VedioAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.ShumeiManager
import
com.mints.goodmoney.manager.ShumeiManager
import
com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import
com.mints.goodmoney.manager.TTPreLoadExpressManager
import
com.mints.goodmoney.manager.TTPreLoadExpressManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.MainVedioMsgBean
import
com.mints.goodmoney.mvp.model.MainVedioMsgBean
...
@@ -72,6 +73,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -72,6 +73,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
vedioAdingManager
=
VedioAdingManager
.
getInstance
(
activity
)
vedioAdingManager
=
VedioAdingManager
.
getInstance
(
activity
)
// 奖励页预加载 信息流广告
// 奖励页预加载 信息流广告
TTPreLoadExpressManager
.
getInstance
().
loadTtFrameLayout
()
TTPreLoadExpressManager
.
getInstance
().
loadTtFrameLayout
()
// 喝水页预加载 信息流广告
TTPreLoadCarrierExpressManager
.
getInstance
().
init
()
// 首次显示权限弹窗
// 首次显示权限弹窗
showPowerDialog
()
showPowerDialog
()
...
@@ -107,6 +110,15 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -107,6 +110,15 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
registerPlayerCallBack
()
registerPlayerCallBack
()
littleVideoFragment
?.
onResume
()
littleVideoFragment
?.
onResume
()
if
(
isToCreateReward
)
{
// 防止界面切换 重置红包动画
// 好兔视频已加载 且 红包已转满
if
(!
isFirstLoadVedio
&&
!
cdvvYilanTime
.
isPlaying
)
{
cdvvYilanTime
.
startAnim
()
}
}
}
}
}
}
...
@@ -124,6 +136,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -124,6 +136,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
}
pauseDownloadTime
()
pauseDownloadTime
()
littleVideoFragment
?.
onPause
()
littleVideoFragment
?.
onPause
()
if
(
isToCreateReward
)
{
// 防止界面切换 重置红包动画
// 好兔视频已加载 且 红包已转满
if
(!
isFirstLoadVedio
&&
!
cdvvYilanTime
.
isPlaying
)
{
cdvvYilanTime
.
stopAnim
()
}
}
}
}
override
fun
setUserVisibleHint
(
isVisibleToUser
:
Boolean
)
{
override
fun
setUserVisibleHint
(
isVisibleToUser
:
Boolean
)
{
...
@@ -259,18 +279,18 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -259,18 +279,18 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
isFirstLoadVedio
=
false
isFirstLoadVedio
=
false
initTimeview
()
initTimeview
()
}
else
{
}
else
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onStart"
)
//
LogUtil.d(TAG, "registerPlayerCallBack onStart")
resumeDownloadTime
(
videoid
)
resumeDownloadTime
(
videoid
)
}
}
}
}
override
fun
onPause
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
override
fun
onPause
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onPause"
)
//
LogUtil.d(TAG, "registerPlayerCallBack onPause")
pauseDownloadTime
()
pauseDownloadTime
()
}
}
override
fun
onResume
(
pager
:
String
,
videoid
:
String
,
p2
:
String
?)
{
override
fun
onResume
(
pager
:
String
,
videoid
:
String
,
p2
:
String
?)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onResume"
)
//
LogUtil.d(TAG, "registerPlayerCallBack onResume")
resumeDownloadTime
(
videoid
)
resumeDownloadTime
(
videoid
)
}
}
...
@@ -279,7 +299,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -279,7 +299,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
}
override
fun
onLoopComplete
(
pager
:
String
?,
videoID
:
String
,
taskID
:
String
?,
num
:
Int
)
{
override
fun
onLoopComplete
(
pager
:
String
?,
videoID
:
String
,
taskID
:
String
?,
num
:
Int
)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onLoopComplete"
)
//
LogUtil.d(TAG, "registerPlayerCallBack onLoopComplete")
addVedioIdList
(
videoID
)
addVedioIdList
(
videoID
)
pauseDownloadTime
()
pauseDownloadTime
()
}
}
...
@@ -296,7 +316,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -296,7 +316,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
}
override
fun
onStop
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
override
fun
onStop
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onStop"
)
//
LogUtil.d(TAG, "registerPlayerCallBack onStop")
// pauseDownloadTime()
// pauseDownloadTime()
}
}
})
})
...
@@ -403,7 +423,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -403,7 +423,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 红包倒计时初始化
* 红包倒计时初始化
*/
*/
private
fun
initTimeview
()
{
private
fun
initTimeview
()
{
cdvvYilanTime
.
setCountDownVedioListener
{
cdvvYilanTime
?
.
setCountDownVedioListener
{
if
(
isFirstWatchVideo
)
{
if
(
isFirstWatchVideo
)
{
// 第一次观看完视频提醒用户
// 第一次观看完视频提醒用户
val
vs
=
vs_tips
.
inflate
()
val
vs
=
vs_tips
.
inflate
()
...
@@ -419,8 +439,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
...
@@ -419,8 +439,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
stopDownloadTime
()
stopDownloadTime
()
}
}
val
vedioTime
=
ps
.
getInt
(
Constant
.
MAIN_VEDIO_TIME
,
30
)
val
vedioTime
=
ps
.
getInt
(
Constant
.
MAIN_VEDIO_TIME
,
30
)
cdvvYilanTime
.
setTime
(
vedioTime
)
cdvvYilanTime
?
.
setTime
(
vedioTime
)
cdvvYilanTime
.
start
()
cdvvYilanTime
?
.
start
()
}
}
/**
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
25089161
...
@@ -143,6 +143,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
...
@@ -143,6 +143,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
super
.
onHiddenChanged
(
hidden
)
super
.
onHiddenChanged
(
hidden
)
}
}
override
fun
onPause
()
{
super
.
onPause
()
item_clock_signview
.
stopRedbox
()
}
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_MY
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_MY
)
{
...
@@ -554,7 +559,8 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
...
@@ -554,7 +559,8 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
}
R
.
id
.
iv_right_icon2
->
{
R
.
id
.
iv_right_icon2
->
{
// 跳转QQ客服
// 跳转QQ客服
jumpQQ
()
// jumpQQ()
jumpQQGroup
()
}
}
R
.
id
.
item_customer_service
->
{
R
.
id
.
item_customer_service
->
{
// 跳转加入QQ群
// 跳转加入QQ群
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/CountDownVedioView.java
View file @
25089161
...
@@ -46,13 +46,10 @@ public class CountDownVedioView extends LinearLayout {
...
@@ -46,13 +46,10 @@ public class CountDownVedioView extends LinearLayout {
}
}
private
void
initListener
()
{
private
void
initListener
()
{
cdCountVedioView
.
setOnLoadingFinishListener
(
new
CountDownView
.
OnLoadingFinishListener
()
{
cdCountVedioView
.
setOnLoadingFinishListener
(()
->
{
@Override
public
void
finish
()
{
if
(
countDownVedioListener
!=
null
)
{
if
(
countDownVedioListener
!=
null
)
{
countDownVedioListener
.
finish
();
countDownVedioListener
.
finish
();
}
}
}
});
});
}
}
...
@@ -114,6 +111,24 @@ public class CountDownVedioView extends LinearLayout {
...
@@ -114,6 +111,24 @@ public class CountDownVedioView extends LinearLayout {
}
}
}
}
/**
* 开始红包动画
*/
public
void
startAnim
()
{
if
(
rope
!=
null
&&
!
rope
.
isRunning
())
{
showRedbox
();
}
}
/**
* 暂停红包动画
*/
public
void
stopAnim
()
{
if
(
rope
!=
null
&&
rope
.
isRunning
())
{
rope
.
stop
();
}
}
public
void
stopRedbox
()
{
public
void
stopRedbox
()
{
if
(
ivCountVedioRedbox
!=
null
&&
rope
!=
null
)
{
if
(
ivCountVedioRedbox
!=
null
&&
rope
!=
null
)
{
rope
.
stop
();
rope
.
stop
();
...
@@ -121,6 +136,8 @@ public class CountDownVedioView extends LinearLayout {
...
@@ -121,6 +136,8 @@ public class CountDownVedioView extends LinearLayout {
}
}
public
void
onDestory
()
{
public
void
onDestory
()
{
if
(
cdCountVedioView
.
callOnClick
())
if
(
rope
!=
null
)
{
if
(
rope
!=
null
)
{
rope
.
stop
();
rope
.
stop
();
rope
=
null
;
rope
=
null
;
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/CountDownView.java
View file @
25089161
...
@@ -10,7 +10,9 @@ import android.graphics.Canvas;
...
@@ -10,7 +10,9 @@ import android.graphics.Canvas;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.Paint
;
import
android.graphics.RectF
;
import
android.graphics.RectF
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.View
;
...
@@ -18,7 +20,6 @@ import android.view.animation.LinearInterpolator;
...
@@ -18,7 +20,6 @@ import android.view.animation.LinearInterpolator;
import
com.mints.goodmoney.R
;
import
com.mints.goodmoney.R
;
public
class
CountDownView
extends
View
{
public
class
CountDownView
extends
View
{
private
Context
mContext
;
//上下文
private
Context
mContext
;
//上下文
private
Paint
mPaintBackGround
;
//背景画笔
private
Paint
mPaintBackGround
;
//背景画笔
...
@@ -208,31 +209,26 @@ public class CountDownView extends View {
...
@@ -208,31 +209,26 @@ public class CountDownView extends View {
}
}
public
void
reset
()
{
public
void
reset
()
{
if
(
set
!=
null
)
{
// Android8及8以下回调 onAnimatioinEnd 造成递归调用
set
.
cancel
();
// if (set != null) {
}
// set.cancel();
// }
ValueAnimator
animator
=
ValueAnimator
.
ofFloat
(
0
,
0
);
ValueAnimator
animator
=
ValueAnimator
.
ofFloat
(
0
,
0
);
animator
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
animator
.
addUpdateListener
(
valueAnimator
->
{
@Override
public
void
onAnimationUpdate
(
ValueAnimator
valueAnimator
)
{
mSweepAngle
=
(
float
)
valueAnimator
.
getAnimatedValue
();
mSweepAngle
=
(
float
)
valueAnimator
.
getAnimatedValue
();
//获取到需要绘制的角度,重新绘制
//获取到需要绘制的角度,重新绘制
invalidate
();
invalidate
();
}
});
});
animator
.
start
();
animator
.
start
();
}
}
public
void
start
()
{
public
void
start
()
{
ValueAnimator
animator
=
ValueAnimator
.
ofFloat
(
mmSweepAngleStart
,
mmSweepAngleEnd
);
ValueAnimator
animator
=
ValueAnimator
.
ofFloat
(
mmSweepAngleStart
,
mmSweepAngleEnd
);
animator
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
animator
.
addUpdateListener
(
valueAnimator
->
{
@Override
public
void
onAnimationUpdate
(
ValueAnimator
valueAnimator
)
{
mSweepAngle
=
(
float
)
valueAnimator
.
getAnimatedValue
();
mSweepAngle
=
(
float
)
valueAnimator
.
getAnimatedValue
();
//获取到需要绘制的角度,重新绘制
//获取到需要绘制的角度,重新绘制
invalidate
();
invalidate
();
}
});
});
//这里是时间获取和赋值
//这里是时间获取和赋值
if
(
set
==
null
)
{
if
(
set
==
null
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/ShareDialog.kt
0 → 100644
View file @
25089161
package
com.mints.goodmoney.ui.widgets
import
android.app.Dialog
import
android.content.Context
import
android.graphics.Bitmap
import
android.graphics.drawable.BitmapDrawable
import
android.view.Gravity
import
android.view.View
import
android.view.WindowManager
import
android.widget.ImageView
import
android.widget.LinearLayout
import
android.widget.RelativeLayout
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
cn.sharesdk.framework.Platform
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.favorite.WechatFavorite
import
cn.sharesdk.wechat.friends.Wechat
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.utils.ImageUtil
import
com.mints.goodmoney.utils.QRCodeUtil
import
com.mints.goodmoney.utils.ToastUtil
class
ShareDialog
(
context
:
Context
)
:
Dialog
(
context
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
private
val
llDialogShareWx
:
LinearLayout
private
val
llDialogShareQq
:
LinearLayout
private
val
imgShare
:
ImageView
private
val
imgQrCode
:
ImageView
private
val
rlView
:
RelativeLayout
private
val
tvDialogShareNext
:
TextView
init
{
setContentView
(
R
.
layout
.
dialog_share
)
// 设置window属性
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
BOTTOM
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
height
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnimBottom
// lp.alpha = 1.0f;//透明效果
window
!!
.
attributes
=
lp
// 设置外部不可关闭
// setCancelable(false)
// setCanceledOnTouchOutside(false)
// setOnKeyListener { _, i, _ ->
// i == KeyEvent.KEYCODE_BACK
// }
// 查找View
llDialogShareWx
=
findViewById
<
View
>(
R
.
id
.
llDialogShareWx
)
as
LinearLayout
llDialogShareQq
=
findViewById
<
View
>(
R
.
id
.
llDialogShareQq
)
as
LinearLayout
imgShare
=
findViewById
<
View
>(
R
.
id
.
img_share
)
as
ImageView
imgQrCode
=
findViewById
<
View
>(
R
.
id
.
img_qr_code
)
as
ImageView
rlView
=
findViewById
<
View
>(
R
.
id
.
rl_view
)
as
RelativeLayout
tvDialogShareNext
=
findViewById
<
View
>(
R
.
id
.
tvDialogShareNext
)
as
TextView
// llDialogShareWx.setOnClickListener(listener)
// llDialogShareQq.setOnClickListener(listener)
// tvDialogShareNext.setOnClickListener(listener)
llDialogShareWx
.
setOnClickListener
{
shareWechat
()
}
val
QRCode
=
QRCodeUtil
.
createQRCode
(
Constant
.
SHARE_URL
,
50
)
// imgQrCode.setImageBitmap(QRCode)
imgQrCode
.
background
=
BitmapDrawable
(
QRCode
)
}
private
fun
shareWechat
()
{
rlView
.
isDrawingCacheEnabled
=
true
rlView
.
drawingCacheQuality
=
View
.
DRAWING_CACHE_QUALITY_HIGH
//测量在屏幕上宽和高
// rlView.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
// View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED))
//确定View的大小和位置的,然后将其绘制出来
// rlView.layout(0, 0, rlView.measuredWidth, rlView.measuredHeight)
rlView
.
buildDrawingCache
()
val
bitmap
:
Bitmap
=
rlView
.
drawingCache
val
wechatSp
=
Platform
.
ShareParams
()
wechatSp
.
shareType
=
Platform
.
SHARE_IMAGE
wechatSp
.
title
=
Constant
.
SHARE_TITLE
wechatSp
.
text
=
Constant
.
SHARE_CONTENT
wechatSp
.
imageData
=
bitmap
wechatSp
.
url
=
Constant
.
SHARE_URL
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(
wechat
.
isClientValid
)
{
// 执行图文分享
wechat
.
share
(
wechatSp
)
}
else
{
ToastUtil
.
show
(
MintsApplication
.
getContext
(),
"请先安装微信"
)
}
}
private
fun
shareWechatFavoite
()
{
val
wechatSp
=
Platform
.
ShareParams
()
wechatSp
.
shareType
=
Platform
.
SHARE_IMAGE
wechatSp
.
title
=
Constant
.
SHARE_TITLE
wechatSp
.
text
=
Constant
.
SHARE_CONTENT
wechatSp
.
imageData
=
ImageUtil
.
drawableToBitmap
(
ContextCompat
.
getDrawable
(
context
,
R
.
mipmap
.
bg_eat
))
wechatSp
.
url
=
Constant
.
SHARE_URL
val
wechat
=
ShareSDK
.
getPlatform
(
WechatFavorite
.
NAME
)
if
(
wechat
.
isClientValid
)
{
// 执行图文分享
wechat
.
share
(
wechatSp
)
}
else
{
ToastUtil
.
show
(
MintsApplication
.
getContext
(),
"请先安装微信"
)
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/seekbar/BubbleSeekBar.java
View file @
25089161
...
@@ -785,7 +785,7 @@ public class BubbleSeekBar extends View {
...
@@ -785,7 +785,7 @@ public class BubbleSeekBar extends View {
mBubbleCenterRawX
=
mBubbleCenterRawSolidX
+
mThumbCenterX
-
mLeft
;
mBubbleCenterRawX
=
mBubbleCenterRawSolidX
+
mThumbCenterX
-
mLeft
;
mLayoutParams
.
x
=
(
int
)
(
mBubbleCenterRawX
+
0.5f
);
mLayoutParams
.
x
=
(
int
)
(
mBubbleCenterRawX
+
0.5f
);
if
(
mBubbleView
.
getParent
()
!=
null
)
{
if
(
mBubbleView
.
getParent
()
!=
null
&&
mWindowManager
!=
null
)
{
mWindowManager
.
updateViewLayout
(
mBubbleView
,
mLayoutParams
);
mWindowManager
.
updateViewLayout
(
mBubbleView
,
mLayoutParams
);
}
}
mBubbleView
.
setProgressText
(
isShowProgressInFloat
?
mBubbleView
.
setProgressText
(
isShowProgressInFloat
?
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/QRCodeUtil.java
0 → 100644
View file @
25089161
package
com
.
mints
.
goodmoney
.
utils
;
import
android.graphics.Bitmap
;
import
com.google.zxing.BarcodeFormat
;
import
com.google.zxing.EncodeHintType
;
import
com.google.zxing.WriterException
;
import
com.google.zxing.common.BitMatrix
;
import
com.google.zxing.qrcode.QRCodeWriter
;
import
com.google.zxing.qrcode.decoder.ErrorCorrectionLevel
;
import
java.util.Hashtable
;
public
class
QRCodeUtil
{
/**
* 生成二维码
*
* @param text 需要生成二维码的文字、网址等
* @param size 需要生成二维码的大小()
* @return bitmap
*/
public
static
Bitmap
createQRCode
(
String
text
,
int
size
)
{
try
{
Hashtable
<
EncodeHintType
,
Object
>
hints
=
new
Hashtable
<>();
hints
.
put
(
EncodeHintType
.
CHARACTER_SET
,
"utf-8"
);
hints
.
put
(
EncodeHintType
.
ERROR_CORRECTION
,
ErrorCorrectionLevel
.
H
);
hints
.
put
(
EncodeHintType
.
MARGIN
,
1
);
BitMatrix
bitMatrix
=
new
QRCodeWriter
().
encode
(
text
,
BarcodeFormat
.
QR_CODE
,
size
,
size
,
hints
);
int
[]
pixels
=
new
int
[
size
*
size
];
for
(
int
y
=
0
;
y
<
size
;
y
++)
{
for
(
int
x
=
0
;
x
<
size
;
x
++)
{
if
(
bitMatrix
.
get
(
x
,
y
))
{
pixels
[
y
*
size
+
x
]
=
0xff000000
;
}
else
{
pixels
[
y
*
size
+
x
]
=
0xffffffff
;
}
}
}
Bitmap
bitmap
=
Bitmap
.
createBitmap
(
size
,
size
,
Bitmap
.
Config
.
ARGB_8888
);
bitmap
.
setPixels
(
pixels
,
0
,
size
,
0
,
0
,
size
,
size
);
return
bitmap
;
}
catch
(
WriterException
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/ToastUtil.java
View file @
25089161
...
@@ -23,7 +23,7 @@ public class ToastUtil {
...
@@ -23,7 +23,7 @@ public class ToastUtil {
private
static
Handler
mHandler
=
new
Handler
(
Looper
.
getMainLooper
());
private
static
Handler
mHandler
=
new
Handler
(
Looper
.
getMainLooper
());
private
static
Toast
mToast
=
null
;
private
static
Toast
mToast
=
null
;
private
static
Object
mSynObj
=
new
Object
();
private
static
final
Object
mSynObj
=
new
Object
();
public
static
void
show
(
Context
context
,
String
msg
)
{
public
static
void
show
(
Context
context
,
String
msg
)
{
showToast
(
context
,
msg
,
Toast
.
LENGTH_SHORT
,
Gravity
.
CENTER
);
showToast
(
context
,
msg
,
Toast
.
LENGTH_SHORT
,
Gravity
.
CENTER
);
...
@@ -70,6 +70,7 @@ public class ToastUtil {
...
@@ -70,6 +70,7 @@ public class ToastUtil {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
synchronized
(
mSynObj
)
{
synchronized
(
mSynObj
)
{
try
{
if
(
mToast
!=
null
)
{
if
(
mToast
!=
null
)
{
if
(
Integer
.
valueOf
(
android
.
os
.
Build
.
VERSION
.
SDK
)
<
12
)
if
(
Integer
.
valueOf
(
android
.
os
.
Build
.
VERSION
.
SDK
)
<
12
)
mToast
.
cancel
();
mToast
.
cancel
();
...
@@ -84,6 +85,7 @@ public class ToastUtil {
...
@@ -84,6 +85,7 @@ public class ToastUtil {
}
else
{
}
else
{
mToast
=
new
Toast
(
context
);
mToast
=
new
Toast
(
context
);
TextView
toastView
=
(
TextView
)
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
toast_view
,
null
);
TextView
toastView
=
(
TextView
)
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
toast_view
,
null
);
toastView
.
setText
(
msg
);
toastView
.
setText
(
msg
);
mToast
.
setView
(
toastView
);
mToast
.
setView
(
toastView
);
...
@@ -91,6 +93,9 @@ public class ToastUtil {
...
@@ -91,6 +93,9 @@ public class ToastUtil {
mToast
.
setDuration
(
len
);
mToast
.
setDuration
(
len
);
mToast
.
setGravity
(
gravity
,
0
,
80
);
mToast
.
setGravity
(
gravity
,
0
,
80
);
mToast
.
show
();
mToast
.
show
();
}
catch
(
Exception
e
)
{
}
}
}
}
}
});
});
...
...
GoodMoney/app/src/main/res/layout/dialog_share.xml
0 → 100644
View file @
25089161
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"30dp"
android:background=
"@color/transparent"
>
<RelativeLayout
android:id=
"@+id/rl_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"20dp"
android:background=
"@color/white"
android:gravity=
"center_horizontal"
app:layout_constraintBottom_toTopOf=
"@+id/linearLayout"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<ImageView
android:id=
"@+id/img_share"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/bg_eat"
/>
<TextView
android:id=
"@+id/tv_share_code"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/img_share"
android:layout_marginTop=
"20dp"
android:text=
"@string/app_name"
android:textColor=
"@color/main_mints"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tv_share_code"
android:layout_marginTop=
"10dp"
android:text=
"好玩好赚钱"
android:textColor=
"@color/main_mints"
/>
<ImageView
android:id=
"@+id/img_qr_code"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_below=
"@id/img_share"
android:layout_alignParentEnd=
"true"
android:scaleType=
"fitXY"
/>
</RelativeLayout>
<LinearLayout
android:id=
"@+id/linearLayout"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_tab_friends"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"120dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/llDialogShareWx"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1.0"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:src=
"@mipmap/ic_share_wx"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:text=
"微信"
android:textColor=
"@color/black"
android:textSize=
"14sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/llDialogShareQq"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1.0"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/ic_wx_friends"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:text=
"朋友圈"
android:textColor=
"@color/black"
android:textSize=
"14sp"
/>
</LinearLayout>
</LinearLayout>
<View
style=
"@style/line_3"
/>
<TextView
android:id=
"@+id/tvDialogShareNext"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:gravity=
"center"
android:text=
"取消"
android:textColor=
"@color/black"
android:textSize=
"18sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_share_wx.png
0 → 100644
View file @
25089161
5.47 KB
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_wx_friends.png
0 → 100644
View file @
25089161
6.54 KB
GoodMoney/app/src/main/res/values/themes.xml
View file @
25089161
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<!-- <style name="AppTheme" parent="AppTheme.Base" />-->
<!-- <style name="AppTheme" parent="AppTheme.Base" />-->
<style
name=
"CustomAppTheme"
parent=
"AppTheme.Base"
/>
<style
name=
"CustomAppTheme"
parent=
"AppTheme.Base"
/>
...
@@ -32,4 +32,13 @@
...
@@ -32,4 +32,13 @@
<item
name=
"android:windowIsFloating"
>
true
</item>
<item
name=
"android:windowIsFloating"
>
true
</item>
<item
name=
"android:backgroundDimEnabled"
>
true
</item>
<item
name=
"android:backgroundDimEnabled"
>
true
</item>
</style>
</style>
<style
name=
"Theme.NoDisplay"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<item
name=
"android:windowBackground"
>
@null
</item>
<item
name=
"android:windowContentOverlay"
>
@null
</item>
<item
name=
"android:windowIsTranslucent"
>
false
</item>
<item
name=
"android:windowAnimationStyle"
>
@null
</item>
<item
name=
"android:windowDisablePreview"
>
true
</item>
<item
name=
"android:windowNoDisplay"
>
false
</item>
</style>
</resources>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment