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