Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b1bb1157
authored
Jan 14, 2024
by
wukun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
24.1.14
parent
7c0e4b98
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
241 additions
and
23 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/com/dayu/bigfish/ui/MainActivity.java
baseSDK/src/main/res/layout/activity_webview.xml
build.gradle
learnCenter/src/main/java/com/dayu/learncenter/api/LearnService.java
learnCenter/src/main/java/com/dayu/learncenter/api/bean/ShareRecordBean.java
learnCenter/src/main/java/com/dayu/learncenter/ui/fragment/LiveListFragment.java
learnCenter/src/main/res/layout/fragment_live_list.xml
userCenter/src/main/java/com/dayu/usercenter/ui/activity/CommeWebViewActivity.java
app/src/main/AndroidManifest.xml
View file @
b1bb1157
...
...
@@ -54,6 +54,9 @@
<uses-permission
android:name=
"android.permission.READ_MEDIA_AUDIO"
/>
<uses-permission
android:name=
"android.permission.READ_MEDIA_VIDEO"
/>
<uses-permission
android:name=
"android.permission.READ_CLIPBOARD"
/>
<!--适配Android R包可见性 开始-->
<queries
package=
"${applicationId}"
>
<intent>
...
...
app/src/main/java/com/dayu/bigfish/ui/MainActivity.java
View file @
b1bb1157
...
...
@@ -3,6 +3,8 @@ package com.dayu.bigfish.ui;
import
android.Manifest
;
import
android.app.NotificationChannel
;
import
android.app.NotificationManager
;
import
android.content.ClipData
;
import
android.content.ClipboardManager
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.location.LocationManager
;
...
...
@@ -13,6 +15,7 @@ import android.provider.Settings;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.ViewTreeObserver
;
import
android.widget.TextView
;
import
androidx.core.app.NotificationCompat
;
...
...
@@ -44,6 +47,7 @@ import com.dayu.event.DownloadBean;
import
com.dayu.event.LearnTabNumEvent
;
import
com.dayu.event.SaleTabNumEvent
;
import
com.dayu.event.UserInfo
;
import
com.dayu.learncenter.api.LearnService
;
import
com.dayu.learncenter.ui.fragment.HomeLearnFragment
;
import
com.dayu.livemodule.LiveUtils
;
import
com.dayu.livemodule.event.UserKickOutEvent
;
...
...
@@ -55,6 +59,7 @@ import com.dayu.provider.event.RefreshHxNum;
import
com.dayu.provider.event.RefreshReceivingNum
;
import
com.dayu.provider.event.SwtichFragment
;
import
com.dayu.provider.router.RouterPath
;
import
com.dayu.usercenter.ui.activity.CommeWebViewActivity
;
import
com.dayu.usercenter.ui.activity2.BusinessTypeActivity
;
import
com.dayu.usercenter.ui.fragment.BusinessFragment
;
import
com.dayu.usercenter.ui.fragment.HomeUserFragment
;
...
...
@@ -163,6 +168,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
doAction
(
getIntent
());
startLocationService
();
setUmengDeviceToken
();
}
//设置友盟devicetoken
...
...
@@ -714,4 +720,72 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
UMShareAPI
.
get
(
this
).
onActivityResult
(
requestCode
,
resultCode
,
data
);
}
@Override
protected
void
onStart
()
{
super
.
onStart
();
try
{
getWindow
().
getDecorView
().
getViewTreeObserver
().
addOnWindowFocusChangeListener
(
new
ViewTreeObserver
.
OnWindowFocusChangeListener
()
{
@Override
public
void
onWindowFocusChanged
(
boolean
hasFocus
)
{
if
(
hasFocus
)
{
getClipboardContent
(
MainActivity
.
this
);
getWindow
().
getDecorView
().
getViewTreeObserver
().
removeOnWindowFocusChangeListener
(
this
);
}
}
});
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
private
void
getClipboardContent
(
Context
context
)
{
ClipboardManager
clipboard
=
(
ClipboardManager
)
context
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
if
(!
clipboard
.
hasPrimaryClip
())
{
return
;
}
CharSequence
text
=
clipboard
.
getText
();
if
(
TextUtils
.
isEmpty
(
text
))
{
return
;
}
String
content
=
text
.
toString
();
if
(
content
.
contains
(
"大鱼师傅"
)){
clipboard
.
setPrimaryClip
(
ClipData
.
newPlainText
(
""
,
""
));
Api
.
getService
(
LearnService
.
class
).
shareRecord
(
content
).
compose
(
Api
.
applySchedulers
())
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
String
url
=
data
.
getUrl
();
String
str
=
data
.
getContent
();
CustomDialog
customDialog
=
new
CustomDialog
(
mActivity
,
com
.
dayu
.
managercenter
.
R
.
style
.
CustomDialog
,
str
,
(
dialog
,
confirm
)
->
{
if
(
confirm
)
{
UserInfo
info
=
UserManager
.
getInstance
().
getUser
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
Constants
.
URL
,
url
+
"&token="
+
info
.
getToken
());
// bundle.putString(Constants.URL, "https://www.baidu.com");
bundle
.
putString
(
Constants
.
TITLE
,
str
);
startActivity
(
CommeWebViewActivity
.
class
,
bundle
);
}
});
customDialog
.
setTitle
(
"好友分享的内容"
)
.
setPositiveButton
(
"查看"
)
.
setNegativeButton
(
"取消"
)
.
setNegativeButtonColor
(
com
.
dayu
.
managercenter
.
R
.
color
.
default_editext_color
);
customDialog
.
show
();
},
responeThrowable
->
{
}));
}
}
}
baseSDK/src/main/res/layout/activity_webview.xml
View file @
b1bb1157
...
...
@@ -25,6 +25,7 @@
android:id=
"@+id/tv_right_title"
style=
"@style/title_right_text"
android:textSize=
"15sp"
android:visibility=
"gone"
android:text=
"下载"
/>
</RelativeLayout>
...
...
build.gradle
View file @
b1bb1157
...
...
@@ -5,8 +5,8 @@ buildscript {
ext
.
build_tools_version
=
"29.0.2"
ext
.
min_sdk_version
=
21
ext
.
target_sdk_version
=
29
ext
.
version_code
=
31
8
ext
.
verson_name
=
"3.1.
8
"
ext
.
version_code
=
31
9
ext
.
verson_name
=
"3.1.
9
"
ext
.
gradle_version
=
'4.0.1'
ext
.
isReleaseMinify
=
false
ext
.
isDebugMinify
=
false
...
...
learnCenter/src/main/java/com/dayu/learncenter/api/LearnService.java
View file @
b1bb1157
...
...
@@ -11,6 +11,7 @@ import com.dayu.learncenter.api.bean.CourseDeatilBean;
import
com.dayu.learncenter.api.bean.KnowledgeListBean
;
import
com.dayu.learncenter.api.bean.LearnTabBean
;
import
com.dayu.learncenter.api.bean.LiveBackVideosBean
;
import
com.dayu.learncenter.api.bean.ShareRecordBean
;
import
com.dayu.learncenter.api.data.CheckPayData
;
import
com.dayu.learncenter.api.data.EditCourseData
;
import
com.dayu.learncenter.api.data.LiveData
;
...
...
@@ -172,7 +173,8 @@ public interface LearnService {
@Query
(
"liveStreamType"
)
int
liveStreamType
,
@Query
(
"isNullVideUrl"
)
int
isNullVideUrl
,
@Query
(
"page"
)
int
page
,
@Query
(
"pageSize"
)
int
pageSize
);
@Query
(
"pageSize"
)
int
pageSize
,
@Query
(
"keyword"
)
String
keyword
);
/**
* 回放视频点赞
...
...
@@ -218,4 +220,11 @@ public interface LearnService {
@Query
(
"page"
)
int
page
,
@Query
(
"pageSize"
)
int
pageSize
,
@Query
(
"providerId"
)
String
providerId
);
/**
* 分享
*
*/
@GET
(
Constants
.
API_7900
+
"/shareRecord/commandContent"
)
Observable
<
BaseResponse
<
ShareRecordBean
>>
shareRecord
(
@Query
(
"command"
)
String
commandContent
);
}
learnCenter/src/main/java/com/dayu/learncenter/api/bean/ShareRecordBean.java
0 → 100644
View file @
b1bb1157
package
com
.
dayu
.
learncenter
.
api
.
bean
;
public
class
ShareRecordBean
{
private
String
url
;
private
String
content
;
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
}
learnCenter/src/main/java/com/dayu/learncenter/ui/fragment/LiveListFragment.java
View file @
b1bb1157
package
com
.
dayu
.
learncenter
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.inputmethod.EditorInfo
;
import
android.widget.ImageView
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
...
...
@@ -14,6 +17,7 @@ import com.dayu.base.api.protocol.AddShareRecordData;
import
com.dayu.base.ui.fragment.BaseFragment
;
import
com.dayu.base.ui.presenter.SImplePresenter
;
import
com.dayu.common.Constants
;
import
com.dayu.common.MyTextWatcher
;
import
com.dayu.learncenter.R
;
import
com.dayu.learncenter.api.LearnService
;
import
com.dayu.learncenter.api.bean.LiveBackVideosBean
;
...
...
@@ -45,6 +49,7 @@ public class LiveListFragment extends BaseFragment<SImplePresenter, FragmentLive
List
<
TCVideoInfo
>
liveList
=
new
ArrayList
<>();
List
<
LiveBackVideosBean
>
playBackList
=
new
ArrayList
<>();
BaseQuickAdapter
<
LiveBackVideosBean
,
BaseViewHolder
>
playBackAdapter
;
String
keyStr
=
""
;
int
mPage
=
1
;
...
...
@@ -61,6 +66,7 @@ public class LiveListFragment extends BaseFragment<SImplePresenter, FragmentLive
@Override
public
void
initView
()
{
initUser
();
initSearchView
();
mBind
.
rvLive
.
setNestedScrollingEnabled
(
false
);
mBind
.
rvVideo
.
setNestedScrollingEnabled
(
false
);
mBind
.
rvVideo
.
setFocusable
(
false
);
...
...
@@ -80,6 +86,49 @@ public class LiveListFragment extends BaseFragment<SImplePresenter, FragmentLive
EventBus
.
getDefault
().
register
(
this
);
}
//搜索框
private
void
initSearchView
()
{
mBind
.
edtSeacher
.
addTextChangedListener
(
new
MyTextWatcher
()
{
@Override
public
void
afterTextChanged
(
Editable
s
)
{
super
.
afterTextChanged
(
s
);
if
(
s
.
toString
().
trim
().
length
()
>
0
)
mBind
.
tvCancel
.
setVisibility
(
View
.
VISIBLE
);
}
});
mBind
.
edtSeacher
.
setOnEditorActionListener
((
v
,
actionId
,
event
)
->
{
String
str
=
mBind
.
edtSeacher
.
getText
().
toString
();
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
if
(
str
.
length
()
>
0
)
{
keyStr
=
mBind
.
edtSeacher
.
getText
().
toString
();
refresh
();
CommonUtils
.
hideSoftInput
(
mActivity
);
return
true
;
}
}
return
false
;
});
mBind
.
tvCancel
.
setOnClickListener
(
view
->
{
mBind
.
edtSeacher
.
setText
(
""
);
mBind
.
tvCancel
.
setVisibility
(
View
.
GONE
);
CommonUtils
.
hideSoftInput
(
mActivity
);
if
(!
TextUtils
.
isEmpty
(
keyStr
))
{
keyStr
=
""
;
refresh
();
}
});
}
private
void
refresh
()
{
mPage
=
1
;
initData
();
getUserInfo
();
EventBus
.
getDefault
().
post
(
new
RefreshLeanTabEvent
());
}
@Override
protected
void
lazyLoad
()
{
super
.
lazyLoad
();
...
...
@@ -172,7 +221,7 @@ public class LiveListFragment extends BaseFragment<SImplePresenter, FragmentLive
//回放列表
private
void
getPlayBackVideos
()
{
Api
.
getService
(
LearnService
.
class
).
getLiveVideos
(
mUserId
,
2
,
1
,
1
,
1
,
mPage
,
Constants
.
PAGESIZE
).
compose
(
Api
.
applySchedulers
())
Api
.
getService
(
LearnService
.
class
).
getLiveVideos
(
mUserId
,
2
,
1
,
1
,
1
,
mPage
,
Constants
.
PAGESIZE
,
keyStr
).
compose
(
Api
.
applySchedulers
())
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
mBind
.
refreshLayout
.
finishRefresh
();
mBind
.
refreshLayout
.
finishLoadMore
();
...
...
learnCenter/src/main/res/layout/fragment_live_list.xml
View file @
b1bb1157
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/refresh_layout"
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#f5f5f5"
>
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:background=
"#f5f5f5"
android:orientation=
"vertical"
>
<androidx.core.widget.NestedScrollView
<RelativeLayout
android:id=
"@+id/rl_seacher"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"45dp"
android:background=
"@color/cl_white"
android:layout_marginLeft=
"13dp"
android:layout_marginRight=
"13dp"
>
<LinearLayout
<EditText
android:id=
"@+id/edt_seacher"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_centerVertical=
"true"
android:layout_marginBottom=
"5dp"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
android:background=
"@null"
android:gravity=
"center"
android:hint=
"查找直播视频"
android:imeOptions=
"actionSearch"
android:inputType=
"text"
android:singleLine=
"true"
android:layout_toLeftOf=
"@+id/tv_cancel"
android:textSize=
"15sp"
/>
<TextView
android:id=
"@+id/tv_cancel"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"20dp"
android:gravity=
"center"
android:text=
"@string/cancle"
android:textColor=
"@color/cl_black"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:visibility=
"gone"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_live"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:overScrollMode=
"never"
/>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"5dp"
android:layout_alignParentBottom=
"true"
android:src=
"@drawable/line_shape"
/>
</RelativeLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/refresh_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#f5f5f5"
>
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_video"
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:overScrollMode=
"never"
/>
android:orientation=
"vertical"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_live"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:overScrollMode=
"never"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_video"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:overScrollMode=
"never"
/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</layout>
\ No newline at end of file
userCenter/src/main/java/com/dayu/usercenter/ui/activity/CommeWebViewActivity.java
View file @
b1bb1157
...
...
@@ -72,6 +72,7 @@ public class CommeWebViewActivity extends DataBindingActivity<ActivityWebviewBin
mBind
.
titleBack
.
setOnClickListener
(
v
->
{
if
(
"用料"
.
equals
(
title
)){
EventBus
.
getDefault
().
post
(
new
RefreshMaterialEvent
());
mBind
.
tvRightTitle
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
type
==
0
)
{
finish
();
...
...
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