• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.example.android.threadsample;
18 
19 import java.util.Locale;
20 
21 /**
22  *
23  * Constants used by multiple classes in this package
24  */
25 public final class Constants {
26 
27     // Set to true to turn on verbose logging
28     public static final boolean LOGV = false;
29 
30     // Set to true to turn on debug logging
31     public static final boolean LOGD = true;
32 
33     // Custom actions
34 
35     public static final String ACTION_VIEW_IMAGE =
36             "com.example.android.threadsample.ACTION_VIEW_IMAGE";
37 
38     public static final String ACTION_ZOOM_IMAGE =
39             "com.example.android.threadsample.ACTION_ZOOM_IMAGE";
40 
41     // Defines a custom Intent action
42     public static final String BROADCAST_ACTION = "com.example.android.threadsample.BROADCAST";
43 
44     // Fragment tags
45     public static final String PHOTO_FRAGMENT_TAG =
46             "com.example.android.threadsample.PHOTO_FRAGMENT_TAG";
47 
48     public static final String THUMBNAIL_FRAGMENT_TAG =
49             "com.example.android.threadsample.THUMBNAIL_FRAGMENT_TAG";
50 
51     // Defines the key for the status "extra" in an Intent
52     public static final String EXTENDED_DATA_STATUS = "com.example.android.threadsample.STATUS";
53 
54     // Defines the key for the log "extra" in an Intent
55     public static final String EXTENDED_STATUS_LOG = "com.example.android.threadsample.LOG";
56 
57     // Defines the key for storing fullscreen state
58     public static final String EXTENDED_FULLSCREEN =
59             "com.example.android.threadsample.EXTENDED_FULLSCREEN";
60 
61     /*
62      * A user-agent string that's sent to the HTTP site. It includes information about the device
63      * and the build that the device is running.
64      */
65     public static final String USER_AGENT = "Mozilla/5.0 (Linux; U; Android "
66             + android.os.Build.VERSION.RELEASE + ";"
67             + Locale.getDefault().toString() + "; " + android.os.Build.DEVICE
68             + "/" + android.os.Build.ID + ")";
69 
70     // Status values to broadcast to the Activity
71 
72     // The download is starting
73     public static final int STATE_ACTION_STARTED = 0;
74 
75     // The background thread is connecting to the RSS feed
76     public static final int STATE_ACTION_CONNECTING = 1;
77 
78     // The background thread is parsing the RSS feed
79     public static final int STATE_ACTION_PARSING = 2;
80 
81     // The background thread is writing data to the content provider
82     public static final int STATE_ACTION_WRITING = 3;
83 
84     // The background thread is done
85     public static final int STATE_ACTION_COMPLETE = 4;
86 
87     // The background thread is doing logging
88     public static final int STATE_LOG = -1;
89 
90     public static final CharSequence BLANK = " ";
91 }
92