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