Skip to content

Commit

Permalink
Version 1.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Apr 3, 2012
0 parents commit 4ec246c
Show file tree
Hide file tree
Showing 52 changed files with 1,201 additions and 0 deletions.
42 changes: 42 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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" >

<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="11" />

<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:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/Emaily" >
<activity
android:name="net.thauvin.erik.android.emaily.Emaily"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<activity
android:name=".EmailyPrefs"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Binary file added lib/bitlyj-2.0.0.jar
Binary file not shown.
Binary file added lib/commons-codec-1.6-sources.jar
Binary file not shown.
Binary file added lib/commons-codec-1.6.jar
Binary file not shown.
Binary file added lib/google-api-client-1.7.0-beta-sources.jar
Binary file not shown.
Binary file added lib/google-api-client-1.7.0-beta.jar
Binary file not shown.
Binary file not shown.
Binary file added lib/google-api-client-android2-1.7.0-beta.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added lib/google-http-client-1.7.0-beta-sources.jar
Binary file not shown.
Binary file added lib/google-http-client-1.7.0-beta.jar
Binary file not shown.
Binary file not shown.
Binary file added lib/google-http-client-android2-1.7.0-beta.jar
Binary file not shown.
Binary file not shown.
Binary file added lib/google-http-client-android3-1.7.0-beta.jar
Binary file not shown.
Binary file added lib/google-oauth-client-1.7.0-beta-sources.jar
Binary file not shown.
Binary file added lib/google-oauth-client-1.7.0-beta.jar
Binary file not shown.
Binary file added lib/gson-2.1-sources.jar
Binary file not shown.
Binary file added lib/gson-2.1.jar
Binary file not shown.
Binary file added lib/guava-11.0.1-sources.jar
Binary file not shown.
Binary file added lib/guava-11.0.1.jar
Binary file not shown.
Binary file added lib/jackson-core-asl-1.9.4-sources.jar
Binary file not shown.
Binary file added lib/jackson-core-asl-1.9.4.jar
Binary file not shown.
Binary file added lib/jsr305-1.3.9.jar
Binary file not shown.
Binary file added lib/protobuf-java-2.2.0-sources.jar
Binary file not shown.
Binary file added lib/protobuf-java-2.2.0.jar
Binary file not shown.
64 changes: 64 additions & 0 deletions proguard.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
native <methods>;
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}

-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# Needed by google-http-client to keep generic types and @Key annotations accessed via reflection

-keepclassmembers class * {
@com.google.api.client.util.Key <fields>;
}

# Needed just to be safe in terms of keeping Google API service model classes

-keep class com.google.api.services.*.model.*

-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault

# Needed by Guava

-dontwarn sun.misc.Unsafe

# See https://groups.google.com/forum/#!topic/guava-discuss/YCZzeCiIVoI
-dontwarn com.google.common.collect.MinMaxPriorityQueue

# Emaily
-keep class com.google.api.client.googleapis.json.*
-dontwarn org.apache.commons.codec.binary.StringUtils
-dontwarn org.apache.commons.codec.binary.Base64
Binary file added res/drawable-hdpi/icon.png
Loading
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/drawable-ldpi/icon.png
Loading
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/drawable-mdpi/icon.png
Loading
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/drawable-xhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions res/layout/bitlycreds.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<TextView
android:id="@+id/bit_username_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:gravity="left"
android:text="@string/prefs_bitly_creds_username"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/bitly_username_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:gravity="fill_horizontal"
android:inputType="text"
android:key="@string/prefs_key_bitly_username"
android:scrollHorizontally="true"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/bitly_apikey_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:gravity="left"
android:text="@string/prefs_bitly_creds_apikey"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/bitly_apikey_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:gravity="fill_horizontal"
android:inputType="text"
android:key="@string/prefs_key_bitly_apikey"
android:scrollHorizontally="true"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/bitly_text_fld"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="20dip"
android:layout_marginTop="20dip"
android:gravity="center"
android:text="@string/prefs_bitly_creds_noapi"
android:textColor="#eda712"
android:clickable="true"
android:textAppearance="?android:attr/textAppearanceMedium" >
</TextView>

</LinearLayout>
6 changes: 6 additions & 0 deletions res/values-v11/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Emaily" parent="@android:style/Theme.Holo" />

