From dbf4c14d427cd99a303c75cb355dcddd2abcbfa3 Mon Sep 17 00:00:00 2001 From: serso Date: Sat, 6 Feb 2016 10:48:44 +0100 Subject: [PATCH] CalculatorFragmentType -> FragmentTab --- .../android/calculator/ActivityUi.java | 34 ++++-------- .../android/calculator/BaseActivity.java | 12 ++--- .../android/calculator/BaseFragment.java | 4 +- .../calculator/CalculatorActivity.java | 10 ++-- ...atorFragmentType.java => FragmentTab.java} | 52 ++++++------------- .../calculator/about/AboutActivity.java | 6 +-- .../calculator/about/AboutFragment.java | 2 +- .../about/ReleaseNotesFragment.java | 2 +- .../functions/FunctionsActivity.java | 6 +-- .../functions/FunctionsFragment.java | 2 +- .../history/BaseHistoryFragment.java | 4 +- .../calculator/history/HistoryActivity.java | 4 +- .../history/RecentHistoryFragment.java | 6 +-- .../history/SavedHistoryFragment.java | 4 +- .../matrix/CalculatorMatrixActivity.java | 4 +- .../calculator/matrix/EditMatrixFragment.java | 2 +- .../operators/OperatorsActivity.java | 4 +- .../operators/OperatorsFragment.java | 2 +- .../preferences/PurchaseDialogActivity.java | 2 +- .../variables/VariablesActivity.java | 4 +- .../variables/VariablesFragment.java | 2 +- 21 files changed, 66 insertions(+), 102 deletions(-) rename app/src/main/java/org/solovyev/android/calculator/{CalculatorFragmentType.java => FragmentTab.java} (73%) diff --git a/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java b/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java index 292ca93c..87542e69 100644 --- a/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java @@ -195,14 +195,14 @@ public class ActivityUi extends BaseUi { if (selectedNavigationIndex >= 0) { final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity); final SharedPreferences.Editor editor = preferences.edit(); - editor.putInt(getSavedTabPreferenceName(activity), selectedNavigationIndex); + editor.putInt(makeLastTabKey(activity), selectedNavigationIndex); editor.apply(); } } } @Nonnull - private String getSavedTabPreferenceName(@Nonnull Activity activity) { + private static String makeLastTabKey(@Nonnull Activity activity) { return "tab_" + activity.getClass().getSimpleName(); } @@ -246,18 +246,18 @@ public class ActivityUi extends BaseUi { actionBar.addTab(tab); } - public void addTab(@Nonnull AppCompatActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) { - addTab(activity, fragmentType.getFragmentTag(), fragmentType.getFragmentClass(), fragmentArgs, fragmentType.getDefaultTitleResId(), parentViewId); + public void addTab(@Nonnull AppCompatActivity activity, @Nonnull FragmentTab tab, @Nullable Bundle fragmentArgs, int parentViewId) { + addTab(activity, tab.tag, tab.type, fragmentArgs, tab.title, parentViewId); } - public void setFragment(@Nonnull AppCompatActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) { + public void setFragment(@Nonnull AppCompatActivity activity, @Nonnull FragmentTab tab, @Nullable Bundle fragmentArgs, int parentViewId) { final FragmentManager fm = activity.getSupportFragmentManager(); - Fragment fragment = fm.findFragmentByTag(fragmentType.getFragmentTag()); + Fragment fragment = fm.findFragmentByTag(tab.tag); if (fragment == null) { - fragment = Fragment.instantiate(activity, fragmentType.getFragmentClass().getName(), fragmentArgs); + fragment = Fragment.instantiate(activity, tab.type.getName(), fragmentArgs); final FragmentTransaction ft = fm.beginTransaction(); - ft.add(parentViewId, fragment, fragmentType.getFragmentTag()); + ft.add(parentViewId, fragment, tab.tag); ft.commit(); } else { if (fragment.isDetached()) { @@ -265,25 +265,9 @@ public class ActivityUi extends BaseUi { ft.attach(fragment); ft.commit(); } - } } - public void selectTab(@Nonnull AppCompatActivity activity, @Nonnull CalculatorFragmentType fragmentType) { - final ActionBar actionBar = activity.getSupportActionBar(); - for (int i = 0; i < actionBar.getTabCount(); i++) { - final ActionBar.Tab tab = actionBar.getTabAt(i); - if (tab != null && fragmentType.getFragmentTag().equals(tab.getTag())) { - actionBar.setSelectedNavigationItem(i); - break; - } - } - } - - public int getLayoutId() { - return layoutId; - } - public void setLayoutId(int layoutId) { this.layoutId = layoutId; } @@ -302,7 +286,7 @@ public class ActivityUi extends BaseUi { onResume((Activity) activity); final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity); - selectedNavigationIndex = preferences.getInt(getSavedTabPreferenceName(activity), -1); + selectedNavigationIndex = preferences.getInt(makeLastTabKey(activity), -1); restoreSavedTab(activity); } diff --git a/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java b/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java index 57892cf7..a80f6206 100644 --- a/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java @@ -2,7 +2,6 @@ package org.solovyev.android.calculator; import android.os.Bundle; import android.support.annotation.LayoutRes; -import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; import android.view.KeyEvent; import android.view.MenuItem; @@ -102,16 +101,15 @@ public class BaseActivity extends AppCompatActivity { return super.onOptionsItemSelected(item); } - protected final void addTab(@Nonnull Category category, @Nonnull CalculatorFragmentType type) { + protected final void addTab(@Nonnull Category category, @Nonnull FragmentTab tab) { final CharSequence title = getString(category.title()); - addTab(category, type, title); + addTab(category, tab, title); } - protected final void addTab(@Nonnull Category category, @Nonnull CalculatorFragmentType type, @Nullable CharSequence title) { + protected final void addTab(@Nonnull Category category, @Nonnull FragmentTab tab, @Nullable CharSequence title) { final Bundle arguments = new Bundle(1); arguments.putString(BaseEntitiesFragment.ARG_CATEGORY, category.name()); - final String fragmentTag = type.createSubFragmentTag(category.name()); - final Class fragmentClass = type.getFragmentClass(); - ui.addTab(this, fragmentTag, fragmentClass, arguments, title, R.id.main_layout); + final String fragmentTag = tab.subTag(category.name()); + ui.addTab(this, fragmentTag, tab.type, arguments, title, R.id.main_layout); } } 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 cb8bad3e..bb48efca 100644 --- a/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/BaseFragment.java @@ -26,8 +26,8 @@ public abstract class BaseFragment extends Fragment { protected abstract FragmentUi createUi(); @Nonnull - protected final FragmentUi createUi(@Nonnull CalculatorFragmentType type) { - return new FragmentUi(type.getDefaultLayoutId(), type.getDefaultTitleResId(), false); + protected final FragmentUi createUi(@Nonnull FragmentTab tab) { + return new FragmentUi(tab.layout, tab.title, false); } protected void inject(@Nonnull AppComponent component) { diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java b/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java index 298b3bf4..f2b0a4fe 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java @@ -158,11 +158,11 @@ public class CalculatorActivity extends BaseActivity implements SharedPreference super.onCreate(savedInstanceState); if (isMultiPane()) { - ui.addTab(this, CalculatorFragmentType.history, null, R.id.main_second_pane); - ui.addTab(this, CalculatorFragmentType.saved_history, null, R.id.main_second_pane); - ui.addTab(this, CalculatorFragmentType.variables, null, R.id.main_second_pane); - ui.addTab(this, CalculatorFragmentType.functions, null, R.id.main_second_pane); - ui.addTab(this, CalculatorFragmentType.operators, null, R.id.main_second_pane); + ui.addTab(this, FragmentTab.history, null, R.id.main_second_pane); + ui.addTab(this, FragmentTab.saved_history, null, R.id.main_second_pane); + ui.addTab(this, FragmentTab.variables, null, R.id.main_second_pane); + ui.addTab(this, FragmentTab.functions, null, R.id.main_second_pane); + ui.addTab(this, FragmentTab.operators, null, R.id.main_second_pane); } else { final ActionBar actionBar = getSupportActionBar(); if (Build.VERSION.SDK_INT <= GINGERBREAD_MR1 || (Build.VERSION.SDK_INT >= ICE_CREAM_SANDWICH && hasPermanentMenuKey())) { diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorFragmentType.java b/app/src/main/java/org/solovyev/android/calculator/FragmentTab.java similarity index 73% rename from app/src/main/java/org/solovyev/android/calculator/CalculatorFragmentType.java rename to app/src/main/java/org/solovyev/android/calculator/FragmentTab.java index 46f97425..eb1ff24f 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorFragmentType.java +++ b/app/src/main/java/org/solovyev/android/calculator/FragmentTab.java @@ -22,6 +22,8 @@ package org.solovyev.android.calculator; +import android.support.annotation.LayoutRes; +import android.support.annotation.StringRes; import android.support.v4.app.Fragment; import org.solovyev.android.calculator.about.AboutFragment; @@ -36,12 +38,7 @@ import org.solovyev.android.calculator.preferences.PurchaseDialogActivity; import javax.annotation.Nonnull; -/** - * User: Solovyev_S - * Date: 03.10.12 - * Time: 11:30 - */ -public enum CalculatorFragmentType { +public enum FragmentTab { editor(EditorFragment.class, R.layout.cpp_app_editor, R.string.editor), //display(CalculatorHistoryFragment.class, "history", R.layout.fragment_history, R.string.c_history), @@ -60,39 +57,24 @@ public enum CalculatorFragmentType { matrix_edit(EditMatrixFragment.class, R.layout.matrix_edit_fragment, R.string.c_release_notes), release_notes(ReleaseNotesFragment.class, R.layout.release_notes_fragment, R.string.c_release_notes); - private final int defaultLayoutId; + @LayoutRes + public final int layout; @Nonnull - private Class fragmentClass; - private int defaultTitleResId; + public final Class type; + @StringRes + public final int title; + @Nonnull + public final String tag; - CalculatorFragmentType(@Nonnull Class fragmentClass, - int defaultLayoutId, - int defaultTitleResId) { - this.fragmentClass = fragmentClass; - this.defaultLayoutId = defaultLayoutId; - this.defaultTitleResId = defaultTitleResId; + FragmentTab(@Nonnull Class type, int layout, int title) { + this.type = type; + this.layout = layout; + this.title = title; + this.tag = name(); } @Nonnull - public String getFragmentTag() { - return this.name(); - } - - public int getDefaultTitleResId() { - return defaultTitleResId; - } - - @Nonnull - public Class getFragmentClass() { - return fragmentClass; - } - - public int getDefaultLayoutId() { - return defaultLayoutId; - } - - @Nonnull - public String createSubFragmentTag(@Nonnull String subFragmentTag) { - return this.getFragmentTag() + "_" + subFragmentTag; + public String subTag(@Nonnull String subTag) { + return tag + "_" + subTag; } } diff --git a/app/src/main/java/org/solovyev/android/calculator/about/AboutActivity.java b/app/src/main/java/org/solovyev/android/calculator/about/AboutActivity.java index 7b6fd704..eac7daa8 100644 --- a/app/src/main/java/org/solovyev/android/calculator/about/AboutActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/about/AboutActivity.java @@ -24,7 +24,7 @@ package org.solovyev.android.calculator.about; import android.os.Bundle; -import org.solovyev.android.calculator.CalculatorFragmentType; +import org.solovyev.android.calculator.FragmentTab; import org.solovyev.android.calculator.EmptyActivity; import org.solovyev.android.calculator.R; @@ -41,7 +41,7 @@ public class AboutActivity extends EmptyActivity { public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - getUi().addTab(this, CalculatorFragmentType.about, null, R.id.main_layout); - getUi().addTab(this, CalculatorFragmentType.release_notes, null, R.id.main_layout); + getUi().addTab(this, FragmentTab.about, null, R.id.main_layout); + getUi().addTab(this, FragmentTab.release_notes, null, R.id.main_layout); } } diff --git a/app/src/main/java/org/solovyev/android/calculator/about/AboutFragment.java b/app/src/main/java/org/solovyev/android/calculator/about/AboutFragment.java index 0873dec5..16268d10 100644 --- a/app/src/main/java/org/solovyev/android/calculator/about/AboutFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/about/AboutFragment.java @@ -38,7 +38,7 @@ import org.solovyev.android.calculator.R; import javax.annotation.Nonnull; import static android.view.View.GONE; -import static org.solovyev.android.calculator.CalculatorFragmentType.about; +import static org.solovyev.android.calculator.FragmentTab.about; import static org.solovyev.common.text.Strings.isEmpty; public class AboutFragment extends BaseFragment { diff --git a/app/src/main/java/org/solovyev/android/calculator/about/ReleaseNotesFragment.java b/app/src/main/java/org/solovyev/android/calculator/about/ReleaseNotesFragment.java index 40838a2a..345af06e 100644 --- a/app/src/main/java/org/solovyev/android/calculator/about/ReleaseNotesFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/about/ReleaseNotesFragment.java @@ -38,7 +38,7 @@ import org.solovyev.android.calculator.release.ReleaseNotes; import javax.annotation.Nonnull; -import static org.solovyev.android.calculator.CalculatorFragmentType.release_notes; +import static org.solovyev.android.calculator.FragmentTab.release_notes; public class ReleaseNotesFragment extends BaseFragment { diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsActivity.java b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsActivity.java index e7bf0f66..5b6e2c55 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsActivity.java @@ -24,7 +24,7 @@ package org.solovyev.android.calculator.functions; import android.os.Bundle; import org.solovyev.android.calculator.BaseActivity; -import org.solovyev.android.calculator.CalculatorFragmentType; +import org.solovyev.android.calculator.FragmentTab; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.operators.OperatorCategory; @@ -43,7 +43,7 @@ public class FunctionsActivity extends BaseActivity { super.onCreate(savedInstanceState); for (FunctionCategory category : FunctionCategory.values()) { - addTab(category, CalculatorFragmentType.functions); + addTab(category, FragmentTab.functions); } for (OperatorCategory category : OperatorCategory.values()) { @@ -53,7 +53,7 @@ public class FunctionsActivity extends BaseActivity { } else { title = getString(category.title()); } - addTab(category, CalculatorFragmentType.operators, title); + addTab(category, FragmentTab.operators, title); } if (savedInstanceState == null) { diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsFragment.java b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsFragment.java index f6ea875a..1b3c8767 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsFragment.java @@ -43,7 +43,7 @@ import javax.inject.Inject; import java.util.ArrayList; import java.util.List; -import static org.solovyev.android.calculator.CalculatorFragmentType.functions; +import static org.solovyev.android.calculator.FragmentTab.functions; public class FunctionsFragment extends BaseEntitiesFragment { 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 a13a4456..c1a6f31b 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 @@ -68,8 +68,8 @@ public abstract class BaseHistoryFragment extends BaseFragment { FloatingActionButton fab; private HistoryAdapter adapter; - protected BaseHistoryFragment(@Nonnull CalculatorFragmentType type) { - recentHistory = type == CalculatorFragmentType.history; + protected BaseHistoryFragment(boolean recentHistory) { + this.recentHistory = recentHistory; } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/history/HistoryActivity.java b/app/src/main/java/org/solovyev/android/calculator/history/HistoryActivity.java index 1b89f13e..4100cfaf 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/HistoryActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/HistoryActivity.java @@ -29,8 +29,8 @@ import org.solovyev.android.calculator.R; import javax.annotation.Nullable; -import static org.solovyev.android.calculator.CalculatorFragmentType.history; -import static org.solovyev.android.calculator.CalculatorFragmentType.saved_history; +import static org.solovyev.android.calculator.FragmentTab.history; +import static org.solovyev.android.calculator.FragmentTab.saved_history; public class HistoryActivity extends BaseActivity { diff --git a/app/src/main/java/org/solovyev/android/calculator/history/RecentHistoryFragment.java b/app/src/main/java/org/solovyev/android/calculator/history/RecentHistoryFragment.java index 832273b2..f216e48a 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/RecentHistoryFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/RecentHistoryFragment.java @@ -22,7 +22,7 @@ package org.solovyev.android.calculator.history; -import org.solovyev.android.calculator.CalculatorFragmentType; +import org.solovyev.android.calculator.FragmentTab; import org.solovyev.android.calculator.FragmentUi; import javax.annotation.Nonnull; @@ -30,12 +30,12 @@ import javax.annotation.Nonnull; public class RecentHistoryFragment extends BaseHistoryFragment { public RecentHistoryFragment() { - super(CalculatorFragmentType.history); + super(true); } @Nonnull @Override protected FragmentUi createUi() { - return createUi(CalculatorFragmentType.history); + return createUi(FragmentTab.history); } } diff --git a/app/src/main/java/org/solovyev/android/calculator/history/SavedHistoryFragment.java b/app/src/main/java/org/solovyev/android/calculator/history/SavedHistoryFragment.java index d667b3d4..ca2c3e17 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/SavedHistoryFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/SavedHistoryFragment.java @@ -26,12 +26,12 @@ import org.solovyev.android.calculator.FragmentUi; import javax.annotation.Nonnull; -import static org.solovyev.android.calculator.CalculatorFragmentType.saved_history; +import static org.solovyev.android.calculator.FragmentTab.saved_history; public class SavedHistoryFragment extends BaseHistoryFragment { public SavedHistoryFragment() { - super(saved_history); + super(false); } @Nonnull diff --git a/app/src/main/java/org/solovyev/android/calculator/matrix/CalculatorMatrixActivity.java b/app/src/main/java/org/solovyev/android/calculator/matrix/CalculatorMatrixActivity.java index 38f56f1b..dd43faf4 100644 --- a/app/src/main/java/org/solovyev/android/calculator/matrix/CalculatorMatrixActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/matrix/CalculatorMatrixActivity.java @@ -24,7 +24,7 @@ package org.solovyev.android.calculator.matrix; import android.os.Bundle; -import org.solovyev.android.calculator.CalculatorFragmentType; +import org.solovyev.android.calculator.FragmentTab; import org.solovyev.android.calculator.EmptyActivity; import org.solovyev.android.calculator.R; @@ -42,6 +42,6 @@ public class CalculatorMatrixActivity extends EmptyActivity { super.onCreate(savedInstanceState); getSupportActionBar().setNavigationMode(NAVIGATION_MODE_STANDARD); - getUi().setFragment(this, CalculatorFragmentType.matrix_edit, null, R.id.main_layout); + getUi().setFragment(this, FragmentTab.matrix_edit, null, R.id.main_layout); } } diff --git a/app/src/main/java/org/solovyev/android/calculator/matrix/EditMatrixFragment.java b/app/src/main/java/org/solovyev/android/calculator/matrix/EditMatrixFragment.java index d1839fef..2c9528e5 100644 --- a/app/src/main/java/org/solovyev/android/calculator/matrix/EditMatrixFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/matrix/EditMatrixFragment.java @@ -32,7 +32,7 @@ import org.solovyev.android.view.Picker; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import static org.solovyev.android.calculator.CalculatorFragmentType.matrix_edit; +import static org.solovyev.android.calculator.FragmentTab.matrix_edit; public class EditMatrixFragment extends BaseFragment implements Picker.OnChangedListener { private static final int MAX_COUNT = 10; diff --git a/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsActivity.java b/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsActivity.java index 39c3ab50..6e6a4f55 100644 --- a/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsActivity.java @@ -24,7 +24,7 @@ package org.solovyev.android.calculator.operators; import android.os.Bundle; import org.solovyev.android.calculator.BaseActivity; -import org.solovyev.android.calculator.CalculatorFragmentType; +import org.solovyev.android.calculator.FragmentTab; import org.solovyev.android.calculator.R; import javax.annotation.Nullable; @@ -40,7 +40,7 @@ public class OperatorsActivity extends BaseActivity { super.onCreate(savedInstanceState); for (OperatorCategory category : OperatorCategory.values()) { - addTab(category, CalculatorFragmentType.operators); + addTab(category, FragmentTab.operators); } } } diff --git a/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsFragment.java b/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsFragment.java index 9bde9107..3915a9c6 100644 --- a/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsFragment.java @@ -37,7 +37,7 @@ import javax.inject.Inject; import java.util.ArrayList; import java.util.List; -import static org.solovyev.android.calculator.CalculatorFragmentType.operators; +import static org.solovyev.android.calculator.FragmentTab.operators; public class OperatorsFragment extends BaseEntitiesFragment { diff --git a/app/src/main/java/org/solovyev/android/calculator/preferences/PurchaseDialogActivity.java b/app/src/main/java/org/solovyev/android/calculator/preferences/PurchaseDialogActivity.java index 83402f07..4e96adb7 100644 --- a/app/src/main/java/org/solovyev/android/calculator/preferences/PurchaseDialogActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/preferences/PurchaseDialogActivity.java @@ -45,7 +45,7 @@ import org.solovyev.android.fragments.FragmentUtils; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import static org.solovyev.android.calculator.CalculatorFragmentType.purchase_dialog; +import static org.solovyev.android.calculator.FragmentTab.purchase_dialog; public class PurchaseDialogActivity extends BaseActivity { diff --git a/app/src/main/java/org/solovyev/android/calculator/variables/VariablesActivity.java b/app/src/main/java/org/solovyev/android/calculator/variables/VariablesActivity.java index 66109359..01c7ccee 100644 --- a/app/src/main/java/org/solovyev/android/calculator/variables/VariablesActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/variables/VariablesActivity.java @@ -24,7 +24,7 @@ package org.solovyev.android.calculator.variables; import android.os.Bundle; import org.solovyev.android.calculator.BaseActivity; -import org.solovyev.android.calculator.CalculatorFragmentType; +import org.solovyev.android.calculator.FragmentTab; import org.solovyev.android.calculator.R; import javax.annotation.Nullable; @@ -42,7 +42,7 @@ public class VariablesActivity extends BaseActivity { super.onCreate(savedInstanceState); for (VariableCategory category : VariableCategory.values()) { - addTab(category, CalculatorFragmentType.variables); + addTab(category, FragmentTab.variables); } if (savedInstanceState == null) { diff --git a/app/src/main/java/org/solovyev/android/calculator/variables/VariablesFragment.java b/app/src/main/java/org/solovyev/android/calculator/variables/VariablesFragment.java index 6f064754..83aec8d3 100644 --- a/app/src/main/java/org/solovyev/android/calculator/variables/VariablesFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/variables/VariablesFragment.java @@ -46,7 +46,7 @@ import javax.inject.Inject; import java.util.ArrayList; import java.util.List; -import static org.solovyev.android.calculator.CalculatorFragmentType.variables; +import static org.solovyev.android.calculator.FragmentTab.variables; public class VariablesFragment extends BaseEntitiesFragment {