fix Switch with R.id.object problem
This commit is contained in:
parent
c7dd9a30ce
commit
064ffd23e5
3 changed files with 80 additions and 100 deletions
|
@ -17,14 +17,6 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
import org.linphone.LinphoneManager;
|
|
||||||
import org.linphone.LinphonePreferences;
|
|
||||||
import org.linphone.R;
|
|
||||||
import org.linphone.core.LinphoneAccountCreator;
|
|
||||||
import org.linphone.core.LinphoneAccountCreator.LinphoneAccountCreatorListener;
|
|
||||||
import org.linphone.core.LinphoneCoreFactory;
|
|
||||||
import org.linphone.mediastream.Log;
|
|
||||||
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -34,6 +26,13 @@ import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.LinphonePreferences;
|
||||||
|
import org.linphone.R;
|
||||||
|
import org.linphone.core.LinphoneAccountCreator;
|
||||||
|
import org.linphone.core.LinphoneAccountCreator.LinphoneAccountCreatorListener;
|
||||||
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
|
@ -69,12 +68,10 @@ public class CreateAccountActivationFragment extends Fragment implements OnClick
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
int id = v.getId();
|
||||||
case R.id.assistant_check: {
|
if(id == R.id.assistant_check) {
|
||||||
checkAccount.setEnabled(false);
|
checkAccount.setEnabled(false);
|
||||||
accountCreator.isAccountActivated();
|
accountCreator.isAccountActivated();
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -296,23 +296,19 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
int id = v.getId();
|
||||||
case R.id.select_country: {
|
if(id == R.id.select_country){
|
||||||
AssistantActivity.instance().displayCountryChooser();
|
AssistantActivity.instance().displayCountryChooser();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else if (id == R.id.assistant_skip){
|
||||||
case R.id.assistant_skip: {
|
|
||||||
if (getArguments().getBoolean("LinkFromPref")) {
|
if (getArguments().getBoolean("LinkFromPref")) {
|
||||||
startActivity(new Intent().setClass(AssistantActivity.instance(), LinphoneActivity.class));
|
startActivity(new Intent().setClass(AssistantActivity.instance(), LinphoneActivity.class));
|
||||||
AssistantActivity.instance().finish();
|
AssistantActivity.instance().finish();
|
||||||
} else {
|
} else {
|
||||||
AssistantActivity.instance().success();
|
AssistantActivity.instance().success();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else if(id == R.id.info_phone_number){
|
||||||
case R.id.info_phone_number: {
|
|
||||||
if (linkAccount) {
|
if (linkAccount) {
|
||||||
new AlertDialog.Builder(getActivity())
|
new AlertDialog.Builder(getActivity())
|
||||||
.setTitle(getString(R.string.phone_number_info_title))
|
.setTitle(getString(R.string.phone_number_info_title))
|
||||||
|
@ -325,10 +321,8 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
|
||||||
.setMessage(getString(R.string.phone_number_info_content))
|
.setMessage(getString(R.string.phone_number_info_content))
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else if(id == R.id.assistant_create){
|
||||||
case R.id.assistant_create: {
|
|
||||||
createAccount.setEnabled(false);
|
createAccount.setEnabled(false);
|
||||||
if (linkAccount) {
|
if (linkAccount) {
|
||||||
addAlias();
|
addAlias();
|
||||||
|
@ -341,8 +335,6 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
|
||||||
createAccount.setEnabled(true);
|
createAccount.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,19 +17,6 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import org.linphone.LinphoneManager;
|
|
||||||
import org.linphone.LinphonePreferences;
|
|
||||||
import org.linphone.LinphoneUtils;
|
|
||||||
import org.linphone.R;
|
|
||||||
import org.linphone.compatibility.Compatibility;
|
|
||||||
import org.linphone.core.DialPlan;
|
|
||||||
import org.linphone.core.LinphoneAccountCreator;
|
|
||||||
import org.linphone.core.LinphoneCoreFactory;
|
|
||||||
import org.linphone.core.LinphoneProxyConfig;
|
|
||||||
import org.linphone.mediastream.Log;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -42,7 +29,6 @@ import android.text.method.LinkMovementMethod;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewDebug;
|
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
@ -52,6 +38,18 @@ import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
|
import org.linphone.LinphonePreferences;
|
||||||
|
import org.linphone.LinphoneUtils;
|
||||||
|
import org.linphone.R;
|
||||||
|
import org.linphone.compatibility.Compatibility;
|
||||||
|
import org.linphone.core.DialPlan;
|
||||||
|
import org.linphone.core.LinphoneAccountCreator;
|
||||||
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
|
import org.linphone.core.LinphoneProxyConfig;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
|
@ -231,31 +229,24 @@ public class LinphoneLoginFragment extends Fragment implements CompoundButton.On
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
if(id == R.id.assistant_apply){
|
||||||
switch(id) {
|
|
||||||
case R.id.assistant_apply: {
|
|
||||||
apply.setEnabled(false);
|
apply.setEnabled(false);
|
||||||
if (recoverAccount) {
|
if (recoverAccount) {
|
||||||
recoverAccount();
|
recoverAccount();
|
||||||
} else {
|
} else {
|
||||||
linphoneLogIn();
|
linphoneLogIn();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case R.id.info_phone_number: {
|
else if(id == R.id.info_phone_number){
|
||||||
new AlertDialog.Builder(getActivity())
|
new AlertDialog.Builder(getActivity())
|
||||||
.setTitle(getString(R.string.phone_number_info_title))
|
.setTitle(getString(R.string.phone_number_info_title))
|
||||||
.setMessage(getString(R.string.phone_number_link_info_content))
|
.setMessage(getString(R.string.phone_number_link_info_content))
|
||||||
.show();
|
.show();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case R.id.select_country: {
|
else if(id == R.id.select_country){
|
||||||
AssistantActivity.instance().displayCountryChooser();
|
AssistantActivity.instance().displayCountryChooser();
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void recoverAccount() {
|
private void recoverAccount() {
|
||||||
|
|
Loading…
Reference in a new issue