super(context, com.android.internal.R.style.Theme_Holo_Dialog_MinWidth);
setCancelable(true);
setCanceledOnTouchOutside(true);
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE);
getWindow().setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL);
mService = service;
mAppInfo = appInfo;
setContentView(com.android.internal.R.layout.am_compat_mode_dialog);
mCompatEnabled = (Switch)findViewById(com.android.internal.R.id.compat_checkbox);
mCompatEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
synchronized (mService) {
mService.mCompatModePackages.setPackageScreenCompatModeLocked(
mAppInfo.packageName,
mCompatEnabled.isChecked() ? ActivityManager.COMPAT_MODE_ENABLED
: ActivityManager.COMPAT_MODE_DISABLED);
updateControls();
}
}
});
mAlwaysShow = (CheckBox)findViewById(com.android.internal.R.id.ask_checkbox);
mAlwaysShow.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
synchronized (mService) {
mService.mCompatModePackages.setPackageAskCompatModeLocked(
mAppInfo.packageName, mAlwaysShow.isChecked());
updateControls();
}
}
});
mHint = findViewById(com.android.internal.R.id.reask_hint);
updateControls();