mirror of https://github.com/kurisufriend/Clover
parent
902d661e0e
commit
bce8131422
@ -0,0 +1,61 @@ |
|||||||
|
/* |
||||||
|
* Clover - 4chan browser https://github.com/Floens/Clover/
|
||||||
|
* Copyright (C) 2014 Floens |
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
package org.floens.chan.chan; |
||||||
|
|
||||||
|
import org.floens.chan.R; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public abstract class ImageSearch { |
||||||
|
public static final List<ImageSearch> engines = new ArrayList<>(); |
||||||
|
|
||||||
|
public abstract int getId(); |
||||||
|
public abstract String getName(); |
||||||
|
public abstract String getUrl(String imageUrl); |
||||||
|
|
||||||
|
static { |
||||||
|
engines.add(new ImageSearch() { |
||||||
|
public int getId() { |
||||||
|
return R.id.action_0; |
||||||
|
} |
||||||
|
|
||||||
|
public String getName() { |
||||||
|
return "Google"; |
||||||
|
} |
||||||
|
|
||||||
|
public String getUrl(String imageUrl) { |
||||||
|
return "https://www.google.com/searchbyimage?image_url=" + imageUrl; |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
engines.add(new ImageSearch() { |
||||||
|
public int getId() { |
||||||
|
return R.id.action_1; |
||||||
|
} |
||||||
|
|
||||||
|
public String getName() { |
||||||
|
return "iqdb"; |
||||||
|
} |
||||||
|
|
||||||
|
public String getUrl(String imageUrl) { |
||||||
|
return "http://iqdb.org/?url=" + imageUrl; |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?><!-- |
||||||
|
Clover - 4chan browser https://github.com/Floens/Clover/ |
||||||
|
Copyright (C) 2014 Floens |
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License |
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||||
|
--> |
||||||
|
<resources> |
||||||
|
<!-- placeholder id's for when programmatically xml is needed --> |
||||||
|
<item type="id" name="action_0" /> |
||||||
|
<item type="id" name="action_1" /> |
||||||
|
<item type="id" name="action_2" /> |
||||||
|
<item type="id" name="action_3" /> |
||||||
|
<item type="id" name="action_4" /> |
||||||
|
<item type="id" name="action_5" /> |
||||||
|
<item type="id" name="action_6" /> |
||||||
|
<item type="id" name="action_7" /> |
||||||
|
<item type="id" name="action_8" /> |
||||||
|
<item type="id" name="action_9" /> |
||||||
|
</resources> |
Loading…
Reference in new issue