show title/loading progressbar on GB

This commit is contained in:
Andrew Dolgov 2012-06-25 09:16:55 +04:00
parent 7b10e95213
commit 41f36b00d2
3 changed files with 63 additions and 55 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="77"
android:versionName="0.6.2" >
android:versionCode="79"
android:versionName="0.6.3" >
<uses-sdk android:minSdkVersion="8" />

View File

@ -1,6 +1,6 @@
<resources>
<style name="LightTheme" parent="android:Theme.Light.NoTitleBar">
<style name="LightTheme" parent="android:Theme.Light">
<item name="horizontalDivider">@android:drawable/divider_horizontal_bright</item>
<item name="feedlistBackground">#fafafa</item>
<item name="unreadCounterColor">#0000ff</item>
@ -24,7 +24,7 @@
<item name="loadingBackground">@android:color/white</item>
</style>
<style name="DarkTheme" parent="android:Theme.Black.NoTitleBar">
<style name="DarkTheme" parent="android:Theme.Black">
<item name="horizontalDivider">@android:drawable/divider_horizontal_dark</item>
<item name="feedlistBackground">#101010</item>
<item name="unreadCounterColor">#303030</item>

View File

@ -1423,6 +1423,51 @@ public class MainActivity extends CommonActivity implements OnlineServices {
initMainMenu();
}
private void updateTitle() {
if (!isCompatMode()) {
m_navigationAdapter.clear();
if (m_activeCategory != null || (m_activeFeed != null && isSmallScreen())) {
getActionBar().setDisplayShowTitleEnabled(false);
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
m_navigationAdapter.add(new RootNavigationEntry(getString(R.string.app_name)));
if (m_activeCategory != null)
m_navigationAdapter.add(new CategoryNavigationEntry(m_activeCategory));
if (m_activeFeed != null)
m_navigationAdapter.add(new FeedNavigationEntry(m_activeFeed));
//if (m_selectedArticle != null)
// m_navigationAdapter.add(new ArticleNavigationEntry(m_selectedArticle));
getActionBar().setSelectedNavigationItem(getActionBar().getNavigationItemCount());
} else {
getActionBar().setDisplayShowTitleEnabled(true);
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
getActionBar().setTitle(R.string.app_name);
}
if (isSmallScreen()) {
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticle != null || m_activeCategory != null || m_activeFeed != null);
} else {
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticle != null || m_activeCategory != null);
}
} else {
if (m_activeFeed != null) {
setTitle(m_activeFeed.title);
} else if (m_activeCategory != null) {
setTitle(m_activeCategory.title);
} else {
setTitle(R.string.app_name);
}
}
}
@SuppressLint({ "NewApi", "NewApi", "NewApi" })
public void initMainMenu() {
if (m_menu != null) {
@ -1455,6 +1500,16 @@ public class MainActivity extends CommonActivity implements OnlineServices {
} else if (m_selectedArticle != null) {
m_menu.setGroupVisible(R.id.menu_group_article, true);
if (android.os.Build.VERSION.SDK_INT >= 14) {
ShareActionProvider shareProvider = (ShareActionProvider) m_menu.findItem(R.id.share_article).getActionProvider();
if (m_selectedArticle != null) {
Log.d(TAG, "setting up share provider");
shareProvider.setShareIntent(getShareIntent(m_selectedArticle));
}
}
} else if (m_activeFeed != null) {
m_menu.setGroupVisible(R.id.menu_group_headlines, true);
@ -1505,57 +1560,8 @@ public class MainActivity extends CommonActivity implements OnlineServices {
m_headlinesActionMode.finish();
}
if (!isCompatMode()) {
//Log.d(TAG, "isCompatMode=" + isCompatMode());
/* if (m_activeFeed != null) {
getActionBar().setTitle(m_activeFeed.title);
} else if (m_activeCategory != null) {
getActionBar().setTitle(m_activeCategory.title);
} else {
getActionBar().setTitle(R.string.app_name);
} */
m_navigationAdapter.clear();
if (m_activeCategory != null || (m_activeFeed != null && isSmallScreen())) {
getActionBar().setDisplayShowTitleEnabled(false);
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
m_navigationAdapter.add(new RootNavigationEntry(getString(R.string.app_name)));
if (m_activeCategory != null)
m_navigationAdapter.add(new CategoryNavigationEntry(m_activeCategory));
if (m_activeFeed != null)
m_navigationAdapter.add(new FeedNavigationEntry(m_activeFeed));
//if (m_selectedArticle != null)
// m_navigationAdapter.add(new ArticleNavigationEntry(m_selectedArticle));
getActionBar().setSelectedNavigationItem(getActionBar().getNavigationItemCount());
} else {
getActionBar().setDisplayShowTitleEnabled(true);
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
getActionBar().setTitle(R.string.app_name);
}
if (isSmallScreen()) {
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticle != null || m_activeCategory != null || m_activeFeed != null);
} else {
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticle != null || m_activeCategory != null);
}
if (android.os.Build.VERSION.SDK_INT >= 14) {
ShareActionProvider shareProvider = (ShareActionProvider) m_menu.findItem(R.id.share_article).getActionProvider();
if (m_selectedArticle != null) {
Log.d(TAG, "setting up share provider");
shareProvider.setShareIntent(getShareIntent(m_selectedArticle));
}
}
}
m_menu.findItem(R.id.set_labels).setEnabled(m_apiLevel >= 1);
m_menu.findItem(R.id.article_set_note).setEnabled(m_apiLevel >= 1);
@ -1567,6 +1573,8 @@ public class MainActivity extends CommonActivity implements OnlineServices {
m_menu.setGroupVisible(R.id.menu_group_logged_out, true);
}
}
updateTitle();
}
@Override