Only show the schedule text for the night display and dark theme

In Android S design, night display and dark theme only show
schedule text for summary.

- Rmove redundant string resource.
- Remove redundant method in night display formatter.
- Refactor the code in dark mode preference and night display
controller.

Test: See the correct behavior in screen.
Fix: 174964139
Change-Id: I658b3073a0a6ed83f589103999c711e5430eaeb7
This commit is contained in:
Tsung-Mao Fang
2021-01-07 15:41:26 +08:00
parent cfedc19ab9
commit acab1a0364
4 changed files with 15 additions and 24 deletions

View File

@@ -17,8 +17,8 @@
package com.android.settings.display;
import android.content.Context;
import android.hardware.display.ColorDisplayManager;
import com.android.settings.R;
import java.text.DateFormat;
@@ -45,13 +45,6 @@ public class NightDisplayTimeFormatter {
return mTimeFormatter.format(c.getTime());
}
public String getAutoModeTimeSummary(Context context, ColorDisplayManager manager) {
final int summaryFormatResId =
manager.isNightDisplayActivated() ? R.string.night_display_summary_on
: R.string.night_display_summary_off;
return context.getString(summaryFormatResId, getAutoModeSummary(context, manager));
}
public String getAutoModeSummary(Context context, ColorDisplayManager manager) {
final boolean isActivated = manager.isNightDisplayActivated();
final int autoMode = manager.getNightDisplayAutoMode();