Remove 'check mail' button in message list toolbar
"Pull down to refresh" is now the only way to update the message list.
This commit is contained in:
parent
c38a7ccc7f
commit
a3dee1180e
5 changed files with 2 additions and 96 deletions
|
@ -7,7 +7,6 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
@ -76,8 +75,6 @@ public class ManageFoldersActivity extends K9ListActivity {
|
|||
private FontSizes fontSizes = K9.getFontSizes();
|
||||
private Context context;
|
||||
|
||||
private MenuItem refreshMenuItem;
|
||||
private View actionBarProgressView;
|
||||
private ActionBar actionBar;
|
||||
|
||||
class FolderListHandler extends Handler {
|
||||
|
@ -131,22 +128,7 @@ public class ManageFoldersActivity extends K9ListActivity {
|
|||
}
|
||||
|
||||
public void progress(final boolean progress) {
|
||||
// Make sure we don't try this before the menu is initialized
|
||||
// this could happen while the activity is initialized.
|
||||
if (refreshMenuItem == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (progress) {
|
||||
refreshMenuItem.setActionView(actionBarProgressView);
|
||||
} else {
|
||||
refreshMenuItem.setActionView(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//TODO: Display progress indicator
|
||||
}
|
||||
|
||||
public void dataChanged() {
|
||||
|
@ -175,7 +157,6 @@ public class ManageFoldersActivity extends K9ListActivity {
|
|||
|
||||
setLayout(R.layout.folder_list);
|
||||
initializeActionBar();
|
||||
actionBarProgressView = getActionBarProgressView();
|
||||
listView = getListView();
|
||||
listView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
|
||||
listView.setFastScrollEnabled(true);
|
||||
|
@ -203,11 +184,6 @@ public class ManageFoldersActivity extends K9ListActivity {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private View getActionBarProgressView() {
|
||||
return getLayoutInflater().inflate(R.layout.actionbar_indeterminate_progress_actionview, null);
|
||||
}
|
||||
|
||||
private void initializeActionBar() {
|
||||
actionBar = getSupportActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
@ -383,7 +359,6 @@ public class ManageFoldersActivity extends K9ListActivity {
|
|||
@Override public boolean onCreateOptionsMenu(Menu menu) {
|
||||
super.onCreateOptionsMenu(menu);
|
||||
getMenuInflater().inflate(R.menu.folder_list_option, menu);
|
||||
refreshMenuItem = menu.findItem(R.id.check_mail);
|
||||
configureFolderSearchView(menu);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ package com.fsck.k9.activity;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.SearchManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
@ -194,8 +193,6 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||
private LocalSearch search;
|
||||
private boolean singleFolderMode;
|
||||
|
||||
private MenuItem menuButtonCheckMail;
|
||||
private View actionButtonIndeterminateProgress;
|
||||
private int lastDirection = (K9.isMessageViewShowNext()) ? NEXT : PREVIOUS;
|
||||
|
||||
/**
|
||||
|
@ -586,8 +583,6 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||
private void initializeActionBar() {
|
||||
actionBar = getSupportActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
actionButtonIndeterminateProgress = getActionButtonIndeterminateProgress();
|
||||
}
|
||||
|
||||
private void initializeDrawer(Bundle savedInstanceState) {
|
||||
|
@ -676,11 +671,6 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||
return true;
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private View getActionButtonIndeterminateProgress() {
|
||||
return getLayoutInflater().inflate(R.layout.actionbar_indeterminate_progress_actionview, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
boolean ret = false;
|
||||
|
@ -918,10 +908,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||
} else if (id == R.id.toggle_message_view_theme) {
|
||||
onToggleTheme();
|
||||
return true;
|
||||
} else if (id == R.id.check_mail) { // MessageList
|
||||
messageListFragment.checkMail();
|
||||
return true;
|
||||
} else if (id == R.id.set_sort_date) {
|
||||
} else if (id == R.id.set_sort_date) { // MessageList
|
||||
messageListFragment.changeSort(SortType.SORT_DATE);
|
||||
return true;
|
||||
} else if (id == R.id.set_sort_arrival) {
|
||||
|
@ -1026,7 +1013,6 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.message_list_option, menu);
|
||||
this.menu = menu;
|
||||
menuButtonCheckMail = menu.findItem(R.id.check_mail);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1174,7 +1160,6 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||
|
||||
if (displayMode == DisplayMode.MESSAGE_VIEW || messageListFragment == null ||
|
||||
!messageListFragment.isInitialized()) {
|
||||
menu.findItem(R.id.check_mail).setVisible(false);
|
||||
menu.findItem(R.id.set_sort).setVisible(false);
|
||||
menu.findItem(R.id.select_all).setVisible(false);
|
||||
menu.findItem(R.id.send_messages).setVisible(false);
|
||||
|
@ -1196,7 +1181,6 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||
menu.findItem(R.id.expunge).setVisible(messageListFragment.isRemoteFolder() &&
|
||||
messageListFragment.isAccountExpungeCapable());
|
||||
}
|
||||
menu.findItem(R.id.check_mail).setVisible(messageListFragment.isCheckMailSupported());
|
||||
menu.findItem(R.id.empty_trash).setVisible(messageListFragment.isShowingTrashFolder());
|
||||
|
||||
// If this is an explicit local search, show the option to search on the server
|
||||
|
@ -1469,19 +1453,6 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableActionBarProgress(boolean enable) {
|
||||
if (menuButtonCheckMail == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (menuButtonCheckMail.isVisible()) {
|
||||
menuButtonCheckMail.setActionView(enable ? actionButtonIndeterminateProgress : null);
|
||||
} else {
|
||||
menuButtonCheckMail.setActionView(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showNextMessageOrReturn() {
|
||||
if (K9.isMessageViewReturnToList() || !showLogicalNextMessage()) {
|
||||
|
|
|
@ -322,7 +322,6 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
|
|||
}
|
||||
|
||||
void progress(final boolean progress) {
|
||||
fragmentListener.enableActionBarProgress(progress);
|
||||
if (swipeRefreshLayout != null && !progress) {
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
}
|
||||
|
@ -2280,7 +2279,6 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
|
|||
}
|
||||
|
||||
public interface MessageListFragmentListener {
|
||||
void enableActionBarProgress(boolean enable);
|
||||
void setMessageListProgress(int level);
|
||||
void showThread(Account account, String folderServerId, long rootId);
|
||||
void showMoreFromSameSender(String senderAddress);
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
<!--
|
||||
Copyright 2011 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingRight="12dp"
|
||||
android:paddingLeft="12dp">
|
||||
<!-- FrameLayout ignores margins on android 2.x so we use this padding
|
||||
to make sure the total is the same width as the icon we
|
||||
replace and no visual shifting occurs -->
|
||||
<ProgressBar android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_gravity="center"
|
||||
style="?android:attr/indeterminateProgressStyle" />
|
||||
</FrameLayout>
|
|
@ -26,14 +26,6 @@
|
|||
android:title="@string/action_remote_search"
|
||||
android:visible="false"/>
|
||||
|
||||
<!-- MessageList -->
|
||||
<item
|
||||
android:id="@+id/check_mail"
|
||||
android:alphabeticShortcut="r"
|
||||
android:icon="?attr/iconActionRefresh"
|
||||
app:showAsAction="always"
|
||||
android:title="@string/check_mail_action"/>
|
||||
|
||||
<!-- MessageView -->
|
||||
<item
|
||||
android:id="@+id/archive"
|
||||
|
|
Loading…
Reference in a new issue