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
7f031eb3
Commit
7f031eb3
authored
Jan 13, 2020
by
konghaorui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 修改图片选择库
2. 补充 socket ip地址接口 涉及 im、dynamic、platform,未发布
parent
a51160c5
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
134 additions
and
48 deletions
+134
-48
DemoAppLifecycles.java
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
+5
-4
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
config.gradle
config.gradle
+3
-3
PublishTrendImgAdapter.java
m-dynamic/src/main/java/com/yidianling/dynamic/adapter/PublishTrendImgAdapter.java
+5
-1
RecommendTrendImgAdapter.java
m-dynamic/src/main/java/com/yidianling/dynamic/adapter/RecommendTrendImgAdapter.java
+4
-1
BrowsePicturesActivity.java
m-dynamic/src/main/java/com/yidianling/dynamic/common/browsePictures/BrowsePicturesActivity.java
+8
-2
GlideImageLoader.java
m-dynamic/src/main/java/com/yidianling/dynamic/common/tool/GlideImageLoader.java
+13
-0
ImageCompress.java
m-dynamic/src/main/java/com/yidianling/dynamic/common/tool/ImageCompress.java
+4
-2
PublishQuestionAndTrendFragment.java
m-dynamic/src/main/java/com/yidianling/dynamic/publishTrend/fragment/PublishQuestionAndTrendFragment.java
+2
-29
PickImageAction.java
m-im/src/main/java/com/yidianling/uikit/business/session/actions/PickImageAction.java
+2
-1
GlideImageLoader.java
m-user/src/main/java/com/yidianling/user/GlideImageLoader.java
+13
-0
build.gradle
ydl-platform/build.gradle
+2
-0
YdlImageLoader.java
ydl-platform/src/main/java/com/ydl/ydlcommon/actions/imagepicker/YdlImageLoader.java
+10
-0
HttpConfig.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
+17
-0
JavaGlobalInfo.java
ydl-platform/src/main/java/com/ydl/ydlcommon/bean/JavaGlobalInfo.java
+27
-0
ApiRequestUtil.java
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/api/ApiRequestUtil.java
+9
-0
NetApiStore.java
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/api/NetApiStore.java
+5
-0
AppProgressUtils.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/AppProgressUtils.java
+3
-3
No files found.
app/src/main/java/com/ydl/component/base/DemoAppLifecycles.java
View file @
7f031eb3
...
@@ -20,6 +20,7 @@ import com.umeng.socialize.UMShareAPI;
...
@@ -20,6 +20,7 @@ import com.umeng.socialize.UMShareAPI;
import
com.ydl.component.BuildConfig
;
import
com.ydl.component.BuildConfig
;
import
com.ydl.component.MainActivity
;
import
com.ydl.component.MainActivity
;
import
com.ydl.media.audio.PlayService
;
import
com.ydl.media.audio.PlayService
;
import
com.ydl.ydlcommon.base.config.HttpConfig
;
import
com.ydl.ydlcommon.base.config.YDLConstants
;
import
com.ydl.ydlcommon.base.config.YDLConstants
;
import
com.ydl.ydlcommon.base.delegate.IAppLifecycles
;
import
com.ydl.ydlcommon.base.delegate.IAppLifecycles
;
import
com.ydl.ydlcommon.utils.LogUtil
;
import
com.ydl.ydlcommon.utils.LogUtil
;
...
@@ -125,10 +126,10 @@ public class DemoAppLifecycles implements IAppLifecycles {
...
@@ -125,10 +126,10 @@ public class DemoAppLifecycles implements IAppLifecycles {
//开启友盟集成测试
//开启友盟集成测试
UMConfigure
.
setLogEnabled
(
BuildConfig
.
DEBUG
);
UMConfigure
.
setLogEnabled
(
BuildConfig
.
DEBUG
);
HttpConfig
.
Companion
.
getInstance
().
initSocketConfig
(()
->
{
//数据埋点初始化 (一定要放在主进程中,
因为用到了umeng统计,需要放在umeng初始化后)
//数据埋点初始化 (一定要放在主进程中/
因为用到了umeng统计,需要放在umeng初始化后)
YdlBuryPointUtil
.
init
(
application
,
true
);
YdlBuryPointUtil
.
init
(
application
,
true
);
});
//安全检测
//安全检测
//YDLAppProtector.init();
//YDLAppProtector.init();
...
...
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
7f031eb3
...
@@ -20,8 +20,8 @@ import java.util.List;
...
@@ -20,8 +20,8 @@ import java.util.List;
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
public
final
class
DemoGlobalConfig
implements
IConfigModule
{
String
APP_DOMAIN
=
"https://api.github.com/"
;
String
APP_DOMAIN
=
"https://api.github.com/"
;
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
//
public static String appEnv = YDLConstants.ENV_TEST;
public
static
String
appEnv
=
YDLConstants
.
ENV_TEST
;
public
static
String
appEnv
=
YDLConstants
.
ENV_PROD
;
//
public static String appEnv = YDLConstants.ENV_PROD;
@Override
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
...
...
config.gradle
View file @
7f031eb3
ext
{
ext
{
kotlin_version
=
"1.3.21"
kotlin_version
=
"1.3.21"
dev_mode
=
fals
e
dev_mode
=
tru
e
ydl_app
=
[
ydl_app
=
[
appName
:
"心理咨询壹点灵"
,
appName
:
"心理咨询壹点灵"
,
...
@@ -249,13 +249,13 @@ ext {
...
@@ -249,13 +249,13 @@ ext {
"ydl-pushagent"
:
"com.ydl:pushagent:0.1.1"
,
"ydl-pushagent"
:
"com.ydl:pushagent:0.1.1"
,
"ydl-notracepoint"
:
"com.ydl:notracepoint-lib:0.2.3.1@aar"
,
"ydl-notracepoint"
:
"com.ydl:notracepoint-lib:0.2.3.1@aar"
,
"ydl-js"
:
"com.ydl:ydl-js:1.0.7-SNAPSHOT@aar"
,
"ydl-js"
:
"com.ydl:ydl-js:1.0.7-SNAPSHOT@aar"
,
"ydl-router"
:
"com.ydl:ydl-router:1.3.
7
-SNAPSHOT@aar"
,
"ydl-router"
:
"com.ydl:ydl-router:1.3.
9
-SNAPSHOT@aar"
,
"xrecyclerview"
:
"com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar"
,
"xrecyclerview"
:
"com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar"
,
"arouter-api"
:
"com.alibaba:arouter-api:1.4.1"
,
"arouter-api"
:
"com.alibaba:arouter-api:1.4.1"
,
"arouter-compiler"
:
"com.alibaba:arouter-compiler:1.2.2"
,
"arouter-compiler"
:
"com.alibaba:arouter-compiler:1.2.2"
,
"exoplayer"
:
"com.google.android.exoplayer:exoplayer:2.9.0"
,
"exoplayer"
:
"com.google.android.exoplayer:exoplayer:2.9.0"
,
"free_reflection"
:
"me.weishu:free_reflection:2.0.0"
,
"free_reflection"
:
"me.weishu:free_reflection:2.0.0"
,
"imagepicker"
:
"com.ydl:imagepicker:1.0.
7
"
,
"imagepicker"
:
"com.ydl:imagepicker:1.0.
8.1
"
,
"protector"
:
"com.ydl:protector:1.0.1-SNAPSHOT@aar"
,
"protector"
:
"com.ydl:protector:1.0.1-SNAPSHOT@aar"
,
"ydl-hnet"
:
"com.ydl:h-net:0.0.8"
,
"ydl-hnet"
:
"com.ydl:h-net:0.0.8"
,
"ydl-user-router"
:
"com.ydl:router:1.0.0-SNAPSHOT@aar"
,
"ydl-user-router"
:
"com.ydl:router:1.0.0-SNAPSHOT@aar"
,
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/adapter/PublishTrendImgAdapter.java
View file @
7f031eb3
package
com
.
yidianling
.
dynamic
.
adapter
;
package
com
.
yidianling
.
dynamic
.
adapter
;
import
android.content.Context
;
import
android.content.Context
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.support.annotation.RequiresApi
;
import
android.support.annotation.RequiresApi
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.RecyclerView
;
...
@@ -9,6 +10,7 @@ import android.view.View;
...
@@ -9,6 +10,7 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.transform.GlideRoundTransform
;
import
com.ydl.ydl_image.transform.GlideRoundTransform
;
import
com.yidianling.dynamic.R
;
import
com.yidianling.dynamic.R
;
...
@@ -80,6 +82,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -80,6 +82,7 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
public
void
onBindViewHolder
(
PublishTrendImgViewHolder
holder
,
final
int
position
)
{
public
void
onBindViewHolder
(
PublishTrendImgViewHolder
holder
,
final
int
position
)
{
RecommendTrendImage
trendImage
=
mDatas
.
get
(
position
);
RecommendTrendImage
trendImage
=
mDatas
.
get
(
position
);
String
path
=
trendImage
.
getImage_url
();
String
path
=
trendImage
.
getImage_url
();
if
(
"default"
.
equals
(
path
))
{
if
(
"default"
.
equals
(
path
))
{
holder
.
bg_iv
.
setVisibility
(
View
.
VISIBLE
);
holder
.
bg_iv
.
setVisibility
(
View
.
VISIBLE
);
holder
.
item_publish_iv
.
setVisibility
(
View
.
GONE
);
holder
.
item_publish_iv
.
setVisibility
(
View
.
GONE
);
...
@@ -88,8 +91,9 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
...
@@ -88,8 +91,9 @@ public class PublishTrendImgAdapter extends RecyclerView.Adapter<PublishTrendImg
holder
.
item_publish_cancel_iv
.
setVisibility
(
View
.
VISIBLE
);
holder
.
item_publish_cancel_iv
.
setVisibility
(
View
.
VISIBLE
);
holder
.
bg_iv
.
setVisibility
(
View
.
GONE
);
holder
.
bg_iv
.
setVisibility
(
View
.
GONE
);
holder
.
item_publish_iv
.
setVisibility
(
View
.
VISIBLE
);
holder
.
item_publish_iv
.
setVisibility
(
View
.
VISIBLE
);
Uri
uriByPath
=
FileUtils
.
INSTANCE
.
getUriByPath
(
mContext
,
path
);
GlideApp
.
with
(
mContext
)
GlideApp
.
with
(
mContext
)
.
load
(
p
ath
)
.
load
(
uriByP
ath
)
.
error
(
R
.
drawable
.
dynamic_default_img
)
.
error
(
R
.
drawable
.
dynamic_default_img
)
.
transform
(
new
GlideRoundTransform
(
mContext
,
6
))
.
transform
(
new
GlideRoundTransform
(
mContext
,
6
))
// .centerCrop()
// .centerCrop()
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/adapter/RecommendTrendImgAdapter.java
View file @
7f031eb3
package
com
.
yidianling
.
dynamic
.
adapter
;
package
com
.
yidianling
.
dynamic
.
adapter
;
import
android.content.Context
;
import
android.content.Context
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.support.annotation.RequiresApi
;
import
android.support.annotation.RequiresApi
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.RecyclerView
;
...
@@ -9,6 +10,7 @@ import android.view.View;
...
@@ -9,6 +10,7 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.yidianling.dynamic.R
;
import
com.yidianling.dynamic.R
;
import
com.yidianling.dynamic.model.RecommendTrendImage
;
import
com.yidianling.dynamic.model.RecommendTrendImage
;
...
@@ -60,8 +62,9 @@ public class RecommendTrendImgAdapter extends RecyclerView.Adapter<RecommendTren
...
@@ -60,8 +62,9 @@ public class RecommendTrendImgAdapter extends RecyclerView.Adapter<RecommendTren
RecommendTrendImage
trendImage
=
mDatas
.
get
(
position
);
RecommendTrendImage
trendImage
=
mDatas
.
get
(
position
);
String
img_url
=
trendImage
.
getImage_url
();
String
img_url
=
trendImage
.
getImage_url
();
if
(!
"no"
.
equals
(
img_url
)){
if
(!
"no"
.
equals
(
img_url
)){
Uri
uriByPath
=
FileUtils
.
INSTANCE
.
getUriByPath
(
mContext
,
img_url
);
GlideApp
.
with
(
mContext
)
GlideApp
.
with
(
mContext
)
.
load
(
img_url
)
.
load
(
uriByPath
)
// .override(width,width)
// .override(width,width)
.
error
(
R
.
drawable
.
dynamic_default_img
)
.
error
(
R
.
drawable
.
dynamic_default_img
)
.
centerCrop
()
.
centerCrop
()
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/common/browsePictures/BrowsePicturesActivity.java
View file @
7f031eb3
...
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
...
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
...
@@ -19,6 +20,7 @@ import android.view.WindowManager;
...
@@ -19,6 +20,7 @@ import android.view.WindowManager;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
...
@@ -111,7 +113,9 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
...
@@ -111,7 +113,9 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
if
(
"browse"
.
equals
(
browse_type
))
{
//保存
if
(
"browse"
.
equals
(
browse_type
))
{
//保存
DownLoadImageService
downloadService
=
new
DownLoadImageService
(
BrowsePicturesActivity
.
this
,
trendImages
.
get
(
iposition
).
getImage_url
(),
new
ImageDownLoadCallBack
()
{
DownLoadImageService
downloadService
=
new
DownLoadImageService
(
BrowsePicturesActivity
.
this
,
trendImages
.
get
(
iposition
).
getImage_url
(),
new
ImageDownLoadCallBack
()
{
@Override
@Override
public
void
onDownLoadSuccess
(
File
file
)
{
public
void
onDownLoadSuccess
(
File
file
)
{
...
@@ -314,8 +318,10 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
...
@@ -314,8 +318,10 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
// }
// }
@Override
@Override
public
Object
instantiateItem
(
View
container
,
int
position
)
{
public
Object
instantiateItem
(
View
container
,
int
position
)
{
Uri
uri
=
FileUtils
.
INSTANCE
.
getUriByPath
(
container
.
getContext
(),
mImages
.
get
(
position
).
getImage_url
());
GlideApp
.
with
(
mContext
)
GlideApp
.
with
(
mContext
)
.
load
(
mImages
.
get
(
position
).
getImage_url
()
)
.
load
(
uri
)
.
error
(
R
.
drawable
.
dynamic_default_img
)
.
error
(
R
.
drawable
.
dynamic_default_img
)
.
into
(
mDatas
.
get
(
position
));
.
into
(
mDatas
.
get
(
position
));
mDatas
.
get
(
position
).
setOnPhotoTapListener
(
new
PhotoViewAttacher
.
OnPhotoTapListener
()
{
mDatas
.
get
(
position
).
setOnPhotoTapListener
(
new
PhotoViewAttacher
.
OnPhotoTapListener
()
{
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/common/tool/GlideImageLoader.java
View file @
7f031eb3
package
com
.
yidianling
.
dynamic
.
common
.
tool
;
package
com
.
yidianling
.
dynamic
.
common
.
tool
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.net.Uri
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.lzy.imagepicker.loader.ImageLoader
;
import
com.lzy.imagepicker.loader.ImageLoader
;
import
com.ydl.ydl_image.config.ISimpleImageOpConfig
;
import
com.ydl.ydl_image.config.ISimpleImageOpConfig
;
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
;
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
;
import
com.ydl.ydl_image.manager.YDLImageCacheManager
;
import
com.ydl.ydl_image.manager.YDLImageCacheManager
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.yidianling.dynamic.R
;
import
com.yidianling.dynamic.R
;
/**
/**
...
@@ -24,6 +27,16 @@ public class GlideImageLoader implements ImageLoader {
...
@@ -24,6 +27,16 @@ public class GlideImageLoader implements ImageLoader {
showImage
(
activity
,
path
,
imageView
,
width
,
height
);
showImage
(
activity
,
path
,
imageView
,
width
,
height
);
}
}
@Override
public
void
displayImage
(
Activity
activity
,
Uri
uri
,
ImageView
imageView
,
int
width
,
int
i1
)
{
GlideApp
.
with
(
activity
)
//配置上下文
.
load
(
uri
)
//设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
.
error
(
com
.
ydl
.
ydlcommon
.
R
.
drawable
.
platform_default_img
)
//设置错误图片
.
placeholder
(
com
.
ydl
.
ydlcommon
.
R
.
drawable
.
platform_default_img
)
//设置占位图片
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
//缓存全尺寸
.
into
(
imageView
);
}
private
void
showImage
(
Activity
activity
,
String
path
,
ImageView
imageView
,
int
width
,
int
height
){
private
void
showImage
(
Activity
activity
,
String
path
,
ImageView
imageView
,
int
width
,
int
height
){
SimpleImageOpConfiger
sp
=
new
SimpleImageOpConfiger
();
SimpleImageOpConfiger
sp
=
new
SimpleImageOpConfiger
();
sp
.
loadingPic
=
R
.
drawable
.
dynamic_default_img
;
sp
.
loadingPic
=
R
.
drawable
.
dynamic_default_img
;
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/common/tool/ImageCompress.java
View file @
7f031eb3
...
@@ -3,8 +3,10 @@ package com.yidianling.dynamic.common.tool;
...
@@ -3,8 +3,10 @@ package com.yidianling.dynamic.common.tool;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.BitmapFactory
;
import
android.os.Environment
;
import
android.os.Environment
;
import
android.support.v4.app.FragmentActivity
;
import
android.util.Log
;
import
android.util.Log
;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.yidianling.common.tools.RxFileTool
;
import
com.yidianling.common.tools.RxFileTool
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
...
@@ -30,9 +32,9 @@ public class ImageCompress {
...
@@ -30,9 +32,9 @@ public class ImageCompress {
return
image
;
return
image
;
}
}
public
static
File
scal
(
String
path
,
int
size
)
{
public
static
File
scal
(
FragmentActivity
activity
,
String
path
,
int
size
)
{
// String path = fileUri.getPath();
// String path = fileUri.getPath();
File
outputFile
=
new
File
(
path
);
File
outputFile
=
FileUtils
.
INSTANCE
.
getFileByUri
(
activity
,
path
);
if
(!
outputFile
.
exists
()){
if
(!
outputFile
.
exists
()){
return
null
;
return
null
;
}
}
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/publishTrend/fragment/PublishQuestionAndTrendFragment.java
View file @
7f031eb3
...
@@ -7,13 +7,10 @@ import android.app.Activity;
...
@@ -7,13 +7,10 @@ import android.app.Activity;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.database.Cursor
;
import
android.graphics.Point
;
import
android.graphics.Point
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
android.provider.MediaStore
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AlertDialog
;
...
@@ -687,7 +684,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -687,7 +684,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
private
synchronized
File
DealFile2
(
final
String
path
,
int
size
)
{
private
synchronized
File
DealFile2
(
final
String
path
,
int
size
)
{
File
deal_file
=
null
;
File
deal_file
=
null
;
deal_file
=
ImageCompress
.
scal
(
path
,
size
);
deal_file
=
ImageCompress
.
scal
(
getActivity
(),
path
,
size
);
try
{
try
{
Thread
.
sleep
(
100
);
Thread
.
sleep
(
100
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
...
@@ -786,7 +783,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -786,7 +783,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
return
;
return
;
}
}
for
(
int
i
=
0
;
i
<
images
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
images
.
size
();
i
++)
{
AddImag
(
images
.
get
(
i
).
path
);
AddImag
(
images
.
get
(
i
).
uri
.
toString
()
);
}
}
}
}
...
@@ -858,30 +855,6 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
...
@@ -858,30 +855,6 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
imm
.
toggleSoftInput
(
0
,
InputMethodManager
.
HIDE_NOT_ALWAYS
);
imm
.
toggleSoftInput
(
0
,
InputMethodManager
.
HIDE_NOT_ALWAYS
);
}
}
break
;
break
;
case
DynamicConstants
.
REQUEST_CODE_CAMER_TREND
:
String
hand_carmer_path
=
head_path
;
AddImag
(
hand_carmer_path
);
break
;
case
DynamicConstants
.
REQUEST_CODE_GALLERY_TREN
:
if
(
data
!=
null
)
{
String
picturePath
=
""
;
Uri
selectedImage
=
data
.
getData
();
// File file=new File(imgUri);
String
[]
filePathColumn
=
{
MediaStore
.
Images
.
Media
.
DATA
};
Cursor
cursor
=
getActivity
().
getContentResolver
().
query
(
selectedImage
,
filePathColumn
,
null
,
null
,
null
);
if
(
cursor
!=
null
)
{
cursor
.
moveToFirst
();
int
columnIndex
=
cursor
.
getColumnIndex
(
filePathColumn
[
0
]);
//picturePath就是图片在储存卡所在的位置
picturePath
=
cursor
.
getString
(
columnIndex
);
cursor
.
close
();
}
else
{
picturePath
=
selectedImage
.
getPath
();
}
AddImag
(
picturePath
);
}
break
;
}
}
}
}
}
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/actions/PickImageAction.java
View file @
7f031eb3
...
@@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity;
...
@@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity;
import
android.util.Log
;
import
android.util.Log
;
import
com.lzy.imagepicker.bean.ImageItem
;
import
com.lzy.imagepicker.bean.ImageItem
;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.ydl.ydlcommon.actions.imagepicker.PickerCallback
;
import
com.ydl.ydlcommon.actions.imagepicker.PickerCallback
;
import
com.ydl.ydlcommon.actions.imagepicker.YdlImagePicker
;
import
com.ydl.ydlcommon.actions.imagepicker.YdlImagePicker
;
...
@@ -61,7 +62,7 @@ public abstract class PickImageAction extends BaseAction {
...
@@ -61,7 +62,7 @@ public abstract class PickImageAction extends BaseAction {
@Override
@Override
public
void
onSuccess
(
@NotNull
ArrayList
<
ImageItem
>
images
)
{
public
void
onSuccess
(
@NotNull
ArrayList
<
ImageItem
>
images
)
{
for
(
int
i
=
0
;
i
<
images
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
images
.
size
();
i
++)
{
onPicked
(
new
File
(
images
.
get
(
i
).
path
));
onPicked
(
FileUtils
.
INSTANCE
.
getFileByUri
(
getActivity
(),
images
.
get
(
i
).
uri
.
toString
()
));
}
}
}
}
...
...
m-user/src/main/java/com/yidianling/user/GlideImageLoader.java
View file @
7f031eb3
package
com
.
yidianling
.
user
;
package
com
.
yidianling
.
user
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.net.Uri
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.lzy.imagepicker.loader.ImageLoader
;
import
com.lzy.imagepicker.loader.ImageLoader
;
import
com.ydl.ydl_image.config.ISimpleImageOpConfig
;
import
com.ydl.ydl_image.config.ISimpleImageOpConfig
;
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
;
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
;
import
com.ydl.ydl_image.manager.YDLImageCacheManager
;
import
com.ydl.ydl_image.manager.YDLImageCacheManager
;
import
com.ydl.ydl_image.module.GlideApp
;
/**
/**
* Created by xiongyu on 2017/4/7.
* Created by xiongyu on 2017/4/7.
...
@@ -23,6 +26,16 @@ public class GlideImageLoader implements ImageLoader {
...
@@ -23,6 +26,16 @@ public class GlideImageLoader implements ImageLoader {
showImage
(
activity
,
path
,
imageView
,
width
,
height
);
showImage
(
activity
,
path
,
imageView
,
width
,
height
);
}
}
@Override
public
void
displayImage
(
Activity
activity
,
Uri
uri
,
ImageView
imageView
,
int
i
,
int
i1
)
{
GlideApp
.
with
(
activity
)
//配置上下文
.
load
(
uri
)
//设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
.
error
(
com
.
ydl
.
ydlcommon
.
R
.
drawable
.
platform_default_img
)
//设置错误图片
.
placeholder
(
com
.
ydl
.
ydlcommon
.
R
.
drawable
.
platform_default_img
)
//设置占位图片
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
//缓存全尺寸
.
into
(
imageView
);
}
private
void
showImage
(
Activity
activity
,
String
path
,
ImageView
imageView
,
int
width
,
int
height
){
private
void
showImage
(
Activity
activity
,
String
path
,
ImageView
imageView
,
int
width
,
int
height
){
SimpleImageOpConfiger
sp
=
new
SimpleImageOpConfiger
();
SimpleImageOpConfiger
sp
=
new
SimpleImageOpConfiger
();
sp
.
loadingPic
=
R
.
drawable
.
platform_default_img
;
sp
.
loadingPic
=
R
.
drawable
.
platform_default_img
;
...
...
ydl-platform/build.gradle
View file @
7f031eb3
...
@@ -82,6 +82,8 @@ dependencies {
...
@@ -82,6 +82,8 @@ dependencies {
}
}
api
(
rootProject
.
ext
.
dependencies
[
"imagepicker"
])
{
api
(
rootProject
.
ext
.
dependencies
[
"imagepicker"
])
{
exclude
group:
'com.android.support'
,
module:
'recyclerview-v7'
exclude
group:
'com.android.support'
,
module:
'appcompat-v7'
exclude
group:
'org.jetbrains.kotlin'
,
module:
'kotlin-stdlib'
exclude
group:
'org.jetbrains.kotlin'
,
module:
'kotlin-stdlib'
exclude
group:
'org.jetbrains.kotlin'
,
module:
'kotlin-stdlib-jdk7'
exclude
group:
'org.jetbrains.kotlin'
,
module:
'kotlin-stdlib-jdk7'
exclude
group:
'org.jetbrains.kotlin'
,
module:
'kotlin-stdlib-common'
exclude
group:
'org.jetbrains.kotlin'
,
module:
'kotlin-stdlib-common'
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/actions/imagepicker/YdlImageLoader.java
View file @
7f031eb3
...
@@ -27,6 +27,16 @@ public class YdlImageLoader implements ImageLoader {
...
@@ -27,6 +27,16 @@ public class YdlImageLoader implements ImageLoader {
showImage
(
activity
,
path
,
imageView
,
width
,
height
);
showImage
(
activity
,
path
,
imageView
,
width
,
height
);
}
}
@Override
public
void
displayImage
(
Activity
activity
,
Uri
uri
,
ImageView
imageView
,
int
i
,
int
i1
)
{
GlideApp
.
with
(
activity
)
//配置上下文
.
load
(
uri
)
//设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
.
error
(
R
.
drawable
.
platform_default_img
)
//设置错误图片
.
placeholder
(
R
.
drawable
.
platform_default_img
)
//设置占位图片
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
//缓存全尺寸
.
into
(
imageView
);
}
private
void
showImage
(
Activity
activity
,
String
path
,
ImageView
imageView
,
int
width
,
int
height
){
private
void
showImage
(
Activity
activity
,
String
path
,
ImageView
imageView
,
int
width
,
int
height
){
GlideApp
.
with
(
activity
)
//配置上下文
GlideApp
.
with
(
activity
)
//配置上下文
.
load
(
Uri
.
fromFile
(
new
File
(
path
)))
//设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
.
load
(
Uri
.
fromFile
(
new
File
(
path
)))
//设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
View file @
7f031eb3
...
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
...
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.text.TextUtils
import
android.text.TextUtils
import
com.facebook.stetho.okhttp3.StethoInterceptor
import
com.facebook.stetho.okhttp3.StethoInterceptor
import
com.ydl.pushserver.pushagent.YdlPushAgent
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.base.BaseApp
import
com.ydl.ydlcommon.bean.AuthBean
import
com.ydl.ydlcommon.bean.AuthBean
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.ydl.ydlcommon.data.PlatformDataManager
...
@@ -20,6 +21,7 @@ import com.yidianling.common.tools.LogUtil
...
@@ -20,6 +21,7 @@ import com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.common.tools.ToastUtil
import
io.reactivex.functions.Action
import
okhttp3.*
import
okhttp3.*
import
okio.Buffer
import
okio.Buffer
import
okio.BufferedSink
import
okio.BufferedSink
...
@@ -379,6 +381,21 @@ class HttpConfig {
...
@@ -379,6 +381,21 @@ class HttpConfig {
}
}
}
}
@SuppressLint
(
"CheckResult"
)
fun
initSocketConfig
(
finallyAction
:
Action
)
{
ApiRequestUtil
.
getJavaGlobalInfo
()
.
compose
(
RxUtils
.
applySchedulers
())
.
compose
(
RxUtils
.
resultJavaData
())
.
doFinally
(
finallyAction
)
.
subscribe
({
if
(
it
!=
null
&&!
TextUtils
.
isEmpty
(
it
.
ip
)){
YdlPushAgent
.
setDebugAdree
(
it
.
ip
,
it
.
port
.
toInt
())
}
})
{
LogUtil
.
i
(
"HttpConfig"
,
it
.
toString
())
}
}
private
object
Holder
{
private
object
Holder
{
val
INSTANCE
=
HttpConfig
()
val
INSTANCE
=
HttpConfig
()
}
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/bean/JavaGlobalInfo.java
0 → 100644
View file @
7f031eb3
package
com
.
ydl
.
ydlcommon
.
bean
;
/**
* Created by haorui on 2020-01-13.
* Des:
*/
public
class
JavaGlobalInfo
{
private
String
ip
;
private
String
port
;
public
String
getIp
()
{
return
ip
;
}
public
void
setIp
(
String
ip
)
{
this
.
ip
=
ip
;
}
public
String
getPort
()
{
return
port
;
}
public
void
setPort
(
String
port
)
{
this
.
port
=
port
;
}
}
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/api/ApiRequestUtil.java
View file @
7f031eb3
...
@@ -2,6 +2,7 @@ package com.ydl.ydlcommon.data.http.api;
...
@@ -2,6 +2,7 @@ package com.ydl.ydlcommon.data.http.api;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.ydl.ydlcommon.bean.AuthBean
;
import
com.ydl.ydlcommon.bean.AuthBean
;
import
com.ydl.ydlcommon.bean.JavaGlobalInfo
;
import
com.ydl.ydlcommon.bean.MustUP
;
import
com.ydl.ydlcommon.bean.MustUP
;
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
;
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
;
import
com.ydl.ydlcommon.data.http.BaseResponse
;
import
com.ydl.ydlcommon.data.http.BaseResponse
;
...
@@ -49,4 +50,12 @@ public class ApiRequestUtil {
...
@@ -49,4 +50,12 @@ public class ApiRequestUtil {
public
static
Observable
<
BaseAPIResponse
<
AuthBean
>>
getDynamicToken
()
{
public
static
Observable
<
BaseAPIResponse
<
AuthBean
>>
getDynamicToken
()
{
return
YDLHttpUtils
.
Companion
.
obtainApi
(
NetApiStore
.
class
).
getDynamicToken
();
return
YDLHttpUtils
.
Companion
.
obtainApi
(
NetApiStore
.
class
).
getDynamicToken
();
}
}
/**
* 获取java全局参数接口
* @return
*/
public
static
Observable
<
BaseAPIResponse
<
JavaGlobalInfo
>>
getJavaGlobalInfo
()
{
return
YDLHttpUtils
.
Companion
.
obtainApi
(
NetApiStore
.
class
).
getJavaGlobalInfo
();
}
}
}
ydl-platform/src/main/java/com/ydl/ydlcommon/data/http/api/NetApiStore.java
View file @
7f031eb3
package
com
.
ydl
.
ydlcommon
.
data
.
http
.
api
;
package
com
.
ydl
.
ydlcommon
.
data
.
http
.
api
;
import
com.ydl.ydlcommon.bean.AuthBean
;
import
com.ydl.ydlcommon.bean.AuthBean
;
import
com.ydl.ydlcommon.bean.JavaGlobalInfo
;
import
com.ydl.ydlcommon.bean.MustUP
;
import
com.ydl.ydlcommon.bean.MustUP
;
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
;
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
;
import
com.ydl.ydlcommon.data.http.BaseResponse
;
import
com.ydl.ydlcommon.data.http.BaseResponse
;
...
@@ -44,4 +45,8 @@ interface NetApiStore {
...
@@ -44,4 +45,8 @@ interface NetApiStore {
@GET
(
"risk/key/info"
)
@GET
(
"risk/key/info"
)
Observable
<
BaseAPIResponse
<
AuthBean
>>
getDynamicToken
();
Observable
<
BaseAPIResponse
<
AuthBean
>>
getDynamicToken
();
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@GET
(
"config/socket-config"
)
Observable
<
BaseAPIResponse
<
JavaGlobalInfo
>>
getJavaGlobalInfo
();
}
}
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/AppProgressUtils.java
View file @
7f031eb3
package
com
.
ydl
.
ydlcommon
.
utils
;
package
com
.
ydl
.
ydlcommon
.
utils
;
import
android.
app.Application
;
import
android.
content.Context
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
com.yidianling.common.tools.LogUtil
;
import
com.yidianling.common.tools.LogUtil
;
...
@@ -23,7 +23,7 @@ public class AppProgressUtils {
...
@@ -23,7 +23,7 @@ public class AppProgressUtils {
* (相应代码也可参考 Demo 的 application),使用 EaseUI 库的就不用理会这个。
* (相应代码也可参考 Demo 的 application),使用 EaseUI 库的就不用理会这个。
* @return
* @return
*/
*/
public
static
boolean
isMainProcess
(
Application
application
)
{
public
static
boolean
isMainProcess
(
Context
application
)
{
String
processAppName
=
getProcessName
(
application
);
String
processAppName
=
getProcessName
(
application
);
if
(
TextUtils
.
isEmpty
(
processAppName
))
if
(
TextUtils
.
isEmpty
(
processAppName
))
return
true
;
return
true
;
...
@@ -37,7 +37,7 @@ public class AppProgressUtils {
...
@@ -37,7 +37,7 @@ public class AppProgressUtils {
return
true
;
return
true
;
}
}
private
static
String
getProcessName
(
Application
app
)
{
private
static
String
getProcessName
(
Context
app
)
{
String
processName
=
null
;
String
processName
=
null
;
try
{
try
{
Field
loadedApkField
=
app
.
getClass
().
getField
(
"mLoadedApk"
);
Field
loadedApkField
=
app
.
getClass
().
getField
(
"mLoadedApk"
);
...
...
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