Commit b0140a88 authored by Grigory Fedorov's avatar Grigory Fedorov

ContactList: ContactListFragment getting fixed.

parent b0ac3a7d
...@@ -25,7 +25,6 @@ import android.graphics.Bitmap; ...@@ -25,7 +25,6 @@ import android.graphics.Bitmap;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat; import android.support.v4.view.MenuItemCompat;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.ActionBarDrawerToggle;
...@@ -91,8 +90,6 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL ...@@ -91,8 +90,6 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL
private static final int DIALOG_CLOSE_APPLICATION_ID = 0x57; private static final int DIALOG_CLOSE_APPLICATION_ID = 0x57;
private static final String CONTACT_LIST_TAG = "CONTACT_LIST";
/** /**
* Current action. * Current action.
*/ */
...@@ -394,8 +391,7 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL ...@@ -394,8 +391,7 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL
@Override @Override
public boolean onQueryTextChange(String newText) { public boolean onQueryTextChange(String newText) {
Fragment fragmentById = getSupportFragmentManager().findFragmentById(R.id.container); getContactListFragment().getFilterableAdapter().getFilter().filter(newText);
((ContactListFragment) fragmentById).getFilterableAdapter().getFilter().filter(newText);
return true; return true;
} }
}); });
...@@ -492,7 +488,7 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL ...@@ -492,7 +488,7 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL
} }
private ContactListFragment getContactListFragment() { private ContactListFragment getContactListFragment() {
return (ContactListFragment) getSupportFragmentManager().findFragmentByTag(CONTACT_LIST_TAG); return (ContactListFragment) getSupportFragmentManager().findFragmentById(R.id.container);
} }
@Override @Override
...@@ -602,7 +598,7 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL ...@@ -602,7 +598,7 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL
@Override @Override
public void onAccountsChanged(Collection<String> accounts) { public void onAccountsChanged(Collection<String> accounts) {
((ContactListFragment)getSupportFragmentManager().findFragmentById(R.id.container)).onAccountsChanged(); getContactListFragment().onAccountsChanged();
barPainter.setDefaultColor(); barPainter.setDefaultColor();
} }
...@@ -612,7 +608,7 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL ...@@ -612,7 +608,7 @@ public class ContactList extends ChatIntentActivity implements OnAccountChangedL
} }
private void rebuildAccountToggle() { private void rebuildAccountToggle() {
((ContactListFragment)getSupportFragmentManager().findFragmentById(R.id.container)).rebuild(); getContactListFragment().rebuild();
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment