Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
component
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王涛55
component
Commits
4c19be06
Commit
4c19be06
authored
Sep 20, 2019
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
data
parent
3f42a423
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
240 additions
and
1 deletions
+240
-1
ModuleProject/.idea/codeStyles/Project.xml
+25
-0
ModuleProject/lib_baidu_textdect/src/main/java/com/hikcreate/baidutextdect/FileUtil.java
+99
-0
ModuleProject/lib_baidu_textdect/src/main/java/com/hikcreate/baidutextdect/TextDectCameraFragment.java
+0
-1
ModuleProject/lib_data_drive/build.gradle
+1
-0
ModuleProject/lib_data_drive/src/main/java/com/data/driver/MessageWrap.java
+18
-0
ModuleProject/lib_data_drive/src/main/java/com/data/util/ObjectUtil.java
+97
-0
No files found.
ModuleProject/.idea/codeStyles/Project.xml
View file @
4c19be06
...
...
@@ -64,6 +64,31 @@
<JetCodeStyleSettings>
<option
name=
"CODE_STYLE_DEFAULTS"
value=
"KOTLIN_OFFICIAL"
/>
</JetCodeStyleSettings>
<Objective-C-extensions>
<file>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Import"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Macro"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Typedef"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Enum"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Constant"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Global"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Struct"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"FunctionPredecl"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Function"
/>
</file>
<class>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Property"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Synthesize"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"InitMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"StaticMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"InstanceMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"DeallocMethod"
/>
</class>
<extensions>
<pair
source=
"cpp"
header=
"h"
fileNamingConvention=
"NONE"
/>
<pair
source=
"c"
header=
"h"
fileNamingConvention=
"NONE"
/>
</extensions>
</Objective-C-extensions>
<XML>
<option
name=
"XML_KEEP_LINE_BREAKS"
value=
"false"
/>
<option
name=
"XML_ALIGN_ATTRIBUTES"
value=
"false"
/>
...
...
ModuleProject/lib_baidu_textdect/src/main/java/com/hikcreate/baidutextdect/FileUtil.java
0 → 100644
View file @
4c19be06
package
com
.
hikcreate
.
baidutextdect
;
import
android.content.Context
;
import
android.content.res.AssetManager
;
import
android.os.Environment
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
/**
* Created by fujiayi on 2017/5/19.
*/
public
class
FileUtil
{
private
static
final
String
sAudioDir
=
"baiduTTS"
;
public
static
String
APP_ROOT_FILE_PATH
;
//sd卡根路劲,在Application中初始化
public
static
final
String
APP_ROOT_FILE
=
"/hikcreate/"
;
//app文件根路径
public
static
String
IMAGE_CACHE
=
APP_ROOT_FILE_PATH
+
APP_ROOT_FILE
+
"/cache/image/"
;
//图片缓存路径
// 创建一个临时目录,用于复制临时文件,如assets目录下的离线资源文件
public
static
String
createTmpDir
(
Context
context
)
{
String
tmpDir
=
Environment
.
getExternalStorageDirectory
().
toString
()
+
"/"
+
sAudioDir
;
if
(!
FileUtil
.
makeDir
(
tmpDir
))
{
tmpDir
=
context
.
getExternalFilesDir
(
sAudioDir
).
getAbsolutePath
();
if
(!
FileUtil
.
makeDir
(
sAudioDir
))
{
throw
new
RuntimeException
(
"create model resources dir failed :"
+
tmpDir
);
}
}
return
tmpDir
;
}
public
static
boolean
fileCanRead
(
String
filename
)
{
File
f
=
new
File
(
filename
);
return
f
.
canRead
();
}
public
static
boolean
makeDir
(
String
dirPath
)
{
File
file
=
new
File
(
dirPath
);
if
(!
file
.
exists
())
{
return
file
.
mkdirs
();
}
else
{
return
true
;
}
}
public
static
void
copyFromAssets
(
AssetManager
assets
,
String
source
,
String
dest
,
boolean
isCover
)
throws
IOException
{
File
file
=
new
File
(
dest
);
if
(
isCover
||
(!
isCover
&&
!
file
.
exists
()))
{
InputStream
is
=
null
;
FileOutputStream
fos
=
null
;
try
{
is
=
assets
.
open
(
source
);
String
path
=
dest
;
fos
=
new
FileOutputStream
(
path
);
byte
[]
buffer
=
new
byte
[
1024
];
int
size
=
0
;
while
((
size
=
is
.
read
(
buffer
,
0
,
1024
))
>=
0
)
{
fos
.
write
(
buffer
,
0
,
size
);
}
}
finally
{
if
(
fos
!=
null
)
{
try
{
fos
.
close
();
}
finally
{
if
(
is
!=
null
)
{
is
.
close
();
}
}
}
}
}
}
public
static
String
getImageCacheFilePath
()
{
return
getImageCacheFilePath
(
"pic.jpg"
);
}
public
static
String
getImageCacheFilePath
(
String
fileName
)
{
createDirFile
(
FileUtil
.
getImgCachePath
());
return
FileUtil
.
getImgCachePath
()
+
File
.
separator
+
fileName
;
}
public
static
void
createDirFile
(
String
path
)
{
File
dir
=
new
File
(
path
);
if
(!
dir
.
exists
())
{
dir
.
mkdirs
();
}
}
public
static
String
getImgCachePath
()
{
return
IMAGE_CACHE
;
}
}
ModuleProject/lib_baidu_textdect/src/main/java/com/hikcreate/baidutextdect/TextDectCameraFragment.java
View file @
4c19be06
...
...
@@ -35,7 +35,6 @@ import com.baidu.ocr.ui.camera.PermissionCallback;
import
com.baidu.ocr.ui.crop.CropView
;
import
com.baidu.ocr.ui.crop.FrameOverlayView
;
import
com.hikcreate.baidutextdect.util.TextDecFileUtil
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
...
...
ModuleProject/lib_data_drive/build.gradle
View file @
4c19be06
...
...
@@ -26,4 +26,5 @@ android {
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
deps
.
eventbus
}
ModuleProject/lib_data_drive/src/main/java/com/data/driver/MessageWrap.java
0 → 100644
View file @
4c19be06
package
com
.
data
.
driver
;
import
com.data.bean.GeneralMessageBean
;
/**
* author : taowang
* date :2019/9/19
* description:消息控制中枢
**/
public
class
MessageWrap
{
public
static
void
sendMessage
(
GeneralMessageBean
mGeneralMessageBean
){
// EventBus.getDefault().post(mGeneralMessageBean);
}
}
ModuleProject/lib_data_drive/src/main/java/com/data/util/ObjectUtil.java
0 → 100644
View file @
4c19be06
package
com
.
data
.
util
;
import
java.lang.reflect.Method
;
/**
* author : taowang
* date :2019/9/19
* description:消息实体操作类
**/
public
class
ObjectUtil
{
/**
* @param className : 全路径的类名
* @param dataContent
* @return
*/
public
static
Object
getObjectBean
(
String
className
,
String
dataContent
)
{
Object
messageBeanObject
=
null
;
try
{
Class
messageClass
=
Class
.
forName
(
className
);
messageBeanObject
=
messageClass
.
newInstance
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
messageBeanObject
;
}
private
static
Object
invokeMethod
(
Object
object
,
String
methodName
){
try
{
Method
method
=
object
.
getClass
().
getMethod
(
methodName
);
return
method
.
invoke
(
object
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
private
static
Object
getInfoByMethod
(
String
className
,
String
dataContent
,
String
methodName
){
return
invokeMethod
(
getObjectBean
(
className
,
dataContent
),
methodName
);
}
public
static
<
T
>
T
createInstance
(
Class
<
T
>
clz
)
{
try
{
return
clz
.
newInstance
();
}
catch
(
InstantiationException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
public
static
<
T
>
T
createInstance
(
Class
<
T
>
checkType
,
String
className
){
try
{
Class
<
T
>
clz
=
(
Class
<
T
>)
Class
.
forName
(
className
);
Object
obj
=
clz
.
newInstance
();
if
(!
checkType
.
isInstance
(
obj
))
{
throw
new
Exception
(
"类型不匹配"
);
}
return
(
T
)
obj
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
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