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
8dee92f1
Commit
8dee92f1
authored
Nov 08, 2019
by
linfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
费用明细
parent
81a7f67e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
31 deletions
+33
-31
BasePopupWindow.java
...in/java/com/ruiwenliu/wrapper/dialog/BasePopupWindow.java
+19
-16
ConfirmOrderActivity.java
.../rv/home/rv/module/ui/main/home/ConfirmOrderActivity.java
+8
-15
OrderCarPriceDetailPw.java
.../rv/module/ui/main/home/dialog/OrderCarPriceDetailPw.java
+6
-0
No files found.
RvWrapper/src/main/java/com/ruiwenliu/wrapper/dialog/BasePopupWindow.java
View file @
8dee92f1
...
@@ -2,7 +2,9 @@ package com.ruiwenliu.wrapper.dialog;
...
@@ -2,7 +2,9 @@ package com.ruiwenliu.wrapper.dialog;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Rect
;
import
android.graphics.drawable.ColorDrawable
;
import
android.graphics.drawable.ColorDrawable
;
import
android.os.Build
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.NonNull
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v4.content.ContextCompat
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
...
@@ -27,8 +29,10 @@ import java.lang.ref.WeakReference;
...
@@ -27,8 +29,10 @@ import java.lang.ref.WeakReference;
public
abstract
class
BasePopupWindow
extends
PopupWindow
implements
OnViewHolder
{
public
abstract
class
BasePopupWindow
extends
PopupWindow
implements
OnViewHolder
{
private
WeakReference
<
Activity
>
viewReference
;
//MvpView的子类的弱引用
private
WeakReference
<
Activity
>
viewReference
;
//MvpView的子类的弱引用
protected
ViewHolder
helper
;
protected
ViewHolder
helper
;
// public boolean canDismiss=false;
// public boolean canDismiss=false;
public
WindowManager
.
LayoutParams
params
;
public
WindowManager
.
LayoutParams
params
;
public
View
view
;
public
BasePopupWindow
(
@NonNull
Activity
activity
)
{
public
BasePopupWindow
(
@NonNull
Activity
activity
)
{
viewReference
=
new
WeakReference
<>(
activity
);
viewReference
=
new
WeakReference
<>(
activity
);
...
@@ -36,13 +40,13 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
...
@@ -36,13 +40,13 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
setWidth
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
);
setWidth
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
);
setClippingEnabled
(
false
);
setClippingEnabled
(
false
);
setOutsideTouchable
(
false
);
setOutsideTouchable
(
false
);
setTouchable
(
true
);
setFocusable
(
false
);
setFocusable
(
false
);
setBackgroundDrawable
(
new
ColorDrawable
(
ContextCompat
.
getColor
(
getDialogContext
(),
R
.
color
.
gray_50ffffff
)));
setBackgroundDrawable
(
new
ColorDrawable
(
ContextCompat
.
getColor
(
getDialogContext
(),
R
.
color
.
gray_50ffffff
)));
setContentView
(
getHelperView
(
null
,
getViewLayout
(),
this
));
setContentView
(
getHelperView
(
null
,
getViewLayout
(),
this
));
}
}
public
abstract
int
getViewLayout
();
public
abstract
int
getViewLayout
();
/**
/**
...
@@ -54,7 +58,8 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
...
@@ -54,7 +58,8 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
* @return
* @return
*/
*/
protected
View
getHelperView
(
ViewGroup
group
,
int
layoutId
,
OnViewHolder
listener
)
{
protected
View
getHelperView
(
ViewGroup
group
,
int
layoutId
,
OnViewHolder
listener
)
{
helper
=
new
ViewHolder
(
LayoutInflater
.
from
(
getDialogContext
()).
inflate
(
layoutId
,
group
,
false
));
view
=
LayoutInflater
.
from
(
getDialogContext
()).
inflate
(
layoutId
,
group
,
false
);
helper
=
new
ViewHolder
(
view
);
if
(
listener
!=
null
)
{
if
(
listener
!=
null
)
{
listener
.
helper
(
helper
);
listener
.
helper
(
helper
);
}
}
...
@@ -62,8 +67,6 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
...
@@ -62,8 +67,6 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
}
}
@Override
@Override
public
void
helper
(
ViewHolder
helper
)
{
public
void
helper
(
ViewHolder
helper
)
{
...
@@ -84,15 +87,15 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
...
@@ -84,15 +87,15 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
/**
/**
* 关闭处理
* 关闭处理
*/
*/
public
void
onDestroy
()
{
public
void
onDestroy
()
{
if
(
viewReference
!=
null
)
{
if
(
viewReference
!=
null
)
{
viewReference
.
clear
();
viewReference
.
clear
();
viewReference
=
null
;
viewReference
=
null
;
}
}
dismiss
();
dismiss
();
}
}
public
void
closePopupWindow
()
{
public
void
closePopupWindow
()
{
if
(
this
.
isShowing
())
{
if
(
this
.
isShowing
())
{
this
.
dismiss
();
this
.
dismiss
();
setBgShadow
(
1
f
);
setBgShadow
(
1
f
);
...
@@ -102,11 +105,11 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
...
@@ -102,11 +105,11 @@ public abstract class BasePopupWindow extends PopupWindow implements OnViewHolde
/**
/**
* 设置阴影
* 设置阴影
*/
*/
public
void
setBgShadow
(
float
alpha
){
public
void
setBgShadow
(
float
alpha
)
{
if
(
params
==
null
)
{
if
(
params
==
null
)
{
params
=
getDialogContext
().
getWindow
().
getAttributes
();
params
=
getDialogContext
().
getWindow
().
getAttributes
();
}
}
params
.
alpha
=
alpha
;
params
.
alpha
=
alpha
;
getDialogContext
().
getWindow
().
setAttributes
(
params
);
getDialogContext
().
getWindow
().
setAttributes
(
params
);
}
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/ConfirmOrderActivity.java
View file @
8dee92f1
...
@@ -939,6 +939,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
...
@@ -939,6 +939,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
* 显示价格明细弹窗
* 显示价格明细弹窗
*/
*/
private
void
showOrderDetail
(
final
View
view
)
{
private
void
showOrderDetail
(
final
View
view
)
{
if
(
orderPriceDetailBean
!=
null
)
{
if
(
orderPriceDetailBean
!=
null
)
{
if
(
detailPw
==
null
)
{
if
(
detailPw
==
null
)
{
detailPw
=
new
OrderCarPriceDetailPw
(
mActivity
)
{
detailPw
=
new
OrderCarPriceDetailPw
(
mActivity
)
{
...
@@ -948,16 +949,8 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
...
@@ -948,16 +949,8 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
View
contentView
=
detailPw
.
getContentView
();
View
contentView
=
detailPw
.
getContentView
();
//需要先测量,PopupWindow还未弹出时,宽高为0
//需要先测量,PopupWindow还未弹出时,宽高为0
contentView
.
measure
(
makeDropDownMeasureSpec
(
detailPw
.
getWidth
()),
makeDropDownMeasureSpec
(
detailPw
.
getHeight
()));
contentView
.
measure
(
makeDropDownMeasureSpec
(
detailPw
.
getWidth
()),
makeDropDownMeasureSpec
(
detailPw
.
getHeight
()));
// int[] location = new int[2];
detailPw
.
setHeight
(
detailPw
.
getContentView
().
getMeasuredHeight
());
//
// view.getLocationOnScreen(location);
// int hh=location[1]-detailPw.getHeight();
// detailPw.showAtLocation(view, Gravity.NO_GRAVITY,
// location[0], hh);
// detailPw.showAsDropDown(view, 0,0, Gravity.NO_GRAVITY);
// int kk=detailPw.getContentView().getMeasuredHeight();
// int cc=view.getHeight();
int
offsetX
=
Math
.
abs
(
detailPw
.
getContentView
().
getMeasuredWidth
()
-
view
.
getWidth
())
/
2
;
int
offsetX
=
Math
.
abs
(
detailPw
.
getContentView
().
getMeasuredWidth
()
-
view
.
getWidth
())
/
2
;
int
offsetY
=
-(
detailPw
.
getContentView
().
getMeasuredHeight
()
+
view
.
getHeight
());
int
offsetY
=
-(
detailPw
.
getContentView
().
getMeasuredHeight
()
+
view
.
getHeight
());
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/dialog/OrderCarPriceDetailPw.java
View file @
8dee92f1
...
@@ -4,9 +4,15 @@ import android.app.Activity;
...
@@ -4,9 +4,15 @@ import android.app.Activity;
import
android.support.annotation.NonNull
;
import
android.support.annotation.NonNull
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.FrameLayout
;
import
android.widget.LinearLayout
;
import
android.widget.PopupWindow
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.ruiwenliu.wrapper.dialog.BaseDialog
;
import
com.ruiwenliu.wrapper.dialog.BasePopupWindow
;
import
com.ruiwenliu.wrapper.dialog.BasePopupWindow
;
import
com.ruiwenliu.wrapper.util.ViewHolder
;
import
com.ruiwenliu.wrapper.util.ViewHolder
;
import
com.rv.home.R
;
import
com.rv.home.R
;
...
...
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