fix layout weirdness caused by articlepager on several consequent
rotates
This commit is contained in:
parent
6488af111c
commit
94173a7db4
17
src/org/fox/ttrss/DummyFragment.java
Normal file
17
src/org/fox/ttrss/DummyFragment.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package org.fox.ttrss;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
public class DummyFragment extends Fragment {
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
View view = inflater.inflate(R.layout.article_fragment, container, false);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
@ -526,16 +526,14 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
.setVisibility(View.GONE);
|
.setVisibility(View.GONE);
|
||||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
//findViewById(R.id.headlines_fragment).setVisibility(
|
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
||||||
// View.GONE);
|
findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
||||||
|
|
||||||
//findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
|
||||||
|
|
||||||
if (m_enableCats && m_activeCategory == null) {
|
if (m_enableCats && m_activeCategory == null) {
|
||||||
findViewById(R.id.feeds_fragment).setVisibility(
|
|
||||||
View.GONE);
|
|
||||||
findViewById(R.id.cats_fragment).setVisibility(
|
findViewById(R.id.cats_fragment).setVisibility(
|
||||||
View.VISIBLE);
|
View.VISIBLE);
|
||||||
|
findViewById(R.id.feeds_fragment).setVisibility(
|
||||||
|
View.GONE);
|
||||||
} else {
|
} else {
|
||||||
findViewById(R.id.cats_fragment).setVisibility(
|
findViewById(R.id.cats_fragment).setVisibility(
|
||||||
View.GONE);
|
View.GONE);
|
||||||
@ -759,8 +757,8 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
|
|
||||||
private void closeCategory() {
|
private void closeCategory() {
|
||||||
|
|
||||||
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
|
||||||
findViewById(R.id.cats_fragment).setVisibility(View.VISIBLE);
|
findViewById(R.id.cats_fragment).setVisibility(View.VISIBLE);
|
||||||
|
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||||
|
|
||||||
m_activeCategory = null;
|
m_activeCategory = null;
|
||||||
|
|
||||||
@ -794,17 +792,16 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_activeFeed != null && m_activeFeed.is_cat) {
|
if (m_activeFeed != null && m_activeFeed.is_cat) {
|
||||||
|
findViewById(R.id.cats_fragment)
|
||||||
|
.setVisibility(View.VISIBLE);
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(
|
findViewById(R.id.headlines_fragment).setVisibility(
|
||||||
View.GONE);
|
View.GONE);
|
||||||
findViewById(R.id.cats_fragment)
|
|
||||||
.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
refreshCategories();
|
refreshCategories();
|
||||||
} else {
|
} else {
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(
|
|
||||||
View.GONE);
|
|
||||||
findViewById(R.id.feeds_fragment).setVisibility(
|
findViewById(R.id.feeds_fragment).setVisibility(
|
||||||
View.VISIBLE);
|
View.VISIBLE);
|
||||||
|
findViewById(R.id.headlines_fragment).setVisibility(
|
||||||
|
View.GONE);
|
||||||
|
|
||||||
refreshFeeds();
|
refreshFeeds();
|
||||||
}
|
}
|
||||||
@ -1141,8 +1138,8 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
// false);
|
// false);
|
||||||
|
|
||||||
if (m_smallScreenMode) {
|
if (m_smallScreenMode) {
|
||||||
findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
||||||
|
findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
||||||
|
|
||||||
@ -1158,6 +1155,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_selectedArticle = null;
|
m_selectedArticle = null;
|
||||||
|
|
||||||
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
|
ft.replace(R.id.article_fragment, new DummyFragment());
|
||||||
|
ft.commit();
|
||||||
|
|
||||||
initMainMenu();
|
initMainMenu();
|
||||||
|
|
||||||
@ -1407,13 +1408,15 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void viewFeed(Feed feed, boolean append) {
|
public void viewFeed(Feed feed, boolean append) {
|
||||||
|
Log.d(TAG, "viewFeeed/" + feed.id);
|
||||||
|
|
||||||
m_activeFeed = feed;
|
m_activeFeed = feed;
|
||||||
|
|
||||||
initMainMenu();
|
initMainMenu();
|
||||||
|
|
||||||
if (m_smallScreenMode) {
|
if (m_smallScreenMode) {
|
||||||
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
||||||
|
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
@ -1439,8 +1442,8 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
Log.d(TAG, "viewCategory");
|
Log.d(TAG, "viewCategory");
|
||||||
|
|
||||||
if (!openAsFeed) {
|
if (!openAsFeed) {
|
||||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
|
||||||
findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE);
|
findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE);
|
||||||
|
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||||
|
|
||||||
m_activeCategory = cat;
|
m_activeCategory = cat;
|
||||||
|
|
||||||
@ -1451,9 +1454,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
ft.replace(R.id.feeds_fragment, frag);
|
ft.replace(R.id.feeds_fragment, frag);
|
||||||
ft.commit();
|
ft.commit();
|
||||||
} else {
|
} else {
|
||||||
|
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
if (m_smallScreenMode)
|
if (m_smallScreenMode)
|
||||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
m_activeFeed = new Feed(cat.id, cat.title, true);
|
m_activeFeed = new Feed(cat.id, cat.title, true);
|
||||||
|
|
||||||
@ -1487,12 +1491,12 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_smallScreenMode) {
|
if (m_smallScreenMode) {
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
|
||||||
findViewById(R.id.article_fragment).setVisibility(View.VISIBLE);
|
findViewById(R.id.article_fragment).setVisibility(View.VISIBLE);
|
||||||
|
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
|
findViewById(R.id.article_fragment).setVisibility(View.VISIBLE);
|
||||||
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||||
findViewById(R.id.article_fragment).setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Fragment frag;
|
Fragment frag;
|
||||||
|
@ -633,6 +633,10 @@ public class OfflineActivity extends FragmentActivity implements
|
|||||||
refreshViews();
|
refreshViews();
|
||||||
|
|
||||||
m_selectedArticleId = 0;
|
m_selectedArticleId = 0;
|
||||||
|
|
||||||
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
|
ft.replace(R.id.article_fragment, new DummyFragment());
|
||||||
|
ft.commit();
|
||||||
|
|
||||||
initMainMenu();
|
initMainMenu();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user