Merge "some brain dead typing shortening"
This commit is contained in:
commit
facd131fad
@ -198,8 +198,6 @@ public class EmailActivity extends Activity implements View.OnClickListener, Fra
|
||||
if (savedInstanceState != null) {
|
||||
mUIController.onRestoreInstanceState(savedInstanceState);
|
||||
} else {
|
||||
// This needs to be done after installRestoredFragments.
|
||||
// See UIControllerTwoPane.preFragmentTransactionCheck()
|
||||
initFromIntent();
|
||||
}
|
||||
mUIController.onActivityCreated();
|
||||
|
@ -53,6 +53,7 @@ abstract class UIControllerBase implements MailboxListFragment.Callback,
|
||||
|
||||
/** The owner activity */
|
||||
final EmailActivity mActivity;
|
||||
final FragmentManager mFragmentManager;
|
||||
|
||||
private final ActionBarController mActionBarController;
|
||||
|
||||
@ -121,6 +122,7 @@ abstract class UIControllerBase implements MailboxListFragment.Callback,
|
||||
|
||||
public UIControllerBase(EmailActivity activity) {
|
||||
mActivity = activity;
|
||||
mFragmentManager = activity.getFragmentManager();
|
||||
mRefreshManager = RefreshManager.getInstance(mActivity);
|
||||
mActionBarController = createActionBarController(activity);
|
||||
if (DEBUG_FRAGMENTS) {
|
||||
|
@ -16,6 +16,12 @@
|
||||
|
||||
package com.android.email.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.email.Email;
|
||||
import com.android.email.R;
|
||||
import com.android.email.activity.MailboxFinder.Callback;
|
||||
@ -26,12 +32,6 @@ import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.Utility;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
@ -288,7 +288,7 @@ class UIControllerOnePane extends UIControllerBase {
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
if (mPreviousFragment != null) {
|
||||
mActivity.getFragmentManager().putFragment(outState,
|
||||
mFragmentManager.putFragment(outState,
|
||||
BUNDLE_KEY_PREVIOUS_FRAGMENT, mPreviousFragment);
|
||||
}
|
||||
}
|
||||
@ -296,7 +296,7 @@ class UIControllerOnePane extends UIControllerBase {
|
||||
@Override
|
||||
public void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
mPreviousFragment = mActivity.getFragmentManager().getFragment(savedInstanceState,
|
||||
mPreviousFragment = mFragmentManager.getFragment(savedInstanceState,
|
||||
BUNDLE_KEY_PREVIOUS_FRAGMENT);
|
||||
}
|
||||
|
||||
@ -517,7 +517,7 @@ class UIControllerOnePane extends UIControllerBase {
|
||||
private void commitFragmentTransaction(FragmentTransaction ft) {
|
||||
if (!ft.isEmpty()) {
|
||||
ft.commit();
|
||||
mActivity.getFragmentManager().executePendingTransactions();
|
||||
mFragmentManager.executePendingTransactions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -540,7 +540,7 @@ class UIControllerOnePane extends UIControllerBase {
|
||||
+ " -> " + fragment);
|
||||
}
|
||||
}
|
||||
final FragmentTransaction ft = mActivity.getFragmentManager().beginTransaction();
|
||||
final FragmentTransaction ft = mFragmentManager.beginTransaction();
|
||||
if (mPreviousFragment != null) {
|
||||
if (DEBUG_FRAGMENTS) {
|
||||
Log.d(Logging.LOG_TAG, this + " showFragment: destroying previous fragment "
|
||||
@ -627,7 +627,7 @@ class UIControllerOnePane extends UIControllerBase {
|
||||
if (mPreviousFragment == null) {
|
||||
return;
|
||||
}
|
||||
final FragmentTransaction ft = mActivity.getFragmentManager().beginTransaction();
|
||||
final FragmentTransaction ft = mFragmentManager.beginTransaction();
|
||||
final Fragment installed = getInstalledFragment();
|
||||
if (DEBUG_FRAGMENTS) {
|
||||
Log.i(Logging.LOG_TAG, this + " backstack: [pop] " + installed + " -> "
|
||||
|
@ -16,6 +16,12 @@
|
||||
|
||||
package com.android.email.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.email.Clock;
|
||||
import com.android.email.Controller;
|
||||
import com.android.email.Email;
|
||||
@ -28,19 +34,9 @@ import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.Message;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.service.SearchParams;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@ -534,20 +530,17 @@ class UIControllerTwoPane extends UIControllerBase implements
|
||||
}
|
||||
if (!ft.isEmpty()) {
|
||||
ft.commit();
|
||||
mActivity.getFragmentManager().executePendingTransactions();
|
||||
mFragmentManager.executePendingTransactions();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void open(long accountId, long mailboxId, long messageId) {
|
||||
if (Logging.DEBUG_LIFECYCLE && Email.DEBUG) {
|
||||
Log.d(Logging.LOG_TAG, this + " open accountId=" + accountId
|
||||
+ " mailboxId=" + mailboxId + " messageId=" + messageId);
|
||||
}
|
||||
final FragmentTransaction ft = mActivity.getFragmentManager().beginTransaction();
|
||||
final FragmentTransaction ft = mFragmentManager.beginTransaction();
|
||||
if (accountId == Account.NO_ACCOUNT) {
|
||||
throw new IllegalArgumentException();
|
||||
} else if (mailboxId == Mailbox.NO_MAILBOX) {
|
||||
@ -621,7 +614,7 @@ class UIControllerTwoPane extends UIControllerBase implements
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private void updateMailboxList(long accountId, long mailboxId, boolean clearDependentPane) {
|
||||
FragmentTransaction ft = mActivity.getFragmentManager().beginTransaction();
|
||||
FragmentTransaction ft = mFragmentManager.beginTransaction();
|
||||
updateMailboxList(ft, accountId, mailboxId, clearDependentPane);
|
||||
commitFragmentTransaction(ft);
|
||||
}
|
||||
@ -671,7 +664,7 @@ class UIControllerTwoPane extends UIControllerBase implements
|
||||
* commit.
|
||||
*/
|
||||
private void updateMessageList(long accountId, long mailboxId, boolean clearDependentPane) {
|
||||
FragmentTransaction ft = mActivity.getFragmentManager().beginTransaction();
|
||||
FragmentTransaction ft = mFragmentManager.beginTransaction();
|
||||
updateMessageList(ft, accountId, mailboxId, clearDependentPane);
|
||||
commitFragmentTransaction(ft);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user