Skip to content

Commit

Permalink
show seperator only on day description and first following item
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Feb 2, 2022
1 parent 8e8292b commit 78f1ad4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions res/layout/agenda_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
android:columnCount="3"
android:rowCount="2">
<View
android:id="@+id/seperator"
android:layout_height="1px"
android:background="@color/agenda_list_separator_color"
android:layout_column="0"
Expand Down
3 changes: 3 additions & 0 deletions src/com/android/calendar/agenda/AgendaAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public void bindView(View view, Context context, Cursor cursor) {
holder.colorChip = (ColorChipView)view.findViewById(R.id.agenda_item_color);
}

holder.seperator = view.findViewById(R.id.seperator);

holder.startTimeMilli = cursor.getLong(AgendaWindowAdapter.INDEX_BEGIN);
// Fade text if event was declined and set the color chip mode (response
boolean allDay = cursor.getInt(AgendaWindowAdapter.INDEX_ALL_DAY) != 0;
Expand Down Expand Up @@ -235,6 +237,7 @@ static class ViewHolder {
LinearLayout textContainer;
long instanceId;
ColorChipView colorChip;
View seperator;
long startTimeMilli;
boolean allDay;
boolean grayed;
Expand Down
5 changes: 5 additions & 0 deletions src/com/android/calendar/agenda/AgendaByDayAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ public View getView(int position, View convertView, ViewGroup parent) {
View itemView = mAgendaAdapter.getView(row.mPosition, convertView, parent);
AgendaAdapter.ViewHolder holder = ((AgendaAdapter.ViewHolder) itemView.getTag());
TextView title = holder.title;

if(getItemViewType(position-1)==TYPE_MEETING){
holder.seperator.setVisibility(View.INVISIBLE);
}

// The holder in the view stores information from the cursor, but the cursor has no
// notion of multi-day event and the start time of each instance of a multi-day event
// is the same. RowInfo has the correct info , so take it from there.
Expand Down

0 comments on commit 78f1ad4

Please sign in to comment.