Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mebitek committed Dec 19, 2022
1 parent c68bf76 commit df5aa6b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
6 changes: 2 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="org.dmfs.permission.READ_TASKS" />
<uses-permission android:name="org.dmfs.permission.WRITE_TASKS" />
<uses-permission android:name="org.tasks.permission.READ_TASKS" />

<queries>
<package android:name="at.bitfire.davdroid" />
Expand All @@ -55,7 +54,6 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>

<provider android:authorities="org.tasks" android:exported="false" />
<provider android:authorities="org.dmfs.tasks" android:exported="false" />
</queries>
Expand Down
8 changes: 3 additions & 5 deletions app/src/main/java/com/android/calendar/AllInOneActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public void onClick(View v) {
}
});
}

private void hideActionBar() {
if (mActionBar == null) return;
mActionBar.hide();
Expand Down Expand Up @@ -986,10 +986,8 @@ public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth
} else if (itemId == R.id.action_view_agenda_tasks || itemId == R.id.action_view_agenda_events) {
FragmentManager manager = getFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
AgendaFragment frag = (AgendaFragment) manager.findFragmentById(R.id.agenda_events_list);
if (frag == null) {
frag = new AgendaFragment(0L, false);
}
long millis = Utils.timeFromIntentInMillis(getIntent());
AgendaFragment frag = new AgendaFragment(millis, false);

if (itemId == R.id.action_view_agenda_tasks) {
frag.isTask = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ public void onResume() {
boolean hideDeclined = prefs.getBoolean(
GeneralPreferences.KEY_HIDE_DECLINED, false);

AgendaWindowAdapter.AgendaItem item = mAgendaListView.getFirstVisibleAgendaItem();
if (item!=null && item.isTask) {
Time t = new Time(mTimeZone);
t.set(item.end);
mController.setTime(item.end);
mTime.set(t.toMillis());
}

mAgendaListView.setHideDeclinedEvents(hideDeclined);
if (mLastHandledEventId != -1) {
mAgendaListView.goTo(mLastHandledEventTime, mLastHandledEventId, mQuery, true, false);
Expand Down Expand Up @@ -463,6 +471,7 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun
Time t = new Time(mTimeZone);
t.setJulianDay(mJulianDayOnTop);
mController.setTime(t.toMillis());
mTime.set(t.toMillis());
// Cannot sent a message that eventually may change the layout of the views
// so instead post a runnable that will run when the layout is done
if (!mIsTabletConfig) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

import ws.xsoh.etar.R;

import java.util.Calendar;

public class AgendaListView extends ListView implements OnItemClickListener {

private static final String TAG = "AgendaListView";
Expand Down Expand Up @@ -182,6 +184,12 @@ public void onItemClick(AdapterView<?> a, View v, int position, long id) {
!mShowEventDetailsWithAgenda)) {
long startTime = item.begin;
long endTime = item.end;
if (startTime==0) {
Calendar instance = Calendar.getInstance();
instance.setTimeInMillis(endTime);
instance.add(Calendar.MINUTE, -30);
startTime = instance.getTimeInMillis();
}
// Holder in view holds the start of the specific part of a multi-day event ,
// use it for the goto
long holderStartTime;
Expand Down

0 comments on commit df5aa6b

Please sign in to comment.