xlarge layout fixes
This commit is contained in:
parent
bd937be784
commit
ff6f103900
@ -1,5 +1,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="fill_parent" android:orientation="horizontal" android:id="@+id/main" android:layout_width="fill_parent">
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/loading_container"
|
||||
@ -24,13 +26,39 @@
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout android:layout_height="match_parent" android:layout_width="300dp" android:layout_weight="0" android:id="@+id/feeds_fragment"></FrameLayout>
|
||||
<FrameLayout android:layout_height="match_parent" android:layout_width="300dp" android:layout_weight="0" android:id="@+id/cats_fragment"></FrameLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_height="match_parent" android:orientation="vertical" android:layout_width="match_parent">
|
||||
<FrameLayout android:layout_weight="0.5" android:id="@+id/headlines_fragment" android:layout_width="match_parent" android:layout_height="0dp"></FrameLayout>
|
||||
<FrameLayout android:layout_weight="0.5" android:id="@+id/article_fragment" android:layout_width="match_parent" android:layout_height="0dp"></FrameLayout>
|
||||
</LinearLayout>
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/feeds_fragment"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0" >
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/vertical_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/headlines_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.5" >
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/article_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.5" >
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
@ -1,8 +1,8 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="horizontal" >
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/loading_container"
|
||||
@ -24,9 +24,14 @@
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/loading_message"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/feeds_fragment"
|
||||
android:layout_width="0dp"
|
||||
@ -34,13 +39,6 @@
|
||||
android:layout_weight="0.3" >
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/cats_fragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.3" >
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/headlines_fragment"
|
||||
android:layout_width="0dp"
|
||||
@ -54,5 +52,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5" >
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
@ -96,6 +96,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
m_feed = feed;
|
||||
}
|
||||
|
||||
public HeadlinesFragment() {
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateContextMenu(ContextMenu menu, View v,
|
||||
ContextMenuInfo menuInfo) {
|
||||
|
@ -491,12 +491,14 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
Log.d(TAG, "m_compatMode=" + m_compatMode);
|
||||
|
||||
if (!m_compatMode) {
|
||||
//if (android.os.Build.VERSION.SDK_INT < 14 || android.os.Build.VERSION.SDK_INT == 15) {
|
||||
//if (!m_smallScreenMode) {
|
||||
|
||||
if (!m_smallScreenMode) {
|
||||
findViewById(R.id.feeds_fragment).setVisibility(m_selectedArticle != null ? View.GONE : View.VISIBLE);
|
||||
findViewById(R.id.article_fragment).setVisibility(m_selectedArticle != null ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
LayoutTransition transitioner = new LayoutTransition();
|
||||
((ViewGroup) findViewById(R.id.fragment_container)).setLayoutTransition(transitioner);
|
||||
//}
|
||||
//}
|
||||
|
||||
m_headlinesActionModeCallback = new HeadlinesActionModeCallback();
|
||||
}
|
||||
@ -762,12 +764,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
closeArticle();
|
||||
} else if (m_activeCategory != null) {
|
||||
closeCategory();
|
||||
} else if (m_activeFeed != null) {
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
ft.replace(R.id.fragment_container, new FeedsFragment(m_activeCategory), FRAG_FEEDS);
|
||||
ft.commit();
|
||||
|
||||
initMainMenu();
|
||||
/* } else if (m_activeFeed != null) {
|
||||
m_activeFeed = null;
|
||||
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
||||
initMainMenu(); */
|
||||
|
||||
} else if (allowQuit) {
|
||||
finish();
|
||||
@ -1150,8 +1150,15 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
m_selectedArticle = null;
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
|
||||
if (m_smallScreenMode) {
|
||||
ft.remove(getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE));
|
||||
ft.show(getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES));
|
||||
} else {
|
||||
findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
||||
ft.replace(R.id.article_fragment, new DummyFragment(), FRAG_ARTICLE);
|
||||
}
|
||||
ft.commit();
|
||||
|
||||
initMainMenu();
|
||||
@ -1249,11 +1256,7 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
getActionBar().setTitle(R.string.app_name);
|
||||
}
|
||||
|
||||
if (!m_smallScreenMode) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticle != null || m_activeCategory != null);
|
||||
} else {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticle != null || m_activeFeed != null || m_activeCategory != null);
|
||||
}
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||
ShareActionProvider shareProvider = (ShareActionProvider) m_menu.findItem(R.id.share_article).getActionProvider();
|
||||
@ -1381,10 +1384,19 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
|
||||
if (m_enableCats) {
|
||||
FeedCategoriesFragment frag = new FeedCategoriesFragment();
|
||||
if (m_smallScreenMode) {
|
||||
ft.replace(R.id.fragment_container, frag, FRAG_CATS);
|
||||
} else {
|
||||
ft.replace(R.id.feeds_fragment, frag, FRAG_CATS);
|
||||
}
|
||||
|
||||
} else {
|
||||
FeedsFragment frag = new FeedsFragment();
|
||||
if (m_smallScreenMode) {
|
||||
ft.replace(R.id.fragment_container, frag, FRAG_FEEDS);
|
||||
} else {
|
||||
ft.replace(R.id.feeds_fragment, frag, FRAG_FEEDS);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
@ -1482,7 +1494,13 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager()
|
||||
.beginTransaction();
|
||||
|
||||
if (m_smallScreenMode) {
|
||||
ft.replace(R.id.fragment_container, hf, FRAG_HEADLINES);
|
||||
} else {
|
||||
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
||||
ft.replace(R.id.headlines_fragment, hf, FRAG_HEADLINES);
|
||||
}
|
||||
ft.commit();
|
||||
} else {
|
||||
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager()
|
||||
@ -1504,7 +1522,12 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager()
|
||||
.beginTransaction();
|
||||
|
||||
if (m_smallScreenMode) {
|
||||
ft.replace(R.id.fragment_container, frag, FRAG_FEEDS);
|
||||
} else {
|
||||
ft.replace(R.id.feeds_fragment, frag, FRAG_FEEDS);
|
||||
}
|
||||
ft.commit();
|
||||
|
||||
|
||||
@ -1524,7 +1547,12 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager()
|
||||
.beginTransaction();
|
||||
if (m_smallScreenMode) {
|
||||
ft.replace(R.id.fragment_container, frag, FRAG_HEADLINES);
|
||||
} else {
|
||||
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
|
||||
ft.replace(R.id.headlines_fragment, frag, FRAG_HEADLINES);
|
||||
}
|
||||
ft.commit();
|
||||
|
||||
}
|
||||
@ -1558,8 +1586,14 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
}
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
if (m_smallScreenMode) {
|
||||
ft.hide(getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES));
|
||||
ft.add(R.id.fragment_container, frag, FRAG_ARTICLE);
|
||||
} else {
|
||||
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||
findViewById(R.id.article_fragment).setVisibility(View.VISIBLE);
|
||||
ft.replace(R.id.article_fragment, frag, FRAG_ARTICLE);
|
||||
}
|
||||
ft.commit();
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ public class OfflineActivity extends FragmentActivity implements
|
||||
|
||||
findViewById(R.id.loading_container).setVisibility(View.GONE);
|
||||
|
||||
if (m_smallScreenMode) {
|
||||
/* if (m_smallScreenMode) {
|
||||
if (m_selectedArticleId != 0) {
|
||||
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||
@ -166,34 +166,18 @@ public class OfflineActivity extends FragmentActivity implements
|
||||
//findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
||||
// findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
||||
|
||||
/*
|
||||
* if (m_enableCats && m_activeCategory == null) {
|
||||
* findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||
* findViewById(R.id.cats_fragment).setVisibility(View.VISIBLE);
|
||||
* } else {
|
||||
* findViewById(R.id.cats_fragment).setVisibility(View.GONE); }
|
||||
*/
|
||||
|
||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
if (m_selectedArticleId == 0) {
|
||||
findViewById(R.id.article_fragment).setVisibility(View.GONE);
|
||||
|
||||
/*
|
||||
* if (!m_enableCats || m_activeCategory != null)
|
||||
* findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||
* else
|
||||
* findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||
*/
|
||||
|
||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||
|
||||
} else {
|
||||
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
if (m_activeFeedId == 0) {
|
||||
FragmentTransaction ft = getSupportFragmentManager()
|
||||
@ -1205,16 +1189,6 @@ public class OfflineActivity extends FragmentActivity implements
|
||||
findViewById(R.id.main).setAnimation(
|
||||
AnimationUtils.loadAnimation(this, compatAnimation));
|
||||
}
|
||||
|
||||
if (m_smallScreenMode) {
|
||||
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
||||
findViewById(R.id.article_fragment).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
|
||||
findViewById(R.id.cats_fragment).setVisibility(View.GONE);
|
||||
findViewById(R.id.article_fragment).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user