Rename fragment
This commit is contained in:
parent
dde619359b
commit
0ad181c1c3
5 changed files with 49 additions and 32 deletions
|
@ -1,7 +1,7 @@
|
|||
package org.linphone;
|
||||
/*
|
||||
ContactFragment.java
|
||||
Copyright (C) 2012 Belledonne Communications, Grenoble, France
|
||||
ContactDetailsFragment.java
|
||||
Copyright (C) 2015 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -44,7 +44,7 @@ import android.widget.TextView;
|
|||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class ContactFragment extends Fragment implements OnClickListener {
|
||||
public class ContactDetailsFragment extends Fragment implements OnClickListener {
|
||||
private Contact contact;
|
||||
private ImageView editContact, deleteContact, back;
|
||||
private LayoutInflater inflater;
|
||||
|
@ -217,7 +217,7 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
super.onResume();
|
||||
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACT);
|
||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACT_DETAIL);
|
||||
LinphoneActivity.instance().hideTabBar(false);
|
||||
}
|
||||
contact.refresh(getActivity().getContentResolver());
|
|
@ -1,4 +1,22 @@
|
|||
package org.linphone;
|
||||
/*
|
||||
ContactEditorFragment.java
|
||||
Copyright (C) 2012 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
|
@ -7,7 +25,6 @@ import java.util.List;
|
|||
import org.linphone.compatibility.Compatibility;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
import org.linphone.mediastream.Version;
|
||||
import org.linphone.mediastream.Log;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.ContentProviderOperation;
|
||||
|
@ -35,7 +52,7 @@ import android.widget.EditText;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
public class EditContactFragment extends Fragment {
|
||||
public class ContactEditorFragment extends Fragment {
|
||||
private View view;
|
||||
private ImageView back, edit, ok;
|
||||
private ImageView addNumber, addSipAddress, contactPicture;
|
|
@ -419,7 +419,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
}
|
||||
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACTS);
|
||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACTS_LIST);
|
||||
LinphoneActivity.instance().hideTabBar(false);
|
||||
onlyDisplayLinphoneContacts = ContactsManager.getInstance().isLinphoneContactsPrefered();
|
||||
}
|
||||
|
|
|
@ -25,9 +25,9 @@ public enum FragmentsAvailable {
|
|||
DIALER,
|
||||
HISTORY_LIST,
|
||||
HISTORY_DETAIL,
|
||||
CONTACTS,
|
||||
CONTACT,
|
||||
EDIT_CONTACT,
|
||||
CONTACTS_LIST,
|
||||
CONTACT_DETAIL,
|
||||
CONTACT_EDITOR,
|
||||
ABOUT,
|
||||
ACCOUNT_SETTINGS,
|
||||
SETTINGS,
|
||||
|
@ -46,17 +46,17 @@ public enum FragmentsAvailable {
|
|||
case HISTORY_DETAIL:
|
||||
return HISTORY_LIST.isRightOf(fragment) || fragment == HISTORY_LIST;
|
||||
|
||||
case CONTACTS:
|
||||
case CONTACTS_LIST:
|
||||
return HISTORY_DETAIL.isRightOf(fragment) || fragment == HISTORY_DETAIL;
|
||||
|
||||
case CONTACT:
|
||||
return CONTACTS.isRightOf(fragment) || fragment == CONTACTS;
|
||||
case CONTACT_DETAIL:
|
||||
return CONTACTS_LIST.isRightOf(fragment) || fragment == CONTACTS_LIST;
|
||||
|
||||
case EDIT_CONTACT:
|
||||
return CONTACT.isRightOf(fragment) || fragment == CONTACT;
|
||||
case CONTACT_EDITOR:
|
||||
return CONTACT_DETAIL.isRightOf(fragment) || fragment == CONTACT_DETAIL;
|
||||
|
||||
case DIALER:
|
||||
return EDIT_CONTACT.isRightOf(fragment) || fragment == EDIT_CONTACT;
|
||||
return CONTACT_EDITOR.isRightOf(fragment) || fragment == CONTACT_EDITOR;
|
||||
|
||||
case CHATLIST:
|
||||
return DIALER.isRightOf(fragment) || fragment == DIALER;
|
||||
|
@ -81,11 +81,11 @@ public enum FragmentsAvailable {
|
|||
case HISTORY_DETAIL:
|
||||
return fragment == HISTORY_LIST;
|
||||
|
||||
case CONTACT:
|
||||
return fragment == CONTACTS;
|
||||
case CONTACT_DETAIL:
|
||||
return fragment == CONTACTS_LIST;
|
||||
|
||||
case EDIT_CONTACT:
|
||||
return fragment == CONTACT || fragment == CONTACTS;
|
||||
case CONTACT_EDITOR:
|
||||
return fragment == CONTACT_DETAIL || fragment == CONTACTS_LIST;
|
||||
|
||||
case CHAT:
|
||||
return fragment == CHATLIST;
|
||||
|
|
|
@ -381,11 +381,11 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
newFragment = new ContactsListFragment();
|
||||
friendStatusListenerFragment = newFragment;
|
||||
break;
|
||||
case CONTACT:
|
||||
newFragment = new ContactFragment();
|
||||
case CONTACT_DETAIL:
|
||||
newFragment = new ContactDetailsFragment();
|
||||
break;
|
||||
case EDIT_CONTACT:
|
||||
newFragment = new EditContactFragment();
|
||||
case CONTACT_EDITOR:
|
||||
newFragment = new ContactEditorFragment();
|
||||
break;
|
||||
case DIALER:
|
||||
newFragment = new DialerFragment();
|
||||
|
@ -581,14 +581,14 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
|
||||
public void displayContact(Contact contact, boolean chatOnly) {
|
||||
Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
|
||||
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CONTACT) {
|
||||
ContactFragment contactFragment = (ContactFragment) fragment2;
|
||||
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CONTACT_DETAIL) {
|
||||
ContactDetailsFragment contactFragment = (ContactDetailsFragment) fragment2;
|
||||
contactFragment.changeDisplayedContact(contact);
|
||||
} else {
|
||||
Bundle extras = new Bundle();
|
||||
extras.putSerializable("Contact", contact);
|
||||
extras.putBoolean("ChatAddressOnly", chatOnly);
|
||||
changeCurrentFragment(FragmentsAvailable.CONTACT, extras);
|
||||
changeCurrentFragment(FragmentsAvailable.CONTACT_DETAIL, extras);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -747,8 +747,8 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
history_selected.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case CONTACTS_LIST:
|
||||
case CONTACT:
|
||||
case EDIT_CONTACT:
|
||||
case CONTACT_DETAIL:
|
||||
case CONTACT_EDITOR:
|
||||
contacts_selected.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case DIALER:
|
||||
|
@ -1049,14 +1049,14 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
{
|
||||
Bundle extras = new Bundle();
|
||||
extras.putSerializable("NewSipAdress", sipUri);
|
||||
changeCurrentFragment(FragmentsAvailable.EDIT_CONTACT, extras);
|
||||
changeCurrentFragment(FragmentsAvailable.CONTACT_EDITOR, extras);
|
||||
}
|
||||
|
||||
public void editContact(Contact contact)
|
||||
{
|
||||
Bundle extras = new Bundle();
|
||||
extras.putSerializable("Contact", contact);
|
||||
changeCurrentFragment(FragmentsAvailable.EDIT_CONTACT, extras);
|
||||
changeCurrentFragment(FragmentsAvailable.CONTACT_EDITOR, extras);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1066,7 +1066,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
Bundle extras = new Bundle();
|
||||
extras.putSerializable("Contact", contact);
|
||||
extras.putSerializable("NewSipAdress", sipAddress);
|
||||
changeCurrentFragment(FragmentsAvailable.EDIT_CONTACT, extras);
|
||||
changeCurrentFragment(FragmentsAvailable.CONTACT_EDITOR, extras);
|
||||
}
|
||||
|
||||
public void quit() {
|
||||
|
|
Loading…
Reference in a new issue