预设机器人设置UI

This commit is contained in:
Yutousama 2022-12-19 17:32:42 +08:00
parent f872029c9d
commit 2d2cc21e15
2 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,63 @@
package com.yunbao.live.dialog;
import android.app.ActionBar;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.live.R;
import androidx.annotation.Nullable;
/**
* 机器人设置
*/
public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements View.OnClickListener {
@Override
protected int getLayoutId() {
return R.layout.dialog_live_robot_setting;
}
@Override
protected int getDialogStyle() {
return R.style.dialog2;
}
@Override
protected boolean canCancel() {
return true;
}
@Override
protected void setWindowAttributes(Window window) {
WindowManager.LayoutParams params = window.getAttributes();
params.width = ActionBar.LayoutParams.MATCH_PARENT;
params.height = DpUtil.dp2px(460);
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Bundle bundle = getArguments();
if (bundle == null) {
return;
}
}
@Override
public void onClick(View v) {
dismiss();
}
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
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="wrap_content"
android:background="@drawable/border_translucent">
</androidx.coordinatorlayout.widget.CoordinatorLayout>