From d81eedae55312d98b845da73660e6393ca3d3ab3 Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Mon, 12 Jul 2021 17:59:12 +0300 Subject: [PATCH 1/9] Added parsing of semicolon separated phones. Added multiple phones on place details UI. Call button on place page now shows popup if case of multiple phone numbers. Edit UI changes. Replace phone input field with text view and new PhoneFragment. Added phones validation on save. Signed-off-by: S. Kozyr --- android/res/layout/fragment_editor.xml | 36 ++++- android/res/layout/fragment_phone.xml | 44 ++++++ android/res/layout/item_phone.xml | 47 ++++++ android/res/layout/place_page_details.xml | 2 +- android/res/layout/place_page_phone.xml | 7 +- android/res/layout/place_page_phone_list.xml | 13 ++ .../maps/editor/EditorFragment.java | 19 ++- .../maps/editor/EditorHostFragment.java | 19 ++- .../maps/editor/PhoneListAdapter.java | 143 ++++++++++++++++++ .../maps/editor/data/PhoneFragment.java | 58 +++++++ .../maps/widget/placepage/PlacePageView.java | 87 +++++++++-- 11 files changed, 444 insertions(+), 31 deletions(-) create mode 100644 android/res/layout/fragment_phone.xml create mode 100644 android/res/layout/item_phone.xml create mode 100644 android/res/layout/place_page_phone_list.xml create mode 100644 android/src/com/mapswithme/maps/editor/PhoneListAdapter.java create mode 100644 android/src/com/mapswithme/maps/editor/data/PhoneFragment.java diff --git a/android/res/layout/fragment_editor.xml b/android/res/layout/fragment_editor.xml index 1b74eacac2..7495a85f16 100644 --- a/android/res/layout/fragment_editor.xml +++ b/android/res/layout/fragment_editor.xml @@ -144,9 +144,39 @@ - + + + + + diff --git a/android/res/layout/fragment_phone.xml b/android/res/layout/fragment_phone.xml new file mode 100644 index 0000000000..347a670973 --- /dev/null +++ b/android/res/layout/fragment_phone.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/res/layout/item_phone.xml b/android/res/layout/item_phone.xml new file mode 100644 index 0000000000..e362495f31 --- /dev/null +++ b/android/res/layout/item_phone.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/res/layout/place_page_details.xml b/android/res/layout/place_page_details.xml index 45ad4b6902..f1f5414675 100644 --- a/android/res/layout/place_page_details.xml +++ b/android/res/layout/place_page_details.xml @@ -42,7 +42,7 @@ - + diff --git a/android/res/layout/place_page_phone.xml b/android/res/layout/place_page_phone.xml index ce9091f87e..442308cfbb 100644 --- a/android/res/layout/place_page_phone.xml +++ b/android/res/layout/place_page_phone.xml @@ -4,9 +4,12 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/ll__place_phone" style="@style/PlacePageItemFrame" - android:tag="phone" tools:background="#2000FF00" - tools:visibility="visible"> + android:orientation="horizontal" + android:visibility="visible" + android:tag="phone"> + + + + \ No newline at end of file diff --git a/android/src/com/mapswithme/maps/editor/EditorFragment.java b/android/src/com/mapswithme/maps/editor/EditorFragment.java index 554fab46d1..e9d4a47394 100644 --- a/android/src/com/mapswithme/maps/editor/EditorFragment.java +++ b/android/src/com/mapswithme/maps/editor/EditorFragment.java @@ -97,7 +97,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe private EditText mZipcode; private View mBlockLevels; private EditText mBuildingLevels; - private EditText mPhone; + private TextView mPhone; + private TextView mEditPhoneLink; private EditText mWebsite; private EditText mEmail; private TextView mCuisine; @@ -107,7 +108,6 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe private TextInputLayout mInputHouseNumber; private TextInputLayout mInputBuildingLevels; private TextInputLayout mInputZipcode; - private TextInputLayout mInputPhone; private TextInputLayout mInputWebsite; private TextInputLayout mInputEmail; @@ -170,14 +170,14 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe }); mPhone.setText(Editor.nativeGetPhone()); - mPhone.addTextChangedListener(new StringUtils.SimpleTextWatcher() + /*mPhone.addTextChangedListener(new StringUtils.SimpleTextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { UiUtils.setInputError(mInputPhone, Editor.nativeIsPhoneValid(s.toString()) ? 0 : R.string.error_enter_correct_phone); } - }); + });*/ mWebsite.setText(Editor.nativeGetWebsite()); mWebsite.addTextChangedListener(new StringUtils.SimpleTextWatcher() @@ -222,7 +222,6 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe Editor.nativeSetHouseNumber(mHouseNumber.getText().toString()); Editor.nativeSetZipCode(mZipcode.getText().toString()); Editor.nativeSetBuildingLevels(mBuildingLevels.getText().toString()); - Editor.nativeSetPhone(mPhone.getText().toString()); Editor.nativeSetWebsite(mWebsite.getText().toString()); Editor.nativeSetEmail(mEmail.getText().toString()); Editor.nativeSetHasWifi(mWifi.isChecked()); @@ -433,9 +432,10 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe mBuildingLevels.setInputType(InputType.TYPE_CLASS_NUMBER); mInputBuildingLevels = mBlockLevels.findViewById(R.id.custom_input); View blockPhone = view.findViewById(R.id.block_phone); - mPhone = findInputAndInitBlock(blockPhone, R.drawable.ic_phone, R.string.phone); - mPhone.setInputType(InputType.TYPE_CLASS_PHONE); - mInputPhone = blockPhone.findViewById(R.id.custom_input); + mPhone = blockPhone.findViewById(R.id.phone); + mEditPhoneLink = blockPhone.findViewById(R.id.edit_phone); + mEditPhoneLink.setOnClickListener(this); + mPhone.setOnClickListener(this); View blockWeb = view.findViewById(R.id.block_website); mWebsite = findInputAndInitBlock(blockWeb, R.drawable.ic_website, R.string.website); mWebsite.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI); @@ -502,6 +502,9 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe case R.id.opening_hours: mParent.editTimetable(); break; + case R.id.phone: + case R.id.edit_phone: + mParent.editPhone(); case R.id.block_wifi: mWifi.toggle(); break; diff --git a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java index 49863f7948..8f71fbe580 100644 --- a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java +++ b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java @@ -27,6 +27,7 @@ import com.mapswithme.maps.editor.data.Language; import com.mapswithme.maps.editor.data.LocalizedName; import com.mapswithme.maps.editor.data.LocalizedStreet; import com.mapswithme.maps.editor.data.NamesDataSource; +import com.mapswithme.maps.editor.data.PhoneFragment; import com.mapswithme.maps.intent.Factory; import com.mapswithme.maps.widget.SearchToolbarController; import com.mapswithme.maps.widget.ToolbarController; @@ -48,7 +49,8 @@ public class EditorHostFragment extends BaseMwmToolbarFragment OPENING_HOURS, STREET, CUISINE, - LANGUAGE + LANGUAGE, + PHONE } private Mode mMode; @@ -171,6 +173,7 @@ public class EditorHostFragment extends BaseMwmToolbarFragment case STREET: case CUISINE: case LANGUAGE: + case PHONE: editMapObject(); break; default: @@ -206,6 +209,13 @@ public class EditorHostFragment extends BaseMwmToolbarFragment editWithFragment(Mode.OPENING_HOURS, R.string.editor_time_title, args, TimetableContainerFragment.class, false); } + protected void editPhone() + { + final Bundle args = new Bundle(); + args.putString(PhoneFragment.EXTRA_PHONE_LIST, Editor.nativeGetPhone()); + editWithFragment(Mode.PHONE, R.string.phone_number, args, PhoneFragment.class, false); + } + protected void editStreet() { editWithFragment(Mode.STREET, R.string.choose_street, null, StreetFragment.class, false); @@ -301,6 +311,13 @@ public class EditorHostFragment extends BaseMwmToolbarFragment saveMapObjectEdits(); } break; + case PHONE: + final String phone = ((PhoneFragment) getChildFragmentManager().findFragmentByTag(PhoneFragment.class.getName())).getPhone(); + if (Editor.nativeIsPhoneValid(phone)) { + Editor.nativeSetPhone(phone); + editMapObject(); + } + break; } } } diff --git a/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java b/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java new file mode 100644 index 0000000000..0ded2be1cb --- /dev/null +++ b/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java @@ -0,0 +1,143 @@ +package com.mapswithme.maps.editor; + +import android.text.Editable; +import android.text.TextUtils; +import android.util.Log; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.android.material.textfield.TextInputLayout; +import com.mapswithme.maps.R; +import com.mapswithme.util.StringUtils; +import com.mapswithme.util.UiUtils; + +import java.util.ArrayList; +import java.util.List; + +public class PhoneListAdapter extends RecyclerView.Adapter { + + private List phonesData = new ArrayList<>(); + + public PhoneListAdapter() { + phonesData.add(""); + } + + public PhoneListAdapter(String phoneList) { + if(TextUtils.isEmpty(phoneList)) { + phonesData.add(""); + return; + } + + phonesData = new ArrayList<>(); + for(String p: phoneList.split(";")) { + p = p.trim(); + if(TextUtils.isEmpty(p)) continue; + phonesData.add(p); + } + + if(phonesData.size() == 0) phonesData.add(""); + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_phone, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull PhoneListAdapter.ViewHolder holder, int position) { + holder.setPosition(position); + holder.setPhone(phonesData.get(position)); + } + + @Override + public int getItemCount() { + return phonesData.size(); + } + + @Override + public long getItemId(int position) { + return position; + } + + public void appendPhone() { + phonesData.add(""); + notifyDataSetChanged(); + } + + public String getPhoneList() { + StringBuilder sb = new StringBuilder(); + for(int i=0; i0) sb.append(';'); + sb.append(p); + } + } + String phoneList = sb.toString(); + return phoneList; + } + + protected class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { + private int mPosition = -1; + private final EditText mInput; + private final ImageView deleteButton; + + public ViewHolder(@NonNull View itemView) { + super(itemView); + + mInput = itemView.findViewById(R.id.input); + final TextInputLayout phoneInput = itemView.findViewById(R.id.phone_input); + mInput.addTextChangedListener(new StringUtils.SimpleTextWatcher() + { + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) + { + UiUtils.setInputError(phoneInput, Editor.nativeIsPhoneValid(s.toString()) ? 0 : R.string.error_enter_correct_phone); + PhoneListAdapter.this.updatePhoneItem(mPosition, mInput.getText().toString()); + } + }); + + deleteButton = itemView.findViewById(R.id.delete_icon); + deleteButton.setOnClickListener(this); + //TODO: setting icons from code because icons defined in layout XML are white. + deleteButton.setImageResource(R.drawable.ic_delete); + ((ImageView)itemView.findViewById(R.id.phone_icon)).setImageResource(R.drawable.ic_phone); + } + + public void setPosition(int position) { + mPosition = position; + } + + public void setPhone(String phone) { + if(!mInput.getText().toString().equals(phone)) { + mInput.setText(phone); + } + } + + @Override + public void onClick(View view) { + if(view.getId() == R.id.delete_icon) { + PhoneListAdapter.this.deleteItem(mPosition); + } + } + } + + private void updatePhoneItem(int position, String text) { + if(position == -1) return; + phonesData.set(position, text); + } + + void deleteItem(int position) { + phonesData.remove(position); + notifyDataSetChanged(); + } +} diff --git a/android/src/com/mapswithme/maps/editor/data/PhoneFragment.java b/android/src/com/mapswithme/maps/editor/data/PhoneFragment.java new file mode 100644 index 0000000000..ab5fa1a764 --- /dev/null +++ b/android/src/com/mapswithme/maps/editor/data/PhoneFragment.java @@ -0,0 +1,58 @@ +package com.mapswithme.maps.editor.data; + +import android.app.Fragment; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.mapswithme.maps.R; +import com.mapswithme.maps.base.BaseMwmFragment; +import com.mapswithme.maps.editor.PhoneListAdapter; + +public class PhoneFragment extends BaseMwmFragment implements View.OnClickListener { + public static final String EXTRA_PHONE_LIST = "Phone"; + private PhoneListAdapter mAdapter; + private RecyclerView mPhonesRecycler; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) + { + return inflater.inflate(R.layout.fragment_phone, container, false); + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + final Bundle args = getArguments(); + String phoneList = null; + if (args != null) + phoneList = args.getString(EXTRA_PHONE_LIST); + mAdapter = new PhoneListAdapter(phoneList); + mAdapter.setHasStableIds(true); + + view.findViewById(R.id.tv__append_phone).setOnClickListener(this); + mPhonesRecycler = view.findViewById(R.id.phones_recycler); + LinearLayoutManager manager = new LinearLayoutManager(view.getContext()); + manager.setSmoothScrollbarEnabled(true); + mPhonesRecycler.setLayoutManager(manager); + mPhonesRecycler.setAdapter(mAdapter); + } + + public String getPhone() { + return mAdapter != null ? mAdapter.getPhoneList() : null; + } + + @Override + public void onClick(View view) { + if(view.getId() == R.id.tv__append_phone) { + if (mAdapter != null) mAdapter.appendPhone(); + } + } +} diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index efe0e9c375..1602c1edbe 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -15,6 +15,7 @@ import android.text.style.ForegroundColorSpan; import android.text.util.Linkify; import android.util.AttributeSet; import android.util.Base64; +import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MotionEvent; @@ -96,8 +97,7 @@ public class PlacePageView extends NestedScrollViewClickFixed private ArrowView mAvDirection; private TextView mTvDistance; private TextView mTvAddress; - private View mPhone; - private TextView mTvPhone; + private ViewGroup mPhoneList; private View mWebsite; private TextView mTvWebsite; private TextView mTvLatlon; @@ -292,9 +292,7 @@ public class PlacePageView extends NestedScrollViewClickFixed mTvAddress = mPreview.findViewById(R.id.tv__address); RelativeLayout address = findViewById(R.id.ll__place_name); - mPhone = findViewById(R.id.ll__place_phone); - mPhone.setOnClickListener(this); - mTvPhone = findViewById(R.id.tv__place_phone); + mPhoneList = findViewById(R.id.ll__place_phone_list); mWebsite = findViewById(R.id.ll__place_website); mWebsite.setOnClickListener(this); mTvWebsite = findViewById(R.id.tv__place_website); @@ -327,7 +325,6 @@ public class PlacePageView extends NestedScrollViewClickFixed mEditTopSpace = findViewById(R.id.edit_top_space); latlon.setOnLongClickListener(this); address.setOnLongClickListener(this); - mPhone.setOnLongClickListener(this); mWebsite.setOnLongClickListener(this); mOpeningHours.setOnLongClickListener(this); mEmail.setOnLongClickListener(this); @@ -451,7 +448,7 @@ public class PlacePageView extends NestedScrollViewClickFixed break; case CALL: - onCallBtnClicked(); + onCallBtnClicked(buttons); break; } } @@ -538,9 +535,38 @@ public class PlacePageView extends NestedScrollViewClickFixed RoutingController.get().removeStop(mMapObject); } - private void onCallBtnClicked() + private List getAllPhones() { + List phones = new ArrayList<>(mPhoneList.getChildCount()); + for(int i=0; i< mPhoneList.getChildCount(); i++) { + TextView tvPhoneNumber = mPhoneList.getChildAt(i).findViewById(R.id.tv__place_phone); + phones.add(tvPhoneNumber.getText().toString()); + } + return phones; + } + + private void onCallBtnClicked(View parentView) { - Utils.callPhone(getContext(), mTvPhone.getText().toString()); + final List phones = getAllPhones(); + if(phones.size() == 1) { + Utils.callPhone(getContext(), phones.get(0)); + } + else { + //Show popup menu with all phones + final PopupMenu popup = new PopupMenu(getContext(), parentView); + final Menu menu = popup.getMenu(); + + for (int i = 0; i < phones.size(); i++) + menu.add(Menu.NONE, i, i, phones.get(i)); + + popup.setOnMenuItemClickListener(item -> { + final int id = item.getItemId(); + final Context ctx = getContext(); + Utils.callPhone(ctx, phones.get(id)); + return true; + }); + + popup.show(); + } } public void setRoutingModeListener(@Nullable RoutingModeListener routingModeListener) @@ -772,7 +798,8 @@ public class PlacePageView extends NestedScrollViewClickFixed String website = mapObject.getMetadata(Metadata.MetadataType.FMD_WEBSITE); String url = mapObject.getMetadata(Metadata.MetadataType.FMD_URL); refreshMetadataOrHide(TextUtils.isEmpty(website) ? url : website, mWebsite, mTvWebsite); - refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_PHONE_NUMBER), mPhone, mTvPhone); + //refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_PHONE_NUMBER), mPhone, mTvPhone); + refreshPhoneNumberList(mapObject.getMetadata(Metadata.MetadataType.FMD_PHONE_NUMBER)); refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_EMAIL), mEmail, mTvEmail); refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_OPERATOR), mOperator, mTvOperator); refreshMetadataOrHide(Framework.nativeGetActiveObjectFormattedCuisine(), mCuisine, mTvCuisine); @@ -871,6 +898,27 @@ public class PlacePageView extends NestedScrollViewClickFixed mTodayOpeningHours.setTextColor(color); } + private void refreshPhoneNumberList(String phones) { + mPhoneList.removeAllViews(); + + if (!TextUtils.isEmpty(phones)) { + for(String phoneNumber: phones.split(";")) { + phoneNumber = phoneNumber.trim(); + if (phoneNumber.trim().length() == 0) continue; + Log.i(TAG, "refreshPhoneNumberList: adding phone "+phoneNumber); + + final View phoneView = LayoutInflater.from(getContext()).inflate(R.layout.place_page_phone, null); + final TextView tvPhoneNumber = phoneView.findViewById(R.id.tv__place_phone); + tvPhoneNumber.setText(phoneNumber); + phoneView.setTag(R.id.place_phone_tag, phoneNumber); + phoneView.setVisibility(VISIBLE); + phoneView.setOnClickListener(this); + phoneView.setOnLongClickListener(this); + mPhoneList.addView(phoneView); + } + } + } + private void updateBookmarkButton() { if (mBookmarkButtonIcon == null || mBookmarkButtonFrame == null) @@ -1111,9 +1159,9 @@ public class PlacePageView extends NestedScrollViewClickFixed } refreshLatLon(mMapObject); break; - case R.id.ll__place_phone: - Utils.callPhone(getContext(), mTvPhone.getText().toString()); - break; + //case R.id.ll__place_phone: + // Utils.callPhone(getContext(), mTvPhone.getText().toString()); + // break; case R.id.ll__place_website: Utils.openUrl(getContext(), mTvWebsite.getText().toString()); break; @@ -1133,6 +1181,10 @@ public class PlacePageView extends NestedScrollViewClickFixed Utils.sendTo(getContext(), mTvEmail.getText().toString()); break; } + + if (v.getTag(R.id.place_phone_tag) != null) { + Utils.callPhone(getContext(), v.getTag(R.id.place_phone_tag).toString()); + } } private void toggleIsBookmark(@NonNull MapObject mapObject) @@ -1179,9 +1231,9 @@ public class PlacePageView extends NestedScrollViewClickFixed case R.id.ll__place_email: items.add(mTvEmail.getText().toString()); break; - case R.id.ll__place_phone: - items.add(mTvPhone.getText().toString()); - break; + //case R.id.ll__place_phone: + // items.add(mTvPhone.getText().toString()); + // break; case R.id.ll__place_schedule: String text = UiUtils.isVisible(mFullOpeningHours) ? mFullOpeningHours.getText().toString() @@ -1200,6 +1252,9 @@ public class PlacePageView extends NestedScrollViewClickFixed items.add(mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA)); break; } + if (v.getTag(R.id.place_phone_tag) != null) { + items.add(v.getTag(R.id.place_phone_tag).toString()); + } final String copyText = getResources().getString(android.R.string.copy); for (int i = 0; i < items.size(); i++) -- 2.45.3 From beb13b2a64cf3a46c747bd0c8c238a82e9f5a26d Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Tue, 13 Jul 2021 16:16:24 +0300 Subject: [PATCH 2/9] Reformatter code. Removed commented code. Signed-off-by: S. Kozyr --- .../maps/editor/EditorHostFragment.java | 3 +- .../maps/editor/PhoneListAdapter.java | 227 ++++++++++-------- .../maps/editor/data/PhoneFragment.java | 80 +++--- .../maps/widget/placepage/PlacePageView.java | 36 +-- 4 files changed, 185 insertions(+), 161 deletions(-) diff --git a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java index 8f71fbe580..65b8bb0b08 100644 --- a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java +++ b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java @@ -313,7 +313,8 @@ public class EditorHostFragment extends BaseMwmToolbarFragment break; case PHONE: final String phone = ((PhoneFragment) getChildFragmentManager().findFragmentByTag(PhoneFragment.class.getName())).getPhone(); - if (Editor.nativeIsPhoneValid(phone)) { + if (Editor.nativeIsPhoneValid(phone)) + { Editor.nativeSetPhone(phone); editMapObject(); } diff --git a/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java b/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java index 0ded2be1cb..026571b665 100644 --- a/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java +++ b/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java @@ -1,15 +1,11 @@ package com.mapswithme.maps.editor; -import android.text.Editable; import android.text.TextUtils; -import android.util.Log; -import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ImageView; -import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; @@ -22,122 +18,143 @@ import com.mapswithme.util.UiUtils; import java.util.ArrayList; import java.util.List; -public class PhoneListAdapter extends RecyclerView.Adapter { +public class PhoneListAdapter extends RecyclerView.Adapter +{ + private List phonesData = new ArrayList<>(); - private List phonesData = new ArrayList<>(); + public PhoneListAdapter() + { + phonesData.add(""); + } - public PhoneListAdapter() { - phonesData.add(""); + public PhoneListAdapter(String phoneList) + { + if (TextUtils.isEmpty(phoneList)) + { + phonesData.add(""); + return; } - public PhoneListAdapter(String phoneList) { - if(TextUtils.isEmpty(phoneList)) { - phonesData.add(""); - return; - } - - phonesData = new ArrayList<>(); - for(String p: phoneList.split(";")) { - p = p.trim(); - if(TextUtils.isEmpty(p)) continue; - phonesData.add(p); - } - - if(phonesData.size() == 0) phonesData.add(""); + phonesData = new ArrayList<>(); + for (String p : phoneList.split(";")) + { + p = p.trim(); + if (TextUtils.isEmpty(p)) continue; + phonesData.add(p); } - @NonNull - @Override - public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { - return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_phone, parent, false)); + if (phonesData.size() == 0) phonesData.add(""); + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) + { + return new ViewHolder(LayoutInflater.from(parent.getContext()) + .inflate(R.layout.item_phone, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull PhoneListAdapter.ViewHolder holder, int position) + { + holder.setPosition(position); + holder.setPhone(phonesData.get(position)); + } + + @Override + public int getItemCount() + { + return phonesData.size(); + } + + @Override + public long getItemId(int position) + { + return position; + } + + public void appendPhone() + { + phonesData.add(""); + notifyDataSetChanged(); + } + + public String getPhoneList() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < phonesData.size(); i++) + { + final String p = phonesData.get(i).trim(); + if (!TextUtils.isEmpty(p)) + { + if (sb.length() > 0) sb.append(';'); + sb.append(p); + } } + return sb.toString(); + } - @Override - public void onBindViewHolder(@NonNull PhoneListAdapter.ViewHolder holder, int position) { - holder.setPosition(position); - holder.setPhone(phonesData.get(position)); - } + protected class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener + { + private int mPosition = -1; + private final EditText mInput; + private final ImageView deleteButton; - @Override - public int getItemCount() { - return phonesData.size(); - } - - @Override - public long getItemId(int position) { - return position; - } - - public void appendPhone() { - phonesData.add(""); - notifyDataSetChanged(); - } - - public String getPhoneList() { - StringBuilder sb = new StringBuilder(); - for(int i=0; i0) sb.append(';'); - sb.append(p); - } - } - String phoneList = sb.toString(); - return phoneList; - } - - protected class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { - private int mPosition = -1; - private final EditText mInput; - private final ImageView deleteButton; - - public ViewHolder(@NonNull View itemView) { - super(itemView); - - mInput = itemView.findViewById(R.id.input); - final TextInputLayout phoneInput = itemView.findViewById(R.id.phone_input); - mInput.addTextChangedListener(new StringUtils.SimpleTextWatcher() - { - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) - { - UiUtils.setInputError(phoneInput, Editor.nativeIsPhoneValid(s.toString()) ? 0 : R.string.error_enter_correct_phone); - PhoneListAdapter.this.updatePhoneItem(mPosition, mInput.getText().toString()); - } - }); - - deleteButton = itemView.findViewById(R.id.delete_icon); - deleteButton.setOnClickListener(this); - //TODO: setting icons from code because icons defined in layout XML are white. - deleteButton.setImageResource(R.drawable.ic_delete); - ((ImageView)itemView.findViewById(R.id.phone_icon)).setImageResource(R.drawable.ic_phone); - } - - public void setPosition(int position) { - mPosition = position; - } - - public void setPhone(String phone) { - if(!mInput.getText().toString().equals(phone)) { - mInput.setText(phone); - } - } + public ViewHolder(@NonNull View itemView) + { + super(itemView); + mInput = itemView.findViewById(R.id.input); + final TextInputLayout phoneInput = itemView.findViewById(R.id.phone_input); + mInput.addTextChangedListener(new StringUtils.SimpleTextWatcher() + { @Override - public void onClick(View view) { - if(view.getId() == R.id.delete_icon) { - PhoneListAdapter.this.deleteItem(mPosition); - } + public void onTextChanged(CharSequence s, int start, int before, int count) + { + UiUtils.setInputError(phoneInput, Editor.nativeIsPhoneValid(s.toString()) ? 0 : R.string.error_enter_correct_phone); + PhoneListAdapter.this.updatePhoneItem(mPosition, mInput.getText().toString()); } + }); + + deleteButton = itemView.findViewById(R.id.delete_icon); + deleteButton.setOnClickListener(this); + //TODO: setting icons from code because icons defined in layout XML are white. + deleteButton.setImageResource(R.drawable.ic_delete); + ((ImageView) itemView.findViewById(R.id.phone_icon)).setImageResource(R.drawable.ic_phone); } - private void updatePhoneItem(int position, String text) { - if(position == -1) return; - phonesData.set(position, text); + public void setPosition(int position) + { + mPosition = position; } - void deleteItem(int position) { - phonesData.remove(position); - notifyDataSetChanged(); + public void setPhone(String phone) + { + if (!mInput.getText().toString().equals(phone)) + { + mInput.setText(phone); + } } + + @Override + public void onClick(View view) + { + if (view.getId() == R.id.delete_icon) + { + PhoneListAdapter.this.deleteItem(mPosition); + } + } + } + + private void updatePhoneItem(int position, String text) + { + if (position == -1) return; + phonesData.set(position, text); + } + + void deleteItem(int position) + { + phonesData.remove(position); + notifyDataSetChanged(); + } } diff --git a/android/src/com/mapswithme/maps/editor/data/PhoneFragment.java b/android/src/com/mapswithme/maps/editor/data/PhoneFragment.java index ab5fa1a764..10ecd6d327 100644 --- a/android/src/com/mapswithme/maps/editor/data/PhoneFragment.java +++ b/android/src/com/mapswithme/maps/editor/data/PhoneFragment.java @@ -1,6 +1,5 @@ package com.mapswithme.maps.editor.data; -import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -15,44 +14,49 @@ import com.mapswithme.maps.R; import com.mapswithme.maps.base.BaseMwmFragment; import com.mapswithme.maps.editor.PhoneListAdapter; -public class PhoneFragment extends BaseMwmFragment implements View.OnClickListener { - public static final String EXTRA_PHONE_LIST = "Phone"; - private PhoneListAdapter mAdapter; - private RecyclerView mPhonesRecycler; +public class PhoneFragment extends BaseMwmFragment implements View.OnClickListener +{ + public static final String EXTRA_PHONE_LIST = "Phone"; + private PhoneListAdapter mAdapter; + private RecyclerView mPhonesRecycler; - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) + { + return inflater.inflate(R.layout.fragment_phone, container, false); + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) + { + super.onViewCreated(view, savedInstanceState); + + final Bundle args = getArguments(); + String phoneList = null; + if (args != null) + phoneList = args.getString(EXTRA_PHONE_LIST); + mAdapter = new PhoneListAdapter(phoneList); + mAdapter.setHasStableIds(true); + + view.findViewById(R.id.tv__append_phone).setOnClickListener(this); + mPhonesRecycler = view.findViewById(R.id.phones_recycler); + LinearLayoutManager manager = new LinearLayoutManager(view.getContext()); + manager.setSmoothScrollbarEnabled(true); + mPhonesRecycler.setLayoutManager(manager); + mPhonesRecycler.setAdapter(mAdapter); + } + + public String getPhone() + { + return mAdapter != null ? mAdapter.getPhoneList() : null; + } + + @Override + public void onClick(View view) + { + if (view.getId() == R.id.tv__append_phone) { - return inflater.inflate(R.layout.fragment_phone, container, false); - } - - @Override - public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - final Bundle args = getArguments(); - String phoneList = null; - if (args != null) - phoneList = args.getString(EXTRA_PHONE_LIST); - mAdapter = new PhoneListAdapter(phoneList); - mAdapter.setHasStableIds(true); - - view.findViewById(R.id.tv__append_phone).setOnClickListener(this); - mPhonesRecycler = view.findViewById(R.id.phones_recycler); - LinearLayoutManager manager = new LinearLayoutManager(view.getContext()); - manager.setSmoothScrollbarEnabled(true); - mPhonesRecycler.setLayoutManager(manager); - mPhonesRecycler.setAdapter(mAdapter); - } - - public String getPhone() { - return mAdapter != null ? mAdapter.getPhoneList() : null; - } - - @Override - public void onClick(View view) { - if(view.getId() == R.id.tv__append_phone) { - if (mAdapter != null) mAdapter.appendPhone(); - } + if (mAdapter != null) mAdapter.appendPhone(); } + } } diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 1602c1edbe..31cec6e44d 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -535,9 +535,11 @@ public class PlacePageView extends NestedScrollViewClickFixed RoutingController.get().removeStop(mMapObject); } - private List getAllPhones() { + private List getAllPhones() + { List phones = new ArrayList<>(mPhoneList.getChildCount()); - for(int i=0; i< mPhoneList.getChildCount(); i++) { + for (int i = 0; i < mPhoneList.getChildCount(); i++) + { TextView tvPhoneNumber = mPhoneList.getChildAt(i).findViewById(R.id.tv__place_phone); phones.add(tvPhoneNumber.getText().toString()); } @@ -547,10 +549,12 @@ public class PlacePageView extends NestedScrollViewClickFixed private void onCallBtnClicked(View parentView) { final List phones = getAllPhones(); - if(phones.size() == 1) { + if (phones.size() == 1) + { Utils.callPhone(getContext(), phones.get(0)); } - else { + else + { //Show popup menu with all phones final PopupMenu popup = new PopupMenu(getContext(), parentView); final Menu menu = popup.getMenu(); @@ -798,7 +802,6 @@ public class PlacePageView extends NestedScrollViewClickFixed String website = mapObject.getMetadata(Metadata.MetadataType.FMD_WEBSITE); String url = mapObject.getMetadata(Metadata.MetadataType.FMD_URL); refreshMetadataOrHide(TextUtils.isEmpty(website) ? url : website, mWebsite, mTvWebsite); - //refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_PHONE_NUMBER), mPhone, mTvPhone); refreshPhoneNumberList(mapObject.getMetadata(Metadata.MetadataType.FMD_PHONE_NUMBER)); refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_EMAIL), mEmail, mTvEmail); refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_OPERATOR), mOperator, mTvOperator); @@ -898,16 +901,20 @@ public class PlacePageView extends NestedScrollViewClickFixed mTodayOpeningHours.setTextColor(color); } - private void refreshPhoneNumberList(String phones) { + private void refreshPhoneNumberList(String phones) + { mPhoneList.removeAllViews(); - if (!TextUtils.isEmpty(phones)) { - for(String phoneNumber: phones.split(";")) { + if (!TextUtils.isEmpty(phones)) + { + for (String phoneNumber : phones.split(";")) + { phoneNumber = phoneNumber.trim(); if (phoneNumber.trim().length() == 0) continue; - Log.i(TAG, "refreshPhoneNumberList: adding phone "+phoneNumber); + Log.i(TAG, "refreshPhoneNumberList: adding phone " + phoneNumber); - final View phoneView = LayoutInflater.from(getContext()).inflate(R.layout.place_page_phone, null); + final View phoneView = LayoutInflater.from(getContext()) + .inflate(R.layout.place_page_phone, null); final TextView tvPhoneNumber = phoneView.findViewById(R.id.tv__place_phone); tvPhoneNumber.setText(phoneNumber); phoneView.setTag(R.id.place_phone_tag, phoneNumber); @@ -1182,9 +1189,8 @@ public class PlacePageView extends NestedScrollViewClickFixed break; } - if (v.getTag(R.id.place_phone_tag) != null) { + if (v.getTag(R.id.place_phone_tag) != null) Utils.callPhone(getContext(), v.getTag(R.id.place_phone_tag).toString()); - } } private void toggleIsBookmark(@NonNull MapObject mapObject) @@ -1231,9 +1237,6 @@ public class PlacePageView extends NestedScrollViewClickFixed case R.id.ll__place_email: items.add(mTvEmail.getText().toString()); break; - //case R.id.ll__place_phone: - // items.add(mTvPhone.getText().toString()); - // break; case R.id.ll__place_schedule: String text = UiUtils.isVisible(mFullOpeningHours) ? mFullOpeningHours.getText().toString() @@ -1252,9 +1255,8 @@ public class PlacePageView extends NestedScrollViewClickFixed items.add(mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA)); break; } - if (v.getTag(R.id.place_phone_tag) != null) { + if (v.getTag(R.id.place_phone_tag) != null) items.add(v.getTag(R.id.place_phone_tag).toString()); - } final String copyText = getResources().getString(android.R.string.copy); for (int i = 0; i < items.size(); i++) -- 2.45.3 From 4b5d278054a1bb14be90affe94a5ad0e9fb73b09 Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Tue, 13 Jul 2021 16:19:10 +0300 Subject: [PATCH 3/9] Reformatted code Signed-off-by: S. Kozyr --- android/src/com/mapswithme/maps/editor/PhoneListAdapter.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java b/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java index 026571b665..4cfa3a924c 100644 --- a/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java +++ b/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java @@ -131,18 +131,14 @@ public class PhoneListAdapter extends RecyclerView.Adapter Date: Fri, 16 Jul 2021 10:43:52 +0300 Subject: [PATCH 4/9] Added RecyclerView to show multiple phones on a place details fragment. Signed-off-by: S. Kozyr --- android/res/layout/place_page_details.xml | 8 +- ...ge_phone.xml => place_page_phone_item.xml} | 2 - android/res/layout/place_page_phone_list.xml | 13 -- .../maps/widget/placepage/PlacePageView.java | 53 ++------ .../widget/placepage/PlacePhoneAdapter.java | 122 ++++++++++++++++++ 5 files changed, 142 insertions(+), 56 deletions(-) rename android/res/layout/{place_page_phone.xml => place_page_phone_item.xml} (91%) delete mode 100644 android/res/layout/place_page_phone_list.xml create mode 100644 android/src/com/mapswithme/maps/widget/placepage/PlacePhoneAdapter.java diff --git a/android/res/layout/place_page_details.xml b/android/res/layout/place_page_details.xml index f1f5414675..28d0fc6686 100644 --- a/android/res/layout/place_page_details.xml +++ b/android/res/layout/place_page_details.xml @@ -4,6 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" + xmlns:app="http://schemas.android.com/apk/res-auto" android:background="?windowBackgroundForced" android:orientation="vertical"> @@ -42,7 +43,12 @@ - + diff --git a/android/res/layout/place_page_phone.xml b/android/res/layout/place_page_phone_item.xml similarity index 91% rename from android/res/layout/place_page_phone.xml rename to android/res/layout/place_page_phone_item.xml index 442308cfbb..60a1334857 100644 --- a/android/res/layout/place_page_phone.xml +++ b/android/res/layout/place_page_phone_item.xml @@ -8,8 +8,6 @@ android:orientation="horizontal" android:visibility="visible" android:tag="phone"> - - - - \ No newline at end of file diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index 31cec6e44d..03a58fd5a8 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -4,7 +4,6 @@ import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Color; -import android.graphics.drawable.Drawable; import android.location.Location; import android.os.Build; import android.text.Html; @@ -15,7 +14,6 @@ import android.text.style.ForegroundColorSpan; import android.text.util.Linkify; import android.util.AttributeSet; import android.util.Base64; -import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MotionEvent; @@ -35,6 +33,7 @@ import androidx.appcompat.widget.Toolbar; import androidx.core.widget.NestedScrollViewClickFixed; import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; import com.mapswithme.maps.Framework; import com.mapswithme.maps.MwmActivity; import com.mapswithme.maps.MwmApplication; @@ -97,7 +96,8 @@ public class PlacePageView extends NestedScrollViewClickFixed private ArrowView mAvDirection; private TextView mTvDistance; private TextView mTvAddress; - private ViewGroup mPhoneList; + private RecyclerView mPhoneRecycler; + private PlacePhoneAdapter mPhoneAdapter; private View mWebsite; private TextView mTvWebsite; private TextView mTvLatlon; @@ -292,7 +292,9 @@ public class PlacePageView extends NestedScrollViewClickFixed mTvAddress = mPreview.findViewById(R.id.tv__address); RelativeLayout address = findViewById(R.id.ll__place_name); - mPhoneList = findViewById(R.id.ll__place_phone_list); + mPhoneRecycler = findViewById(R.id.rw__phone); + mPhoneAdapter = new PlacePhoneAdapter(); + mPhoneRecycler.setAdapter(mPhoneAdapter); mWebsite = findViewById(R.id.ll__place_website); mWebsite.setOnClickListener(this); mTvWebsite = findViewById(R.id.tv__place_website); @@ -537,13 +539,7 @@ public class PlacePageView extends NestedScrollViewClickFixed private List getAllPhones() { - List phones = new ArrayList<>(mPhoneList.getChildCount()); - for (int i = 0; i < mPhoneList.getChildCount(); i++) - { - TextView tvPhoneNumber = mPhoneList.getChildAt(i).findViewById(R.id.tv__place_phone); - phones.add(tvPhoneNumber.getText().toString()); - } - return phones; + return mPhoneAdapter.getPhonesList(); } private void onCallBtnClicked(View parentView) @@ -903,27 +899,7 @@ public class PlacePageView extends NestedScrollViewClickFixed private void refreshPhoneNumberList(String phones) { - mPhoneList.removeAllViews(); - - if (!TextUtils.isEmpty(phones)) - { - for (String phoneNumber : phones.split(";")) - { - phoneNumber = phoneNumber.trim(); - if (phoneNumber.trim().length() == 0) continue; - Log.i(TAG, "refreshPhoneNumberList: adding phone " + phoneNumber); - - final View phoneView = LayoutInflater.from(getContext()) - .inflate(R.layout.place_page_phone, null); - final TextView tvPhoneNumber = phoneView.findViewById(R.id.tv__place_phone); - tvPhoneNumber.setText(phoneNumber); - phoneView.setTag(R.id.place_phone_tag, phoneNumber); - phoneView.setVisibility(VISIBLE); - phoneView.setOnClickListener(this); - phoneView.setOnLongClickListener(this); - mPhoneList.addView(phoneView); - } - } + mPhoneAdapter.refreshPhones(phones); } private void updateBookmarkButton() @@ -1015,7 +991,12 @@ public class PlacePageView extends NestedScrollViewClickFixed buttons.add(PlacePageButtons.Item.BACK); if (mapObject.hasPhoneNumber()) + { buttons.add(PlacePageButtons.Item.CALL); + mPhoneRecycler.setVisibility(VISIBLE); + } + else + mPhoneRecycler.setVisibility(GONE); buttons.add(PlacePageButtons.Item.BOOKMARK); @@ -1166,9 +1147,6 @@ public class PlacePageView extends NestedScrollViewClickFixed } refreshLatLon(mMapObject); break; - //case R.id.ll__place_phone: - // Utils.callPhone(getContext(), mTvPhone.getText().toString()); - // break; case R.id.ll__place_website: Utils.openUrl(getContext(), mTvWebsite.getText().toString()); break; @@ -1188,9 +1166,6 @@ public class PlacePageView extends NestedScrollViewClickFixed Utils.sendTo(getContext(), mTvEmail.getText().toString()); break; } - - if (v.getTag(R.id.place_phone_tag) != null) - Utils.callPhone(getContext(), v.getTag(R.id.place_phone_tag).toString()); } private void toggleIsBookmark(@NonNull MapObject mapObject) @@ -1255,8 +1230,6 @@ public class PlacePageView extends NestedScrollViewClickFixed items.add(mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA)); break; } - if (v.getTag(R.id.place_phone_tag) != null) - items.add(v.getTag(R.id.place_phone_tag).toString()); final String copyText = getResources().getString(android.R.string.copy); for (int i = 0; i < items.size(); i++) diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePhoneAdapter.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePhoneAdapter.java new file mode 100644 index 0000000000..41144dc3bc --- /dev/null +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePhoneAdapter.java @@ -0,0 +1,122 @@ +package com.mapswithme.maps.widget.placepage; + +import android.content.Context; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.View; +import android.view.ViewGroup; +import android.widget.PopupMenu; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; +import com.mapswithme.maps.R; +import com.mapswithme.util.Utils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class PlacePhoneAdapter extends RecyclerView.Adapter +{ + public static String TAG = "PlacePhoneAdapter"; + + private List mPhoneData = Collections.emptyList(); + + public PlacePhoneAdapter() {} + + public PlacePhoneAdapter(String phones) { + refreshPhones(phones); + } + + public void refreshPhones(String phones) { + Log.w(TAG, "refreshPhones: " + phones); + if (TextUtils.isEmpty(phones)) + return; + + mPhoneData = new ArrayList<>(); + for (String p : phones.split(";")) + { + p = p.trim(); + if (TextUtils.isEmpty(p)) continue; + Log.w(TAG, "adding phone: "+p); + mPhoneData.add(p); + } + + notifyDataSetChanged(); + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) + { + return new ViewHolder(LayoutInflater.from(parent.getContext()) + .inflate(R.layout.place_page_phone_item, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull PlacePhoneAdapter.ViewHolder holder, int position) + { + holder.setPhone(mPhoneData.get(position)); + } + + @Override + public int getItemCount() + { + return mPhoneData.size(); + } + + public List getPhonesList() + { + return new ArrayList<>(mPhoneData); + } + + public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener + { + private TextView mPhone; + + public ViewHolder(@NonNull View itemView) + { + super(itemView); + mPhone = itemView.findViewById(R.id.tv__place_phone); + itemView.setVisibility(View.VISIBLE); + itemView.setOnClickListener(this); + itemView.setOnLongClickListener(this); + } + + public void setPhone(String phoneNumber) + { + Log.w(PlacePhoneAdapter.TAG + ".ViewHolder", "setPhone: "+phoneNumber); + mPhone.setText(phoneNumber); + } + + @Override + public void onClick(View view) + { + Utils.callPhone(view.getContext(), mPhone.getText().toString()); + } + + @Override + public boolean onLongClick(View view) + { + final PopupMenu popup = new PopupMenu(view.getContext(), view); + final Menu menu = popup.getMenu(); + final String copyText = view.getResources().getString(android.R.string.copy); + final String phoneNumber = mPhone.getText().toString(); + menu.add(Menu.NONE, 0, 0, String.format("%s %s", copyText, phoneNumber)); + + popup.setOnMenuItemClickListener(item -> { + final Context ctx = view.getContext(); + Utils.copyTextToClipboard(ctx, phoneNumber); + Utils.showSnackbarAbove(view, view.getRootView().findViewById(R.id.menu_frame), + ctx.getString(R.string.copied_to_clipboard, phoneNumber)); + return true; + }); + + popup.show(); + return true; + } + } +} -- 2.45.3 From d8e2c79847ab7d1f67e5a90756149dcc5361bc35 Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Fri, 16 Jul 2021 17:39:22 +0300 Subject: [PATCH 5/9] Changed layout to support RTL languages and removed redundant attributes. Extracted new string "editor_add_phone" = "Add phone". Signed-off-by: S. Kozyr --- android/res/layout/fragment_editor.xml | 8 ++------ android/res/layout/fragment_phone.xml | 2 +- android/res/layout/item_phone.xml | 15 ++++++--------- android/res/values/strings.xml | 1 + 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/android/res/layout/fragment_editor.xml b/android/res/layout/fragment_editor.xml index 7495a85f16..b64cbfd092 100644 --- a/android/res/layout/fragment_editor.xml +++ b/android/res/layout/fragment_editor.xml @@ -158,20 +158,16 @@ android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginStart="@dimen/editor_margin_left" - android:layout_toLeftOf="@+id/edit_phone" android:layout_toStartOf="@+id/edit_phone"/> diff --git a/android/res/layout/item_phone.xml b/android/res/layout/item_phone.xml index e362495f31..a63ed93b8f 100644 --- a/android/res/layout/item_phone.xml +++ b/android/res/layout/item_phone.xml @@ -6,10 +6,8 @@ android:background="?clickableBackground" android:gravity="center_vertical" android:orientation="horizontal" - android:paddingEnd="@dimen/margin_base" - android:paddingLeft="@dimen/margin_half_plus" - android:paddingRight="@dimen/margin_base" - android:paddingStart="@dimen/margin_half_plus"> + android:paddingStart="@dimen/margin_half_plus" + android:paddingEnd="@dimen/margin_half"> + android:layout_alignParentEnd="true"/> \ No newline at end of file diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index c10668a03c..c02bf5a19c 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -641,6 +641,7 @@ You’ve changed the world map. Do not keep it to yourself! Tell your friends, and edit it together. This is the second time you edited the map. Now you are number %d in the map editors ranking. Tell your friends about it. You’ve improved the map, tell your friends about it, and edit the map together. + Add phone Share with friends Please describe the problem in detail so that the OpenStreeMap community can fix the error. Or do it yourself at https://www.openstreetmap.org/ -- 2.45.3 From 8b53e90df0c3a07a0ff77343e9a0f80179c761bc Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Mon, 19 Jul 2021 11:22:58 +0300 Subject: [PATCH 6/9] Added "phone_number" string value. Signed-off-by: S. Kozyr --- android/res/values-ar/strings.xml | 1 + android/res/values-cs/strings.xml | 1 + android/res/values-da/strings.xml | 1 + android/res/values-de/strings.xml | 1 + android/res/values-el/strings.xml | 1 + android/res/values-es/strings.xml | 1 + android/res/values-fa/strings.xml | 1 + android/res/values-fi/strings.xml | 1 + android/res/values-fr/strings.xml | 1 + android/res/values-hu/strings.xml | 1 + android/res/values-in/strings.xml | 1 + android/res/values-it/strings.xml | 1 + android/res/values-ja/strings.xml | 1 + android/res/values-ko/strings.xml | 1 + android/res/values-nb/strings.xml | 1 + android/res/values-nl/strings.xml | 1 + android/res/values-pl/strings.xml | 1 + android/res/values-pt/strings.xml | 1 + android/res/values-ro/strings.xml | 1 + android/res/values-ru/strings.xml | 1 + android/res/values-sk/strings.xml | 1 + android/res/values-sv/strings.xml | 1 + android/res/values-th/strings.xml | 1 + android/res/values-tr/strings.xml | 1 + android/res/values-uk/strings.xml | 1 + android/res/values-vi/strings.xml | 1 + android/res/values-zh-rTW/strings.xml | 1 + android/res/values-zh/strings.xml | 1 + android/res/values/strings.xml | 1 + 29 files changed, 29 insertions(+) diff --git a/android/res/values-ar/strings.xml b/android/res/values-ar/strings.xml index 5beda721e5..81269bf23d 100644 --- a/android/res/values-ar/strings.xml +++ b/android/res/values-ar/strings.xml @@ -603,6 +603,7 @@ هذا الاسم أخذ سابقا يرجى اختيار اسم آخر أرجو الإنتظار… + رقم الهاتف الملف الشخصي OpenStreetMap ابحث عن فنادق مماثلة تم اكتشاف ملفات جديدة diff --git a/android/res/values-cs/strings.xml b/android/res/values-cs/strings.xml index 323ba34fa7..e07f1b8f35 100644 --- a/android/res/values-cs/strings.xml +++ b/android/res/values-cs/strings.xml @@ -601,6 +601,7 @@ Toto jméno již bylo provedeno Zvolte jiný název Prosím, čekejte… + Telefonní číslo Profil OpenStreetMap Hledat podobné hotely Byly zjištěny nové soubory diff --git a/android/res/values-da/strings.xml b/android/res/values-da/strings.xml index f138df6fb5..67f74d04b4 100644 --- a/android/res/values-da/strings.xml +++ b/android/res/values-da/strings.xml @@ -603,6 +603,7 @@ Dette navn er allerede taget Vælg venligst et andet navn Vent venligst… + Telefonnummer OpenStreetMap profil Søg lignende hoteller Nye filer registreret diff --git a/android/res/values-de/strings.xml b/android/res/values-de/strings.xml index 61bec12200..c114748b40 100644 --- a/android/res/values-de/strings.xml +++ b/android/res/values-de/strings.xml @@ -605,6 +605,7 @@ Dieser Name ist bereits vergeben Bitte wähle einen anderen Namen Warten Sie mal… + Telefonnummer OpenStreetMap-Profil Nach ähnlichen Hotels suchen Neue Dateien erkannt diff --git a/android/res/values-el/strings.xml b/android/res/values-el/strings.xml index e1c334dc59..ab1098ca9e 100644 --- a/android/res/values-el/strings.xml +++ b/android/res/values-el/strings.xml @@ -599,6 +599,7 @@ Αυτό το όνομα έχει ήδη ληφθεί Επιλέξτε άλλο όνομα Παρακαλώ περιμένετε… + Τηλεφωνικό νούμερο Προφίλ OpenStreetMap Αναζήτηση παρόμοιων ξενοδοχείων Εντοπίστηκαν νέα αρχεία diff --git a/android/res/values-es/strings.xml b/android/res/values-es/strings.xml index 59551c1f29..2e02ce5049 100644 --- a/android/res/values-es/strings.xml +++ b/android/res/values-es/strings.xml @@ -599,6 +599,7 @@ Este nombre ya ha sido tomado Por favor elige otro nombre Por favor espera… + Número de teléfono Perfil de OpenStreetMap Buscar hoteles similares Nuevos archivos detectados diff --git a/android/res/values-fa/strings.xml b/android/res/values-fa/strings.xml index d3d3249314..22da48c8ef 100644 --- a/android/res/values-fa/strings.xml +++ b/android/res/values-fa/strings.xml @@ -593,6 +593,7 @@ این اسم قبلا انتخاب شده است لطفا نام دیگری را انتخاب کنید لطفا صبر کنید… + شماره تلفن OpenStreetMap نمایه جست‌وجوی هتل‌های مشابه فایل‌های جدید پیدا شد diff --git a/android/res/values-fi/strings.xml b/android/res/values-fi/strings.xml index 7b83a7f8b1..c28dbff91d 100644 --- a/android/res/values-fi/strings.xml +++ b/android/res/values-fi/strings.xml @@ -603,6 +603,7 @@ Tämä nimi on jo otettu Valitse toinen nimi Odota… + Puhelinnumero OpenStreetMap-profiili Etsi samanlaisia ​​hotelleja Uusia tiedostoja havaittiin diff --git a/android/res/values-fr/strings.xml b/android/res/values-fr/strings.xml index 379cf0bee2..6e795faac7 100644 --- a/android/res/values-fr/strings.xml +++ b/android/res/values-fr/strings.xml @@ -609,6 +609,7 @@ Ce nom est déjà pris Merci de choisir un autre nom S\'il vous plaît, attendez… + Numéro de téléphone Profil OpenStreetMap Rechercher des hôtels similaires Nouveaux fichiers détectés diff --git a/android/res/values-hu/strings.xml b/android/res/values-hu/strings.xml index 1e0dd419de..fbea783882 100644 --- a/android/res/values-hu/strings.xml +++ b/android/res/values-hu/strings.xml @@ -600,6 +600,7 @@ Ez a név már foglalt Kérjük, válasszon másik nevet Kérlek várj… + Telefonszám OpenStreetMap profil Hasonló szálláshelyek keresése Új fájlokat észleltek diff --git a/android/res/values-in/strings.xml b/android/res/values-in/strings.xml index 66ade7b23e..9367e4792e 100644 --- a/android/res/values-in/strings.xml +++ b/android/res/values-in/strings.xml @@ -602,6 +602,7 @@ Nama ini sudah dipakai Silakan pilih nama lain Mohon tunggu… + Nomor telepon Profil OpenStreetMap Cari hotel serupa File baru terdeteksi diff --git a/android/res/values-it/strings.xml b/android/res/values-it/strings.xml index ada45d3370..3d359eb501 100644 --- a/android/res/values-it/strings.xml +++ b/android/res/values-it/strings.xml @@ -599,6 +599,7 @@ Questo nome è già stato scelto Si prega di scegliere un altro nome Attendere prego… + Numero di telefono Profilo OpenStreetMap Cerca hotel simili Nuovi file rilevati diff --git a/android/res/values-ja/strings.xml b/android/res/values-ja/strings.xml index e3fbb0e3de..503310fe41 100644 --- a/android/res/values-ja/strings.xml +++ b/android/res/values-ja/strings.xml @@ -599,6 +599,7 @@ この名前はすでに使用されています 別の名前を選んでください お待ちください… + 電話番号 OpenStreetMap プロフィール 類似のホテルを検索 新しいファイルが検出されました diff --git a/android/res/values-ko/strings.xml b/android/res/values-ko/strings.xml index c1c68fd172..def8081a89 100644 --- a/android/res/values-ko/strings.xml +++ b/android/res/values-ko/strings.xml @@ -601,6 +601,7 @@ 이 이름은 이미 사용 중입니다. 다른 이름을 선택하십시오. 잠시만 기다려주십시오… + 전화 번호 OpenStreetMap 프로필 비슷한 호텔 검색 새 파일이 감지되었습니다. diff --git a/android/res/values-nb/strings.xml b/android/res/values-nb/strings.xml index b10a05e77d..c50af5ec81 100644 --- a/android/res/values-nb/strings.xml +++ b/android/res/values-nb/strings.xml @@ -601,6 +601,7 @@ Dette navnet er allerede tatt Vennligst velg et annet navn Vennligst vent… + Telefonnummer OpenStreetMap profil Søk lignende hoteller Nye filer oppdaget diff --git a/android/res/values-nl/strings.xml b/android/res/values-nl/strings.xml index 4757c28271..d8e22cc5d0 100644 --- a/android/res/values-nl/strings.xml +++ b/android/res/values-nl/strings.xml @@ -598,6 +598,7 @@ Deze naam is al in gebruik Kies alstublieft een andere naam Even geduld aub… + Telefoonnummer OpenStreetMap-profiel Zoek vergelijkbare hotels Nieuwe bestanden gedetecteerd diff --git a/android/res/values-pl/strings.xml b/android/res/values-pl/strings.xml index 9092d87dc8..fa8b5d76d5 100644 --- a/android/res/values-pl/strings.xml +++ b/android/res/values-pl/strings.xml @@ -607,6 +607,7 @@ Ta nazwa jest już zajęta Wybierz inną nazwę Proszę czekać… + Numer telefonu Profil OpenStreetMap Wyszukaj podobne hotele Wykryto nowe pliki diff --git a/android/res/values-pt/strings.xml b/android/res/values-pt/strings.xml index 34aa59205d..9c8b85d32f 100644 --- a/android/res/values-pt/strings.xml +++ b/android/res/values-pt/strings.xml @@ -603,6 +603,7 @@ Esse nome já foi levado Por favor, escolha outro nome Por favor, espere… + Número de telefone Perfil do OpenStreetMap Pesquisar hotéis semelhantes Novos arquivos detectados diff --git a/android/res/values-ro/strings.xml b/android/res/values-ro/strings.xml index 9d38045022..c534f17885 100644 --- a/android/res/values-ro/strings.xml +++ b/android/res/values-ro/strings.xml @@ -602,6 +602,7 @@ Acest nume este deja luat Alegeți un alt nume Te rog asteapta… + Numar de telefon Profil OpenStreetMap Căutați hoteluri similare Au fost detectate fișiere noi diff --git a/android/res/values-ru/strings.xml b/android/res/values-ru/strings.xml index c45fc6aae7..42dd1683de 100644 --- a/android/res/values-ru/strings.xml +++ b/android/res/values-ru/strings.xml @@ -613,6 +613,7 @@ Такое имя уже занято Выберите, пожалуйста, другое имя Пожалуйста, подождите… + Номер телефона Профиль OpenStreetMap Найти похожие отели Обнаружены новые файлы diff --git a/android/res/values-sk/strings.xml b/android/res/values-sk/strings.xml index abe4da8566..9a6c482faf 100644 --- a/android/res/values-sk/strings.xml +++ b/android/res/values-sk/strings.xml @@ -599,6 +599,7 @@ Tento názov už bol prijatý Vyberte iné meno Prosím čakajte… + Telefónne číslo Profil OpenStreetMap Vyhľadať podobné hotely Zistené nové súbory diff --git a/android/res/values-sv/strings.xml b/android/res/values-sv/strings.xml index 8a22461414..6196dda371 100644 --- a/android/res/values-sv/strings.xml +++ b/android/res/values-sv/strings.xml @@ -599,6 +599,7 @@ Det här namnet är redan taget Vänligen välj ett annat namn Vänligen vänta… + Telefonnummer OpenStreetMap profil Sök liknande hotell Nya filer upptäcktes diff --git a/android/res/values-th/strings.xml b/android/res/values-th/strings.xml index b3930ae9fc..03a484c5d5 100644 --- a/android/res/values-th/strings.xml +++ b/android/res/values-th/strings.xml @@ -603,6 +603,7 @@ ชื่อนี้ถูกนำมาใช้แล้ว โปรดเลือกชื่ออื่น โปรดรอสักครู่ … + หมายเลขโทรศัพท์ โปรไฟล์ OpenStreetMap ค้นหาโรงแรมที่คล้ายกัน พบไฟล์ใหม่แล้ว diff --git a/android/res/values-tr/strings.xml b/android/res/values-tr/strings.xml index 0d240ac53d..89a1ebaf97 100644 --- a/android/res/values-tr/strings.xml +++ b/android/res/values-tr/strings.xml @@ -603,6 +603,7 @@ Bu isim zaten alınmış Lütfen başka bir isim seçiniz Lütfen bekle… + Telefon numarası OpenStreetMap profil Benzer otellerde ara Yeni dosyalar algılandı diff --git a/android/res/values-uk/strings.xml b/android/res/values-uk/strings.xml index 7623690585..20c261c470 100644 --- a/android/res/values-uk/strings.xml +++ b/android/res/values-uk/strings.xml @@ -604,6 +604,7 @@ Це ім\'я вже зайнято Виберіть інше ім\'я Будь ласка, зачекайте… + Номер телефону Профіль OpenStreetMap Шукати схожі готелі Виявлено нові файли diff --git a/android/res/values-vi/strings.xml b/android/res/values-vi/strings.xml index efe7362ab6..8fea5c2b8f 100644 --- a/android/res/values-vi/strings.xml +++ b/android/res/values-vi/strings.xml @@ -603,6 +603,7 @@ Tên này đã được sử dụng Vui lòng chọn một tên khác Vui lòng chờ… + Số điện thoại Hồ sơ OpenStreetMap Tìm kiếm khách sạn Đã phát hiện tệp mới diff --git a/android/res/values-zh-rTW/strings.xml b/android/res/values-zh-rTW/strings.xml index 7761d8fda3..89813fdaa2 100644 --- a/android/res/values-zh-rTW/strings.xml +++ b/android/res/values-zh-rTW/strings.xml @@ -605,6 +605,7 @@ 這個名字已經被使用了 請選擇其他名稱 請稍候… + 電話號碼 OpenStreetMap 資料 搜索類似的酒店 檢測到新文件 diff --git a/android/res/values-zh/strings.xml b/android/res/values-zh/strings.xml index 57e96fe223..99250ef7a7 100644 --- a/android/res/values-zh/strings.xml +++ b/android/res/values-zh/strings.xml @@ -601,6 +601,7 @@ 这个名字已经被使用了 请选择其他名称 请稍候… + 电话号码 OpenStreetMap 资料 搜索类似的酒店 检测到新文件 diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 6da70def90..0fe975c849 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -628,6 +628,7 @@ This name is already taken Please choose another name Please wait… + Phone number OpenStreetMap profile Search similar hotels New files detected -- 2.45.3 From 0f24510f311f4eda23538993fce79852ae76a4a3 Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Tue, 20 Jul 2021 10:54:45 +0300 Subject: [PATCH 7/9] Removed unused code. Fixed formatting Signed-off-by: S. Kozyr --- .../src/com/mapswithme/maps/editor/EditorFragment.java | 8 -------- .../src/com/mapswithme/maps/editor/PhoneListAdapter.java | 5 +++-- .../mapswithme/maps/widget/placepage/PlacePageView.java | 2 +- .../maps/widget/placepage/PlacePhoneAdapter.java | 5 ----- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/android/src/com/mapswithme/maps/editor/EditorFragment.java b/android/src/com/mapswithme/maps/editor/EditorFragment.java index e9d4a47394..e8de3abca4 100644 --- a/android/src/com/mapswithme/maps/editor/EditorFragment.java +++ b/android/src/com/mapswithme/maps/editor/EditorFragment.java @@ -170,14 +170,6 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe }); mPhone.setText(Editor.nativeGetPhone()); - /*mPhone.addTextChangedListener(new StringUtils.SimpleTextWatcher() - { - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) - { - UiUtils.setInputError(mInputPhone, Editor.nativeIsPhoneValid(s.toString()) ? 0 : R.string.error_enter_correct_phone); - } - });*/ mWebsite.setText(Editor.nativeGetWebsite()); mWebsite.addTextChangedListener(new StringUtils.SimpleTextWatcher() diff --git a/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java b/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java index 4cfa3a924c..77366a6d99 100644 --- a/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java +++ b/android/src/com/mapswithme/maps/editor/PhoneListAdapter.java @@ -87,7 +87,8 @@ public class PhoneListAdapter extends RecyclerView.Adapter 0) sb.append(';'); + if (sb.length() > 0) + sb.append(';'); sb.append(p); } } @@ -118,7 +119,7 @@ public class PhoneListAdapter extends RecyclerView.Adapter { - public static String TAG = "PlacePhoneAdapter"; private List mPhoneData = Collections.emptyList(); @@ -32,7 +30,6 @@ public class PlacePhoneAdapter extends RecyclerView.Adapter Date: Tue, 20 Jul 2021 11:05:48 +0300 Subject: [PATCH 8/9] Reverted "phone_number" string Signed-off-by: S. Kozyr --- data/strings/strings.txt | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/data/strings/strings.txt b/data/strings/strings.txt index 1f67f74257..38dd12647a 100644 --- a/data/strings/strings.txt +++ b/data/strings/strings.txt @@ -14548,6 +14548,40 @@ sk = Prosím čakajte… sw = Tafadhali subiri… + [phone_number] + en = Phone number + ru = Номер телефона + ar = رقم الهاتف + cs = Telefonní číslo + da = Telefonnummer + nl = Telefoonnummer + fi = Puhelinnumero + fr = Numéro de téléphone + de = Telefonnummer + hu = Telefonszám + id = Nomor telepon + it = Numero di telefono + ja = 電話番号 + ko = 전화 번호 + nb = Telefonnummer + pl = Numer telefonu + pt = Número de telefone + pt-BR = Número de telefone + ro = Numar de telefon + es = Número de teléfono + es_MX = Número de teléfono + sv = Telefonnummer + th = หมายเลขโทรศัพท์ + tr = Telefon numarası + uk = Номер телефону + vi = Số điện thoại + el = Τηλεφωνικό νούμερο + sk = Telefónne číslo + sw = Nambari ya simu + zh-Hans = 电话号码 + zh-Hant = 電話號碼 + fa = شماره تلفن + [profile] tags = ios, android en = OpenStreetMap profile -- 2.45.3 From fa5ba31363373871872ddc3d0601941784d94cb1 Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Tue, 20 Jul 2021 11:12:08 +0300 Subject: [PATCH 9/9] Formatter strings.xml using `clean_strings_txt.py` Signed-off-by: S. Kozyr --- data/strings/strings.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/data/strings/strings.txt b/data/strings/strings.txt index 38dd12647a..d0c48a00ef 100644 --- a/data/strings/strings.txt +++ b/data/strings/strings.txt @@ -9495,7 +9495,7 @@ sk = Email alebo používateľské meno [phone] - tags = ios, android + tags = ios en = Phone ru = Телефон ar = الهاتف @@ -14549,6 +14549,7 @@ sw = Tafadhali subiri… [phone_number] + tags = android en = Phone number ru = Номер телефона ar = رقم الهاتف @@ -14569,18 +14570,18 @@ pt-BR = Número de telefone ro = Numar de telefon es = Número de teléfono - es_MX = Número de teléfono sv = Telefonnummer th = หมายเลขโทรศัพท์ tr = Telefon numarası uk = Номер телефону vi = Số điện thoại - el = Τηλεφωνικό νούμερο - sk = Telefónne číslo - sw = Nambari ya simu zh-Hans = 电话号码 zh-Hant = 電話號碼 + el = Τηλεφωνικό νούμερο + es_MX = Número de teléfono fa = شماره تلفن + sk = Telefónne číslo + sw = Nambari ya simu [profile] tags = ios, android -- 2.45.3