Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
7a742ae6
Commit
7a742ae6
authored
Jul 13, 2022
by
fengquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 咨询师详情页
parent
09667d3f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
20 deletions
+37
-20
BasePhotoFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/preview/BasePhotoFragment.kt
+4
-0
GPreviewActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/preview/GPreviewActivity.kt
+30
-19
TestImageLoader.java
m-consultant/src/main/java/com/yidianling/consultant/preview/TestImageLoader.java
+3
-1
consultant_bg_black.jpg
m-consultant/src/main/res/drawable-xxhdpi/consultant_bg_black.jpg
+0
-0
No files found.
m-consultant/src/main/java/com/yidianling/consultant/preview/BasePhotoFragment.kt
View file @
7a742ae6
...
...
@@ -17,6 +17,7 @@ import androidx.fragment.app.Fragment
import
com.dou361.ijkplayer.widget.IjkVideoView
import
com.ydl.ydlcommon.ui.Loading.close
import
com.ydl.ydlcommon.ui.Loading.show
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.consultant.R
import
com.yidianling.consultant.preview.SmoothImageView.*
import
io.reactivex.Observable
...
...
@@ -158,6 +159,9 @@ class BasePhotoFragment : Fragment() {
override
fun
onLoadFailed
(
errorDrawable
:
Drawable
?)
{
loading
?.
setVisibility
(
GONE
)
if
(
isVisiable
)
{
ToastUtil
.
toastShort
(
activity
,
"加载失败"
)
}
if
(
errorDrawable
!=
null
)
{
imageView
?.
setImageDrawable
(
errorDrawable
)
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/preview/GPreviewActivity.kt
View file @
7a742ae6
...
...
@@ -17,6 +17,7 @@ import com.ydl.ydlcommon.utils.StatusBarUtils
import
com.yidianling.consultant.R
import
com.yidianling.consultant.preview.GPreviewBuilder.IndicatorType
import
com.yidianling.consultant.preview.SmoothImageView.onTransformListener
import
com.yidianling.im.api.listener.ApiStringResponseCallback
import
com.yidianling.im.api.service.IImService
import
kotlinx.android.synthetic.main.consultant_image_preview_photo.*
import
kotlinx.android.synthetic.main.fragment_image_photo_layout.*
...
...
@@ -135,29 +136,39 @@ class GPreviewActivity : AppCompatActivity() {
override
fun
onPageScrollStateChanged
(
state
:
Int
)
{}
})
// viewPager.setOffscreenPageLimit(3);
}
override
fun
onResume
()
{
super
.
onResume
()
if
(
toUid
!=
null
)
{
val
unReadByUid
=
ARouter
.
getInstance
().
navigation
(
IImService
::
class
.
java
).
getUnReadByUid
(
toUid
!!
)
when
{
unReadByUid
<=
0
->
{
un_read_num_ll
.
visibility
=
View
.
GONE
}
unReadByUid
>
99
->
{
un_read_num_ll
.
visibility
=
View
.
VISIBLE
un_read_num
.
text
=
"99"
}
else
->
{
un_read_num_ll
.
visibility
=
View
.
VISIBLE
un_read_num
.
text
=
unReadByUid
.
toString
()
}
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
try
{
ModularServiceManager
.
provide
(
IImService
::
class
.
java
)
.
getChatUid
(
context
=
this
,
uid
=
toUid
!!
,
callback
=
object
:
ApiStringResponseCallback
{
override
fun
onUidCallback
(
uid
:
String
)
{
val
unReadNum
=
ModularServiceManager
.
provide
(
IImService
::
class
.
java
)
.
getUnReadByUid
(
uid
!!
)
when
{
unReadNum
<=
0
->
{
un_read_num_ll
.
visibility
=
View
.
GONE
}
unReadNum
>
99
->
{
un_read_num_ll
.
visibility
=
View
.
VISIBLE
un_read_num
.
text
=
"99"
}
else
->
{
un_read_num_ll
.
visibility
=
View
.
VISIBLE
un_read_num
.
text
=
unReadNum
.
toString
()
}
}
}
})
}
catch
(
e
:
Exception
)
{
}
}
// viewPager.setOffscreenPageLimit(3);
}
private
fun
initData
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/preview/TestImageLoader.java
View file @
7a742ae6
...
...
@@ -12,6 +12,7 @@ import androidx.fragment.app.Fragment;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.request.target.SimpleTarget
;
import
com.bumptech.glide.request.transition.Transition
;
import
com.yidianling.consultant.R
;
import
org.jetbrains.annotations.NotNull
;
...
...
@@ -21,7 +22,7 @@ import org.jetbrains.annotations.NotNull;
public
class
TestImageLoader
implements
IZoomMediaLoader
{
@Override
public
void
displayImage
(
@NonNull
Fragment
context
,
@NonNull
String
path
,
final
ImageView
imageView
,
@NonNull
final
MySimpleTarget
simpleTarget
)
{
Glide
.
with
(
context
).
asBitmap
().
load
(
path
)
Glide
.
with
(
context
).
asBitmap
().
load
(
path
)
.
placeholder
(
R
.
drawable
.
consultant_bg_black
).
error
(
R
.
drawable
.
consultant_bg_black
)
// .placeholder(android.R.color.darker_gray)
.
fitCenter
()
...
...
@@ -35,6 +36,7 @@ public class TestImageLoader implements IZoomMediaLoader {
@Override
public
void
onLoadFailed
(
@Nullable
@org
.
jetbrains
.
annotations
.
Nullable
Drawable
errorDrawable
)
{
simpleTarget
.
onLoadFailed
(
errorDrawable
);
imageView
.
setImageDrawable
(
errorDrawable
);
}
});
...
...
m-consultant/src/main/res/drawable-xxhdpi/consultant_bg_black.jpg
0 → 100644
View file @
7a742ae6
3.62 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