~tomdroid-dev/tomdroid/check-for-linebreak

« back to all changes in this revision

Viewing changes to src/org/tomdroid/ui/ViewNote.java

  • Committer: Olivier Bilodeau
  • Date: 2012-03-31 14:36:55 UTC
  • mfrom: (254.2.8 loggers-cleanup)
  • Revision ID: olivier@bottomlesspit.org-20120331143655-0osjgyvnxvy3c90f
Our own mini-logging layer. Fixes lp:882218

Thanks to Piotr Adamski for the work

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 */
24
24
package org.tomdroid.ui;
25
25
 
26
 
import java.util.regex.Matcher;
27
 
import java.util.regex.Pattern;
28
 
 
29
 
import org.tomdroid.Note;
30
 
import org.tomdroid.NoteManager;
31
 
import org.tomdroid.R;
32
 
import org.tomdroid.sync.SyncManager;
33
 
import org.tomdroid.util.LinkifyPhone;
34
 
import org.tomdroid.util.NoteContentBuilder;
35
 
import org.tomdroid.util.Send;
36
 
 
37
26
import android.app.Activity;
38
27
import android.app.AlertDialog;
39
28
import android.content.DialogInterface;
 
29
import android.content.DialogInterface.OnClickListener;
40
30
import android.content.Intent;
41
 
import android.content.DialogInterface.OnClickListener;
42
31
import android.database.Cursor;
43
32
import android.graphics.Color;
44
33
import android.net.Uri;
48
37
import android.text.SpannableStringBuilder;
49
38
import android.text.util.Linkify;
50
39
import android.text.util.Linkify.TransformFilter;
51
 
import android.util.Log;
52
40
import android.view.Menu;
53
41
import android.view.MenuInflater;
54
42
import android.view.MenuItem;
55
43
import android.widget.TextView;
 
44
import org.tomdroid.Note;
 
45
import org.tomdroid.NoteManager;
 
46
import org.tomdroid.R;
 
47
import org.tomdroid.sync.SyncManager;
 
48
import org.tomdroid.util.LinkifyPhone;
 
49
import org.tomdroid.util.NoteContentBuilder;
 
50
import org.tomdroid.util.Send;
 
51
import org.tomdroid.util.TLog;
 
52
 
 
53
import java.util.regex.Matcher;
 
54
import java.util.regex.Pattern;
56
55
 
57
56
// TODO this class is starting to smell
58
57
public class ViewNote extends Activity {
91
90
                if (uri != null) {
92
91
                        
93
92
                        // We were triggered by an Intent URI 
94
 
                        if (Tomdroid.LOGGING_ENABLED) Log.d(TAG, "ViewNote started: Intent-filter triggered.");
 
93
                        TLog.d(TAG, "ViewNote started: Intent-filter triggered.");
95
94
 
96
95
                        // TODO validate the good action?
97
96
                        // intent.getAction()
107
106
                                
108
107
                        } else {
109
108
                                
110
 
                                if (Tomdroid.LOGGING_ENABLED) Log.d(TAG, "The note "+uri+" doesn't exist");
 
109
                                TLog.d(TAG, "The note {0} doesn't exist", uri);
111
110
                                
112
111
                                // TODO put error string in a translatable resource
113
112
                                new AlertDialog.Builder(this)
123
122
                        }
124
123
                } else {
125
124
                        
126
 
                        if (Tomdroid.LOGGING_ENABLED) Log.d(TAG, "The Intent's data was null.");
 
125
                        TLog.d(TAG, "The Intent's data was null.");
127
126
                        
128
127
                        // TODO put error string in a translatable resource
129
128
                        new AlertDialog.Builder(this)
250
249
                } else {
251
250
                        
252
251
                        // TODO send an error to the user
253
 
                        if (Tomdroid.LOGGING_ENABLED) Log.d(TAG, "Cursor returned null or 0 notes");
 
252
                        TLog.d(TAG, "Cursor returned null or 0 notes");
254
253
                }
255
254
                
256
255
                return null;