</resources>
46 changes: 46 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="alert_error">Sorry. An error was returned by %2$s while shortening the url: %1$s</string>
<string name="alert_nocreds">Please provide your credentials to shorten urls.</string>
<string name="alert_nohost">Sorry. Could not connect to %1$s.</string>
<string name="alert_notfound">Sorry. No applications can perform this action.</string>
<string name="alert_notfound_clip">Sorry. No applications can perform this action. The shortened url has been copied to the clipboard.</string>
<string name="app_name">Emaily</string>
<string name="dialog_accounts_title">Select a Google account</string>
<string name="prefs_about_title">About</string>
<string name="prefs_bitly_creds_apikey">API Key</string>
<string name="prefs_bitly_creds_cancel">Cancel</string>
<string name="prefs_bitly_creds_dialog_title">Bit.ly API Credentials</string>
<string name="prefs_bitly_creds_noapi"><u>Need an API key?</u></string>
<string name="prefs_bitly_creds_ok">OK</string>
<string name="prefs_bitly_creds_summary">Enter your credentials…</string>
<string name="prefs_bitly_creds_title">API Credentials</string>
<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_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>
<string name="prefs_feedback_url">mailto:[email protected]</string>
<string name="prefs_googl_chkbox_title">Use as shorterner?</string>
<string name="prefs_googl_title">goo.gl</string>
<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_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>
<string name="prefs_key_feedback">prefs_feedback</string>
<string name="prefs_key_googl_account">prefs_googl_account</string>
<string name="prefs_key_googl_chkbox">prefs_googl_chkbox</string>
<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_version">prefs_version</string>
<string name="prefs_version_title">Version</string>
<string name="progress_msg">Shortening url…</string>
<string name="progress_msg_retry">Retrying…</string>

</resources>
6 changes: 6 additions & 0 deletions res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Emaily" parent="@android:style/Theme" />

</resources>
46 changes: 46 additions & 0 deletions res/xml/prefs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >

<PreferenceCategory android:title="@string/prefs_googl_title" >
<CheckBoxPreference
android:defaultValue="true"
android:key="@string/prefs_key_googl_chkbox"
android:title="@string/prefs_googl_chkbox_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/prefs_bitly_title" >
<net.thauvin.erik.android.emaily.BitlyCredsDialog
android:dialogLayout="@layout/bitlycreds"
android:dialogTitle="@string/prefs_bitly_creds_dialog_title"
android:key="@string/prefs_key_bitly_creds"
android:negativeButtonText="@string/prefs_bitly_creds_cancel"
android:positiveButtonText="@string/prefs_bitly_creds_ok"
android:summary="@string/prefs_bitly_creds_summary"
android:title="@string/prefs_bitly_creds_title" >
</net.thauvin.erik.android.emaily.BitlyCredsDialog>
</PreferenceCategory>
<PreferenceCategory android:title="@string/prefs_about_title" >
<Preference
android:enabled="false"
android:key="@string/prefs_key_version"
android:singleLine="true"
android:summary="@string/prefs_copyright"
android:title="@string/prefs_version_title" />

<PreferenceScreen
android:summary="@string/prefs_help_summary"
android:title="@string/prefs_help_title" >
<intent
android:action="android.intent.action.VIEW"
android:data="@string/prefs_help_url" />
</PreferenceScreen>
<PreferenceScreen
android:key="@string/prefs_key_feedback"
android:summary="@string/prefs_feedback_summary"
android:title="@string/prefs_feedback_title" >
<intent
android:action="android.intent.action.VIEW"
android:data="@string/prefs_feedback_url" />
</PreferenceScreen>
</PreferenceCategory>

</PreferenceScreen>
Binary file added screenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/api_branding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/emaily.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/icon114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/promo-1024x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/promo-180x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions src/net/thauvin/erik/android/emaily/BitlyCredsDialog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* @(#)Emaily.java
*
* Copyright (c) 2012 Erik C. Thauvin (http://erik.thauvin.net/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the authors nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
package net.thauvin.erik.android.emaily;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

/**
* The <code>BitlyCredsDialog</code> class implements a bit.ly credential dialog.
*
* @author <a href="mailto:[email protected]">Erik C. Thauvin</a>
* @version $Revision$
* @created March 28, 2012
* @since 1.0
*/
public class BitlyCredsDialog extends DialogPreference
{
private final Context mContext;
private EditText username;
private EditText apikey;

public BitlyCredsDialog(Context context, AttributeSet attrs)
{
super(context, attrs);
mContext = context;
setPersistent(false);
}

@Override
protected void onBindDialogView(View view)
{
super.onBindDialogView(view);

final SharedPreferences sharedPrefs = getSharedPreferences();
username = (EditText) view.findViewById(R.id.bitly_username_edit);
apikey = (EditText) view.findViewById(R.id.bitly_apikey_edit);
final TextView textFld = (TextView) view.findViewById(R.id.bitly_text_fld);

username.setText(sharedPrefs.getString(mContext.getString(R.string.prefs_key_bitly_username), ""));
apikey.setText(sharedPrefs.getString(mContext.getString(R.string.prefs_key_bitly_apikey), ""));

textFld.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mContext.getString(R.string.prefs_bitly_creds_url)));
mContext.startActivity(intent);
};
});
}

@Override
protected void onDialogClosed(boolean positiveResult)
{
super.onDialogClosed(positiveResult);

if (positiveResult)
{
final SharedPreferences sharedPrefs = getSharedPreferences();
final Editor editor = sharedPrefs.edit();
editor.putString(mContext.getString(R.string.prefs_key_bitly_username), username.getText().toString());
editor.putString(mContext.getString(R.string.prefs_key_bitly_apikey), apikey.getText().toString());
editor.commit();
}

}
}
Loading

0 comments on commit 4ec246c

Please sign in to comment.