This file contains 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
dependencies{ | |
implementation ....................... | |
..................................... | |
def lifecycle_version = "1.1.1" | |
implementation "android.arch.lifecycle:extensions:$lifecycle_version" | |
annotationProcessor "android.arch.lifecycle:compiler:$lifecycle_version" | |
} |
This file contains 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
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT' | |
implementation 'com.afollestad.material-dialogs:core:0.9.0.1' | |
implementation 'com.afollestad.material-dialogs:commons:0.9.0.1' | |
implementation 'com.android.support:design:28.0.0' | |
implementation 'com.wdullaer:materialdatetimepicker:2.5.0' |
This file contains 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
timeButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Calendar now = Calendar.getInstance(); | |
TimePickerDialog tpd = TimePickerDialog.newInstance( | |
NewItem.this, | |
now.get(Calendar.HOUR_OF_DAY), | |
now.get(Calendar.MINUTE), | |
false | |
); |
This file contains 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
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); | |
sharingIntent.setType("text/plain"); | |
String shareBody = ""; | |
shareBody += etNewTask.getText().toString(); | |
if(!TextUtils.isEmpty(dateTextView.getText().toString())) { | |
shareBody += " by " + dateTextView.getText().toString(); | |
if(!TextUtils.isEmpty(timeTextView.getText().toString())) { | |
shareBody += " " + timeTextView.getText().toString(); | |
} | |
} |
This file contains 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 enum Priority { | |
LOW("low", 2, Color.rgb(204, 214, 0)), | |
MEDIUM("medium", 1, Color.rgb(255, 170, 0)), | |
HIGH("high", 0, Color.rgb(255, 0, 0)); | |
} |
This file contains 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 static Date getDateFromString(String date) { | |
SimpleDateFormat sf = new SimpleDateFormat("M/dd/yyyy"); | |
sf.setLenient(true); | |
try { | |
return sf.parse(date); | |
} catch (ParseException e) { | |
e.printStackTrace(); | |
} | |
return null; | |
} |
This file contains 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
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingStart="@dimen/activity_main_left" | |
android:paddingEnd="@dimen/activity_main_right" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:descendantFocusability="beforeDescendants" | |
android:focusableInTouchMode="true" |
This file contains 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"?> | |
<LinearLayout android:layout_height="match_parent" | |
android:layout_width="match_parent" | |
android:orientation="vertical" | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" > | |
<android.support.v7.widget.CardView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="10dp" |
This file contains 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"?> | |
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" > | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@android:color/white" | |
android:paddingBottom="@dimen/activity_vertical_margin" |
This file contains 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
listView = (ListView) findViewById(R.id.lvDisplay); | |
listView.setAdapter(aToDoAdaptor); | |
findViewById(R.id.spkBtn).setOnClickListener(this); | |
imgTick = (ImageView)findViewById(R.id.imgTick); | |
fab = (FloatingActionButton) findViewById(R.id.fab); | |
spkBtn = (ImageView) findViewById(R.id.spkBtn); | |
editText = (EditText) findViewById(R.id.etAddText); | |
OlderNewer