Add custom options for rebranding

These are: use create account view at first start, hide assistant from side menu and hide options from side menu.

(cherry picked from commit a9eafaa9f34e82151531cf0fd5d37ed88f52b8dc)
This commit is contained in:
Mickaël Turnel 2018-09-28 14:33:19 +02:00
parent dc35dfeefe
commit 50373ebe53
3 changed files with 20 additions and 2 deletions

View file

@ -27,7 +27,10 @@
<!-- Assistant --> <!-- Assistant -->
<bool name="assistant_allow_username">true</bool> <!-- Allow to use an username instead of the phone number for account creation --> <bool name="assistant_allow_username">true</bool> <!-- Allow to use an username instead of the phone number for account creation -->
<!-- Only on should be set to true at a time! If not the first one will be used -->
<bool name="assistant_use_linphone_login_as_first_fragment">false</bool><!-- Start assistant in loginFragment view instead of menu --> <bool name="assistant_use_linphone_login_as_first_fragment">false</bool><!-- Start assistant in loginFragment view instead of menu -->
<bool name="assistant_use_create_linphone_account_as_first_fragment">false</bool><!-- Start Linphone creation account in loginFragment view instead of menu -->
<bool name="replace_assistant_with_old_interface">false</bool> <bool name="replace_assistant_with_old_interface">false</bool>
<bool name="hide_assistant">false</bool> <bool name="hide_assistant">false</bool>
@ -91,6 +94,10 @@
<bool name="allow_only_one_sip_address">false</bool> <bool name="allow_only_one_sip_address">false</bool>
<bool name="display_contact_organization">true</bool> <bool name="display_contact_organization">true</bool>
<!-- Side Menu -->
<bool name="hide_assistant_from_side_menu">false</bool>
<bool name="hide_settings_from_side_menu">false</bool>
<!-- Others Parameters--> <!-- Others Parameters-->
<string name="about_bugreport_email">linphone-android@belledonne-communications.com</string> <string name="about_bugreport_email">linphone-android@belledonne-communications.com</string>
<bool name="enable_call_notification">true</bool> <bool name="enable_call_notification">true</bool>

View file

@ -1564,8 +1564,12 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
public void initSideMenu() { public void initSideMenu() {
sideMenu = findViewById(R.id.side_menu); sideMenu = findViewById(R.id.side_menu);
sideMenuItems = new ArrayList<>(); sideMenuItems = new ArrayList<>();
sideMenuItems.add(getResources().getString(R.string.menu_assistant)); if (!getResources().getBoolean(R.bool.hide_assistant_from_side_menu)) {
sideMenuItems.add(getResources().getString(R.string.menu_settings)); sideMenuItems.add(getResources().getString(R.string.menu_assistant));
}
if (!getResources().getBoolean(R.bool.hide_settings_from_side_menu)) {
sideMenuItems.add(getResources().getString(R.string.menu_settings));
}
if (getResources().getBoolean(R.bool.enable_in_app_purchase)) { if (getResources().getBoolean(R.bool.enable_in_app_purchase)) {
sideMenuItems.add(getResources().getString(R.string.inapp)); sideMenuItems.add(getResources().getString(R.string.inapp));
} }

View file

@ -124,6 +124,10 @@ public class AssistantActivity extends Activity implements OnClickListener, Acti
displayCreateAccount(); displayCreateAccount();
} else { } else {
firstFragment = getResources().getBoolean(R.bool.assistant_use_linphone_login_as_first_fragment) ? AssistantFragmentsEnum.LINPHONE_LOGIN : AssistantFragmentsEnum.WELCOME; firstFragment = getResources().getBoolean(R.bool.assistant_use_linphone_login_as_first_fragment) ? AssistantFragmentsEnum.LINPHONE_LOGIN : AssistantFragmentsEnum.WELCOME;
if (firstFragment == AssistantFragmentsEnum.WELCOME) {
firstFragment = getResources().getBoolean(R.bool.assistant_use_create_linphone_account_as_first_fragment) ? AssistantFragmentsEnum.CREATE_ACCOUNT : AssistantFragmentsEnum.WELCOME;
}
if (findViewById(R.id.fragment_container) != null) { if (findViewById(R.id.fragment_container) != null) {
if (savedInstanceState == null) { if (savedInstanceState == null) {
display(firstFragment); display(firstFragment);
@ -439,6 +443,9 @@ public class AssistantActivity extends Activity implements OnClickListener, Acti
case LINPHONE_LOGIN: case LINPHONE_LOGIN:
displayLoginLinphone(null, null); displayLoginLinphone(null, null);
break; break;
case CREATE_ACCOUNT:
displayCreateAccount();
break;
default: default:
throw new IllegalStateException("Can't handle " + fragment); throw new IllegalStateException("Can't handle " + fragment);
} }