Merge pull request #926 from mfietz/issue/919-921-923
Fixes Queue not opening, small podcasts images not scaling up and long URL not wrapping
This commit is contained in:
commit
b5fed017d3
|
@ -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) {
|
||||
|
|
|
@ -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" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -20,8 +20,8 @@
|
|||
<ImageView
|
||||
android:id="@+id/imgvCover"
|
||||
android:contentDescription="@string/cover_label"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
tools:src="@drawable/ic_stat_antenna_default"
|
||||
|
@ -33,7 +33,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_alignTop="@id/imgvCover"
|
||||
android:layout_toRightOf="@id/imgvCover"
|
||||
android:layout_alignBottom="@id/imgvCover"
|
||||
style="@style/AntennaPod.TextView.Heading"
|
||||
tools:text="Feed title"
|
||||
tools:background="@android:color/holo_green_dark"/>
|
||||
|
@ -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 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/txtvUrl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="4dp"
|
||||
app:layout_row="2"
|
||||
app:layout_column="1"
|
||||
app:layout_gravity="fill"
|
||||
android:maxLines="4"
|
||||
tools:text="http://www.example.com/feed"
|
||||
tools:background="@android:color/holo_green_dark"/>
|
||||
|
||||
|
|
Loading…
Reference in New Issue