-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opentask view Support #1279
base: master
Are you sure you want to change the base?
Opentask view Support #1279
Conversation
@jspricke I think that now is better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stopped after finding two problems..
Please don't open new PRs but keep this one now.
@jspricke maybe I not understanding the situation but if I compare my branch with master etar I get this: could you please help me to understand? |
You undo the changes in your last commit: c68bf76 Instead you should use |
e2a5760
to
ce843fe
Compare
Can you please finish your commits before pushing, as every push produces a mail for me ;). |
@jspricke sorry but I cannot understand how to solve this situation. I think that I solve as |
See your list of commits here: https://github.com/Etar-Group/Etar-Calendar/pull/1279/commits |
All the git stuff is something for @jspricke ;). I'll try to test this over the holidays when I get a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the commits, looks much better now.
I've left some general comments, but did not look into the patches deeply.
For the requested changes you can use git add -i
and git commit --fixup <sha1>
to add fixup commits that can be autosquashed later.
app/src/main/java/com/android/calendar/month/MonthByWeekFragment.java
Outdated
Show resolved
Hide resolved
If I click on "View Tasks" in Agenda View Etar crashes(Failed to find provider info for org.dmfs.tasks) |
Are opentasks installed? I think I miss the check on agenda view? |
Yes I haven't installed it yet. |
@Gitsaibot fixed. added a check to see if opentasks has been installed. if not the menu "view tasks" is not visible |
When opentask is not installed i still get these debug messages: debug E/ActivityThread: Failed to find provider info for org.dmfs.tasks |
@Gitsaibot fixed |
I still get the messages when I switch between calendar views. |
@Gitsaibot now is fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some clean up of the commits, please update your local branch before doing new changes, for example by:
git fetch origin
get reset --hard origin/master
@@ -147,7 +147,7 @@ protected void onCreate(Bundle icicle) { | |||
if (mInfoFragment == null) { | |||
FragmentManager fragmentManager = getFragmentManager(); | |||
FragmentTransaction ft = fragmentManager.beginTransaction(); | |||
mInfoFragment = new EventInfoFragment(this, mEventId, mStartMillis, mEndMillis, | |||
mInfoFragment = new EventInfoFragment(this, intent.getData(), mStartMillis, mEndMillis, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure intent
is never null
here?
if (isTask) { | ||
val taskUri = | ||
ContentUris.withAppendedId(DmfsOpenTasksContract.TaskLists.PROVIDER_URI, calendarId) | ||
contentResolver.query(taskUri, ACCOUNT_PROJECTION, null, null, null)?.use { | ||
if (it.moveToFirst()) { | ||
val accountName = it.getString(PROJECTION_ACCOUNT_INDEX_NAME) | ||
val accountType = it.getString(PROJECTION_ACCOUNT_INDEX_TYPE) | ||
return Account(accountName, accountType) | ||
} | ||
} | ||
} else { | ||
val calendarUri = | ||
ContentUris.withAppendedId(CalendarContract.Calendars.CONTENT_URI, calendarId) | ||
contentResolver.query(calendarUri, ACCOUNT_PROJECTION, null, null, null)?.use { | ||
if (it.moveToFirst()) { | ||
val accountName = it.getString(PROJECTION_ACCOUNT_INDEX_NAME) | ||
val accountType = it.getString(PROJECTION_ACCOUNT_INDEX_TYPE) | ||
return Account(accountName, accountType) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (isTask) { | |
val taskUri = | |
ContentUris.withAppendedId(DmfsOpenTasksContract.TaskLists.PROVIDER_URI, calendarId) | |
contentResolver.query(taskUri, ACCOUNT_PROJECTION, null, null, null)?.use { | |
if (it.moveToFirst()) { | |
val accountName = it.getString(PROJECTION_ACCOUNT_INDEX_NAME) | |
val accountType = it.getString(PROJECTION_ACCOUNT_INDEX_TYPE) | |
return Account(accountName, accountType) | |
} | |
} | |
} else { | |
val calendarUri = | |
ContentUris.withAppendedId(CalendarContract.Calendars.CONTENT_URI, calendarId) | |
contentResolver.query(calendarUri, ACCOUNT_PROJECTION, null, null, null)?.use { | |
if (it.moveToFirst()) { | |
val accountName = it.getString(PROJECTION_ACCOUNT_INDEX_NAME) | |
val accountType = it.getString(PROJECTION_ACCOUNT_INDEX_TYPE) | |
return Account(accountName, accountType) | |
} | |
} | |
} | |
if (isTask) { | |
val uri = | |
ContentUris.withAppendedId(DmfsOpenTasksContract.TaskLists.PROVIDER_URI, calendarId) | |
} else { | |
val uri = | |
ContentUris.withAppendedId(CalendarContract.Calendars.CONTENT_URI, calendarId) | |
} | |
contentResolver.query(uri, ACCOUNT_PROJECTION, null, null, null)?.use { | |
if (it.moveToFirst()) { | |
val accountName = it.getString(PROJECTION_ACCOUNT_INDEX_NAME) | |
val accountType = it.getString(PROJECTION_ACCOUNT_INDEX_TYPE) | |
return Account(accountName, accountType) | |
} | |
} | |
} |
app/src/main/java/com/android/calendar/agenda/AgendaListView.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/android/calendar/agenda/AgendaAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/android/calendar/widget/CalendarAppWidgetModel.java
Outdated
Show resolved
Hide resolved
// populate the day buckets that this event falls into | ||
int from = Math.max(startDay, mTodayJulianDay); | ||
int to = Math.min(endDay, mMaxJulianDay); | ||
int from = Math.max(Time.getJulianDay(mEventInfo.start, new Time().getGmtOffset()), mTodayJulianDay); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give some explanation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before. tasks has no begin time, so it will be recalcualted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give some more explanation? Why do you need a loop? Why an extra method? Why change the computation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cause tasks comes from different objects than events, so I need to calculate dates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to compute them in the object instead of different times in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mebitek just a friendly pint. Do you have any comment here? I think I would be fine with the current state but maybe this would simplify the code a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jspricke sorry but I was a little busy these days. if it will be possiible to leave as it is for now should be better for me
app/src/main/java/com/android/calendar/widget/CalendarAppWidgetModel.java
Outdated
Show resolved
Hide resolved
// populate the day buckets that this event falls into | ||
int from = Math.max(startDay, mTodayJulianDay); | ||
int to = Math.min(endDay, mMaxJulianDay); | ||
int from = Math.max(Time.getJulianDay(mEventInfo.start, new Time().getGmtOffset()), mTodayJulianDay); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give some more explanation? Why do you need a loop? Why an extra method? Why change the computation?
if (it.moveToFirst()) { | ||
return it.getString(it.getColumnIndex(databaseKey)) | ||
} | ||
} | ||
return defValue | ||
} | ||
private fun getValues(key: String?) : Map<String, Any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing new line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the loop was already present. I just move variables to meet day calculation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry to be really picky but you added a new line and four spaces, please remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the loop was already present. I just move variables to meet day calculation
Well, the PR duplicates https://github.com/Etar-Group/Etar-Calendar/pull/1279/files#diff-0c9e564dd7ccd03597c26106698536e263e2459daa6d329134ecf2f82b244c6dR70 in https://github.com/Etar-Group/Etar-Calendar/pull/1279/files#diff-0c9e564dd7ccd03597c26106698536e263e2459daa6d329134ecf2f82b244c6dR141 making the first one superfluous and adds a second loop here https://github.com/Etar-Group/Etar-Calendar/pull/1279/files#diff-0c9e564dd7ccd03597c26106698536e263e2459daa6d329134ecf2f82b244c6dR145 (that's the one I'm asking for).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I do not understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why is there the loop in https://github.com/Etar-Group/Etar-Calendar/pull/1279/files#diff-0c9e564dd7ccd03597c26106698536e263e2459daa6d329134ecf2f82b244c6dR145
- This loop should be deleted (if we keep this refactoring): https://github.com/Etar-Group/Etar-Calendar/pull/1279/files#diff-0c9e564dd7ccd03597c26106698536e263e2459daa6d329134ecf2f82b244c6dR70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I remeber well it's cause tasks has different time enconding in front of events, so I need to recalculate
I gave this a quick try and it shows tasks nicely but clicking on a task shows an empty loading screen and editing one loads a different event. Can you implement some workaround there? |
just tested now and seems to work on my android, can you provide more details? |
Not sure what to provide, what happens when you select a task from the calendar? |
it should open the task details, in readonly mode |
@jspricke @Gitsaibot any news about this pull request? |
@mebitek I experience the same behaviour. When I select a task, it shows an empty loading screen. |
Hey that feature seems to be very cool. Is there already a release planned for it? 🙂 |
@immertroll There are still some issues/incomplete parts with this feature which is the reason why this pull request has not been merged yet. It would be great if someone would complete the feature and therefore it could be added to Etar. |
It would be great to also add support for Tasks app as OpenTask is not developed anymore and it's becoming outdated. |
I added Opentask support in read-only mode:
current features
show/hide task calendars
view task on day, week, month and agenda view
view task detail with markdown support
support Opentask
share task as VTODO
add option to show/hide non-visible calendars in main preferences list
widget show tasks