Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MiYaFastCashier
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
MiYaFastCashier
Commits
c265d99c
Commit
c265d99c
authored
May 10, 2022
by
赵鹏翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志事件添加,日志中转组件添加
parent
81acdb06
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
521 additions
and
7 deletions
+521
-7
FunctionCenterActivity.kt
...n/java/com/miya/fastcashier/log/FunctionCenterActivity.kt
+7
-7
LFilePicker.java
app/src/main/java/com/miya/fastcashier/log/LFilePicker.java
+307
-0
ParamEntity.java
app/src/main/java/com/miya/fastcashier/log/ParamEntity.java
+165
-0
app_icon_lfile_back.png
app/src/main/res/mipmap-xhdpi/app_icon_lfile_back.png
+0
-0
styles.xml
app/src/main/res/values/styles.xml
+25
-0
themes.xml
app/src/main/res/values/themes.xml
+17
-0
No files found.
app/src/main/java/com/miya/fastcashier/log/FunctionCenterActivity.kt
View file @
c265d99c
...
...
@@ -37,13 +37,13 @@ class FunctionCenterActivity : BaseActivity() {
}
fun
toUploadLog
()
{
//
LFilePicker()
//
.withActivity(this)
//
.withStartPath(LogFileUtils.CACHE_FILE_PATH) //指定初始显示路径
//
.withIsGreater(true) //过滤文件大小 小于指定大小的文件
//
.withFileSize(0) //指定文件大小为500K
//
.withMutilyMode(false)
//
.start()
LFilePicker
()
.
withActivity
(
this
)
.
withStartPath
(
LogFileUtils
.
CACHE_FILE_PATH
)
//指定初始显示路径
.
withIsGreater
(
true
)
//过滤文件大小 小于指定大小的文件
.
withFileSize
(
0
)
//指定文件大小为500K
.
withMutilyMode
(
false
)
.
start
()
}
...
...
app/src/main/java/com/miya/fastcashier/log/LFilePicker.java
0 → 100644
View file @
c265d99c
package
com
.
miya
.
fastcashier
.
log
;
import
android.app.Activity
;
import
android.app.Fragment
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
com.miya.fastcashier.R
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.StyleRes
;
/**
* 作者:Leon
* 时间:2017/3/20 16:57
*/
public
class
LFilePicker
{
private
Activity
mActivity
;
private
Fragment
mFragment
;
private
String
mTitle
;
private
String
mTitleColor
;
private
int
theme
=
R
.
style
.
LFileTheme
;
private
int
mTitleStyle
=
R
.
style
.
LFileToolbarTextStyle
;
private
String
mBackgroundColor
;
private
int
mBackStyle
;
private
int
mRequestCode
;
private
boolean
mMutilyMode
=
true
;
private
boolean
mChooseMode
=
true
;
private
String
mAddText
;
private
int
mIconStyle
;
private
String
[]
mFileTypes
;
private
String
mNotFoundFiles
;
private
int
mMaxNum
;
private
String
mStartPath
;
private
boolean
mIsGreater
=
true
;
//是否大于
private
long
mFileSize
;
private
String
mFileName
;
/**
* 绑定Activity
*
* @param activity
* @return
*/
public
LFilePicker
withActivity
(
Activity
activity
)
{
this
.
mActivity
=
activity
;
return
this
;
}
/**
* 绑定Fragment
*
* @param fragment
* @return
*/
public
LFilePicker
withFragment
(
Fragment
fragment
)
{
this
.
mFragment
=
fragment
;
return
this
;
}
/**
* 设置主标题
*
* @param title
* @return
*/
public
LFilePicker
withTitle
(
String
title
)
{
this
.
mTitle
=
title
;
return
this
;
}
/**
* 设置辩题颜色
*
* @param color
* @return
*/
@Deprecated
public
LFilePicker
withTitleColor
(
String
color
)
{
this
.
mTitleColor
=
color
;
return
this
;
}
/**
* 设置主题
*
* @param theme
* @return
*/
public
LFilePicker
withTheme
(
@StyleRes
int
theme
)
{
this
.
theme
=
theme
;
return
this
;
}
/**
* 设置标题的颜色和字体大小
*
* @param style
* @return
*/
public
LFilePicker
withTitleStyle
(
@StyleRes
int
style
)
{
this
.
mTitleStyle
=
style
;
return
this
;
}
/**
* 设置背景色
*
* @param color
* @return
*/
public
LFilePicker
withBackgroundColor
(
String
color
)
{
this
.
mBackgroundColor
=
color
;
return
this
;
}
/**
* 请求码
*
* @param requestCode
* @return
*/
public
LFilePicker
withRequestCode
(
int
requestCode
)
{
this
.
mRequestCode
=
requestCode
;
return
this
;
}
/**
* 设置返回图标
*
* @param backStyle
* @return
*/
public
LFilePicker
withBackIcon
(
int
backStyle
)
{
this
.
mBackStyle
=
0
;
//默认样式
this
.
mBackStyle
=
backStyle
;
return
this
;
}
/**
* 设置选择模式,默认为true,多选;false为单选
*
* @param isMutily
* @return
*/
public
LFilePicker
withMutilyMode
(
boolean
isMutily
)
{
this
.
mMutilyMode
=
isMutily
;
return
this
;
}
/**
* 设置多选时按钮文字
*
* @param text
* @return
*/
public
LFilePicker
withAddText
(
String
text
)
{
this
.
mAddText
=
text
;
return
this
;
}
/**
* 设置文件夹图标风格
*
* @param style
* @return
*/
public
LFilePicker
withIconStyle
(
int
style
)
{
this
.
mIconStyle
=
style
;
return
this
;
}
public
LFilePicker
withFileFilter
(
String
[]
arrs
)
{
this
.
mFileTypes
=
arrs
;
return
this
;
}
/**
* 没有选中文件时的提示信息
*
* @param notFoundFiles
* @return
*/
public
LFilePicker
withNotFoundBooks
(
String
notFoundFiles
)
{
this
.
mNotFoundFiles
=
notFoundFiles
;
return
this
;
}
/**
* 设置最大选中数量
*
* @param num
* @return
*/
public
LFilePicker
withMaxNum
(
int
num
)
{
this
.
mMaxNum
=
num
;
return
this
;
}
/**
* 设置选择上传的文件
*
* @param fileName
* @return
*/
public
LFilePicker
withFileName
(
String
fileName
)
{
this
.
mFileName
=
fileName
;
return
this
;
}
/**
* 设置初始显示路径
*
* @param path
* @return
*/
public
LFilePicker
withStartPath
(
String
path
)
{
this
.
mStartPath
=
path
;
return
this
;
}
/**
* 设置选择模式,true为文件选择模式,false为文件夹选择模式,默认为true
*
* @param chooseMode
* @return
*/
public
LFilePicker
withChooseMode
(
boolean
chooseMode
)
{
this
.
mChooseMode
=
chooseMode
;
return
this
;
}
/**
* 设置文件大小过滤方式:大于指定大小或者小于指定大小
*
* @param isGreater true:大于 ;false:小于,同时包含指定大小在内
* @return
*/
public
LFilePicker
withIsGreater
(
boolean
isGreater
)
{
this
.
mIsGreater
=
isGreater
;
return
this
;
}
/**
* 设置过滤文件大小
*
* @param fileSize
* @return
*/
public
LFilePicker
withFileSize
(
long
fileSize
)
{
this
.
mFileSize
=
fileSize
;
return
this
;
}
public
void
start
()
{
if
(
mActivity
==
null
&&
mFragment
==
null
)
{
throw
new
RuntimeException
(
"You must pass Activity or Fragment by withActivity or withFragment or withSupportFragment method"
);
}
Intent
intent
=
initIntent
();
Bundle
bundle
=
getBundle
();
intent
.
putExtras
(
bundle
);
if
(
mActivity
!=
null
)
{
mActivity
.
startActivityForResult
(
intent
,
mRequestCode
);
}
else
{
mFragment
.
startActivityForResult
(
intent
,
mRequestCode
);
}
}
private
Intent
initIntent
()
{
// Intent intent;
// if (mActivity != null) {
// intent = new Intent(mActivity, LFilePickerActivity.class);
// } else {
// intent = new Intent(mFragment.getActivity(), LFilePickerActivity.class);
// }
// return intent;
return
null
;
}
@NonNull
private
Bundle
getBundle
()
{
ParamEntity
paramEntity
=
new
ParamEntity
();
paramEntity
.
setTitle
(
mTitle
);
paramEntity
.
setTheme
(
theme
);
paramEntity
.
setTitleColor
(
mTitleColor
);
paramEntity
.
setTitleStyle
(
mTitleStyle
);
paramEntity
.
setBackgroundColor
(
mBackgroundColor
);
paramEntity
.
setBackIcon
(
mBackStyle
);
paramEntity
.
setMutilyMode
(
mMutilyMode
);
paramEntity
.
setAddText
(
mAddText
);
paramEntity
.
setIconStyle
(
mIconStyle
);
paramEntity
.
setFileTypes
(
mFileTypes
);
paramEntity
.
setNotFoundFiles
(
mNotFoundFiles
);
paramEntity
.
setMaxNum
(
mMaxNum
);
paramEntity
.
setChooseMode
(
mChooseMode
);
paramEntity
.
setPath
(
mStartPath
);
paramEntity
.
setFileSize
(
mFileSize
);
paramEntity
.
setFileName
(
mFileName
);
paramEntity
.
setGreater
(
mIsGreater
);
Bundle
bundle
=
new
Bundle
();
bundle
.
putSerializable
(
"param"
,
paramEntity
);
return
bundle
;
}
}
app/src/main/java/com/miya/fastcashier/log/ParamEntity.java
0 → 100644
View file @
c265d99c
package
com
.
miya
.
fastcashier
.
log
;
import
java.io.Serializable
;
/**
* 作者:Leon
* 时间:2017/3/21 14:50
*/
public
class
ParamEntity
implements
Serializable
{
private
String
title
;
private
String
titleColor
;
private
int
titleStyle
;
private
int
theme
;
private
String
backgroundColor
;
private
int
backIcon
;
private
boolean
mutilyMode
;
private
String
addText
;
private
int
iconStyle
;
private
String
[]
fileTypes
;
private
String
notFoundFiles
;
private
int
maxNum
;
private
boolean
chooseMode
=
true
;
private
String
path
;
private
long
fileSize
;
private
boolean
isGreater
;
private
String
fileName
;
public
String
getFileName
()
{
return
fileName
;
}
public
void
setFileName
(
String
fileName
)
{
this
.
fileName
=
fileName
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
@Deprecated
public
String
getTitleColor
()
{
return
titleColor
;
}
@Deprecated
public
void
setTitleColor
(
String
titleColor
)
{
this
.
titleColor
=
titleColor
;
}
public
int
getTheme
()
{
return
theme
;
}
public
void
setTheme
(
int
theme
)
{
this
.
theme
=
theme
;
}
public
int
getTitleStyle
()
{
return
titleStyle
;
}
public
void
setTitleStyle
(
int
titleStyle
)
{
this
.
titleStyle
=
titleStyle
;
}
public
String
getBackgroundColor
()
{
return
backgroundColor
;
}
public
void
setBackgroundColor
(
String
backgroundColor
)
{
this
.
backgroundColor
=
backgroundColor
;
}
public
boolean
isMutilyMode
()
{
return
mutilyMode
;
}
public
void
setMutilyMode
(
boolean
mutilyMode
)
{
this
.
mutilyMode
=
mutilyMode
;
}
public
int
getBackIcon
()
{
return
backIcon
;
}
public
void
setBackIcon
(
int
backIcon
)
{
this
.
backIcon
=
backIcon
;
}
public
String
getAddText
()
{
return
addText
;
}
public
void
setAddText
(
String
addText
)
{
this
.
addText
=
addText
;
}
public
int
getIconStyle
()
{
return
iconStyle
;
}
public
void
setIconStyle
(
int
iconStyle
)
{
this
.
iconStyle
=
iconStyle
;
}
public
String
[]
getFileTypes
()
{
return
fileTypes
;
}
public
void
setFileTypes
(
String
[]
fileTypes
)
{
this
.
fileTypes
=
fileTypes
;
}
public
String
getNotFoundFiles
()
{
return
notFoundFiles
;
}
public
void
setNotFoundFiles
(
String
notFoundFiles
)
{
this
.
notFoundFiles
=
notFoundFiles
;
}
public
int
getMaxNum
()
{
return
maxNum
;
}
public
void
setMaxNum
(
int
maxNum
)
{
this
.
maxNum
=
maxNum
;
}
public
boolean
isChooseMode
()
{
return
chooseMode
;
}
public
void
setChooseMode
(
boolean
chooseMode
)
{
this
.
chooseMode
=
chooseMode
;
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
public
long
getFileSize
()
{
return
fileSize
;
}
public
void
setFileSize
(
long
fileSize
)
{
this
.
fileSize
=
fileSize
;
}
public
boolean
isGreater
()
{
return
isGreater
;
}
public
void
setGreater
(
boolean
greater
)
{
isGreater
=
greater
;
}
}
app/src/main/res/mipmap-xhdpi/app_icon_lfile_back.png
0 → 100644
View file @
c265d99c
264 Bytes
app/src/main/res/values/styles.xml
View file @
c265d99c
...
...
@@ -33,4 +33,29 @@
<item
name=
"android:backgroundDimAmount"
>
0.7
</item>
</style>
<style
name=
"LFileToolbarTextStyle"
parent=
"ThemeOverlay.AppCompat.Dark.ActionBar"
>
<item
name=
"android:textColor"
>
@color/lfile_white
</item>
<item
name=
"android:textSize"
>
16sp
</item>
</style>
<style
name=
"LFile_item_text_detail"
>
<item
name=
"android:layout_width"
>
match_parent
</item>
<item
name=
"android:layout_height"
>
0dp
</item>
<item
name=
"android:textColor"
>
#999999
</item>
<item
name=
"android:layout_weight"
>
1
</item>
<item
name=
"android:gravity"
>
left
</item>
<item
name=
"android:textSize"
>
14sp
</item>
</style>
<style
name=
"LFile_item_text_name"
>
<item
name=
"android:layout_width"
>
match_parent
</item>
<item
name=
"android:layout_height"
>
0dp
</item>
<item
name=
"android:layout_weight"
>
1
</item>
<item
name=
"android:maxLines"
>
1
</item>
<item
name=
"android:ellipsize"
>
end
</item>
<item
name=
"android:textColor"
>
#101010
</item>
<item
name=
"android:gravity"
>
left
</item>
<item
name=
"android:textSize"
>
16sp
</item>
</style>
</resources>
app/src/main/res/values/themes.xml
View file @
c265d99c
...
...
@@ -16,4 +16,21 @@
<item
name=
"android:statusBarColor"
tools:targetApi=
"l"
>
@color/green
</item>
</style>
<style
name=
"LFileTheme"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<item
name=
"colorPrimary"
>
@color/lfile_colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/lfile_colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/lfile_colorAccent
</item>
<item
name=
"homeAsUpIndicator"
>
@mipmap/app_icon_lfile_back
</item>
<item
name=
"actionBarSize"
>
36dp
</item>
<item
name=
"navigationIcon"
>
@mipmap/app_icon_lfile_back
</item>
<!--返回icon-->
<!-- 溢出菜单图标颜色-->
<item
name=
"colorControlNormal"
>
@android:color/white
</item>
<item
name=
"actionMenuTextColor"
>
@android:color/white
</item>
</style>
<style
name=
"LFileCheckBoxTheme"
parent=
"LFileTheme"
>
<!-- 溢出菜单图标颜色-->
<item
name=
"colorControlNormal"
>
@color/lfile_gray
</item>
</style>
</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