More theme adjustments

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save