Add header to TimersList for expired timers
Bug: 7564639
Transparent header in TimersList is now always added.
Change-Id: Ia18afd737aca83ea18320eb2c474335c728c7135
diff --git a/src/com/android/deskclock/timer/TimerFragment.java b/src/com/android/deskclock/timer/TimerFragment.java
index b388da3..82aea29 100644
--- a/src/com/android/deskclock/timer/TimerFragment.java
+++ b/src/com/android/deskclock/timer/TimerFragment.java
@@ -418,22 +418,25 @@
mTimersList = (ListView)v.findViewById(R.id.timers_list);
// Use light's out if this fragment is within the DeskClock
+ LayoutParams params;
+ float dividerHeight = getResources().getDimension(R.dimen.timer_divider_height);
if (getActivity() instanceof DeskClock) {
- float dividerHeight = getResources().getDimension(R.dimen.timer_divider_height);
View footerView = inflater.inflate(R.layout.blank_footer_view, mTimersList, false);
- LayoutParams params = footerView.getLayoutParams();
+ params = footerView.getLayoutParams();
params.height -= dividerHeight;
footerView.setLayoutParams(params);
footerView.setBackgroundResource(R.color.blackish);
mTimersList.addFooterView(footerView);
- View headerView = inflater.inflate(R.layout.blank_header_view, mTimersList, false);
- params = headerView.getLayoutParams();
- params.height -= dividerHeight;
- headerView.setLayoutParams(params);
- mTimersList.addHeaderView(headerView);
} else {
mTimersList.setBackgroundColor(getResources().getColor(R.color.blackish));
}
+ // Make the top transparent header always visible so that the transition
+ // from the DeskClock app to the alert screen will be more pleasing visually.
+ View headerView = inflater.inflate(R.layout.blank_header_view, mTimersList, false);
+ params = headerView.getLayoutParams();
+ params.height -= dividerHeight;
+ headerView.setLayoutParams(params);
+ mTimersList.addHeaderView(headerView);
mNewTimerPage = v.findViewById(R.id.new_timer_page);
mTimersListPage = v.findViewById(R.id.timers_list_page);