Skip to content

Commit

Permalink
时间电话区号列表添加
Browse files Browse the repository at this point in the history
  • Loading branch information
maning0303 committed Oct 15, 2020
1 parent 6bc9fce commit a6edd76
Show file tree
Hide file tree
Showing 29 changed files with 392 additions and 726 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
<activity android:name=".ui.activity.tools.ChineseCalendarActivity"/>
<activity android:name=".ui.activity.tools.OilPriceActivity"/>
<activity android:name=".ui.activity.tools.DictionaryActivity"/>
<activity android:name=".ui.activity.tools.IdiomActivity"/>
<activity android:name=".ui.activity.tools.WorldPhoneCodeActivity"/>
<activity android:name=".ui.activity.tools.HistoryTodayActivity"/>
<activity android:name=".ui.activity.tools.RubbishActivity"/>
<activity android:name=".ui.activity.tools.TrainActivity"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.maning.gankmm.bean.rolltools;

import java.util.List;

/**
* @author : maning
* @date : 2020-10-15
* @desc :
*/
public class WorldPhoneCodeResultBean extends RollToolsBaseBean {


private List<DataEntity> data;

public List<DataEntity> getData() {
return data;
}

public void setData(List<DataEntity> data) {
this.data = data;
}

public static class DataEntity {
/**
* zhCn : 中国
* enUs : China
* phoneCode : +86
*/

private String zhCn;
private String enUs;
private String phoneCode;

public String getZhCn() {
return zhCn;
}

public void setZhCn(String zhCn) {
this.zhCn = zhCn;
}

public String getEnUs() {
return enUs;
}

public void setEnUs(String enUs) {
this.enUs = enUs;
}

public String getPhoneCode() {
return phoneCode;
}

public void setPhoneCode(String phoneCode) {
this.phoneCode = phoneCode;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.maning.gankmm.bean.rolltools.MobileLocationResultBean;
import com.maning.gankmm.bean.rolltools.RubbishTypeResultBean;
import com.maning.gankmm.bean.rolltools.WeatherFuturedaysResultBean;
import com.maning.gankmm.bean.rolltools.WorldPhoneCodeResultBean;
import com.maning.gankmm.constant.Constants;

import retrofit2.Call;
Expand Down Expand Up @@ -92,4 +93,11 @@ Call<IpResultBean> getIpLocation(
@Query("ip") String ip
);

@Headers({
"app_id:" + Constants.ROLL_TOOLS_APP_ID,
"app_secret:" + Constants.ROLL_TOOLS_APP_SECRET
})
@GET("phone_code/list")
Call<WorldPhoneCodeResultBean> getWorldPhoneCode();

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.maning.gankmm.bean.rolltools.MobileLocationResultBean;
import com.maning.gankmm.bean.rolltools.RubbishTypeResultBean;
import com.maning.gankmm.bean.rolltools.WeatherFuturedaysResultBean;
import com.maning.gankmm.bean.rolltools.WorldPhoneCodeResultBean;
import com.maning.gankmm.http.BuildApi;
import com.maning.gankmm.http.callback.CommonHttpCallback;

Expand Down Expand Up @@ -95,5 +96,13 @@ public static void getIpLocation(String ip, CommonHttpCallback<IpResultBean> htt
BuildApi.getRooltoolsAPIService().getIpLocation(ip).enqueue(httpCallback);
}

/**
* 获取世界电话区号列表。
* @param httpCallback
*/
public static void getWorldPhoneCode(CommonHttpCallback<WorldPhoneCodeResultBean> httpCallback) {
BuildApi.getRooltoolsAPIService().getWorldPhoneCode().enqueue(httpCallback);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ private void initRecyclerView() {

private void initAdapter() {
ArrayList<String> mDatas = new ArrayList<>();
mDatas.add("生活常用");
mDatas.add("金融基金");
mDatas.add("休闲旅游");
mDatas.add("便民服务");
mDatas.add("生活阅读");
mDatas.add("休闲旅游");
mDatas.add("工具集合");
recycleMoreAdapter = new RecycleMoreAdapter(this, mDatas);
recyclerView.setAdapter(recycleMoreAdapter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.maning.gankmm.http.mob.MobApi;
import com.maning.gankmm.http.callback.MyCallBack;
import com.maning.gankmm.skin.SkinManager;
import com.maning.gankmm.ui.adapter.RecycleMobQueryAdapter;
import com.maning.gankmm.ui.adapter.RecycleCommonQueryAdapter;
import com.maning.gankmm.ui.base.BaseActivity;
import com.maning.gankmm.ui.view.MClearEditText;
import com.maning.gankmm.utils.KeyboardUtils;
Expand All @@ -38,7 +38,7 @@ public class BankCardActivity extends BaseActivity {
MClearEditText editTextInput;
@Bind(R.id.recyclerView)
RecyclerView recyclerView;
private RecycleMobQueryAdapter recycleMobQueryAdapter;
private RecycleCommonQueryAdapter recycleCommonQueryAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -125,11 +125,11 @@ private void initAdapter(MobBankCard result) {
mDatas.put("3", new CommonItemEntity("卡号长度:", String.valueOf(result.getCardNumber())));
mDatas.put("4", new CommonItemEntity("bin码:", result.getBin()));

if (recycleMobQueryAdapter == null) {
recycleMobQueryAdapter = new RecycleMobQueryAdapter(this, mDatas);
recyclerView.setAdapter(recycleMobQueryAdapter);
if (recycleCommonQueryAdapter == null) {
recycleCommonQueryAdapter = new RecycleCommonQueryAdapter(this, mDatas);
recyclerView.setAdapter(recycleCommonQueryAdapter);
} else {
recycleMobQueryAdapter.updateDatas(mDatas);
recycleCommonQueryAdapter.updateDatas(mDatas);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.maning.gankmm.http.callback.CommonHttpCallback;
import com.maning.gankmm.http.rolltools.RolltoolsApi;
import com.maning.gankmm.skin.SkinManager;
import com.maning.gankmm.ui.adapter.RecycleMobQueryAdapter;
import com.maning.gankmm.ui.adapter.RecycleCommonQueryAdapter;
import com.maning.gankmm.ui.base.BaseActivity;
import com.maning.gankmm.ui.view.MClearEditText;
import com.maning.gankmm.utils.KeyboardUtils;
Expand All @@ -37,7 +37,7 @@ public class DictionaryActivity extends BaseActivity {
MClearEditText editText;
@Bind(R.id.recyclerView)
RecyclerView recyclerView;
private RecycleMobQueryAdapter recycleMobQueryAdapter;
private RecycleCommonQueryAdapter recycleCommonQueryAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -117,11 +117,11 @@ private void initAdapter(DictionaryResultBean.DataEntity dataEntity) {
mDatas.put("4", new CommonItemEntity("汉字释义:", dataEntity.getExplanation()));
mDatas.put("5", new CommonItemEntity("汉字笔画数:", String.valueOf(dataEntity.getStrokes())));

if (recycleMobQueryAdapter == null) {
recycleMobQueryAdapter = new RecycleMobQueryAdapter(this, mDatas);
recyclerView.setAdapter(recycleMobQueryAdapter);
if (recycleCommonQueryAdapter == null) {
recycleCommonQueryAdapter = new RecycleCommonQueryAdapter(this, mDatas);
recyclerView.setAdapter(recycleCommonQueryAdapter);
} else {
recycleMobQueryAdapter.updateDatas(mDatas);
recycleCommonQueryAdapter.updateDatas(mDatas);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.maning.gankmm.http.mob.MobApi;
import com.maning.gankmm.http.callback.MyCallBack;
import com.maning.gankmm.skin.SkinManager;
import com.maning.gankmm.ui.adapter.RecycleMobQueryAdapter;
import com.maning.gankmm.ui.adapter.RecycleCommonQueryAdapter;
import com.maning.gankmm.ui.base.BaseActivity;
import com.maning.gankmm.ui.view.MClearEditText;
import com.maning.gankmm.utils.KeyboardUtils;
Expand All @@ -38,7 +38,7 @@ public class IDCardQueryActivity extends BaseActivity {
MClearEditText editTextPhone;
@Bind(R.id.recyclerView)
RecyclerView recyclerView;
private RecycleMobQueryAdapter recycleMobQueryAdapter;
private RecycleCommonQueryAdapter recycleCommonQueryAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -123,11 +123,11 @@ private void initAdapter(MobIdCardEntity result) {
mDatas.put("1", new CommonItemEntity("生日:", result.getBirthday()));
mDatas.put("2", new CommonItemEntity("性别:", result.getSex()));

if (recycleMobQueryAdapter == null) {
recycleMobQueryAdapter = new RecycleMobQueryAdapter(this, mDatas);
recyclerView.setAdapter(recycleMobQueryAdapter);
if (recycleCommonQueryAdapter == null) {
recycleCommonQueryAdapter = new RecycleCommonQueryAdapter(this, mDatas);
recyclerView.setAdapter(recycleCommonQueryAdapter);
} else {
recycleMobQueryAdapter.updateDatas(mDatas);
recycleCommonQueryAdapter.updateDatas(mDatas);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,20 @@
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.MenuItem;
import android.widget.Button;

import com.maning.gankmm.R;
import com.maning.gankmm.bean.CommonItemEntity;
import com.maning.gankmm.bean.mob.MobIpEntity;
import com.maning.gankmm.bean.rolltools.IpResultBean;
import com.maning.gankmm.http.callback.CommonHttpCallback;
import com.maning.gankmm.http.callback.MyCallBack;
import com.maning.gankmm.http.mob.MobApi;
import com.maning.gankmm.http.rolltools.RolltoolsApi;
import com.maning.gankmm.skin.SkinManager;
import com.maning.gankmm.ui.adapter.RecycleMobQueryAdapter;
import com.maning.gankmm.ui.adapter.RecycleCommonQueryAdapter;
import com.maning.gankmm.ui.base.BaseActivity;
import com.maning.gankmm.ui.view.MClearEditText;
import com.maning.gankmm.utils.KeyboardUtils;
import com.maning.gankmm.utils.MySnackbar;

import java.util.HashMap;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
Expand All @@ -42,7 +37,7 @@ public class IPQueryActivity extends BaseActivity {
MClearEditText editTextPhone;
@Bind(R.id.recyclerView)
RecyclerView recyclerView;
private RecycleMobQueryAdapter recycleMobQueryAdapter;
private RecycleCommonQueryAdapter recycleCommonQueryAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -140,11 +135,11 @@ private void initAdapter(IpResultBean.DataEntity data) {
mDatas.put("2", new CommonItemEntity("IP描述:", data.getDesc()));
mDatas.put("3", new CommonItemEntity("城市:", data.getProvince() + " " + data.getCity()));

if (recycleMobQueryAdapter == null) {
recycleMobQueryAdapter = new RecycleMobQueryAdapter(this, mDatas);
recyclerView.setAdapter(recycleMobQueryAdapter);
if (recycleCommonQueryAdapter == null) {
recycleCommonQueryAdapter = new RecycleCommonQueryAdapter(this, mDatas);
recyclerView.setAdapter(recycleCommonQueryAdapter);
} else {
recycleMobQueryAdapter.updateDatas(mDatas);
recycleCommonQueryAdapter.updateDatas(mDatas);
}

}
Expand Down
Loading

0 comments on commit a6edd76

Please sign in to comment.