getMainActivtyActionBar -> getSupportActionBar

This commit is contained in:
Martin Fietz 2015-11-30 18:29:26 +01:00
parent 99800d9873
commit 77f7826932
5 changed files with 4 additions and 13 deletions

View File

@ -137,7 +137,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
}
private String getActionbarTitle() {
return ((MainActivity)solo.getCurrentActivity()).getMainActivtyActionBar().getTitle().toString();
return ((MainActivity)solo.getCurrentActivity()).getSupportActionBar().getTitle().toString();
}
@FlakyTest(tolerance = 3)

View File

@ -15,7 +15,6 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AlertDialog;
@ -252,10 +251,6 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity
builder.create().show();
}
public ActionBar getMainActivtyActionBar() {
return getSupportActionBar();
}
public boolean isDrawerOpen() {
return drawerLayout != null && navDrawer != null && drawerLayout.isDrawerOpen(navDrawer);
}
@ -363,10 +358,6 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity
getSupportFragmentManager().popBackStack();
}
public Toolbar getToolbar() {
return toolbar;
}
private int getSelectedNavListIndex() {
String currentFragment = getLastNavFragment();
if(currentFragment == null) {

View File

@ -45,7 +45,7 @@ public class AddFeedFragment extends Fragment {
Button butSearchITunes = (Button) root.findViewById(R.id.butSearchItunes);
final MainActivity activity = (MainActivity) getActivity();
activity.getMainActivtyActionBar().setTitle(R.string.add_feed_label);
activity.getSupportActionBar().setTitle(R.string.add_feed_label);
butSearchITunes.setOnClickListener(new View.OnClickListener() {
@Override

View File

@ -45,7 +45,7 @@ public class TagFragment extends PodcastListFragment {
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
((MainActivity) getActivity()).getMainActivtyActionBar().setTitle(tag.getTitle());
((MainActivity) getActivity()).getSupportActionBar().setTitle(tag.getTitle());
}
@Override

View File

@ -80,7 +80,7 @@ public class TagListFragment extends ListFragment {
@Override
public void onResume() {
super.onResume();
((MainActivity) getActivity()).getMainActivtyActionBar().setTitle(R.string.add_feed_label);
((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.add_feed_label);
}
@Override