Added option to send email as HTML.
Added Material Design theme.
This commit is contained in:
parent
89fdb19ea8
commit
64173c4a3c
19 changed files with 192 additions and 22 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
@ -1,9 +1,10 @@
|
|||
/.classpath
|
||||
/.idea/libraries
|
||||
/.idea/workspace.xml
|
||||
/.pmd
|
||||
/.project
|
||||
/.svn/
|
||||
/bin
|
||||
/gen
|
||||
/proguard
|
||||
/project.properties
|
||||
/.classpath
|
||||
/.project
|
||||
/.pmd
|
||||
|
||||
/project.properties
|
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
|
@ -0,0 +1 @@
|
|||
Emaily
|
23
.idea/compiler.xml
generated
Normal file
23
.idea/compiler.xml
generated
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
<resourceExtensions />
|
||||
<wildcardResourcePatterns>
|
||||
<entry name="!?*.java" />
|
||||
<entry name="!?*.form" />
|
||||
<entry name="!?*.class" />
|
||||
<entry name="!?*.groovy" />
|
||||
<entry name="!?*.scala" />
|
||||
<entry name="!?*.flex" />
|
||||
<entry name="!?*.kt" />
|
||||
<entry name="!?*.clj" />
|
||||
</wildcardResourcePatterns>
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="false">
|
||||
<processorPath useClasspath="true" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
||||
|
5
.idea/copyright/profiles_settings.xml
generated
Normal file
5
.idea/copyright/profiles_settings.xml
generated
Normal file
|
@ -0,0 +1,5 @@
|
|||
<component name="CopyrightManager">
|
||||
<settings default="">
|
||||
<module2copyright />
|
||||
</settings>
|
||||
</component>
|
5
.idea/encodings.xml
generated
Normal file
5
.idea/encodings.xml
generated
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||
</project>
|
||||
|
23
.idea/misc.xml
generated
Normal file
23
.idea/misc.xml
generated
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
<state key="ProjectJDKs.UI">
|
||||
<settings>
|
||||
<last-edited>1.7</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
</states>
|
||||
</component>
|
||||
</project>
|
||||
|
9
.idea/modules.xml
generated
Normal file
9
.idea/modules.xml
generated
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Emaily.iml" filepath="$PROJECT_DIR$/Emaily.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
5
.idea/scopes/scope_settings.xml
generated
Normal file
5
.idea/scopes/scope_settings.xml
generated
Normal file
|
@ -0,0 +1,5 @@
|
|||
<component name="DependencyValidationManager">
|
||||
<state>
|
||||
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||
</state>
|
||||
</component>
|
7
.idea/vcs.xml
generated
Normal file
7
.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
4
.settings/org.eclipse.jdt.core.prefs
Normal file
4
.settings/org.eclipse.jdt.core.prefs
Normal file
|
@ -0,0 +1,4 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -1,18 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="net.thauvin.erik.android.emaily"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
android:versionCode="2"
|
||||
android:versionName="1.1b7" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="10"
|
||||
android:targetSdkVersion="11" />
|
||||
android:targetSdkVersion="21" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/icon"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Emaily" >
|
||||
|
|
19
Emaily.iml
Normal file
19
Emaily.iml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="android" name="Android">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android 4.2.2" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="lib" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
49
build.gradle
Normal file
49
build.gradle
Normal file
|
@ -0,0 +1,49 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:0.4'
|
||||
}
|
||||
}
|
||||
apply plugin: 'android'
|
||||
|
||||
dependencies {
|
||||
compile files('lib/bitlyj-2.0.0.jar')
|
||||
compile files('../../Emaily/lib/commons-codec-1.6.jar')
|
||||
compile files('../../Emaily/lib/google-api-client-1.7.0-beta.jar')
|
||||
compile files('../../Emaily/lib/google-api-client-android2-1.7.0-beta.jar')
|
||||
compile files('../../Emaily/lib/google-api-urlshortener-v1-rev2-java-1.4.0-beta.jar')
|
||||
compile files('../../Emaily/lib/google-http-client-1.7.0-beta.jar')
|
||||
compile files('../../Emaily/lib/google-http-client-android2-1.7.0-beta.jar')
|
||||
compile files('../../Emaily/lib/google-http-client-android3-1.7.0-beta.jar')
|
||||
compile files('../../Emaily/lib/google-oauth-client-1.7.0-beta.jar')
|
||||
compile files('../../Emaily/lib/gson-2.1.jar')
|
||||
compile files('../../Emaily/lib/guava-11.0.1.jar')
|
||||
compile files('../../Emaily/lib/jackson-core-asl-1.9.4.jar')
|
||||
compile files('../../Emaily/lib/jsr305-1.3.9.jar')
|
||||
compile files('../../Emaily/lib/protobuf-java-2.2.0.jar')
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 17
|
||||
buildToolsVersion "17"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 10
|
||||
targetSdkVersion 11
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
java.srcDirs = ['src']
|
||||
resources.srcDirs = ['src']
|
||||
aidl.srcDirs = ['src']
|
||||
renderscript.srcDirs = ['src']
|
||||
res.srcDirs = ['res']
|
||||
assets.srcDirs = ['assets']
|
||||
}
|
||||
|
||||
instrumentTest.setRoot('tests')
|
||||
}
|
||||
}
|
6
res/values-v21/themes.xml
Normal file
6
res/values-v21/themes.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Emaily" parent="@android:style/Theme.Material" />
|
||||
|
||||
</resources>
|
|
@ -19,7 +19,7 @@
|
|||
<string name="prefs_bitly_creds_url">http://bitly.com/a/your_api_key/</string>
|
||||
<string name="prefs_bitly_creds_username">Username</string>
|
||||
<string name="prefs_bitly_title">bit.ly</string>
|
||||
<string name="prefs_copyright">© 2012 Erik C. Thauvin</string>
|
||||
<string name="prefs_copyright">© 2012-14 Erik C. Thauvin</string>
|
||||
<string name="prefs_feedback_subject">%1$s %2$s %3$s (%4$s %5$s, %6$s)</string>
|
||||
<string name="prefs_feedback_summary">Send email, please check Help first…</string>
|
||||
<string name="prefs_feedback_title">Feedback</string>
|
||||
|
@ -29,6 +29,8 @@
|
|||
<string name="prefs_help_summary">Learn how to use…</string>
|
||||
<string name="prefs_help_title">Help</string>
|
||||
<string name="prefs_help_url">http://m.thauvin.net/android/Emaily/help/</string>
|
||||
<string name="prefs_html_title">HTML</string>
|
||||
<string name="prefs_html_chkbox_title">Send email as HTML?</string>
|
||||
<string name="prefs_key_bitly_apikey">prefs_bitly_apikey</string>
|
||||
<string name="prefs_key_bitly_creds">prefs_bitly_creds</string>
|
||||
<string name="prefs_key_bitly_username">prefs_bitly_username</string>
|
||||
|
@ -38,6 +40,7 @@
|
|||
<string name="prefs_key_googl_enabled">prefs_google_enabled</string>
|
||||
<string name="prefs_key_googl_token">prefs_googl_token</string>
|
||||
<string name="prefs_key_googl_token_expiry">prefs_gool_token_expiry</string>
|
||||
<string name="prefs_key_html_chkbox">prefs_html_chkbox</string>
|
||||
<string name="prefs_key_version">prefs_version</string>
|
||||
<string name="prefs_version_title">Version</string>
|
||||
<string name="progress_msg">Shortening url…</string>
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
android:title="@string/prefs_bitly_creds_title" >
|
||||
</net.thauvin.erik.android.emaily.BitlyCredsDialog>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/prefs_html_title" >
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="@string/prefs_key_html_chkbox"
|
||||
android:title="@string/prefs_html_chkbox_title" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/prefs_about_title" >
|
||||
<Preference
|
||||
android:enabled="false"
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 418 KiB After Width: | Height: | Size: 415 KiB |
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* @(#)Emaily.java
|
||||
*
|
||||
* Copyright (c) 2011-2012 Erik C. Thauvin (http://erik.thauvin.net/)
|
||||
* Copyright (c) 2011-2014 Erik C. Thauvin (http://erik.thauvin.net/)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -88,6 +88,7 @@ import com.google.api.services.urlshortener.model.Url;
|
|||
* @created Oct 11, 2011
|
||||
* @since 1.0
|
||||
*/
|
||||
@SuppressWarnings( "deprecation" )
|
||||
public class Emaily extends Activity
|
||||
{
|
||||
private static final String ACCOUNT_TYPE = "com.google";
|
||||
|
@ -103,7 +104,7 @@ public class Emaily extends Activity
|
|||
|
||||
final Intent intent = getIntent();
|
||||
|
||||
appName = getApplicationContext().getResources().getString(R.string.app_name);
|
||||
appName = getString(R.string.app_name);
|
||||
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
if (Intent.ACTION_SEND.equals(intent.getAction()))
|
||||
|
@ -346,17 +347,17 @@ public class Emaily extends Activity
|
|||
{
|
||||
final EmailyResult result = new EmailyResult(intent[0]);
|
||||
|
||||
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
|
||||
final Intent emailIntent = new Intent(Intent.ACTION_SEND);
|
||||
emailIntent.setType("text/html");
|
||||
|
||||
final Bundle extras = intent[0].getExtras();
|
||||
|
||||
final String pageUrl = extras.getString("android.intent.extra.TEXT");
|
||||
final String pageTitle = extras.getString("android.intent.extra.SUBJECT");
|
||||
final String pageUrl = extras.getString(Intent.EXTRA_TEXT);
|
||||
final String pageTitle = extras.getString(Intent.EXTRA_SUBJECT);
|
||||
|
||||
if (isValid(pageTitle))
|
||||
{
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, pageTitle);
|
||||
emailIntent.putExtra(Intent.EXTRA_SUBJECT, pageTitle);
|
||||
}
|
||||
|
||||
final boolean hasCredentials = isValid(username) && isValid(keytoken);
|
||||
|
@ -499,20 +500,20 @@ public class Emaily extends Activity
|
|||
{
|
||||
if (shortUrl.length() > 0)
|
||||
{
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
|
||||
emailIntent.putExtra(Intent.EXTRA_TEXT,
|
||||
Html.fromHtml("<a href=\"" + shortUrl + "\">" + shortUrl + "</a>"));
|
||||
}
|
||||
else
|
||||
{
|
||||
final CharSequence text = extras.getCharSequence("android.intent.extra.TEXT");
|
||||
final CharSequence text = extras.getCharSequence(Intent.EXTRA_TEXT);
|
||||
|
||||
if (text.length() > 0)
|
||||
{
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, text);
|
||||
emailIntent.putExtra(Intent.EXTRA_TEXT, text);
|
||||
}
|
||||
else if (isValid(pageUrl))
|
||||
{
|
||||
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, pageUrl);
|
||||
emailIntent.putExtra(Intent.EXTRA_TEXT, pageUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -524,7 +525,6 @@ public class Emaily extends Activity
|
|||
{
|
||||
if (!result.hasError() && shortUrl.length() > 0)
|
||||
{
|
||||
|
||||
final ClipboardManager clip = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
clip.setText(shortUrl);
|
||||
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
*/
|
||||
package net.thauvin.erik.android.emaily;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
|
@ -56,6 +58,7 @@ import android.preference.PreferenceScreen;
|
|||
* @created Oct 11, 2011
|
||||
* @since 1.0
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class EmailyPrefs extends PreferenceActivity implements OnSharedPreferenceChangeListener
|
||||
{
|
||||
private SharedPreferences sharedPrefs;
|
||||
|
@ -97,8 +100,8 @@ public class EmailyPrefs extends PreferenceActivity implements OnSharedPreferenc
|
|||
Uri.parse(getString(R.string.prefs_feedback_url)
|
||||
+ "?subject="
|
||||
+ getString(R.string.prefs_feedback_subject, getString(R.string.app_name), vNumber,
|
||||
getString(R.string.prefs_feedback_title).toLowerCase(), Build.MANUFACTURER, Build.PRODUCT,
|
||||
Build.VERSION.RELEASE)));
|
||||
getString(R.string.prefs_feedback_title).toLowerCase(Locale.getDefault()), Build.MANUFACTURER,
|
||||
Build.PRODUCT, Build.VERSION.RELEASE)));
|
||||
|
||||
}
|
||||
catch (NameNotFoundException ignore)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue