Fix fonts even for list views

This commit is contained in:
serso 2016-04-30 09:38:53 +02:00
parent 70abeeeea5
commit 545caebc32
4 changed files with 12 additions and 9 deletions

View File

@ -23,7 +23,7 @@ public abstract class BaseFragment extends Fragment {
@Inject @Inject
AdUi adUi; AdUi adUi;
@Inject @Inject
Typeface typeface; public Typeface typeface;
protected BaseFragment(@LayoutRes int layout) { protected BaseFragment(@LayoutRes int layout) {
this.layout = layout; this.layout = layout;

View File

@ -36,10 +36,7 @@ import android.widget.TextView;
import butterknife.Bind; import butterknife.Bind;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import org.solovyev.android.Check; import org.solovyev.android.Check;
import org.solovyev.android.calculator.BaseFragment; import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.CalculatorActivity;
import org.solovyev.android.calculator.Keyboard;
import org.solovyev.android.calculator.R;
import org.solovyev.android.views.DividerItemDecoration; import org.solovyev.android.views.DividerItemDecoration;
import org.solovyev.common.math.MathEntity; import org.solovyev.common.math.MathEntity;
import org.solovyev.common.text.Strings; import org.solovyev.common.text.Strings;
@ -205,6 +202,7 @@ public abstract class BaseEntitiesFragment<E extends MathEntity> extends BaseFra
public EntityViewHolder(@Nonnull View view) { public EntityViewHolder(@Nonnull View view) {
super(view); super(view);
BaseActivity.fixFonts(itemView, typeface);
ButterKnife.bind(this, view); ButterKnife.bind(this, view);
view.setOnClickListener(this); view.setOnClickListener(this);
view.setOnCreateContextMenuListener(this); view.setOnCreateContextMenuListener(this);

View File

@ -24,6 +24,7 @@ package org.solovyev.android.calculator.history;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentActivity;
@ -59,6 +60,8 @@ public abstract class BaseHistoryFragment extends BaseFragment {
Editor editor; Editor editor;
@Inject @Inject
Bus bus; Bus bus;
@Inject
Typeface typeface;
@Bind(R.id.history_recyclerview) @Bind(R.id.history_recyclerview)
RecyclerView recyclerView; RecyclerView recyclerView;
private HistoryAdapter adapter; private HistoryAdapter adapter;
@ -151,6 +154,7 @@ public abstract class BaseHistoryFragment extends BaseFragment {
public HistoryViewHolder(View view) { public HistoryViewHolder(View view) {
super(view); super(view);
BaseActivity.fixFonts(view, typeface);
ButterKnife.bind(this, view); ButterKnife.bind(this, view);
view.setOnCreateContextMenuListener(this); view.setOnCreateContextMenuListener(this);
view.setOnClickListener(this); view.setOnClickListener(this);

View File

@ -3,6 +3,7 @@ package org.solovyev.android.calculator.plot;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
@ -14,10 +15,7 @@ import android.view.*;
import android.widget.TextView; import android.widget.TextView;
import butterknife.Bind; import butterknife.Bind;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import org.solovyev.android.calculator.App; import org.solovyev.android.calculator.*;
import org.solovyev.android.calculator.AppComponent;
import org.solovyev.android.calculator.BaseDialogFragment;
import org.solovyev.android.calculator.R;
import org.solovyev.android.plotter.BasePlotterListener; import org.solovyev.android.plotter.BasePlotterListener;
import org.solovyev.android.plotter.PlotFunction; import org.solovyev.android.plotter.PlotFunction;
import org.solovyev.android.plotter.PlotIconView; import org.solovyev.android.plotter.PlotIconView;
@ -35,6 +33,8 @@ public class PlotFunctionsFragment extends BaseDialogFragment {
@Inject @Inject
Plotter plotter; Plotter plotter;
@Inject
Typeface typeface;
@NonNull @NonNull
private final PlotterListener plotterListener = new PlotterListener(); private final PlotterListener plotterListener = new PlotterListener();
private Adapter adapter; private Adapter adapter;
@ -105,6 +105,7 @@ public class PlotFunctionsFragment extends BaseDialogFragment {
private ViewHolder(@NonNull View itemView) { private ViewHolder(@NonNull View itemView) {
super(itemView); super(itemView);
BaseActivity.fixFonts(itemView, typeface);
ButterKnife.bind(this, itemView); ButterKnife.bind(this, itemView);
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
itemView.setOnCreateContextMenuListener(this); itemView.setOnCreateContextMenuListener(this);