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 809b8471..f93d063a 100644 --- a/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java @@ -33,7 +33,8 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBar; -import android.support.v7.app.ActionBarActivity; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.app.AppCompatActivity; import android.util.DisplayMetrics; import android.view.View; import android.view.ViewGroup; @@ -125,7 +126,7 @@ public class ActivityUi extends BaseUi { } } - public void onCreate(@Nonnull final ActionBarActivity activity) { + public void onCreate(@Nonnull final AppCompatActivity activity) { onCreate((Activity) activity); final ActionBar actionBar = activity.getSupportActionBar(); if (actionBar != null) { @@ -161,7 +162,7 @@ public class ActivityUi extends BaseUi { } } - public void restoreSavedTab(@Nonnull ActionBarActivity activity) { + public void restoreSavedTab(@Nonnull AppCompatActivity activity) { final ActionBar actionBar = activity.getSupportActionBar(); if (actionBar != null) { if (selectedNavigationIndex >= 0 && selectedNavigationIndex < actionBar.getTabCount()) { @@ -170,7 +171,7 @@ public class ActivityUi extends BaseUi { } } - public void onSaveInstanceState(@Nonnull ActionBarActivity activity, @Nonnull Bundle outState) { + public void onSaveInstanceState(@Nonnull AppCompatActivity activity, @Nonnull Bundle outState) { onSaveInstanceState((Activity) activity, outState); } @@ -186,7 +187,7 @@ public class ActivityUi extends BaseUi { public void onPause(@Nonnull Activity activity) { } - public void onPause(@Nonnull ActionBarActivity activity) { + public void onPause(@Nonnull AppCompatActivity activity) { onPause((Activity) activity); final ActionBar actionBar = activity.getSupportActionBar(); @@ -215,11 +216,11 @@ public class ActivityUi extends BaseUi { } } - public void onDestroy(@Nonnull ActionBarActivity activity) { + public void onDestroy(@Nonnull AppCompatActivity activity) { this.onDestroy((Activity) activity); } - public void addTab(@Nonnull ActionBarActivity activity, + public void addTab(@Nonnull AppCompatActivity activity, @Nonnull String tag, @Nonnull Class fragmentClass, @Nullable Bundle fragmentArgs, @@ -236,11 +237,11 @@ public class ActivityUi extends BaseUi { actionBar.addTab(tab); } - public void addTab(@Nonnull ActionBarActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) { + 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 setFragment(@Nonnull ActionBarActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) { + public void setFragment(@Nonnull AppCompatActivity activity, @Nonnull CalculatorFragmentType fragmentType, @Nullable Bundle fragmentArgs, int parentViewId) { final FragmentManager fm = activity.getSupportFragmentManager(); Fragment fragment = fm.findFragmentByTag(fragmentType.getFragmentTag()); @@ -259,7 +260,7 @@ public class ActivityUi extends BaseUi { } } - public void selectTab(@Nonnull ActionBarActivity activity, @Nonnull CalculatorFragmentType fragmentType) { + 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); @@ -293,7 +294,7 @@ public class ActivityUi extends BaseUi { return layout; } - public void onResume(@Nonnull ActionBarActivity activity) { + public void onResume(@Nonnull AppCompatActivity activity) { onResume((Activity) activity); final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(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 f8e91f7c..d0e848c5 100644 --- a/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java @@ -2,13 +2,13 @@ package org.solovyev.android.calculator; import android.os.Bundle; import android.support.annotation.LayoutRes; -import android.support.v7.app.ActionBarActivity; +import android.support.v7.app.AppCompatActivity; import android.view.KeyEvent; import android.view.MenuItem; import javax.annotation.Nonnull; -public class BaseActivity extends ActionBarActivity { +public class BaseActivity extends AppCompatActivity { @Nonnull protected final ActivityUi ui; diff --git a/app/src/main/java/org/solovyev/android/sherlock/FragmentItemImpl.java b/app/src/main/java/org/solovyev/android/sherlock/FragmentItemImpl.java index 91817c70..3b276c61 100644 --- a/app/src/main/java/org/solovyev/android/sherlock/FragmentItemImpl.java +++ b/app/src/main/java/org/solovyev/android/sherlock/FragmentItemImpl.java @@ -26,7 +26,7 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.ActionBarActivity; +import android.support.v7.app.AppCompatActivity; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -39,7 +39,7 @@ import javax.annotation.Nullable; public class FragmentItemImpl implements FragmentItem { @Nonnull - private final ActionBarActivity activity; + private final AppCompatActivity activity; // Fragment @@ -65,7 +65,7 @@ public class FragmentItemImpl implements FragmentItem { * @param parentViewId parent view id */ - public FragmentItemImpl(@Nonnull ActionBarActivity activity, + public FragmentItemImpl(@Nonnull AppCompatActivity activity, @Nonnull String tag, @Nonnull Class fragmentClass, @Nullable Bundle fragmentArgs, diff --git a/app/src/main/java/org/solovyev/android/sherlock/tabs/ActionBarFragmentTabListener.java b/app/src/main/java/org/solovyev/android/sherlock/tabs/ActionBarFragmentTabListener.java index 285c88ad..695726d2 100644 --- a/app/src/main/java/org/solovyev/android/sherlock/tabs/ActionBarFragmentTabListener.java +++ b/app/src/main/java/org/solovyev/android/sherlock/tabs/ActionBarFragmentTabListener.java @@ -26,8 +26,7 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBar; -import android.support.v7.app.ActionBarActivity; - +import android.support.v7.app.AppCompatActivity; import org.solovyev.android.sherlock.FragmentItem; import org.solovyev.android.sherlock.FragmentItemImpl; @@ -53,7 +52,7 @@ public class ActionBarFragmentTabListener implements ActionBar.TabListener { * @param parentViewId parent view id */ - public ActionBarFragmentTabListener(@Nonnull ActionBarActivity activity, + public ActionBarFragmentTabListener(@Nonnull AppCompatActivity activity, @Nonnull String tag, @Nonnull Class fragmentClass, @Nullable Bundle fragmentArgs,