Added bools to customize options button in call and possibility to send files in chat + use let's go button in simple wizard to validate form

This commit is contained in:
Sylvain Berfini 2013-06-10 11:31:11 +02:00
parent fcb4ebc5dd
commit 3c7eab420f
8 changed files with 58 additions and 31 deletions

View file

@ -57,6 +57,7 @@
android:background="@drawable/setup_field_background" />
<RelativeLayout
android:id="@+id/setup_apply_button"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">

View file

@ -56,6 +56,7 @@
android:background="@drawable/setup_field_background" />
<RelativeLayout
android:id="@+id/setup_apply_button"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">

View file

@ -25,7 +25,7 @@
<bool name="hide_linphone_accounts_wizard">false</bool>
<bool name="hide_generic_accounts_wizard">false</bool>
<bool name="hide_accounts">false</bool>
<bool name="use_first_login_activity">true</bool>
<bool name="display_account_wizard_at_first_start">true</bool>
<bool name="use_android_native_contact_edit_interface">false</bool>
<!-- The following settings are only usefull if use_android_native_contact_edit_interface = false -->
@ -41,11 +41,11 @@
<bool name="display_messages_time_and_status">true</bool> <!-- Used to show the time of each message arrival -->
<bool name="display_time_aside">false</bool> <!-- if display_messages_time = true, display time on the side of the message instead of below -->
<bool name="display_call_stats">true</bool>
<bool name="enable_linphone_friends">false</bool>
<bool name="display_call_stats">true</bool>
<bool name="show_current_calls_above_video">false</bool>
<bool name="disable_options_in_call">false</bool>
<!-- Behavior Settings -->
<bool name="allow_chat_multiline">false</bool>
@ -55,6 +55,7 @@
<bool name="allow_edit_in_dialer">true</bool>
<bool name="forbid_self_call">false</bool>
<bool name="disable_chat">false</bool>
<bool name="disable_chat_send_file">false</bool>
<bool name="hash_images_as_name_before_upload">true</bool>

View file

@ -156,13 +156,17 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);
sendImage = (TextView) view.findViewById(R.id.sendPicture);
registerForContextMenu(sendImage);
sendImage.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
pickImage();
}
});
if (!getResources().getBoolean(R.bool.disable_chat_send_file)) {
registerForContextMenu(sendImage);
sendImage.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
pickImage();
}
});
} else {
sendImage.setEnabled(false);
}
cancelUpload = (ImageView) view.findViewById(R.id.cancelUpload);
cancelUpload.setOnClickListener(new OnClickListener() {

View file

@ -333,7 +333,12 @@ public class InCallActivity extends FragmentActivity implements
mHandler.post(new Runnable() {
@Override
public void run() {
options.setEnabled(true);
if (getResources().getBoolean(R.bool.disable_options_in_call)) {
options.setEnabled(false);
} else {
options.setEnabled(true);
}
video.setEnabled(true);
micro.setEnabled(true);
speaker.setEnabled(true);

View file

@ -138,7 +138,7 @@ public class LinphoneActivity extends FragmentActivity implements
return;
}
boolean useFirstLoginActivity = getResources().getBoolean(R.bool.use_first_login_activity);
boolean useFirstLoginActivity = getResources().getBoolean(R.bool.display_account_wizard_at_first_start);
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
if (useFirstLoginActivity && !pref.getBoolean(getString(R.string.first_launch_suceeded_once_key), false)) {
if (pref.getInt(getString(R.string.pref_extra_accounts), -1) > -1) {

View file

@ -45,20 +45,28 @@ public class LinphoneLoginFragment extends Fragment implements OnClickListener {
apply = (ImageView) view.findViewById(R.id.setup_apply);
apply.setOnClickListener(this);
if (getResources().getBoolean(R.bool.setup_use_linphone_as_first_fragment)) {
view.findViewById(R.id.setup_apply_button).setVisibility(View.GONE);
}
return view;
}
public void linphoneLogIn() {
if (login.getText() == null || login.length() == 0 || password.getText() == null || password.length() == 0) {
Toast.makeText(getActivity(), getString(R.string.first_launch_no_login_password), Toast.LENGTH_LONG).show();
return;
}
SetupActivity.instance().linphoneLogIn(login.getText().toString(), password.getText().toString());
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.setup_apply) {
if (login.getText() == null || login.length() == 0 || password.getText() == null || password.length() == 0) {
Toast.makeText(getActivity(), getString(R.string.first_launch_no_login_password), Toast.LENGTH_LONG).show();
return;
}
SetupActivity.instance().linphoneLogIn(login.getText().toString(), password.getText().toString());
linphoneLogIn();
}
}
}

View file

@ -45,6 +45,7 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
private SetupFragmentsEnum currentFragment;
private SharedPreferences mPref;
private SetupFragmentsEnum firstFragment;
private Fragment fragment;
private boolean accountCreated = false;
protected void onCreate(Bundle savedInstanceState) {
@ -110,15 +111,20 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
finish();
}
} else if (id == R.id.setup_next) {
if (currentFragment == SetupFragmentsEnum.WELCOME) {
MenuFragment fragment = new MenuFragment();
changeFragment(fragment);
currentFragment = SetupFragmentsEnum.MENU;
if (firstFragment == SetupFragmentsEnum.LINPHONE_LOGIN) {
LinphoneLoginFragment linphoneFragment = (LinphoneLoginFragment) fragment;
linphoneFragment.linphoneLogIn();
} else {
if (currentFragment == SetupFragmentsEnum.WELCOME) {
MenuFragment fragment = new MenuFragment();
changeFragment(fragment);
currentFragment = SetupFragmentsEnum.MENU;
next.setVisibility(View.GONE);
back.setVisibility(View.VISIBLE);
} else if (currentFragment == SetupFragmentsEnum.WIZARD_CONFIRM) {
finish();
next.setVisibility(View.GONE);
back.setVisibility(View.VISIBLE);
} else if (currentFragment == SetupFragmentsEnum.WIZARD_CONFIRM) {
finish();
}
}
} else if (id == R.id.setup_back) {
onBackPressed();
@ -224,24 +230,25 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
}
public void displayWelcome() {
changeFragment(new WelcomeFragment());
fragment = new WelcomeFragment();
changeFragment(fragment);
currentFragment = SetupFragmentsEnum.WELCOME;
}
public void displayLoginGeneric() {
GenericLoginFragment fragment = new GenericLoginFragment();
fragment = new GenericLoginFragment();
changeFragment(fragment);
currentFragment = SetupFragmentsEnum.GENERIC_LOGIN;
}
public void displayLoginLinphone() {
LinphoneLoginFragment fragment = new LinphoneLoginFragment();
fragment = new LinphoneLoginFragment();
changeFragment(fragment);
currentFragment = SetupFragmentsEnum.LINPHONE_LOGIN;
}
public void displayWizard() {
WizardFragment fragment = new WizardFragment();
fragment = new WizardFragment();
changeFragment(fragment);
currentFragment = SetupFragmentsEnum.WIZARD;
}