use actionbar home button to close article on HC
This commit is contained in:
parent
e0012da1e9
commit
a33272bdc7
@ -108,12 +108,6 @@
|
||||
android:showAsAction=""
|
||||
android:title="@string/article_set_unread"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/close_article"
|
||||
android:icon="@android:drawable/ic_menu_close_clear_cancel"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="@string/close_article"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/catchup_above"
|
||||
android:icon="@drawable/ic_menu_tick"
|
||||
|
@ -96,12 +96,6 @@
|
||||
android:showAsAction=""
|
||||
android:title="@string/article_set_unread"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/close_article"
|
||||
android:icon="@android:drawable/ic_menu_close_clear_cancel"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="@string/close_article"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/catchup_above"
|
||||
android:icon="@drawable/ic_menu_tick"
|
||||
|
@ -828,6 +828,9 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
.findFragmentById(R.id.headlines_fragment);
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
closeArticle();
|
||||
return true;
|
||||
case R.id.preferences:
|
||||
Intent intent = new Intent(MainActivity.this,
|
||||
PreferencesActivity.class);
|
||||
@ -848,12 +851,6 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
case R.id.go_offline:
|
||||
switchOffline();
|
||||
return true;
|
||||
case R.id.close_article:
|
||||
closeArticle();
|
||||
return true;
|
||||
/*
|
||||
* case R.id.back_to_categories: closeCategory(); return true;
|
||||
*/
|
||||
case R.id.headlines_select:
|
||||
if (hf != null) {
|
||||
Dialog dialog = new Dialog(this);
|
||||
@ -1114,6 +1111,10 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
|
||||
m_headlinesActionMode.finish();
|
||||
}
|
||||
|
||||
if (!m_compatMode) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticle != null);
|
||||
}
|
||||
|
||||
} else {
|
||||
m_menu.setGroupVisible(R.id.menu_group_logged_in, false);
|
||||
m_menu.setGroupVisible(R.id.menu_group_logged_out, true);
|
||||
|
@ -427,6 +427,9 @@ public class OfflineActivity extends FragmentActivity implements
|
||||
.findFragmentById(R.id.headlines_fragment);
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
closeArticle();
|
||||
return true;
|
||||
case R.id.preferences:
|
||||
Intent intent = new Intent(this, PreferencesActivity.class);
|
||||
startActivityForResult(intent, 0);
|
||||
@ -434,12 +437,6 @@ public class OfflineActivity extends FragmentActivity implements
|
||||
case R.id.go_online:
|
||||
switchOnline();
|
||||
return true;
|
||||
case R.id.close_article:
|
||||
closeArticle();
|
||||
return true;
|
||||
/* case R.id.back_to_categories:
|
||||
// closeCategory();
|
||||
return true; */
|
||||
case R.id.headlines_select:
|
||||
if (ohf != null) {
|
||||
Dialog dialog = new Dialog(this);
|
||||
@ -670,6 +667,10 @@ public class OfflineActivity extends FragmentActivity implements
|
||||
if (numSelected == 0 && m_headlinesActionMode != null) {
|
||||
m_headlinesActionMode.finish();
|
||||
}
|
||||
|
||||
if (!m_compatMode) {
|
||||
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticleId != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user