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
private void setDateFields(){ | |
entryDate.setOnClickListener(this); | |
Calendar calendar = Calendar.getInstance(); | |
datePickerDialog = new DatePickerDialog(mThis, new DatePickerDialog.OnDateSetListener() { | |
@Override | |
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { | |
Calendar newDate = Calendar.getInstance(); | |
newDate.set(year, monthOfYear, dayOfMonth); | |
entryDate.setText(dateFormatter.format(newDate.getTime())); |
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
private DatePickerDialog datePickerDialog; | |
private EditText entryDate; | |
private SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yyyy", Locale.US); |
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
<android.support.design.widget.TextInputLayout | |
android:id="@+id/add_entry_date_wrapper" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<EditText | |
android:id="@+id/add_entry_date" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:ems="10" |
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
package com.stevendanna.navigation; | |
import android.os.Bundle; | |
import android.support.design.widget.FloatingActionButton; | |
import android.support.design.widget.Snackbar; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.Toolbar; | |
import android.view.View; | |
import android.view.Menu; | |
import android.view.MenuItem; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" | |
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
app:layout_behavior="@string/appbar_scrolling_view_behavior" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.design.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fitsSystemWindows="true" | |
tools:context=".MainActivity"> |
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
public class DatabaseFixture<T> : IDisposable | |
{ | |
public DatabaseFixture<T>() | |
{ | |
// Do something interesting with the Generic parameter like initialize | |
// a database dynamically based on generic type. | |
Db = new SqlConnection("MyConnectionString"); | |
// ... initialize data in the test database ... |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
using StructureMap; | |
namespace ConsoleApplication1 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
public class EmailConfig | |
{ | |
public static void Configure() | |
{ | |
#if(DEBUG) | |
// Allows for a good F5 from Visual Studio experience. | |
const string emailDropFolder = "C:\\Email-Drop\\"; | |
if (!Directory.Exists(emailDropFolder)) Directory.CreateDirectory(emailDropFolder); | |
#endif | |
} |