Commits

Robert Massaioli [Atlassian] committed f24168b

Minor amount of code refactoring.

Comments (0)

Files changed (2)

LibAndroTranslation/src/shoozhoo/libandrotranslation/LibAndTransUtil.java

 import android.util.Log;
 
 public class LibAndTransUtil {
+    private static final String TAG = "LibAndroTrans";
+
     public static void log(String s) {
-        Log.i("LibAndroTrans", s);
+        Log.i(TAG, s);
     }
 
     public static void log(String s, Throwable t) {
-        Log.i("LibAndroTrans", s, t);
+        Log.i(TAG, s, t);
     }
 
     public static void safeclose(Closeable c) {

LibAndroTranslation/src/shoozhoo/libandrotranslation/TranslationListActivity.java

 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.widget.Toast;
 
 public class TranslationListActivity extends ListActivity {
-    public static final String INTENT_EXTRA_MAIL_APPNAME                      = "INTENT_EXTRA_MAIL_APPNAME";
-    public static final String INTENT_EXTRA_MAIL_TO                           = "INTENT_EXTRA_MAIL_TO";
-    public static final String INTENT_EXTRA_PACKAGE                           = "INTENT_EXTRA_PACKAGE";
-    public static final String INTENT_EXTRA_DIR                               = "INTENT_EXTRA_DIR";
-    public static final String INTENT_EXTRA_SHOW_LIBANDROTRANSLATION_RESOURCE = "INTENT_EXTRA_SHOW_LIBANDROTRANSLATION_RESOURCE";
-    public static final String INTENT_EXTRA_IGNORE_PATTERNS                   = "INTENT_EXTRA_IGNORE_PATTERNS";
-    public static final int    REQUEST_EDIT                                   = 100;
-    public static final int    REQUEST_MAIL                                   = 200;
-
-    private Handler            handler                                        = new Handler();
-    private List<String>       pkgs;
-    private StringResources    strReses;
-    private List<StringRes>    resList;
-    private TextView           rateTextView;
-    private Spinner            langSpinner;
-    private String             lang;
-    private boolean            showSelfResource;
-    private String             dir;
-    private String             mailApp;
-    private String             mailTo;
-    private List<String>       ignorePattern;
-
-    private boolean            initialized;
+    private static final String TAG                                            = TranslationListActivity.class.getName();
+
+    public static final String  INTENT_EXTRA_MAIL_APPNAME                      = "INTENT_EXTRA_MAIL_APPNAME";
+    public static final String  INTENT_EXTRA_MAIL_TO                           = "INTENT_EXTRA_MAIL_TO";
+    public static final String  INTENT_EXTRA_PACKAGE                           = "INTENT_EXTRA_PACKAGE";
+    public static final String  INTENT_EXTRA_DIR                               = "INTENT_EXTRA_DIR";
+    public static final String  INTENT_EXTRA_SHOW_LIBANDROTRANSLATION_RESOURCE = "INTENT_EXTRA_SHOW_LIBANDROTRANSLATION_RESOURCE";
+    public static final String  INTENT_EXTRA_IGNORE_PATTERNS                   = "INTENT_EXTRA_IGNORE_PATTERNS";
+    public static final int     REQUEST_EDIT                                   = 100;
+    public static final int     REQUEST_MAIL                                   = 200;
+
+    private Handler             handler                                        = new Handler();
+    private List<String>        pkgs;
+    private StringResources     strReses;
+    private List<StringRes>     resList;
+    private TextView            rateTextView;
+    private Spinner             langSpinner;
+    private String              lang;
+    private boolean             showSelfResource;
+    private String              dir;
+    private String              mailApp;
+    private String              mailTo;
+    private List<String>        ignorePattern;
+
+    private boolean             initialized;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         this.mailTo = intent.getStringExtra(INTENT_EXTRA_MAIL_TO);
         this.ignorePattern = intent.getStringArrayListExtra(INTENT_EXTRA_IGNORE_PATTERNS);
         for (String s : ignorePattern) {
-            System.out.println("## " + s);
+            Log.i(TAG, "Ignore Pattern: " + s);
         }
+
         this.pkgs = new ArrayList<String>();
         try {
             String s = intent.getStringExtra(INTENT_EXTRA_PACKAGE);
     private String mailContent() {
         // It doesn't internationalize.
         // The developer is sure to know English.
-        return "Translation request.";
+        return "Translation request: the relevant details are attatched.";
     }
 
     /*
             this.strReses.loadStringResources(getApplicationContext());
         } catch (Exception e) {
             errorToast(R.string.zzlibandrotranslation_toast_cant_read_resource);
-            LibAndTransUtil.log(e.getMessage());
-            e.printStackTrace();
+            LibAndTransUtil.log("Failed to refresh the resources.", e);
             return;
         }
         this.resList = this.strReses.getStringResources();