Commit faaf826e authored by Grigory Fedorov's avatar Grigory Fedorov

New interface ContactAdder for ContactAddFragment.

parent 5581d92e
......@@ -77,7 +77,7 @@ public class ContactAdd extends ManagedActivity implements ContactAddFragment.Li
}
private void addContact() {
((ContactAddFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_container)).addContact();
((ContactAdder) getSupportFragmentManager().findFragmentById(R.id.fragment_container)).addContact();
}
@Override
......
......@@ -22,7 +22,8 @@ import com.xabber.android.ui.adapter.AccountChooseAdapter;
import java.util.Collection;
public class ContactAddFragment extends GroupEditorFragment implements AdapterView.OnItemSelectedListener {
public class ContactAddFragment extends GroupEditorFragment
implements AdapterView.OnItemSelectedListener, ContactAdder {
private static final String SAVED_NAME = "com.xabber.android.ui.ContactAdd.SAVED_NAME";
private static final String SAVED_ACCOUNT = "com.xabber.android.ui.ContactAdd.SAVED_ACCOUNT";
......@@ -166,6 +167,7 @@ public class ContactAddFragment extends GroupEditorFragment implements AdapterVi
public void onNothingSelected(AdapterView<?> parent) {
}
@Override
public void addContact() {
if (getAccount() == null) {
Toast.makeText(getActivity(), getString(R.string.EMPTY_ACCOUNT),
......
package com.xabber.android.ui;
public interface ContactAdder {
void addContact();
}
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