diff --git a/res/layout/in_app_purchasable.xml b/res/layout/in_app_purchasable.xml index 1af59b944..768c58572 100644 --- a/res/layout/in_app_purchasable.xml +++ b/res/layout/in_app_purchasable.xml @@ -5,26 +5,15 @@ android:layout_height="match_parent" android:gravity="center_vertical" android:orientation="vertical" > - - - - - - - - + android:paddingRight="10dp" + android:layout_width="match_parent" + android:layout_height="40dp"/> \ No newline at end of file diff --git a/res/layout/in_app_store.xml b/res/layout/in_app_store.xml index 2e390ebba..ba4341aed 100644 --- a/res/layout/in_app_store.xml +++ b/res/layout/in_app_store.xml @@ -1,78 +1,95 @@ - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + false false false + false https://www.linphone.org/wizard.php diff --git a/res/values/non_localizable_strings.xml b/res/values/non_localizable_strings.xml index 2a3a3b75b..0c20b9bd4 100644 --- a/res/values/non_localizable_strings.xml +++ b/res/values/non_localizable_strings.xml @@ -34,6 +34,7 @@ pref_sipaccounts_key setup_key pref_add_account_key + pref_in_app_store_key pref_video_key pref_video_codecs_key diff --git a/res/values/strings.xml b/res/values/strings.xml index 04e309487..dbae8f581 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -219,6 +219,7 @@ SIP Accounts Default account Add account + In-app Store Tunnel Hostname Port diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 83ef8c15d..8eab25ca6 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -10,8 +10,8 @@ android:key="@string/pref_add_account_key"/> + android:title="@string/pref_in_app_store" + android:key="@string/pref_in_app_store_key"/> purchasedItems; - private ImageView buyItemButton, recoverAccountButton; + private Button buyItemButton, recoverAccountButton; private Handler mHandler = new Handler(); private EditText username, email; @@ -66,11 +67,10 @@ public class InAppPurchaseActivity extends Activity implements InAppPurchaseList setContentView(R.layout.in_app_store); purchasableItemsLayout = (LinearLayout) findViewById(R.id.purchasable_items); - username = (EditText) findViewById(R.id.setup_username); - email = (EditText) findViewById(R.id.setup_email); - ImageView usernameOkIV = (ImageView) findViewById(R.id.setup_username_ok); - addUsernameHandler(username, usernameOkIV); - errorMessage = (TextView) findViewById(R.id.setup_error); + username = (EditText) findViewById(R.id.username); + email = (EditText) findViewById(R.id.email); + errorMessage = (TextView) findViewById(R.id.username_error); + addUsernameHandler(username, errorMessage); } @Override @@ -174,11 +174,11 @@ public class InAppPurchaseActivity extends Activity implements InAppPurchaseList private void displayBuySubscriptionButton(Purchasable item) { View layout = LayoutInflater.from(this).inflate(R.layout.in_app_purchasable, purchasableItemsLayout); - TextView text = (TextView) layout.findViewById(R.id.text); - text.setText("Buy account (" + item.getPrice() + ")"); - ImageView image = (ImageView) layout.findViewById(R.id.image); - image.setTag(item); - image.setOnClickListener(this);XmlRpcHelper xmlRpcHelper = new XmlRpcHelper(); + Button button = (Button) layout.findViewById(R.id.inapp_button); + button.setText("Buy account (" + item.getPrice() + ")"); + button.setTag(item); + button.setOnClickListener(this); + XmlRpcHelper xmlRpcHelper = new XmlRpcHelper(); xmlRpcHelper.createAccountAsync(new XmlRpcListenerBase() { @Override public void onAccountCreated(String result) { @@ -186,19 +186,18 @@ public class InAppPurchaseActivity extends Activity implements InAppPurchaseList } }, getUsername(), email.getText().toString(), null); - buyItemButton = image; + buyItemButton = button; buyItemButton.setEnabled(usernameOk); } private void displayRecoverAccountButton(Purchasable item) { View layout = LayoutInflater.from(this).inflate(R.layout.in_app_purchasable, purchasableItemsLayout); - TextView text = (TextView) layout.findViewById(R.id.text); - text.setText("Recover account"); - ImageView image = (ImageView) layout.findViewById(R.id.image); - image.setTag(item); - image.setOnClickListener(this); + Button button = (Button) layout.findViewById(R.id.inapp_button); + button.setText("Recover account"); + button.setTag(item); + button.setOnClickListener(this); - recoverAccountButton = image; + recoverAccountButton = button; recoverAccountButton.setEnabled(usernameOk); } @@ -214,7 +213,7 @@ public class InAppPurchaseActivity extends Activity implements InAppPurchaseList return lpc.isPhoneNumber(username); } - private void addUsernameHandler(final EditText field, final ImageView icon) { + private void addUsernameHandler(final EditText field, final TextView errorMessage) { field.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Editable s) { @@ -229,11 +228,9 @@ public class InAppPurchaseActivity extends Activity implements InAppPurchaseList String username = s.toString(); if (isUsernameCorrect(username)) { usernameOk = true; - //icon.setImageResource(R.drawable.wizard_ok); errorMessage.setText(""); } else { errorMessage.setText(R.string.wizard_username_incorrect); - //icon.setImageResource(R.drawable.wizard_notok); } if (buyItemButton != null) buyItemButton.setEnabled(usernameOk); if (recoverAccountButton != null) recoverAccountButton.setEnabled(usernameOk);