Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RvApp
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lify
RvApp
Commits
48ef05e2
Commit
48ef05e2
authored
Jul 13, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传ShareChoiceDialog
parent
d3a76bbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
183 additions
and
0 deletions
+183
-0
ShareChoiceDialog.java
...re/src/main/java/com/rv/share/view/ShareChoiceDialog.java
+183
-0
No files found.
plugin_share/src/main/java/com/rv/share/view/ShareChoiceDialog.java
0 → 100644
View file @
48ef05e2
package
com
.
rv
.
share
.
view
;
import
android.content.Context
;
import
android.support.design.widget.BottomSheetDialog
;
import
android.view.View
;
import
android.widget.TextView
;
import
com.rv.share.R
;
/*****
*
* 分享选择框
*/
public
class
ShareChoiceDialog
implements
View
.
OnClickListener
{
private
Context
mContext
;
private
BottomSheetDialog
dialog
;
private
TextView
tvCopy
;
private
TextView
tvWx
;
private
TextView
tvWXC
;
private
TextView
tvQQ
;
private
TextView
tvBill
;
private
TextView
tvCancle
;
private
ShareListener
listener
;
private
boolean
isShowCopy
=
false
;
private
boolean
isShowBill
=
false
;
private
boolean
isShowWx
=
false
;
private
boolean
isShowWxC
=
false
;
private
boolean
isShowQQ
=
false
;
private
ShareChoiceDialog
(
Context
context
)
{
mContext
=
context
;
dialog
=
new
BottomSheetDialog
(
context
);
}
private
void
create
()
{
View
view
=
View
.
inflate
(
mContext
,
R
.
layout
.
dialog_share_choice
,
null
);
tvCopy
=
view
.
findViewById
(
R
.
id
.
tv_copy
);
tvWx
=
view
.
findViewById
(
R
.
id
.
tv_weixin
);
tvWXC
=
view
.
findViewById
(
R
.
id
.
tv_weixin_circle
);
tvQQ
=
view
.
findViewById
(
R
.
id
.
tv_qq
);
tvBill
=
view
.
findViewById
(
R
.
id
.
tv_bill
);
tvCancle
=
view
.
findViewById
(
R
.
id
.
tv_cancel
);
if
(
isShowCopy
)
{
tvCopy
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
isShowWx
)
{
tvWx
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
isShowWxC
)
{
tvWXC
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
isShowQQ
)
{
tvQQ
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
isShowBill
)
{
tvBill
.
setVisibility
(
View
.
VISIBLE
);
}
tvCopy
.
setOnClickListener
(
this
);
tvWx
.
setOnClickListener
(
this
);
tvWXC
.
setOnClickListener
(
this
);
tvQQ
.
setOnClickListener
(
this
);
tvBill
.
setOnClickListener
(
this
);
tvCancle
.
setOnClickListener
(
this
);
dialog
.
setContentView
(
view
);
dialog
.
setCancelable
(
false
);
}
public
void
show
()
{
dialog
.
show
();
}
@Override
public
void
onClick
(
View
view
)
{
int
i
=
view
.
getId
();
if
(
i
==
R
.
id
.
tv_copy
)
{
if
(
listener
!=
null
)
{
listener
.
copyShare
();
}
}
else
if
(
i
==
R
.
id
.
tv_weixin
)
{
if
(
listener
!=
null
)
{
listener
.
wxShare
();
}
}
else
if
(
i
==
R
.
id
.
tv_weixin_circle
)
{
if
(
listener
!=
null
)
{
listener
.
wxCShare
();
}
}
else
if
(
i
==
R
.
id
.
tv_qq
)
{
if
(
listener
!=
null
)
{
listener
.
qqShare
();
}
}
else
if
(
i
==
R
.
id
.
tv_bill
)
{
if
(
listener
!=
null
)
{
listener
.
billShare
();
}
}
else
if
(
i
==
R
.
id
.
tv_cancel
)
{
dialog
.
dismiss
();
}
dialog
.
dismiss
();
}
public
static
class
Builder
{
private
ShareChoiceDialog
dialog
;
public
Builder
(
Context
context
)
{
dialog
=
new
ShareChoiceDialog
(
context
);
}
public
Builder
setShareListener
(
ShareListener
listener
)
{
dialog
.
listener
=
listener
;
return
this
;
}
public
Builder
setCopyVisiable
(
boolean
b
)
{
dialog
.
isShowCopy
=
b
;
return
this
;
}
public
Builder
setBillVisiable
(
boolean
b
)
{
dialog
.
isShowBill
=
b
;
return
this
;
}
public
Builder
setWxVisiable
(
boolean
b
)
{
dialog
.
isShowWx
=
b
;
return
this
;
}
public
Builder
setWxCVisiable
(
boolean
b
)
{
dialog
.
isShowWxC
=
b
;
return
this
;
}
public
Builder
setQQVisiable
(
boolean
b
)
{
dialog
.
isShowQQ
=
b
;
return
this
;
}
public
ShareChoiceDialog
create
()
{
dialog
.
create
();
return
dialog
;
}
}
public
interface
ShareListener
{
/****
* 复制链接
*/
void
copyShare
();
/****
* 微信分享
*/
void
wxShare
();
/*****
* 朋友圈分享
*/
void
wxCShare
();
/*****
* qq分享
*/
void
qqShare
();
/****
* 生成海报
*/
void
billShare
();
/*****
* 取消
*/
void
close
();
}
}
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