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 254749cd6..add0ca62d 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -92,8 +92,8 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity private ActionBarDrawerToggle drawerToggle; - private CharSequence drawerTitle; private CharSequence currentTitle; + private String currentFragment; @Override public void onCreate(Bundle savedInstanceState) { @@ -107,7 +107,7 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity setSupportActionBar(toolbar); getSupportActionBar().setElevation(3.0f); - drawerTitle = currentTitle = getTitle(); + currentTitle = getTitle(); drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); navList = (ListView) findViewById(R.id.nav_list); @@ -173,6 +173,7 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity } private void saveLastNavFragment(String tag) { + Log.d(TAG, "saveLastNavFragment(tag: " + tag +")"); SharedPreferences prefs = getSharedPreferences(PREF_NAME, MODE_PRIVATE); SharedPreferences.Editor edit = prefs.edit(); if(tag != null) { @@ -180,12 +181,15 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity } else { edit.remove(PREF_LAST_FRAGMENT_TAG); } + currentFragment = tag; edit.commit(); } private String getLastNavFragment() { SharedPreferences prefs = getSharedPreferences(PREF_NAME, MODE_PRIVATE); - return prefs.getString(PREF_LAST_FRAGMENT_TAG, QueueFragment.TAG); + String lastFragment = prefs.getString(PREF_LAST_FRAGMENT_TAG, QueueFragment.TAG); + Log.d(TAG, "getLastNavFragment() -> " + lastFragment); + return lastFragment; } private void checkFirstLaunch() { @@ -251,6 +255,7 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity } public void loadFragment(int index, Bundle args) { + Log.d(TAG, "loadFragment(index: " + index + ", args: " + args +")"); if (index < navAdapter.getSubscriptionOffset()) { String tag = navAdapter.getTags().get(index); loadFragment(tag, args); @@ -261,7 +266,7 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity } public void loadFragment(final String tag, Bundle args) { - Log.d(TAG, "loadFragment(\"" + tag + "\", " + args + ")"); + Log.d(TAG, "loadFragment(tag: " + tag + ", args: " + args + ")"); Fragment fragment = null; switch (tag) { case QueueFragment.TAG: @@ -543,10 +548,10 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity navAdapter.notifyDataSetChanged(); String lastFragment = getLastNavFragment(); - if(!ArrayUtils.contains(NAV_DRAWER_TAGS, lastFragment)) { + if(currentFragment != lastFragment && + !ArrayUtils.contains(NAV_DRAWER_TAGS, lastFragment)) { long feedId = Long.valueOf(lastFragment); loadFeedFragmentById(feedId); - saveLastNavFragment(null); } if (handleIntent) { diff --git a/app/src/main/res/layout/cover_fragment.xml b/app/src/main/res/layout/cover_fragment.xml index 18540aa1f..4bbdeae06 100644 --- a/app/src/main/res/layout/cover_fragment.xml +++ b/app/src/main/res/layout/cover_fragment.xml @@ -13,7 +13,7 @@ android:layout_height="match_parent" android:layout_gravity="center" android:adjustViewBounds="true" - android:scaleType="centerInside" + android:scaleType="fitCenter" tools:src="@android:drawable/sym_def_app_icon" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/feedinfo.xml b/app/src/main/res/layout/feedinfo.xml index db897865c..4dab1e189 100644 --- a/app/src/main/res/layout/feedinfo.xml +++ b/app/src/main/res/layout/feedinfo.xml @@ -20,8 +20,8 @@ @@ -52,7 +54,7 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" - android:scrollbarStyle="outsideInset" + android:scrollbarStyle="outsideOverlay" android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingBottom="8dp"> @@ -119,7 +121,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="8dp" - android:layout_marginBottom="8dp" app:layout_row="2" app:layout_column="0" android:lines="1" @@ -129,10 +130,13 @@