修改注册页面选择国家区号功能,添加国家名称

This commit is contained in:
18401019693 2023-02-15 15:57:53 +08:00
parent f2cff3b93f
commit d86e16c9f5
4 changed files with 11 additions and 4 deletions

View File

@ -1002,4 +1002,5 @@ Limited ride And limited avatar frame</string>
<string name="live_user_ban_fhd" >There is no choice, the anchor is not turned on FHD live.</string> <string name="live_user_ban_fhd" >There is no choice, the anchor is not turned on FHD live.</string>
<string name="live_user_ban_hd" >There is no choice, the anchor is not turned on HD live.</string> <string name="live_user_ban_hd" >There is no choice, the anchor is not turned on HD live.</string>
<string name="function_is_suspended" >Sorry, this feature is on hold.</string> <string name="function_is_suspended" >Sorry, this feature is on hold.</string>
<string name="phone_number" >phone</string>
</resources> </resources>

View File

@ -1022,4 +1022,5 @@
<string name="live_user_ban_fhd" >無法選擇,該主播未開啟超高清直播。</string> <string name="live_user_ban_fhd" >無法選擇,該主播未開啟超高清直播。</string>
<string name="live_user_ban_hd" >無法選擇,該主播未開啟高清直播。</string> <string name="live_user_ban_hd" >無法選擇,該主播未開啟高清直播。</string>
<string name="function_is_suspended" >抱歉,該功能暫停使用中。</string> <string name="function_is_suspended" >抱歉,該功能暫停使用中。</string>
<string name="phone_number" >手機號</string>
</resources> </resources>

View File

@ -190,9 +190,12 @@ public class RegisterActivity extends AbsActivity {
allCountries.addAll(Country.getAll(mContext, null)); allCountries.addAll(Country.getAll(mContext, null));
String ct = Locale.getDefault().getCountry(); String ct = Locale.getDefault().getCountry();
ct = TextUtils.equals("CN", ct) ? "HK" : ct;
for (int i = 0; i < allCountries.size(); i++) { for (int i = 0; i < allCountries.size(); i++) {
if (allCountries.get(i).locale.equals(ct)) { if (allCountries.get(i).locale.equals(ct)) {
mTvCountryCode.setText("+" + allCountries.get(i).code); String countryName = allCountries.get(i).name;
countryName = countryName.length() > 4 ? countryName.substring(0, 4) : countryName;
mTvCountryCode.setText("+" + allCountries.get(i).code + " " + countryName);
mCountryCode = allCountries.get(i).code; mCountryCode = allCountries.get(i).code;
return; return;
} }
@ -260,7 +263,9 @@ public class RegisterActivity extends AbsActivity {
CountryPicker.newInstance(null, new OnPick() { CountryPicker.newInstance(null, new OnPick() {
@Override @Override
public void onPick(Country country) { public void onPick(Country country) {
mTvCountryCode.setText("+" + country.code); String countryName = country.name;
countryName = countryName.length() > 4 ? countryName.substring(0, 4) + "..." : countryName;
mTvCountryCode.setText(" +" + country.code + " " + countryName);
mCountryCode = country.code; mCountryCode = country.code;
} }
}).show(getSupportFragmentManager(), "country"); }).show(getSupportFragmentManager(), "country");
@ -506,7 +511,7 @@ public class RegisterActivity extends AbsActivity {
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
@Override @Override
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
NoviceInstructorManager.get(mContext).setFrist(false); NoviceInstructorManager.get(mContext).setFrist(false);
} }

View File

@ -96,7 +96,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:background="@null" android:background="@null"
android:hint="@string/reg_input_phone" android:hint="@string/phone_number"
android:inputType="number" android:inputType="number"
android:maxLength="11" android:maxLength="11"
android:textColor="@color/textColor" android:textColor="@color/textColor"