Left: | ||
Right: |
OLD | NEW |
---|---|
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 UrlInputOpenerPreference urlPreference = new UrlInputOpenerPreference( this.getContext()); | 97 final InputValidatorDialogPreference urlPreference = new InputValidatorDialo gPreference( |
98 this.getContext(), InputValidatorDialogPreference.ValidationType.DOMAIN) ; | |
98 urlPreference.setTitle(R.string.whitelisted_websites_add_button); | 99 urlPreference.setTitle(R.string.whitelisted_websites_add_button); |
99 urlPreference.setDialogTitle(R.string.whitelist_website_dialog_title); | 100 urlPreference.setDialogTitle(R.string.whitelist_website_dialog_title); |
100 urlPreference.setDialogMessage(R.string.whitelist_website_dialog_message); | 101 urlPreference.setDialogMessage(R.string.whitelist_website_dialog_message); |
101 urlPreference.getEditText().setHint(R.string.whitelist_website_dialog_hint); | 102 urlPreference.getEditText().setHint(R.string.whitelist_website_dialog_hint); |
102 urlPreference.setOnUrlReadyListener(new UrlInputOpenerPreference.OnUrlReadyL istener() | 103 urlPreference.setOnInputReadyListener(new InputValidatorDialogPreference.OnI nputReadyListener() |
103 { | 104 { |
104 @Override | 105 @Override |
105 public void onUrlReady(String url) | 106 public void onInputReady(String url) |
diegocarloslima
2017/09/22 17:43:42
I would suggest changing from `String url` to `Str
jens
2017/09/26 10:25:02
Acknowledged.
| |
106 { | 107 { |
107 WhitelistedWebsitesPreferenceCategory.this.whitelistWebsite(url); | 108 WhitelistedWebsitesPreferenceCategory.this.whitelistWebsite(url); |
108 } | 109 } |
109 }); | 110 }); |
110 this.addPreference(urlPreference); | 111 this.addPreference(urlPreference); |
111 } | 112 } |
112 | 113 |
113 private void whitelistWebsite(String url) | 114 private void whitelistWebsite(String url) |
114 { | 115 { |
115 this.whitelistedWebsites.add(url); | 116 this.whitelistedWebsites.add(url); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 { | 182 { |
182 if (WhitelistedWebsitePreference.this.onDeleteClickListener != null) | 183 if (WhitelistedWebsitePreference.this.onDeleteClickListener != null) |
183 { | 184 { |
184 WhitelistedWebsitePreference.this.onDeleteClickListener.onClick(dial og, which); | 185 WhitelistedWebsitePreference.this.onDeleteClickListener.onClick(dial og, which); |
185 } | 186 } |
186 } | 187 } |
187 }); | 188 }); |
188 } | 189 } |
189 } | 190 } |
190 } | 191 } |
OLD | NEW |