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;
|
package org.linphone;
|
||||||
/*
|
/*
|
||||||
ContactFragment.java
|
ContactDetailsFragment.java
|
||||||
Copyright (C) 2012 Belledonne Communications, Grenoble, France
|
Copyright (C) 2015 Belledonne Communications, Grenoble, France
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -44,7 +44,7 @@ import android.widget.TextView;
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
public class ContactFragment extends Fragment implements OnClickListener {
|
public class ContactDetailsFragment extends Fragment implements OnClickListener {
|
||||||
private Contact contact;
|
private Contact contact;
|
||||||
private ImageView editContact, deleteContact, back;
|
private ImageView editContact, deleteContact, back;
|
||||||
private LayoutInflater inflater;
|
private LayoutInflater inflater;
|
||||||
|
@ -217,7 +217,7 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
if (LinphoneActivity.isInstanciated()) {
|
if (LinphoneActivity.isInstanciated()) {
|
||||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACT);
|
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACT_DETAIL);
|
||||||
LinphoneActivity.instance().hideTabBar(false);
|
LinphoneActivity.instance().hideTabBar(false);
|
||||||
}
|
}
|
||||||
contact.refresh(getActivity().getContentResolver());
|
contact.refresh(getActivity().getContentResolver());
|
|
@ -1,4 +1,22 @@
|
||||||
package org.linphone;
|
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.File;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -7,7 +25,6 @@ import java.util.List;
|
||||||
import org.linphone.compatibility.Compatibility;
|
import org.linphone.compatibility.Compatibility;
|
||||||
import org.linphone.core.LinphoneProxyConfig;
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
import org.linphone.mediastream.Version;
|
import org.linphone.mediastream.Version;
|
||||||
import org.linphone.mediastream.Log;
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ContentProviderOperation;
|
import android.content.ContentProviderOperation;
|
||||||
|
@ -35,7 +52,7 @@ import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
public class EditContactFragment extends Fragment {
|
public class ContactEditorFragment extends Fragment {
|
||||||
private View view;
|
private View view;
|
||||||
private ImageView back, edit, ok;
|
private ImageView back, edit, ok;
|
||||||
private ImageView addNumber, addSipAddress, contactPicture;
|
private ImageView addNumber, addSipAddress, contactPicture;
|
|
@ -419,7 +419,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LinphoneActivity.isInstanciated()) {
|
if (LinphoneActivity.isInstanciated()) {
|
||||||
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACTS);
|
LinphoneActivity.instance().selectMenu(FragmentsAvailable.CONTACTS_LIST);
|
||||||
LinphoneActivity.instance().hideTabBar(false);
|
LinphoneActivity.instance().hideTabBar(false);
|
||||||
onlyDisplayLinphoneContacts = ContactsManager.getInstance().isLinphoneContactsPrefered();
|
onlyDisplayLinphoneContacts = ContactsManager.getInstance().isLinphoneContactsPrefered();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,9 @@ public enum FragmentsAvailable {
|
||||||
DIALER,
|
DIALER,
|
||||||
HISTORY_LIST,
|
HISTORY_LIST,
|
||||||
HISTORY_DETAIL,
|
HISTORY_DETAIL,
|
||||||
CONTACTS,
|
CONTACTS_LIST,
|
||||||
CONTACT,
|
CONTACT_DETAIL,
|
||||||
EDIT_CONTACT,
|
CONTACT_EDITOR,
|
||||||
ABOUT,
|
ABOUT,
|
||||||
ACCOUNT_SETTINGS,
|
ACCOUNT_SETTINGS,
|
||||||
SETTINGS,
|
SETTINGS,
|
||||||
|
@ -46,17 +46,17 @@ public enum FragmentsAvailable {
|
||||||
case HISTORY_DETAIL:
|
case HISTORY_DETAIL:
|
||||||
return HISTORY_LIST.isRightOf(fragment) || fragment == HISTORY_LIST;
|
return HISTORY_LIST.isRightOf(fragment) || fragment == HISTORY_LIST;
|
||||||
|
|
||||||
case CONTACTS:
|
case CONTACTS_LIST:
|
||||||
return HISTORY_DETAIL.isRightOf(fragment) || fragment == HISTORY_DETAIL;
|
return HISTORY_DETAIL.isRightOf(fragment) || fragment == HISTORY_DETAIL;
|
||||||
|
|
||||||
case CONTACT:
|
case CONTACT_DETAIL:
|
||||||
return CONTACTS.isRightOf(fragment) || fragment == CONTACTS;
|
return CONTACTS_LIST.isRightOf(fragment) || fragment == CONTACTS_LIST;
|
||||||
|
|
||||||
case EDIT_CONTACT:
|
case CONTACT_EDITOR:
|
||||||
return CONTACT.isRightOf(fragment) || fragment == CONTACT;
|
return CONTACT_DETAIL.isRightOf(fragment) || fragment == CONTACT_DETAIL;
|
||||||
|
|
||||||
case DIALER:
|
case DIALER:
|
||||||
return EDIT_CONTACT.isRightOf(fragment) || fragment == EDIT_CONTACT;
|
return CONTACT_EDITOR.isRightOf(fragment) || fragment == CONTACT_EDITOR;
|
||||||
|
|
||||||
case CHATLIST:
|
case CHATLIST:
|
||||||
return DIALER.isRightOf(fragment) || fragment == DIALER;
|
return DIALER.isRightOf(fragment) || fragment == DIALER;
|
||||||
|
@ -81,11 +81,11 @@ public enum FragmentsAvailable {
|
||||||
case HISTORY_DETAIL:
|
case HISTORY_DETAIL:
|
||||||
return fragment == HISTORY_LIST;
|
return fragment == HISTORY_LIST;
|
||||||
|
|
||||||
case CONTACT:
|
case CONTACT_DETAIL:
|
||||||
return fragment == CONTACTS;
|
return fragment == CONTACTS_LIST;
|
||||||
|
|
||||||
case EDIT_CONTACT:
|
case CONTACT_EDITOR:
|
||||||
return fragment == CONTACT || fragment == CONTACTS;
|
return fragment == CONTACT_DETAIL || fragment == CONTACTS_LIST;
|
||||||
|
|
||||||
case CHAT:
|
case CHAT:
|
||||||
return fragment == CHATLIST;
|
return fragment == CHATLIST;
|
||||||
|
|
|
@ -381,11 +381,11 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
newFragment = new ContactsListFragment();
|
newFragment = new ContactsListFragment();
|
||||||
friendStatusListenerFragment = newFragment;
|
friendStatusListenerFragment = newFragment;
|
||||||
break;
|
break;
|
||||||
case CONTACT:
|
case CONTACT_DETAIL:
|
||||||
newFragment = new ContactFragment();
|
newFragment = new ContactDetailsFragment();
|
||||||
break;
|
break;
|
||||||
case EDIT_CONTACT:
|
case CONTACT_EDITOR:
|
||||||
newFragment = new EditContactFragment();
|
newFragment = new ContactEditorFragment();
|
||||||
break;
|
break;
|
||||||
case DIALER:
|
case DIALER:
|
||||||
newFragment = new DialerFragment();
|
newFragment = new DialerFragment();
|
||||||
|
@ -581,14 +581,14 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
|
|
||||||
public void displayContact(Contact contact, boolean chatOnly) {
|
public void displayContact(Contact contact, boolean chatOnly) {
|
||||||
Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
|
Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
|
||||||
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CONTACT) {
|
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CONTACT_DETAIL) {
|
||||||
ContactFragment contactFragment = (ContactFragment) fragment2;
|
ContactDetailsFragment contactFragment = (ContactDetailsFragment) fragment2;
|
||||||
contactFragment.changeDisplayedContact(contact);
|
contactFragment.changeDisplayedContact(contact);
|
||||||
} else {
|
} else {
|
||||||
Bundle extras = new Bundle();
|
Bundle extras = new Bundle();
|
||||||
extras.putSerializable("Contact", contact);
|
extras.putSerializable("Contact", contact);
|
||||||
extras.putBoolean("ChatAddressOnly", chatOnly);
|
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);
|
history_selected.setVisibility(View.VISIBLE);
|
||||||
break;
|
break;
|
||||||
case CONTACTS_LIST:
|
case CONTACTS_LIST:
|
||||||
case CONTACT:
|
case CONTACT_DETAIL:
|
||||||
case EDIT_CONTACT:
|
case CONTACT_EDITOR:
|
||||||
contacts_selected.setVisibility(View.VISIBLE);
|
contacts_selected.setVisibility(View.VISIBLE);
|
||||||
break;
|
break;
|
||||||
case DIALER:
|
case DIALER:
|
||||||
|
@ -1049,14 +1049,14 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
||||||
{
|
{
|
||||||
Bundle extras = new Bundle();
|
Bundle extras = new Bundle();
|
||||||
extras.putSerializable("NewSipAdress", sipUri);
|
extras.putSerializable("NewSipAdress", sipUri);
|
||||||
changeCurrentFragment(FragmentsAvailable.EDIT_CONTACT, extras);
|
changeCurrentFragment(FragmentsAvailable.CONTACT_EDITOR, extras);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void editContact(Contact contact)
|
public void editContact(Contact contact)
|
||||||
{
|
{
|
||||||
Bundle extras = new Bundle();
|
Bundle extras = new Bundle();
|
||||||
extras.putSerializable("Contact", contact);
|
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();
|
Bundle extras = new Bundle();
|
||||||
extras.putSerializable("Contact", contact);
|
extras.putSerializable("Contact", contact);
|
||||||
extras.putSerializable("NewSipAdress", sipAddress);
|
extras.putSerializable("NewSipAdress", sipAddress);
|
||||||
changeCurrentFragment(FragmentsAvailable.EDIT_CONTACT, extras);
|
changeCurrentFragment(FragmentsAvailable.CONTACT_EDITOR, extras);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void quit() {
|
public void quit() {
|
||||||
|
|
Loading…
Reference in a new issue