From 545caebc329eedd339d01543632a3c102f7a463b Mon Sep 17 00:00:00 2001 From: serso Date: Sat, 30 Apr 2016 09:38:53 +0200 Subject: [PATCH] Fix fonts even for list views --- .../org/solovyev/android/calculator/BaseFragment.java | 2 +- .../calculator/entities/BaseEntitiesFragment.java | 6 ++---- .../android/calculator/history/BaseHistoryFragment.java | 4 ++++ .../android/calculator/plot/PlotFunctionsFragment.java | 9 +++++---- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java b/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java index 81d93632..ac09fc8c 100644 --- a/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java @@ -23,7 +23,7 @@ public abstract class BaseFragment extends Fragment { @Inject AdUi adUi; @Inject - Typeface typeface; + public Typeface typeface; protected BaseFragment(@LayoutRes int layout) { this.layout = layout; diff --git a/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesFragment.java b/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesFragment.java index 8f893ea7..ae3794d2 100644 --- a/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesFragment.java @@ -36,10 +36,7 @@ import android.widget.TextView; import butterknife.Bind; import butterknife.ButterKnife; import org.solovyev.android.Check; -import org.solovyev.android.calculator.BaseFragment; -import org.solovyev.android.calculator.CalculatorActivity; -import org.solovyev.android.calculator.Keyboard; -import org.solovyev.android.calculator.R; +import org.solovyev.android.calculator.*; import org.solovyev.android.views.DividerItemDecoration; import org.solovyev.common.math.MathEntity; import org.solovyev.common.text.Strings; @@ -205,6 +202,7 @@ public abstract class BaseEntitiesFragment extends BaseFra public EntityViewHolder(@Nonnull View view) { super(view); + BaseActivity.fixFonts(itemView, typeface); ButterKnife.bind(this, view); view.setOnClickListener(this); view.setOnCreateContextMenuListener(this); diff --git a/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java b/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java index 228faf61..6d95a33b 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java @@ -24,6 +24,7 @@ package org.solovyev.android.calculator.history; import android.app.Activity; import android.content.Context; +import android.graphics.Typeface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.FragmentActivity; @@ -59,6 +60,8 @@ public abstract class BaseHistoryFragment extends BaseFragment { Editor editor; @Inject Bus bus; + @Inject + Typeface typeface; @Bind(R.id.history_recyclerview) RecyclerView recyclerView; private HistoryAdapter adapter; @@ -151,6 +154,7 @@ public abstract class BaseHistoryFragment extends BaseFragment { public HistoryViewHolder(View view) { super(view); + BaseActivity.fixFonts(view, typeface); ButterKnife.bind(this, view); view.setOnCreateContextMenuListener(this); view.setOnClickListener(this); diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java index cb2f2b9f..5b6efc0a 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java @@ -3,6 +3,7 @@ package org.solovyev.android.calculator.plot; import android.annotation.SuppressLint; import android.content.Context; import android.content.DialogInterface; +import android.graphics.Typeface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -14,10 +15,7 @@ import android.view.*; import android.widget.TextView; import butterknife.Bind; import butterknife.ButterKnife; -import org.solovyev.android.calculator.App; -import org.solovyev.android.calculator.AppComponent; -import org.solovyev.android.calculator.BaseDialogFragment; -import org.solovyev.android.calculator.R; +import org.solovyev.android.calculator.*; import org.solovyev.android.plotter.BasePlotterListener; import org.solovyev.android.plotter.PlotFunction; import org.solovyev.android.plotter.PlotIconView; @@ -35,6 +33,8 @@ public class PlotFunctionsFragment extends BaseDialogFragment { @Inject Plotter plotter; + @Inject + Typeface typeface; @NonNull private final PlotterListener plotterListener = new PlotterListener(); private Adapter adapter; @@ -105,6 +105,7 @@ public class PlotFunctionsFragment extends BaseDialogFragment { private ViewHolder(@NonNull View itemView) { super(itemView); + BaseActivity.fixFonts(itemView, typeface); ButterKnife.bind(this, itemView); itemView.setOnClickListener(this); itemView.setOnCreateContextMenuListener(this);