Query Description: I am using custom progress dialog with the transparent theme. And this works fine. What problem I am facing is, when my keyboard is open and if I show Custom Progress Dialog then It force closes my Keyboard. However, if I use default Progress Dialog then it works fine.
: As you can see the keyboard is still there even after progress dialog appears. I want to implement the same in Custom Progress Dialog.
: As you can see, the keyboard gets disappears when the dialog is showing. It feels tedious, 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);
//setOnCancelListener(null);
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();
}
}
Dialog theme in style.xml:
<style name="DialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@color/actionbar_gradient_endColor</item>
</style>
Any Help will 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" />