|
5 | 5 | import android.graphics.Color; |
6 | 6 | import android.graphics.drawable.Drawable; |
7 | 7 | import android.view.View; |
| 8 | +import android.view.ViewGroup; |
8 | 9 | import android.widget.Button; |
9 | 10 | import android.widget.ImageView; |
10 | 11 | import android.widget.RelativeLayout; |
@@ -169,8 +170,8 @@ public QCircleDialog create() { |
169 | 170 | public void show(final Activity activity, QCircleTemplate activityTemplate) { |
170 | 171 | this.activity = activity; |
171 | 172 | this.activityTemplate = activityTemplate; |
172 | | - RelativeLayout layout = (RelativeLayout) activityTemplate.getLayoutById(TemplateTag.CONTENT).getParent(); |
173 | | - final QCircleTemplate template = new QCircleTemplate(activity, TemplateType.CIRCLE_EMPTY, false); |
| 173 | + ViewGroup layout = (ViewGroup) activityTemplate.getView().getParent(); |
| 174 | + final QCircleTemplate template = new QCircleTemplate(activity, TemplateType.CIRCLE_EMPTY); |
174 | 175 | QCircleTitle qCircleTitle = new QCircleTitle(activity, title == null ? "" : title, Color.WHITE, |
175 | 176 | activity.getResources().getColor(mode == DialogMode.Error ? R.color.dialog_title_background_color_error : R.color.dialog_title_background_color_regular)); |
176 | 177 | qCircleTitle.setTextSize(17f); |
@@ -227,14 +228,16 @@ public void onClick(View v) { |
227 | 228 |
|
228 | 229 | } |
229 | 230 | template.getLayoutById(TemplateTag.CONTENT).addView(dialogLayout); |
| 231 | + activityTemplate.getView().setVisibility(View.GONE); |
230 | 232 | layout.addView(templateLayout = template.getView()); |
231 | 233 | } |
232 | 234 |
|
233 | 235 | /** |
234 | 236 | * hides the dialog. |
235 | 237 | */ |
236 | 238 | public void hide() { |
237 | | - ((RelativeLayout) activityTemplate.getLayoutById(TemplateTag.CONTENT).getParent()).removeView(templateLayout); |
| 239 | + ((ViewGroup) activityTemplate.getView().getParent()).removeView(templateLayout); |
| 240 | + activityTemplate.getView().setVisibility(View.VISIBLE); |
238 | 241 | templateLayout = null; |
239 | 242 | } |
240 | 243 |
|
|
0 commit comments