summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Huang <ath@google.com>2014-04-09 15:30:42 -0700
committerAndy Huang <ath@google.com>2014-04-09 15:30:42 -0700
commit5d674a741d78f7771299c426a4bfe0d319cc0f2b (patch)
tree8edd8362b0c28f18456522d5d7fbd1dbeaea4f94
parent4de81adc296a3d559d7a8f8689625b8914c79c53 (diff)
downloadandroid_packages_apps_UnifiedEmail-5d674a741d78f7771299c426a4bfe0d319cc0f2b.tar.gz
android_packages_apps_UnifiedEmail-5d674a741d78f7771299c426a4bfe0d319cc0f2b.tar.bz2
android_packages_apps_UnifiedEmail-5d674a741d78f7771299c426a4bfe0d319cc0f2b.zip
"waiting for sync" -> "getting your messages"
Bug: 12421412 Change-Id: I5ee3d66add25ebc75420c3433f47cb44b85e3275
-rw-r--r--res/layout/conversation_list.xml2
-rw-r--r--res/layout/loading_messages.xml (renamed from res/layout/conversation_list_loading_view.xml)1
-rw-r--r--res/layout/wait_for_sync.xml42
-rw-r--r--res/values/strings.xml2
-rw-r--r--src/com/android/mail/compose/ComposeActivity.java2
-rw-r--r--src/com/android/mail/ui/AbstractActivityController.java2
-rw-r--r--src/com/android/mail/ui/ButteryProgressBar.java17
-rw-r--r--src/com/android/mail/ui/ConversationListFragment.java1
-rw-r--r--src/com/android/mail/ui/MailboxSelectionActivity.java2
-rw-r--r--src/com/android/mail/ui/WaitFragment.java20
10 files changed, 26 insertions, 65 deletions
diff --git a/res/layout/conversation_list.xml b/res/layout/conversation_list.xml
index faa7affd4..5c9f6ecc7 100644
--- a/res/layout/conversation_list.xml
+++ b/res/layout/conversation_list.xml
@@ -42,7 +42,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/ConversationListFade" />
- <include layout="@layout/conversation_list_loading_view" />
+ <include layout="@layout/loading_messages" />
</FrameLayout>
</com.android.mail.ui.MailSwipeRefreshLayout>
</RelativeLayout>
diff --git a/res/layout/conversation_list_loading_view.xml b/res/layout/loading_messages.xml
index a33d05e4c..f626f610d 100644
--- a/res/layout/conversation_list_loading_view.xml
+++ b/res/layout/loading_messages.xml
@@ -22,7 +22,6 @@
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
- android:visibility="gone"
android:background="@color/footer_background_color">
<ImageView
diff --git a/res/layout/wait_for_sync.xml b/res/layout/wait_for_sync.xml
deleted file mode 100644
index f40e8e182..000000000
--- a/res/layout/wait_for_sync.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2012 Google Inc.
- Licensed to 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.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@android:color/white"
- android:padding="@dimen/wait_padding">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/wait_for_sync_title"
- style="@style/WaitFragmentTitle"
- android:id="@+id/wait_for_sync_title"
- android:layout_marginLeft="8dip"
- android:layout_marginBottom="4dip"/>
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/wait_for_sync_body"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:layout_below="@id/wait_for_sync_title"
- android:layout_marginLeft="8dip" />
-
- </RelativeLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 838354c9d..bac8c47e3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -615,8 +615,6 @@
<!-- Wait fragment strings -->
<!-- Displayed in title bar during the initial sync [CHAR LIMIT=40] -->
<string name="wait_for_sync_title">Waiting for sync</string>
- <!-- Displayed in the middle of the screen during the initial sync [CHAR LIMIT=40] -->
- <string name="wait_for_sync_body">Your email will appear shortly.</string>
<!-- Title for the screen displayed during the initial sync [CHAR LIMIT=100] -->
<string name="not_synced_title">Account not synced</string>
<!-- Displayed in the middle of the screen during the initial sync [CHAR LIMIT=300]-->
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index dc5063d6f..80eb8ac88 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -3590,7 +3590,7 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi
fragment.updateAccount(account);
} else {
findViewById(R.id.wait).setVisibility(View.VISIBLE);
- replaceFragment(WaitFragment.newInstance(account, true),
+ replaceFragment(WaitFragment.newInstance(account, false /* expectingMessages */),
FragmentTransaction.TRANSIT_FRAGMENT_OPEN, TAG_WAIT);
}
}
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java
index cf18905a4..1b63db680 100644
--- a/src/com/android/mail/ui/AbstractActivityController.java
+++ b/src/com/android/mail/ui/AbstractActivityController.java
@@ -2466,7 +2466,7 @@ public abstract class AbstractActivityController implements ActivityController,
@Override
public void showWaitForInitialization() {
mViewMode.enterWaitingForInitializationMode();
- mWaitFragment = WaitFragment.newInstance(mAccount);
+ mWaitFragment = WaitFragment.newInstance(mAccount, true /* expectingMessages */);
}
private void updateWaitMode() {
diff --git a/src/com/android/mail/ui/ButteryProgressBar.java b/src/com/android/mail/ui/ButteryProgressBar.java
index 00bf03216..abf0214e3 100644
--- a/src/com/android/mail/ui/ButteryProgressBar.java
+++ b/src/com/android/mail/ui/ButteryProgressBar.java
@@ -161,6 +161,18 @@ public class ButteryProgressBar extends View {
}
@Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ start();
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ stop();
+ }
+
+ @Override
protected void onVisibilityChanged(View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
@@ -172,16 +184,13 @@ public class ButteryProgressBar extends View {
}
private void start() {
- if (mAnimator == null) {
+ if (getVisibility() != VISIBLE) {
return;
}
mAnimator.start();
}
private void stop() {
- if (mAnimator == null) {
- return;
- }
mAnimator.cancel();
}
diff --git a/src/com/android/mail/ui/ConversationListFragment.java b/src/com/android/mail/ui/ConversationListFragment.java
index 5e91471ff..b614a267d 100644
--- a/src/com/android/mail/ui/ConversationListFragment.java
+++ b/src/com/android/mail/ui/ConversationListFragment.java
@@ -461,6 +461,7 @@ public final class ConversationListFragment extends ListFragment implements
View rootView = inflater.inflate(R.layout.conversation_list, null);
mEmptyView = (ConversationListEmptyView) rootView.findViewById(R.id.empty_view);
mLoadingView = rootView.findViewById(R.id.loading_view);
+ mLoadingView.setVisibility(View.GONE);
mListView = (SwipeableListView) rootView.findViewById(android.R.id.list);
mListView.setHeaderDividersEnabled(false);
mListView.setOnItemLongClickListener(this);
diff --git a/src/com/android/mail/ui/MailboxSelectionActivity.java b/src/com/android/mail/ui/MailboxSelectionActivity.java
index 2f9253ef3..e81fbceb4 100644
--- a/src/com/android/mail/ui/MailboxSelectionActivity.java
+++ b/src/com/android/mail/ui/MailboxSelectionActivity.java
@@ -330,7 +330,7 @@ public class MailboxSelectionActivity extends ListActivity implements OnClickLis
fragment.updateAccount(account);
} else {
mWait.setVisibility(View.VISIBLE);
- replaceFragment(WaitFragment.newInstance(account, true),
+ replaceFragment(WaitFragment.newInstance(account, false /* expectingMessages */),
FragmentTransaction.TRANSIT_FRAGMENT_OPEN, TAG_WAIT);
}
mContent.setVisibility(View.GONE);
diff --git a/src/com/android/mail/ui/WaitFragment.java b/src/com/android/mail/ui/WaitFragment.java
index 7feba14db..13eb44003 100644
--- a/src/com/android/mail/ui/WaitFragment.java
+++ b/src/com/android/mail/ui/WaitFragment.java
@@ -38,7 +38,7 @@ public class WaitFragment extends Fragment implements View.OnClickListener,
// Keys used to pass data to {@link WaitFragment}.
private static final String ACCOUNT_KEY = "account";
- private static final String DEFAULT_KEY = "isDefault";
+ private static final String EXPECTING_MESSAGES_KEY = "expectingMessages";
private static final int MANUAL_SYNC_LOADER = 0;
@@ -47,21 +47,17 @@ public class WaitFragment extends Fragment implements View.OnClickListener,
private LayoutInflater mInflater;
- private boolean mDefault;
+ private boolean mExpectingMessages;
// Public no-args constructor needed for fragment re-instantiation
public WaitFragment() {}
- public static WaitFragment newInstance(Account account) {
- return newInstance(account, false);
- }
-
- public static WaitFragment newInstance(Account account, boolean def) {
+ public static WaitFragment newInstance(Account account, boolean expectingMessages) {
WaitFragment fragment = new WaitFragment();
final Bundle args = new Bundle();
args.putParcelable(ACCOUNT_KEY, account);
- args.putBoolean(DEFAULT_KEY, def);
+ args.putBoolean(EXPECTING_MESSAGES_KEY, expectingMessages);
fragment.setArguments(args);
return fragment;
}
@@ -72,7 +68,7 @@ public class WaitFragment extends Fragment implements View.OnClickListener,
Bundle args = getArguments();
mAccount = (Account)args.getParcelable(ACCOUNT_KEY);
- mDefault = args.getBoolean(DEFAULT_KEY, false);
+ mExpectingMessages = args.getBoolean(EXPECTING_MESSAGES_KEY, false);
}
@Override
@@ -96,10 +92,10 @@ public class WaitFragment extends Fragment implements View.OnClickListener,
view.findViewById(R.id.manual_sync).setOnClickListener(this);
view.findViewById(R.id.change_sync_settings).setOnClickListener(this);
- } else if (mDefault) {
- view = mInflater.inflate(R.layout.wait_default, root, false);
+ } else if (mExpectingMessages) {
+ view = mInflater.inflate(R.layout.loading_messages, root, false);
} else {
- view = mInflater.inflate(R.layout.wait_for_sync, root, false);
+ view = mInflater.inflate(R.layout.wait_default, root, false);
}
return view;