Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 { | 87 { |
88 @Override | 88 @Override |
89 public void onClick(DialogInterface dialog, int which) | 89 public void onClick(DialogInterface dialog, int which) |
90 { | 90 { |
91 removeWhitelistedWebsite(url); | 91 removeWhitelistedWebsite(url); |
92 } | 92 } |
93 }); | 93 }); |
94 this.addPreference(whitelistedWebsitePreference); | 94 this.addPreference(whitelistedWebsitePreference); |
95 } | 95 } |
96 | 96 |
97 final InputValidatorDialogPreference urlPreference = new InputValidatorDialo gPreference( | 97 final InputValidatorDialogPreference urlPreference = new InputValidatorDialo gPreference(this.getContext()); |
98 this.getContext(), InputValidatorDialogPreference.ValidationType.DOMAIN) ; | 98 urlPreference.setValidationType(InputValidatorDialogPreference.ValidationTyp e.DOMAIN); |
99 urlPreference.setTitle(R.string.whitelisted_websites_add_button); | 99 urlPreference.setTitle(R.string.whitelisted_websites_add_button); |
100 urlPreference.setDialogTitle(R.string.whitelist_website_dialog_title); | 100 urlPreference.setDialogTitle(R.string.whitelist_website_dialog_title); |
101 urlPreference.setDialogMessage(R.string.whitelist_website_dialog_message); | 101 urlPreference.setDialogMessage(R.string.whitelist_website_dialog_message); |
102 urlPreference.getEditText().setHint(R.string.whitelist_website_dialog_hint); | 102 urlPreference.getEditText().setHint(R.string.whitelist_website_dialog_hint); |
103 urlPreference.setOnInputReadyListener(new InputValidatorDialogPreference.OnI nputReadyListener() | 103 urlPreference.setOnInputReadyListener(new InputValidatorDialogPreference.OnI nputReadyListener() |
104 { | 104 { |
105 @Override | 105 @Override |
106 public void onInputReady(String url) | 106 public void onInputReady(String input) |
diegocarloslima
2017/09/22 17:43:42
I would suggest changing from `String url` to `Str
jens
2017/09/26 10:25:02
Acknowledged.
| |
107 { | 107 { |
108 WhitelistedWebsitesPreferenceCategory.this.whitelistWebsite(url); | 108 WhitelistedWebsitesPreferenceCategory.this.whitelistWebsite(input); |
109 } | 109 } |
110 }); | 110 }); |
111 this.addPreference(urlPreference); | 111 this.addPreference(urlPreference); |
112 } | 112 } |
113 | 113 |
114 private void whitelistWebsite(String url) | 114 private void whitelistWebsite(String url) |
115 { | 115 { |
116 this.whitelistedWebsites.add(url); | 116 this.whitelistedWebsites.add(url); |
117 this.storeWhitelistedWebsites(); | 117 this.storeWhitelistedWebsites(); |
118 } | 118 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 { | 182 { |
183 if (WhitelistedWebsitePreference.this.onDeleteClickListener != null) | 183 if (WhitelistedWebsitePreference.this.onDeleteClickListener != null) |
184 { | 184 { |
185 WhitelistedWebsitePreference.this.onDeleteClickListener.onClick(dial og, which); | 185 WhitelistedWebsitePreference.this.onDeleteClickListener.onClick(dial og, which); |
186 } | 186 } |
187 } | 187 } |
188 }); | 188 }); |
189 } | 189 } |
190 } | 190 } |
191 } | 191 } |
LEFT | RIGHT |