Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishiranu committed Jul 12, 2016
0 parents commit 9c9a6e2
Show file tree
Hide file tree
Showing 26 changed files with 1,509 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
@@ -0,0 +1,8 @@
/*
!/res
!/src
!/.gitignore
!/AndroidManifest.xml
!/build.gradle
!/LICENSE
!/README.md
32 changes: 32 additions & 0 deletions AndroidManifest.xml
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mishiranu.instantimage"
android:versionCode="1"
android:versionName="1.0.0">

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="24" />

<uses-permission android:name="android.permission.INTERNET" />

<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="Instant Image">

<activity android:name=".FetchActivity" android:theme="@style/Theme.Main">

<intent-filter>

<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="image/*" />

</intent-filter>

</activity>

<provider android:name=".ImageProvider" android:authorities="com.mishiranu.providers.instantimage"
tools:ignore="ExportedContentProvider" android:exported="true" android:grantUriPermissions="true" />

</application>

</manifest>
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Fukurou Mishiranu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
29 changes: 29 additions & 0 deletions README.md
@@ -0,0 +1,29 @@
# Instant Image

Instant Image is tool that allows you to find image in Google search and attach it in two clicks.

Choose this app in attachment dialog, enter search query and choose the desired image.

# Building Guide

1. Install JDK 7 or higher
2. Install Android SDK, define `ANDROID_HOME` environment variable or set `sdk.dir` in `local.properties`
4. Install Gradle
5. Run `gradle assembleRelease`

The resulting APK file will appear in `build/outputs/apk` directory.

### Build Signed Binary

You can create `keystore.properties` in the source code directory with the following properties:

```properties
store.file=%PATH_TO_KEYSTORE_FILE%
store.password=%KEYSTORE_PASSWORD%
key.alias=%KEY_ALIAS%
key.password=%KEY_PASSWORD%
```

# License

Instant Image is licensed under the [MIT License](LICENSE)
69 changes: 69 additions & 0 deletions build.gradle
@@ -0,0 +1,69 @@
buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}

allprojects {
repositories {
jcenter()
}
}

apply plugin: 'com.android.application'

dependencies {
compile 'com.squareup.picasso:picasso:2.5.2'
}

android {
compileSdkVersion 24
buildToolsVersion '24'

sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

if (new File('keystore.properties').exists()) {
def Properties keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(file('keystore.properties')))

signingConfigs {
general {
storeFile file(keystoreProperties['store.file'])
storePassword keystoreProperties['store.password']
keyAlias keystoreProperties['key.alias']
keyPassword keystoreProperties['key.password']
}
}

buildTypes.debug.signingConfig signingConfigs.general
buildTypes.release.signingConfig signingConfigs.general
}

buildTypes {
release {
minifyEnabled false
}
}

lintOptions {
abortOnError false
disable 'ValidFragment'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
Binary file added res/mipmap-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-xhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-xxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/mipmap-xxxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions res/values-ru/strings.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="text_crop_thumbnails">Обрезать превью</string>
<string name="text_loading">Загрузка…</string>

<string name="error_connection">Ошибка соединения</string>
<string name="error_invalid_response">Некорректный ответ сервера</string>
<string name="error_not_found">Не найдено</string>
<string name="error_ssl">Ошибка SSL</string>

</resources>
31 changes: 31 additions & 0 deletions res/values-v21/styles.xml
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="Theme.Main" parent="@android:style/Theme.Material.Light.DarkActionBar">

<item name="android:dialogTheme">@style/Theme.Main.Dialog</item>
<item name="android:alertDialogTheme">@style/Theme.Main.Dialog.Alert</item>

<item name="android:colorPrimary">@color/color_primary</item>
<item name="android:colorPrimaryDark">@color/color_primary_dark</item>
<item name="android:colorAccent">@color/color_accent</item>

</style>

<style name="Theme.Main.Dialog" parent="@android:style/Theme.Material.Light.Dialog">

<item name="android:colorPrimary">@color/color_primary</item>
<item name="android:colorPrimaryDark">@color/color_primary_dark</item>
<item name="android:colorAccent">@color/color_accent</item>

</style>

<style name="Theme.Main.Dialog.Alert" parent="@android:style/Theme.Material.Light.Dialog.Alert">

<item name="android:colorPrimary">@color/color_primary</item>
<item name="android:colorPrimaryDark">@color/color_primary_dark</item>
<item name="android:colorAccent">@color/color_accent</item>

</style>

</resources>
8 changes: 8 additions & 0 deletions res/values/colors.xml
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="color_primary">#37474f</color>
<color name="color_primary_dark">#263238</color>
<color name="color_accent">#009688</color>

</resources>
12 changes: 12 additions & 0 deletions res/values/strings.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="text_crop_thumbnails">Crop thumbnails</string>
<string name="text_loading">Loading…</string>

<string name="error_connection">Connection error</string>
<string name="error_invalid_response">Invalid server response</string>
<string name="error_not_found">Not found</string>
<string name="error_ssl">SSL error</string>

</resources>
6 changes: 6 additions & 0 deletions res/values/styles.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">

<style name="Theme.Main" parent="@android:style/Theme.Holo.Light.DarkActionBar" />

</resources>

0 comments on commit 9c9a6e2

Please sign in to comment.