Created
March 5, 2014 18:08
-
-
Save csdear/a828ce195f625c77b5bb to your computer and use it in GitHub Desktop.
Class Field / Variable Initialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Variable section directly after class i.e. "public class <<ClassName>> extends <<baseClassToInher* itFrom>> This demonstrates the many different types of Fields and field configurations. | |
| * | |
| */ | |
| //Int,days in milliseconds - 7 * 24 * 60 * 60 * 1000 | |
| private static final int SEVEN_DAYS = 604800000; | |
| // String for LogCat messages (Debugging) | |
| private static final String TAG = "<<app||className>>"; | |
| // Simple strings, not initialized | |
| private static String timeString; | |
| private static String dateString; | |
| private Date mDate; | |
| private EditText mTitleText; | |
| //Simple strings, initialized | |
| public final static String TITLE = "title"; | |
| public final static String PRIORITY = "priority"; | |
| public final static String STATUS = "status"; | |
| public final static String DATE = "date"; | |
| public final static String FILENAME = "filename"; | |
| //String Array Field | |
| public static final String[] FRIENDS = { "taylorswift13", "msrebeccablack", | |
| "ladygaga" }; | |
| //String Array Fields Empty | |
| private String[] mRawFeeds = new String[3]; | |
| private String[] mProcessedFeeds = new String[3]; | |
| //URL string fields | |
| private static final String URL_LGAGA = "https://d396qusza40orc.cloudfront.net/android%2FLabs%2FUserNotifications%2Fladygaga.txt"; | |
| private static final String URL_RBLACK = "https://d396qusza40orc.cloudfront.net/android%2FLabs%2FUserNotifications%2Frebeccablack.txt"; | |
| private static final String URL_TSWIFT = "https://d396qusza40orc.cloudfront.net/android%2FLabs%2FUserNotifications%2Ftaylorswift.txt"; | |
| //TextView fields | |
| private static TextView dateView; | |
| private static TextView timeView; | |
| //UI Group Fields | |
| private RadioGroup mPriorityRadioGroup; | |
| private RadioGroup mStatusRadioGroup; | |
| //UI Element RadioButton | |
| private RadioButton mDefaultStatusButton; | |
| private RadioButton mDefaultPriorityButton; | |
| // Enumeration Fields | |
| public enum Priority { | |
| LOW, MED, HIGH | |
| }; | |
| public enum Status { | |
| NOTDONE, DONE | |
| }; | |
| // Setting Format of a date field | |
| public final static SimpleDateFormat FORMAT = new SimpleDateFormat( | |
| "yyyy-MM-dd HH:mm:ss", Locale.US); | |
| // Initiatlizing a field with a method | |
| private String mTitle = new String(); | |
| private Date mDate = new Date(); | |
| //Initializing a priority field -- see associated enumeration field declared above^ | |
| private Priority mPriority = Priority.LOW; | |
| //Initializing a status field -- see associated enumeration field declared above^ | |
| private Status mStatus = Status.NOTDONE; | |
| // Request Code field. Field used later in RequestCode setting | |
| private static final int <<REQUEST_CODE_NAME>> = 0; | |
| private static final int ADD_TODO_ITEM_REQUEST = 0; | |
| //Initializing a File_Name Field | |
| private static final String FILE_NAME = "<<filename.ext>>"; | |
| private static final String FILE_NAME = "TodoManagerActivityData.txt"; | |
| // Menu Item Fields | |
| private static final int MENU_DELETE = Menu.FIRST; | |
| private static final int MENU_DUMP = Menu.FIRST + 1; | |
| // Field for adapter | |
| <<SuperAdapterClassName>> <<fieldName>>; | |
| ToDoListAdapter mAdapter; | |
| private static String timeString; | |
| private static String dateString; | |
| private static TextView dateView; | |
| private static TextView timeView; | |
| //Fragment Fields | |
| private FragmentManager mFragmentManager; | |
| private FriendsFragment mFriendsFragment; | |
| private FeedFragment mFeedFragment; | |
| //BroadcastReceiver field | |
| private BroadcastReceiver mRefreshReceiver; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment