| Index: adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java |
| =================================================================== |
| --- a/adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java |
| +++ b/adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/MainPreferences.java |
| @@ -17,35 +17,37 @@ |
| package org.adblockplus.sbrowser.contentblocker; |
| import org.adblockplus.sbrowser.contentblocker.engine.Engine; |
| import org.adblockplus.sbrowser.contentblocker.engine.EngineService; |
| import org.adblockplus.adblockplussbrowser.R; |
| import android.app.AlertDialog; |
| -import android.app.Dialog; |
| import android.app.ProgressDialog; |
| import android.content.DialogInterface; |
| import android.content.DialogInterface.OnClickListener; |
| import android.content.Intent; |
| import android.content.SharedPreferences; |
| import android.net.Uri; |
| import android.os.Bundle; |
| import android.preference.PreferenceActivity; |
| import android.preference.PreferenceManager; |
| import android.text.Html; |
| import android.util.Log; |
| +import android.view.Gravity; |
| +import android.widget.Button; |
| +import android.widget.LinearLayout; |
| public class MainPreferences extends PreferenceActivity implements |
| EngineService.OnEngineCreatedCallback, SharedPreferences.OnSharedPreferenceChangeListener |
| { |
| private static final String TAG = MainPreferences.class.getSimpleName(); |
| private Engine engine = null; |
| - private Dialog dialog; |
| + private AlertDialog dialog; |
| private int dialogTitleResId; |
| private SharedPreferences getSharedPreferences() |
| { |
| return PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()); |
| } |
| @Override |
| @@ -192,16 +194,22 @@ |
| @Override |
| public void onClick(DialogInterface dialog, int which) |
| { |
| Engine.openSBrowserSettings(MainPreferences.this); |
| } |
| }) |
| .create(); |
| this.dialog.show(); |
| + |
| + final Button btNeutral = this.dialog.getButton(AlertDialog.BUTTON_NEUTRAL); |
| + final LinearLayout.LayoutParams btNeutralLayoutParams = (LinearLayout.LayoutParams) btNeutral.getLayoutParams(); |
| + btNeutralLayoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT; |
| + btNeutralLayoutParams.gravity = Gravity.CENTER; |
| + btNeutral.setLayoutParams(btNeutralLayoutParams); |
| } |
| } |
| @Override |
| public void onEngineCreated(Engine engine, boolean success) |
| { |
| Log.d(TAG, "onEngineCreated: " + success); |
| this.engine = success ? engine : null; |