将TopViewManager#addView()的默认LayoutParams属性改成了(MATCH_PARENT,WRAP_CONTENT)

This commit is contained in:
tongchenfei
2020-07-06 10:14:16 +08:00
parent 8b71870bae
commit e9597d23a0
2 changed files with 7 additions and 17 deletions

View File

@@ -19,16 +19,6 @@ import com.mogo.service.windowview.IMogoTopViewStatusListener;
@Route(path = MogoServicePaths.PATH_EXTENSIONS_TOP_VIEW_MANAGER)
public class TopViewManager implements IMogoTopViewManager {
// @Override
// public void addTopView(View view, ViewGroup.LayoutParams params) {
// TopViewAnimHelper.getInstance().startTopInAnim(view, params);
// }
//
// @Override
// public void removeTopView() {
// TopViewAnimHelper.getInstance().startTopOutAnim();
// }
private Context context;
private LayoutParams parentParams;
@Override
@@ -38,14 +28,14 @@ public class TopViewManager implements IMogoTopViewManager {
@Override
public void addView(View view) {
addView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
(int) context.getResources().getDimension(R.dimen.dp_350)),null);
addView(view, new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT),null);
}
@Override
public void addView(View view, IMogoTopViewStatusListener statusListener) {
addView(view, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
(int) context.getResources().getDimension(R.dimen.dp_350)),statusListener);
addView(view, new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT),statusListener);
}
@Override

View File

@@ -2,7 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_350"
android:layout_height="wrap_content"
android:background="#ccc">
<TextView
@@ -30,8 +30,8 @@
<ImageView
android:id="@+id/iv2"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_150"
android:layout_width="@dimen/dp_250"
android:layout_height="@dimen/dp_250"
android:src="@drawable/icon_default_user_head"
app:layout_constraintLeft_toRightOf="@+id/iv1"
app:layout_constraintRight_toLeftOf="@+id/iv3"