More theme adjustments

pull/848/head
Alex Baker 5 years ago
parent 4fcba12076
commit fbedfc3c89

@ -25,7 +25,7 @@ android {
defaultConfig { defaultConfig {
testApplicationId = "org.tasks.test" testApplicationId = "org.tasks.test"
applicationId = "org.tasks" applicationId = "org.tasks"
versionCode = 602 versionCode = 603
versionName = "6.8" versionName = "6.8"
targetSdkVersion(Versions.compileSdk) targetSdkVersion(Versions.compileSdk)
minSdkVersion(Versions.minSdk) minSdkVersion(Versions.minSdk)

@ -81,7 +81,8 @@ public class OldTaskPreferences extends InjectingPreferenceActivity {
private void purgeDeletedTasks() { private void purgeDeletedTasks() {
dialogBuilder dialogBuilder
.newDialog(R.string.EPr_manage_purge_deleted_message) .newDialog()
.setMessage(R.string.EPr_manage_purge_deleted_message)
.setPositiveButton( .setPositiveButton(
android.R.string.ok, android.R.string.ok,
(dialog, which) -> (dialog, which) ->
@ -93,7 +94,8 @@ public class OldTaskPreferences extends InjectingPreferenceActivity {
private void deleteCompletedEvents() { private void deleteCompletedEvents() {
dialogBuilder dialogBuilder
.newDialog(R.string.EPr_manage_delete_completed_gcal_message) .newDialog()
.setMessage(R.string.EPr_manage_delete_completed_gcal_message)
.setPositiveButton( .setPositiveButton(
android.R.string.ok, android.R.string.ok,
(dialog, which) -> (dialog, which) ->
@ -109,7 +111,8 @@ public class OldTaskPreferences extends InjectingPreferenceActivity {
private void deleteAllCalendarEvents() { private void deleteAllCalendarEvents() {
dialogBuilder dialogBuilder
.newDialog(R.string.EPr_manage_delete_all_gcal_message) .newDialog()
.setMessage(R.string.EPr_manage_delete_all_gcal_message)
.setPositiveButton( .setPositiveButton(
android.R.string.ok, android.R.string.ok,
(dialog, which) -> (dialog, which) ->
@ -133,7 +136,8 @@ public class OldTaskPreferences extends InjectingPreferenceActivity {
private void resetPreferences() { private void resetPreferences() {
dialogBuilder dialogBuilder
.newDialog(R.string.EPr_reset_preferences_warning) .newDialog()
.setMessage(R.string.EPr_reset_preferences_warning)
.setPositiveButton( .setPositiveButton(
R.string.EPr_reset_preferences, R.string.EPr_reset_preferences,
(dialog, which) -> { (dialog, which) -> {
@ -146,7 +150,8 @@ public class OldTaskPreferences extends InjectingPreferenceActivity {
private void deleteTaskData() { private void deleteTaskData() {
dialogBuilder dialogBuilder
.newDialog(R.string.EPr_delete_task_data_warning) .newDialog()
.setMessage(R.string.EPr_delete_task_data_warning)
.setPositiveButton( .setPositiveButton(
R.string.EPr_delete_task_data, R.string.EPr_delete_task_data,
(dialog, which) -> { (dialog, which) -> {

@ -44,7 +44,8 @@ public class CalendarReminderActivity extends ThemedInjectingAppCompatActivity {
ignorePresses++; ignorePresses++;
if (ignorePresses == IGNORE_PROMPT_COUNT) { if (ignorePresses == IGNORE_PROMPT_COUNT) {
dialogBuilder dialogBuilder
.newDialog(R.string.CRA_ignore_body) .newDialog()
.setMessage(R.string.CRA_ignore_body)
.setPositiveButton( .setPositiveButton(
R.string.CRA_ignore_all, R.string.CRA_ignore_all,
(dialog, which) -> { (dialog, which) -> {

@ -34,6 +34,7 @@ import org.tasks.injection.DialogFragmentComponent;
import org.tasks.injection.ForActivity; import org.tasks.injection.ForActivity;
import org.tasks.injection.InjectingDialogFragment; import org.tasks.injection.InjectingDialogFragment;
import org.tasks.locale.Locale; import org.tasks.locale.Locale;
import org.tasks.themes.Theme;
public class NameYourPriceDialog extends InjectingDialogFragment implements OnPurchasesUpdated { public class NameYourPriceDialog extends InjectingDialogFragment implements OnPurchasesUpdated {
@ -46,6 +47,7 @@ public class NameYourPriceDialog extends InjectingDialogFragment implements OnPu
@Inject LocalBroadcastManager localBroadcastManager; @Inject LocalBroadcastManager localBroadcastManager;
@Inject Inventory inventory; @Inject Inventory inventory;
@Inject Locale locale; @Inject Locale locale;
@Inject Theme theme;
@BindView(R.id.recycler_view) @BindView(R.id.recycler_view)
RecyclerView recyclerView; RecyclerView recyclerView;
@ -90,7 +92,7 @@ public class NameYourPriceDialog extends InjectingDialogFragment implements OnPu
setWaitScreen(true); setWaitScreen(true);
adapter = new PurchaseAdapter((Activity) context, locale, this::onPriceChanged); adapter = new PurchaseAdapter(context, theme, locale, this::onPriceChanged);
buttons.addOnButtonCheckedListener(this::onButtonChecked); buttons.addOnButtonCheckedListener(this::onButtonChecked);

@ -1,6 +1,6 @@
package org.tasks.billing; package org.tasks.billing;
import android.app.Activity; import android.content.Context;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@ -9,17 +9,20 @@ import androidx.recyclerview.widget.ListAdapter;
import org.tasks.Callback; import org.tasks.Callback;
import org.tasks.R; import org.tasks.R;
import org.tasks.locale.Locale; import org.tasks.locale.Locale;
import org.tasks.themes.Theme;
public class PurchaseAdapter extends ListAdapter<Integer, PurchaseHolder> { public class PurchaseAdapter extends ListAdapter<Integer, PurchaseHolder> {
private final Activity activity; private final Context context;
private final Theme theme;
private final Locale locale; private final Locale locale;
private final Callback<Integer> onPriceChanged; private final Callback<Integer> onPriceChanged;
private int selected; private int selected;
PurchaseAdapter(Activity activity, Locale locale, Callback<Integer> onPriceChanged) { PurchaseAdapter(Context context, Theme theme, Locale locale, Callback<Integer> onPriceChanged) {
super(new DiffCallback()); super(new DiffCallback());
this.activity = activity; this.context = context;
this.theme = theme;
this.locale = locale; this.locale = locale;
this.onPriceChanged = onPriceChanged; this.onPriceChanged = onPriceChanged;
} }
@ -38,7 +41,7 @@ public class PurchaseAdapter extends ListAdapter<Integer, PurchaseHolder> {
@NonNull @NonNull
@Override @Override
public PurchaseHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public PurchaseHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = activity.getLayoutInflater().inflate(R.layout.dialog_purchase_cell, parent, false); View view = theme.getLayoutInflater(context).inflate(R.layout.dialog_purchase_cell, parent, false);
return new PurchaseHolder(view, onPriceChanged, locale); return new PurchaseHolder(view, onPriceChanged, locale);
} }

@ -409,7 +409,8 @@ public class CaldavAccountSettingsActivity extends ThemedInjectingAppCompatActiv
} }
dialogBuilder dialogBuilder
.newDialog(R.string.logout_warning, caldavAccount.getName()) .newDialog()
.setMessage(R.string.logout_warning, caldavAccount.getName())
.setPositiveButton( .setPositiveButton(
R.string.remove, R.string.remove,
(dialog, which) -> { (dialog, which) -> {

@ -136,7 +136,8 @@ public class SynchronizationPreferences extends InjectingPreferenceActivity {
String name = account.getAccount(); String name = account.getAccount();
AlertDialog alertDialog = AlertDialog alertDialog =
dialogBuilder dialogBuilder
.newDialog(R.string.logout_warning, name) .newDialog()
.setMessage(R.string.logout_warning, name)
.setPositiveButton( .setPositiveButton(
R.string.logout, R.string.logout,
(dialog, which) -> { (dialog, which) -> {

@ -43,7 +43,6 @@ public class ViewHolder extends RecyclerView.ViewHolder {
private final Activity context; private final Activity context;
private final Preferences preferences; private final Preferences preferences;
private final int textColorSecondary; private final int textColorSecondary;
private final int textColorPrimary;
private final TaskDao taskDao; private final TaskDao taskDao;
private final ViewHolderCallbacks callback; private final ViewHolderCallbacks callback;
private final DisplayMetrics metrics; private final DisplayMetrics metrics;
@ -98,7 +97,6 @@ public class ViewHolder extends RecyclerView.ViewHolder {
ChipProvider chipProvider, ChipProvider chipProvider,
int textColorOverdue, int textColorOverdue,
int textColorSecondary, int textColorSecondary,
int textColorPrimary,
TaskDao taskDao, TaskDao taskDao,
ViewHolderCallbacks callback, ViewHolderCallbacks callback,
DisplayMetrics metrics, DisplayMetrics metrics,
@ -112,7 +110,6 @@ public class ViewHolder extends RecyclerView.ViewHolder {
this.chipProvider = chipProvider; this.chipProvider = chipProvider;
this.textColorOverdue = textColorOverdue; this.textColorOverdue = textColorOverdue;
this.textColorSecondary = textColorSecondary; this.textColorSecondary = textColorSecondary;
this.textColorPrimary = textColorPrimary;
this.taskDao = taskDao; this.taskDao = taskDao;
this.callback = callback; this.callback = callback;
this.metrics = metrics; this.metrics = metrics;
@ -231,11 +228,10 @@ public class ViewHolder extends RecyclerView.ViewHolder {
private void setupTitleAndCheckbox() { private void setupTitleAndCheckbox() {
if (task.isCompleted()) { if (task.isCompleted()) {
nameView.setTextColor(textColorSecondary); nameView.setEnabled(false);
nameView.setPaintFlags(nameView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); nameView.setPaintFlags(nameView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else { } else {
nameView.setTextColor(task.isHidden() ? textColorSecondary : textColorPrimary); nameView.setEnabled(!task.isHidden());
nameView.setEnabled(true);
nameView.setPaintFlags(nameView.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); nameView.setPaintFlags(nameView.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
} }

@ -21,7 +21,6 @@ import org.tasks.ui.ChipProvider;
public class ViewHolderFactory { public class ViewHolderFactory {
private final int textColorPrimary;
private final int textColorSecondary; private final int textColorSecondary;
private final int textColorOverdue; private final int textColorOverdue;
private final Context context; private final Context context;
@ -50,7 +49,6 @@ public class ViewHolderFactory {
this.taskDao = taskDao; this.taskDao = taskDao;
this.preferences = preferences; this.preferences = preferences;
this.linkify = linkify; this.linkify = linkify;
textColorPrimary = getColor(context, R.color.text_primary);
textColorSecondary = getData(context, android.R.attr.textColorSecondary); textColorSecondary = getData(context, android.R.attr.textColorSecondary);
textColorOverdue = getColor(context, R.color.overdue); textColorOverdue = getColor(context, R.color.overdue);
background = getResourceId(context, R.attr.selectableItemBackground); background = getResourceId(context, R.attr.selectableItemBackground);
@ -71,7 +69,6 @@ public class ViewHolderFactory {
chipProvider, chipProvider,
textColorOverdue, textColorOverdue,
textColorSecondary, textColorSecondary,
textColorPrimary,
taskDao, taskDao,
callbacks, callbacks,
metrics, metrics,

@ -9,6 +9,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="1px" android:layout_marginBottom="1px"
app:cardBackgroundColor="?android:colorBackground"
app:cardCornerRadius="0dp" app:cardCornerRadius="0dp"
app:cardElevation="?attr/card_elevation" app:cardElevation="?attr/card_elevation"
app:cardPreventCornerOverlap="false"> app:cardPreventCornerOverlap="false">

@ -17,7 +17,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dip" android:layout_marginBottom="10dip"
android:gravity="center" android:gravity="center"
android:textColor="@color/text_primary"
android:textSize="24sp"/> android:textSize="24sp"/>
<TextView <TextView

@ -208,8 +208,7 @@
android:gravity="start" android:gravity="start"
android:text="@android:string/search_go" android:text="@android:string/search_go"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance" android:textAppearance="@style/TextAppearance"/>
android:textColor="@color/text_primary"/>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>

@ -15,7 +15,6 @@
android:id="@+id/title" android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"/> android:textSize="16sp"/>
<TextView <TextView

@ -63,7 +63,6 @@
android:lines="1" android:lines="1"
android:singleLine="true" android:singleLine="true"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textColor="?android:attr/textColorPrimary"
android:textSize="14sp" android:textSize="14sp"
tools:ignore="UnusedAttribute"/> tools:ignore="UnusedAttribute"/>

@ -30,7 +30,6 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/text_primary"
android:textSize="@dimen/sku_details_row_text_size"/> android:textSize="@dimen/sku_details_row_text_size"/>
<TextView <TextView

@ -51,7 +51,6 @@
android:gravity="start|top" android:gravity="start|top"
android:maxLines="2" android:maxLines="2"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"/> android:textSize="16sp"/>
<TextView <TextView

@ -18,8 +18,6 @@
<item name="android:textColorPrimary">@color/text_primary</item> <item name="android:textColorPrimary">@color/text_primary</item>
<item name="android:textColorSecondary">@color/text_secondary</item> <item name="android:textColorSecondary">@color/text_secondary</item>
<item name="android:textColorTertiary">@color/text_tertiary</item> <item name="android:textColorTertiary">@color/text_tertiary</item>
<item name="colorOnBackground">@color/text_primary</item>
<item name="colorOnSurface">@color/text_primary</item>
<item name="nnf_toolbarTheme">?attr/overlay_theme</item> <item name="nnf_toolbarTheme">?attr/overlay_theme</item>
<item name="nnf_separator_color">@color/nnf_light_separator_color</item> <item name="nnf_separator_color">@color/nnf_light_separator_color</item>
<item name="nnf_save_icon_color">?attr/colorAccent</item> <item name="nnf_save_icon_color">?attr/colorAccent</item>
@ -36,14 +34,10 @@
<style name="Tasks" parent="TasksBase"/> <style name="Tasks" parent="TasksBase"/>
<style name="TasksDialogAlert" parent="DayNightAlert"> <style name="TasksDialogAlert" parent="DayNightAlert">
<item name="android:windowBackground">@color/dialog_background</item> <item name="android:textColorPrimary">@color/text_primary</item>
<item name="colorOnBackground">@color/text_primary</item>
<item name="colorOnSurface">@color/text_primary</item>
</style> </style>
<style name="TasksDialog" parent="DayNightDialog"> <style name="TasksDialog" parent="DayNightDialog"/>
<item name="android:windowBackground">@color/dialog_background</item>
</style>
<style name="ThemeBlack" parent="Tasks"> <style name="ThemeBlack" parent="Tasks">
<item name="android:windowBackground">@color/grey_900</item> <item name="android:windowBackground">@color/grey_900</item>

Loading…
Cancel
Save