Description of the request: I use a custom progress dialog with a transparent theme. And it works great. What problems do I encounter when my keyboard is open, and if I show the Custom Progress Dialog, it will close my keyboard. However, if I use the Default Progress Dialog, then it works fine.
: as you can see, the keyboard is still there, even after the progress dialog appears. I want to implement the same in the Custom Progress dialog box.
: As you can see, the keyboard disappears when a dialog is displayed. This is tiring every time the user has to open the keyboard.
Here is my code:
public class CustomProgressDialog extends Dialog {
private ImageView imageView;
private Context mContext;
public CustomProgressDialog(Context context) {
super(context, R.style.DialogTheme);
mContext = context;
getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
WindowManager.LayoutParams wlmp = getWindow().getAttributes();
wlmp.gravity = Gravity.CENTER_HORIZONTAL;
getWindow().setAttributes(wlmp);
setTitle(null);
setCancelable(true);
LinearLayout layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(200, 200);
imageView = new ImageView(context);
imageView.setBackgroundResource(R.drawable.custom_dialog);
layout.addView(imageView, params);
addContentView(layout, params);
}
@Override
public void show() {
super.show();
AnimationDrawable frameAnimation = (AnimationDrawable) imageView.getBackground();
frameAnimation.start();
}
@Override
public void dismiss() {
super.dismiss();
}
}
.Xml style dialog theme:
<style name="DialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@color/actionbar_gradient_endColor</item>
</style>
Any help would be appreciated.
<EditText android:id="@+id/et_search_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/imgClearSearch"
android:background="@drawable/rounded_rdt_txt"
android:hint="Search here..."
android:layout_centerVertical="true"
android:singleLine="true" />