Android: fix deprecations for getDrawable() on QtMessageDialogHelper
Pick-to: 6.5 6.4 6.2 5.15 Change-Id: Icd359663af11f44b4bcf0cd4e4f1f7f5a51242e4 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
parent
40b42ac517
commit
31a0d99fa5
@ -73,7 +73,8 @@ public class QtMessageDialogHelper
|
|||||||
try {
|
try {
|
||||||
TypedValue typedValue = new TypedValue();
|
TypedValue typedValue = new TypedValue();
|
||||||
m_theme.resolveAttribute(android.R.attr.alertDialogIcon, typedValue, true);
|
m_theme.resolveAttribute(android.R.attr.alertDialogIcon, typedValue, true);
|
||||||
return m_activity.getResources().getDrawable(typedValue.resourceId);
|
return m_activity.getResources().getDrawable(typedValue.resourceId,
|
||||||
|
m_activity.getTheme());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -83,7 +84,8 @@ public class QtMessageDialogHelper
|
|||||||
{
|
{
|
||||||
case 1: // Information
|
case 1: // Information
|
||||||
try {
|
try {
|
||||||
return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_info);
|
return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_info,
|
||||||
|
m_activity.getTheme());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -97,14 +99,16 @@ public class QtMessageDialogHelper
|
|||||||
// break;
|
// break;
|
||||||
case 3: // Critical
|
case 3: // Critical
|
||||||
try {
|
try {
|
||||||
return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_alert);
|
return m_activity.getResources().getDrawable(android.R.drawable.ic_dialog_alert,
|
||||||
|
m_activity.getTheme());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: // Question
|
case 4: // Question
|
||||||
try {
|
try {
|
||||||
return m_activity.getResources().getDrawable(android.R.drawable.ic_menu_help);
|
return m_activity.getResources().getDrawable(android.R.drawable.ic_menu_help,
|
||||||
|
m_activity.getTheme());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user