Skip to content
Snippets Groups Projects
Commit 3bdd15f5 authored by John Carlson's avatar John Carlson
Browse files

Add ability to set due date on milestone

parent 689d80e1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -16,22 +16,32 @@ The app uses Fabric for Crashlytics, so you will need to generate your own Crash
GITLAB_FABRIC_KEY = FABRIC_KEY_GOES_HERE_BUT_ONLY_REALLY_NEEDED_FOR_RELEASE_BUILDS
```
## Libraries
The following 3rd party libraries are the reason this app works. Rapid development is easily attainable thanks to these fine folks and the work they do:
The following 3rd party libraries and resources are the reason this app works. Rapid development is easily attainable thanks to these fine folks and the work they do:
 
- AppCompat (https://developer.android.com/tools/support-library/features.html)
- Design (https://developer.android.com/tools/support-library/features.html)
- RecyclerView (https://developer.android.com/tools/support-library/features.html)
- CardView (https://developer.android.com/tools/support-library/features.html)
- Palette (https://developer.android.com/tools/support-library/features.html)
- Picasso (http://square.github.io/picasso/)
- Retrofit (http://square.github.io/retrofit/)
- OkHttp (http://square.github.io/okhttp/)
- Picasso (http://square.github.io/picasso/)
- Otto (http://square.github.io/otto/)
- Butter Knife (http://jakewharton.github.io/butterknife/)
- Timber (https://github.com/JakeWharton/timber)
- GSON (https://github.com/google/gson)
- Joda Time Android (https://github.com/dlew/joda-time-android)
- Parceler (https://github.com/johncarl81/parceler)
- Bypass (https://github.com/Uncodin/bypass)
- Bypasses (https://github.com/Commit451/bypasses)
- Easel (https://github.com/Commit451/Easel)
- CircleImageView (https://github.com/hdodenhof/CircleImageView)
- Material-ish Progress (https://github.com/pnikosis/materialish-progress)
- PhysicsLayout (https://github.com/Jawnnypoo/PhysicsLayout)
- CircleImageView (https://github.com/hdodenhof/CircleImageView)
- Material Letter Icon (https://github.com/IvBaranov/MaterialLetterIcon)
- RobotoTextView (https://github.com/johnkil/Android-RobotoTextView)
- GitDiffTextView (https://github.com/alorma/GitDiffTextView)
- MaterialDateTimePicker (https://github.com/wdullaer/MaterialDateTimePicker)
- Crashlytics (https://www.crashlytics.com)
 
## Contributing
Please fork this repository and contribute back! All Merge Requests should be made against the `develop` branch, as it is the active branch for development. Please make your best effort to break up commits as much as possible to improve the reviewing process.
Loading
Loading
Loading
Loading
@@ -39,8 +39,6 @@ dependencies {
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:palette-v7:23.1.1'
compile 'com.google.code.gson:gson:2.5'
compile 'net.danlew:android.joda:2.9.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
Loading
Loading
@@ -53,16 +51,19 @@ dependencies {
compile 'com.squareup:otto:1.3.8'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.jakewharton.timber:timber:4.1.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.google.code.gson:gson:2.5'
compile 'net.danlew:android.joda:2.9.1'
compile "org.parceler:parceler-api:1.0.3"
apt "org.parceler:parceler:1.0.3"
compile 'com.jawnnypoo:physicslayout:1.0.1'
compile 'com.commit451:bypasses:1.0.1'
compile 'com.commit451:easel:0.0.4'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.jawnnypoo:physicslayout:1.0.1'
compile 'com.github.ivbaranov:MaterialLetterIcon:0.2.1'
compile 'com.github.johnkil.android-robototextview:robototextview:2.4.3'
compile 'com.github.alorma:diff-textview:1.1.0'
compile 'com.wdullaer:materialdatetimepicker:2.1.1'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
Loading
Loading
Loading
Loading
@@ -18,6 +18,10 @@ import com.commit451.gitlab.R;
import com.commit451.gitlab.api.GitLabClient;
import com.commit451.gitlab.event.MilestoneCreatedEvent;
import com.commit451.gitlab.model.api.Milestone;
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog;
import java.util.Calendar;
import java.util.Date;
 
import butterknife.Bind;
import butterknife.ButterKnife;
Loading
Loading
@@ -54,10 +58,33 @@ public class AddMilestoneActivity extends BaseActivity {
 
@OnClick(R.id.due_date)
void onDueDateClicked() {
//TODO bring up the calendar dialog
Calendar now = Calendar.getInstance();
if (mCurrentDate != null) {
now.setTime(mCurrentDate);
}
DatePickerDialog dpd = DatePickerDialog.newInstance(
mOnDateSetListener,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH)
);
dpd.show(getFragmentManager(), "date_picker");
}
 
long mProjectId;
Date mCurrentDate;
private final DatePickerDialog.OnDateSetListener mOnDateSetListener = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, monthOfYear);
calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
mCurrentDate = calendar.getTime();
bind(mCurrentDate);
}
};
 
private final View.OnClickListener mOnBackPressed = new View.OnClickListener() {
@Override
Loading
Loading
@@ -117,7 +144,10 @@ public class AddMilestoneActivity extends BaseActivity {
 
mProgress.setVisibility(View.VISIBLE);
String dueDate = null;
//TODO make this the current due date
if (mCurrentDate != null) {
dueDate = Milestone.DUE_DATE_FORMAT.format(mCurrentDate);
}
GitLabClient.instance().createMilestone(mProjectId,
mTitle.getText().toString(),
mDescription.getText().toString(),
Loading
Loading
@@ -129,4 +159,8 @@ public class AddMilestoneActivity extends BaseActivity {
Snackbar.make(mRoot, getString(R.string.failed_to_create_milestone), Snackbar.LENGTH_SHORT)
.show();
}
private void bind(Date date) {
mDueDate.setText(Milestone.DUE_DATE_FORMAT.format(date));
}
}
Loading
Loading
@@ -36,6 +36,8 @@
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textCapSentences|textAutoCorrect|textMultiLine"
android:imeOptions="actionNone"
android:hint="@string/milestone_hint_title" />
 
</android.support.design.widget.TextInputLayout>
Loading
Loading
@@ -49,6 +51,8 @@
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textCapSentences|textAutoCorrect|textMultiLine"
android:imeOptions="actionNone"
android:hint="@string/milestone_hint_description" />
 
</android.support.design.widget.TextInputLayout>
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment