Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aee8d011 authored by Sara Ting's avatar Sara Ting Committed by Android (Google) Code Review
Browse files

Merge "Prevent empty popup notification dialog resulting when events...

Merge "Prevent empty popup notification dialog resulting when events dismissed/snoozed." into ics-ub-calendar-mr1
parents b1891684 c9129804
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -143,8 +143,6 @@ public class AlertActivity extends Activity implements OnClickListener {
        }
    }



    private final OnItemClickListener mViewListener = new OnItemClickListener() {

        @Override
@@ -215,6 +213,12 @@ public class AlertActivity extends Activity implements OnClickListener {
        }
    }

    void closeActivityIfEmpty() {
        if (mCursor != null && mCursor.getCount() == 0) {
            AlertActivity.this.finish();
        }
    }

    @Override
    protected void onStop() {
        super.onStop();
+12 −2
Original line number Diff line number Diff line
@@ -35,13 +35,15 @@ import java.util.TimeZone;

public class AlertAdapter extends ResourceCursorAdapter {

    private static AlertActivity alertActivity;
    private static boolean mFirstTime = true;
    private static int mTitleColor;
    private static int mOtherColor; // non-title fields
    private static int mPastEventColor;

    public AlertAdapter(Context context, int resource) {
        super(context, resource, null);
    public AlertAdapter(AlertActivity activity, int resource) {
        super(activity, resource, null);
        this.alertActivity = activity;
    }

    @Override
@@ -143,4 +145,12 @@ public class AlertAdapter extends ResourceCursorAdapter {
            whereView.setVisibility(View.VISIBLE);
        }
    }

    @Override
    protected void onContentChanged () {
        super.onContentChanged();

        // Prevent empty popup notification.
        alertActivity.closeActivityIfEmpty();
    }
}