diff options
author | Martin Fietz <marf@hadiko-99-4.hadiko.uni-karlsruhe.de> | 2015-04-18 21:36:00 +0200 |
---|---|---|
committer | Martin Fietz <marf@hadiko-99-4.hadiko.uni-karlsruhe.de> | 2015-04-18 22:12:40 +0200 |
commit | 3bf2b109bb1c386c64b80d277069ead88c79851e (patch) | |
tree | 7168ea30db041b96fe453c755fd05cfae1c1458a /app | |
parent | 3f16b4e8a2520b7b0567e40fa21874adc450c019 (diff) | |
download | AntennaPod-3bf2b109bb1c386c64b80d277069ead88c79851e.zip |
Fixes
Diffstat (limited to 'app')
4 files changed, 24 insertions, 11 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java index fea38b8e6..f0cdbbd98 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/MainActivityTest.java @@ -32,6 +32,8 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv private Solo solo; private UITestUtils uiTestUtils; + private SharedPreferences prefs; + public MainActivityTest() { super(MainActivity.class); } @@ -48,7 +50,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv adapter.close(); // override first launch preference - SharedPreferences prefs = getInstrumentation().getTargetContext().getSharedPreferences(MainActivity.PREF_NAME, Context.MODE_PRIVATE); + prefs = getInstrumentation().getTargetContext().getSharedPreferences(MainActivity.PREF_NAME, Context.MODE_PRIVATE); prefs.edit().putBoolean(MainActivity.PREF_IS_FIRST_LAUNCH, false).commit(); } @@ -56,7 +58,12 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv protected void tearDown() throws Exception { uiTestUtils.tearDown(); solo.finishOpenedActivities(); + PodDBAdapter.deleteDatabase(getInstrumentation().getTargetContext()); + + // reset preferences + prefs.edit().clear().commit(); + super.tearDown(); } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java index 0d96ad4e9..3c6caa787 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -413,6 +413,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc butShowCover = (ImageButton) findViewById(R.id.butCover); txtvTitle = (TextView) findViewById(R.id.txtvTitle); + /* drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close) { CharSequence currentTitle = getSupportActionBar().getTitle(); @@ -430,7 +431,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc getSupportActionBar().setTitle(currentTitle); supportInvalidateOptionsMenu(); } - }; + }; */ drawerToggle.setDrawerIndicatorEnabled(false); drawerLayout.setDrawerListener(drawerToggle); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index af6deb8f3..a13b1f836 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -112,21 +112,21 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); navList = (ListView) findViewById(R.id.nav_list); navDrawer = findViewById(R.id.nav_layout); + drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close) { @Override public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); - currentTitle = getSupportActionBar().getTitle(); - getSupportActionBar().setTitle(drawerTitle); - supportInvalidateOptionsMenu(); + //currentTitle = getSupportActionBar().getTitle(); + //getSupportActionBar().setTitle(drawerTitle); + //supportInvalidateOptionsMenu(); } @Override public void onDrawerClosed(View drawerView) { super.onDrawerClosed(drawerView); - getSupportActionBar().setTitle(currentTitle); - supportInvalidateOptionsMenu(); - + //getSupportActionBar().setTitle(currentTitle); + //supportInvalidateOptionsMenu(); } }; @@ -481,7 +481,8 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity public boolean onOptionsItemSelected(MenuItem item) { if (drawerToggle.onOptionsItemSelected(item)) { return true; - } else if (item.getItemId() == android.R.id.home) { + } else + if (item.getItemId() == android.R.id.home) { if (getSupportFragmentManager().getBackStackEntryCount() > 0) { dismissChildFragment(); } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java index 1dd535f2a..0cd388b9d 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -431,10 +431,14 @@ public abstract class MediaplayerActivity extends ActionBarActivity butPlay = (ImageButton) findViewById(R.id.butPlay); butRev = (ImageButton) findViewById(R.id.butRev); txtvRev = (TextView) findViewById(R.id.txtvRev); - txtvRev.setText(String.valueOf(UserPreferences.getRewindSecs())); + if(txtvRev != null) { + txtvRev.setText(String.valueOf(UserPreferences.getRewindSecs())); + } butFF = (ImageButton) findViewById(R.id.butFF); txtvFF = (TextView) findViewById(R.id.txtvFF); - txtvFF.setText(String.valueOf(UserPreferences.getFastFowardSecs())); + if(txtvFF != null) { + txtvFF.setText(String.valueOf(UserPreferences.getFastFowardSecs())); + } // SEEKBAR SETUP |