| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 public void setIcon(@DrawableRes int iconResId) | 125 public void setIcon(@DrawableRes int iconResId) |
| 126 { | 126 { |
| 127 final Drawable drawable = ContextCompat.getDrawable(getContext(), iconResId)
; | 127 final Drawable drawable = ContextCompat.getDrawable(getContext(), iconResId)
; |
| 128 setIcon(drawable); | 128 setIcon(drawable); |
| 129 } | 129 } |
| 130 | 130 |
| 131 public void setIcon(Drawable icon) | 131 public void setIcon(Drawable icon) |
| 132 { | 132 { |
| 133 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) | 133 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) |
| 134 { | 134 { |
| 135 super.setIcon(android.R.drawable.ic_menu_add); | 135 super.setIcon(icon); |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 public void setOnUrlReadyListener(OnUrlReadyListener listener) | 139 public void setOnUrlReadyListener(OnUrlReadyListener listener) |
| 140 { | 140 { |
| 141 this.onUrlReadyListener = listener; | 141 this.onUrlReadyListener = listener; |
| 142 } | 142 } |
| 143 | 143 |
| 144 private boolean isValidUrl() | 144 private boolean isValidUrl() |
| 145 { | 145 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 157 { | 157 { |
| 158 mAlertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(enabled); | 158 mAlertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(enabled); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 public interface OnUrlReadyListener | 162 public interface OnUrlReadyListener |
| 163 { | 163 { |
| 164 void onUrlReady(String url); | 164 void onUrlReady(String url); |
| 165 } | 165 } |
| 166 } | 166 } |
| OLD | NEW |