-2

I want to remove light purple line in Custom Dialog...

In Custom Dialog, it has two TextView, one ImageView and one Button.

It is about user profile, and if you click Button you can edit your profile.

I do not know what is the problem.purple line

How can I solve the problem?

my_profile_dialog.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="@dimen/dialog_height"
android:background="@color/whiteback">
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:gravity="center|bottom"
    android:paddingTop="@dimen/padding_20dp"
    android:paddingLeft="@dimen/padding_20dp"
    android:paddingRight="@dimen/padding_20dp">
    <ImageView
        android:id="@+id/dialog_imageIv"
        android:src="@drawable/logo"
        android:layout_width="@dimen/logoSize"
        android:layout_height="@dimen/logoSize" />
</LinearLayout>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:gravity="center"
    android:padding="@dimen/padding_15dp"
    android:orientation="vertical">
    <TextView
        android:id="@+id/dialog_nameTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="이름"
        android:textStyle="bold"
        android:textSize="@dimen/btn_16dp"
        android:layout_marginBottom="@dimen/padding_5dp"/>
    <TextView
        android:id="@+id/dialog_emailTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="asmwj3@naver.com"/>
</LinearLayout>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="0.5">
    <Button
        android:id="@+id/dialog_editBtn"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/click_action"
        android:text="@string/profileEdit"
        android:textColor="@color/white"
        android:textStyle="bold"/>
</LinearLayout>

MyProfileCustomDialog.java

public class MyProfileCustomDialog extends Dialog {
public RequestManager mRequestManager;

private ImageView dialog_myProfileIv;
private TextView dialog_myProfileNameTv, dialog_myProfileEmailTv;
private Button dialog_myProfileEditBtn;
private Context mContext;

private String userEmail, userName, userImage;

public MyProfileCustomDialog(@NonNull Context context, String userName, String userEmail, String userImage, RequestManager requestManager) {
    super(context);
    this.mContext = context;
    this.userEmail = userEmail;
    this.userName = userName;
    this.userImage = userImage;
    this.mRequestManager = requestManager;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    WindowManager.LayoutParams lpWindow = new WindowManager.LayoutParams();
    lpWindow.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND;
    lpWindow.dimAmount = 0.8f;
    getWindow().setAttributes(lpWindow);

    setContentView(R.layout.my_profile_dialog);

    dialog_myProfileIv = (ImageView)findViewById(R.id.dialog_imageIv);
    dialog_myProfileEmailTv = (TextView)findViewById(R.id.dialog_emailTv);
    dialog_myProfileNameTv = (TextView)findViewById(R.id.dialog_nameTv);
    dialog_myProfileEditBtn = (Button)findViewById(R.id.dialog_editBtn);

    dialog_myProfileEmailTv.setText(userEmail);
    dialog_myProfileNameTv.setText(userName);

    mRequestManager
            .load(Uri.parse(userImage))
            .centerCrop()
            .crossFade()
            .bitmapTransform(new CropCircleTransformation(new CustomBitmapPool()))
            .signature(new StringSignature(String.valueOf(System.currentTimeMillis())))
            .override(200,200)
            .into(dialog_myProfileIv);

    dialog_myProfileEditBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent i = new Intent(mContext, EditUserActivity.class);
            mContext.startActivity(i);
        }
    });
}

}

and I use like this..

FragmentSecond.java

MyProfileCustomDialog customDialog = new MyProfileCustomDialog(getContext(), userName, userEmail, userImage, mRequestManager);
customDialog.show();

2 Answers2

0

try this use requestWindowFeature(Window.FEATURE_NO_TITLE); to hide your dialog title

you can hide the title of a dialog using:

customDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
AskNilesh
  • 67,701
  • 16
  • 123
  • 163
0

You can define new style for custom dialog and to change all the style attributes such as text appearance, background color and text color. So, in the Style.xml file add the item to the theme of your application like below code:

<style name="AppTheme" parent="AppBaseTheme">

    <item name="android:dialogTheme">@style/alertdialog</item>
</style>


<style name="alertdialog">

    <item name="android:textColor">@android:color/your color</item>
    <item name="android:fontFamily">your font</item>
    <item name="android:textStyle">your text style</item>
</style>
Amir
  • 179
  • 2
  • 14