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
e3083787
Commit
e3083787
authored
May 24, 2022
by
赵鹏翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ce4a1f78
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
63 deletions
+56
-63
EmptyRecyclerView.java
...main/java/com/miya/fastcashier/log/EmptyRecyclerView.java
+0
-62
EmptyRecyclerView.kt
...c/main/java/com/miya/fastcashier/log/EmptyRecyclerView.kt
+55
-0
PrintService.kt
...rc/main/java/com/miya/fastcashier/service/PrintService.kt
+1
-1
No files found.
app/src/main/java/com/miya/fastcashier/log/EmptyRecyclerView.java
deleted
100644 → 0
View file @
ce4a1f78
package
com
.
miya
.
fastcashier
.
log
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
androidx.annotation.Nullable
;
import
androidx.recyclerview.widget.RecyclerView
;
/**
* 作者:Leon
* 时间:2017/3/17 13:44
*/
public
class
EmptyRecyclerView
extends
RecyclerView
{
private
View
mEmptyView
;
public
EmptyRecyclerView
(
Context
context
)
{
super
(
context
);
}
public
EmptyRecyclerView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
EmptyRecyclerView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
}
/**
* 根据数据源判断是否显示空白view
*/
private
void
checkIfEmpty
()
{
if
(
mEmptyView
!=
null
||
getAdapter
()
!=
null
)
{
mEmptyView
.
setVisibility
(
getAdapter
().
getItemCount
()
>
0
?
GONE
:
VISIBLE
);
}
}
public
void
setmEmptyView
(
View
mEmptyView
)
{
this
.
mEmptyView
=
mEmptyView
;
checkIfEmpty
();
}
@Override
public
void
setAdapter
(
Adapter
adapter
)
{
Adapter
adapterOld
=
getAdapter
();
if
(
adapterOld
!=
null
)
{
adapterOld
.
unregisterAdapterDataObserver
(
observer
);
}
super
.
setAdapter
(
adapter
);
if
(
adapter
!=
null
)
{
adapter
.
registerAdapterDataObserver
(
observer
);
}
}
AdapterDataObserver
observer
=
new
AdapterDataObserver
()
{
@Override
public
void
onChanged
()
{
super
.
onChanged
();
checkIfEmpty
();
}
};
}
app/src/main/java/com/miya/fastcashier/log/EmptyRecyclerView.kt
0 → 100644
View file @
e3083787
package
com.miya.fastcashier.log
import
android.content.Context
import
android.util.AttributeSet
import
android.view.View
import
androidx.recyclerview.widget.RecyclerView
/**
* 作者:Leon
* 时间:2017/3/17 13:44
*/
class
EmptyRecyclerView
:
RecyclerView
{
private
var
mEmptyView
:
View
?
=
null
constructor
(
context
:
Context
?)
:
super
(
context
!!
)
{}
constructor
(
context
:
Context
?,
attrs
:
AttributeSet
?)
:
super
(
context
!!
,
attrs
)
{
}
constructor
(
context
:
Context
?,
attrs
:
AttributeSet
?,
defStyle
:
Int
)
:
super
(
context
!!
,
attrs
,
defStyle
)
{
}
/**
* 根据数据源判断是否显示空白view
*/
private
fun
checkIfEmpty
()
{
if
(
mEmptyView
!=
null
||
adapter
!=
null
)
{
mEmptyView
!!
.
visibility
=
if
(
adapter
!!
.
itemCount
>
0
)
GONE
else
VISIBLE
}
}
fun
setmEmptyView
(
mEmptyView
:
View
?)
{
this
.
mEmptyView
=
mEmptyView
checkIfEmpty
()
}
override
fun
setAdapter
(
adapter
:
Adapter
<
*
>?)
{
val
adapterOld
=
getAdapter
()
adapterOld
?.
unregisterAdapterDataObserver
(
observer
)
super
.
setAdapter
(
adapter
)
adapter
?.
registerAdapterDataObserver
(
observer
)
}
var
observer
:
AdapterDataObserver
=
object
:
AdapterDataObserver
()
{
override
fun
onChanged
()
{
super
.
onChanged
()
checkIfEmpty
()
}
}
}
\ No newline at end of file
app/src/main/java/com/miya/fastcashier/service/PrintService.kt
View file @
e3083787
...
...
@@ -16,7 +16,7 @@ import java.util.*
object
PrintService
{
private
var
payServiceResponse
:
PayServiceResponse
?
=
null
;
private
var
payServiceResponse
:
PayServiceResponse
?
=
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