From ed99b6b3f8c28a42d9ee8bb53cb8996a58b2be06 Mon Sep 17 00:00:00 2001 From: maning <154292322@qq.com> Date: Fri, 16 Oct 2020 16:46:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/maning/gankmm/http/mob/MobApi.java | 624 ------------------ .../ui/activity/tools/BankCardActivity.java | 133 ---- .../ui/activity/tools/CarDetailActivity.java | 219 ------ .../ui/activity/tools/CarItemsActivity.java | 118 ---- .../ui/activity/tools/CarListActivity.java | 245 ------- .../activity/tools/IDCardQueryActivity.java | 136 ---- .../ui/activity/tools/PostCodeActivity.java | 138 ---- .../ui/activity/tools/WXArticleActivity.java | 249 ------- .../ui/adapter/RecycleCarDetailsAdapter.java | 154 ----- .../ui/adapter/RecycleCarItemAdapter.java | 92 --- .../ui/adapter/RecycleCarListAdapter.java | 112 ---- .../ui/adapter/RecycleCarListSonAdapter.java | 102 --- .../gankmm/ui/adapter/RecycleMoreAdapter.java | 31 +- .../ui/adapter/RecycleMoreItemAdapter.java | 1 + .../res/drawable/gank_icon_tools_smile.xml | 24 + .../main/res/layout/activity_bank_card.xml | 56 -- .../main/res/layout/activity_car_detail.xml | 18 - .../main/res/layout/activity_car_items.xml | 18 - app/src/main/res/layout/activity_car_list.xml | 85 --- .../main/res/layout/activity_idcard_query.xml | 56 -- .../main/res/layout/activity_post_code.xml | 56 -- .../main/res/layout/activity_wxarticle.xml | 89 --- .../main/res/layout/item_car_detail_image.xml | 16 - app/src/main/res/layout/item_car_details.xml | 164 ----- app/src/main/res/layout/item_car_item.xml | 66 -- app/src/main/res/layout/item_car_list.xml | 31 - 26 files changed, 30 insertions(+), 3003 deletions(-) delete mode 100644 app/src/main/java/com/maning/gankmm/ui/activity/tools/BankCardActivity.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/activity/tools/CarDetailActivity.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/activity/tools/CarItemsActivity.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/activity/tools/CarListActivity.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/activity/tools/IDCardQueryActivity.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/activity/tools/PostCodeActivity.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/activity/tools/WXArticleActivity.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarDetailsAdapter.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarItemAdapter.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarListAdapter.java delete mode 100644 app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarListSonAdapter.java create mode 100644 app/src/main/res/drawable/gank_icon_tools_smile.xml delete mode 100644 app/src/main/res/layout/activity_bank_card.xml delete mode 100644 app/src/main/res/layout/activity_car_detail.xml delete mode 100644 app/src/main/res/layout/activity_car_items.xml delete mode 100644 app/src/main/res/layout/activity_car_list.xml delete mode 100644 app/src/main/res/layout/activity_idcard_query.xml delete mode 100644 app/src/main/res/layout/activity_post_code.xml delete mode 100644 app/src/main/res/layout/activity_wxarticle.xml delete mode 100644 app/src/main/res/layout/item_car_detail_image.xml delete mode 100644 app/src/main/res/layout/item_car_details.xml delete mode 100644 app/src/main/res/layout/item_car_item.xml delete mode 100644 app/src/main/res/layout/item_car_list.xml diff --git a/app/src/main/java/com/maning/gankmm/http/mob/MobApi.java b/app/src/main/java/com/maning/gankmm/http/mob/MobApi.java index bca121b..ae81eb0 100644 --- a/app/src/main/java/com/maning/gankmm/http/mob/MobApi.java +++ b/app/src/main/java/com/maning/gankmm/http/mob/MobApi.java @@ -53,383 +53,6 @@ public class MobApi { public final static String GET_DATA_FAIL = MyApplication.getIntstance().getString(R.string.gank_get_data_fail); public final static String NET_FAIL = MyApplication.getIntstance().getString(R.string.gank_net_fail); - /*** - * 获取城市列表 - * - * @param what - * @param myCallBack - * @return - */ - public static Call getCitys(final int what, final MyCallBack myCallBack) { - - Call entityCall = BuildApi.getMobAPIService().getCitys(Constants.URL_APP_Key); - - entityCall.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - CitysEntity citysEntity = response.body(); - if (citysEntity != null) { - if (citysEntity.getMsg().equals("success")) { - KLog.i("getCitys---success:" + citysEntity.toString()); - myCallBack.onSuccessList(what, citysEntity.getResult()); - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call call, Throwable t) { - KLog.e("getCitys-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return entityCall; - } - - - /*** - * 获取城市天气信息 - * - * @param city - * @param province - * @param what - * @param myCallBack - * @return - */ - public static Call getCityWeather(String city, String province, final int what, final MyCallBack myCallBack) { - - Call weatherEntityCall = BuildApi.getMobAPIService().getCityWeather(Constants.URL_APP_Key, city, province); - - weatherEntityCall.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - WeatherBeseEntity weatherBeseEntity = response.body(); - if (weatherBeseEntity != null) { - if (weatherBeseEntity.getMsg().equals("success")) { - KLog.i("getCityWeather---success:" + weatherBeseEntity.toString()); - myCallBack.onSuccessList(what, weatherBeseEntity.getResult()); - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call call, Throwable t) { - KLog.e("getCityWeather-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return weatherEntityCall; - } - - /*** - * 获取万年历信息 - * - * @param date - * @param what - * @param myCallBack - * @return - */ - public static Call> getCalendarInfo(String date, final int what, final MyCallBack myCallBack) { - Call> calendarInfoCall = BuildApi.getMobAPIService().getCalendarInfo(Constants.URL_APP_Key, date); - calendarInfoCall.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("getCalendarInfo---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("getCalendarInfo-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return calendarInfoCall; - } - - - public static Call>> queryWxArticleCategory(final int what, final MyCallBack myCallBack) { - Call>> wxArticleCategoryCall = BuildApi.getMobAPIService().queryWxArticleCategory(Constants.URL_APP_Key); - wxArticleCategoryCall.enqueue(new Callback>>() { - @Override - public void onResponse(Call>> call, Response>> response) { - if (response.isSuccessful()) { - MobBaseEntity> body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryWxArticleCategory---success:" + body.toString()); - myCallBack.onSuccessList(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call>> call, Throwable t) { - KLog.e("queryWxArticleCategory-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return wxArticleCategoryCall; - } - - public static Call> queryWxArticleList(String cid, int pageIndex, int pageSize, final int what, final MyCallBack myCallBack) { - - Call> queryWxArticleListCall = BuildApi.getMobAPIService().queryWxArticleList(Constants.URL_APP_Key, cid, pageIndex, pageSize); - queryWxArticleListCall.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryWxArticleList---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryWxArticleList-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return queryWxArticleListCall; - - } - - - public static Call> queryIp(String ip, final int what, final MyCallBack myCallBack) { - - Call> call = BuildApi.getMobAPIService().queryIp(Constants.URL_APP_Key, ip); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryIp---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryIp-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - - public static Call> queryIDCard(String idcardNum, final int what, final MyCallBack myCallBack) { - - Call> call = BuildApi.getMobAPIService().queryIdcard(Constants.URL_APP_Key, idcardNum); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryIdcard---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryIdcard-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - - public static Call> queryPostCode(String postCode, final int what, final MyCallBack myCallBack) { - - Call> call = BuildApi.getMobAPIService().queryPostCode(Constants.URL_APP_Key, postCode); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryPostCode---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryPostCode-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - - public static Call> queryPhoneAddress(String phoneNum, final int what, final MyCallBack myCallBack) { - - Call> call = BuildApi.getMobAPIService().queryMobileAddress(Constants.URL_APP_Key, phoneNum); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryPhoneAddress---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryPhoneAddress-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - - public static Call> queryBankCard(String content, final int what, final MyCallBack myCallBack) { - - Call> call = BuildApi.getMobAPIService().queryBankCradInfo(Constants.URL_APP_Key, content); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryBankCard---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryBankCard-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - public static Call> queryOilPrice(final int what, final MyCallBack myCallBack) { @@ -466,148 +89,6 @@ public void onFailure(Call> call, Throwable t) } - public static Call> queryDict(String content, final int what, final MyCallBack myCallBack) { - - Call> call = BuildApi.getMobAPIService().queryDict(Constants.URL_APP_Key, content); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryDict---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryDict-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - public static Call> queryIdiom(String content, final int what, final MyCallBack myCallBack) { - - Call> call = BuildApi.getMobAPIService().queryIdiom(Constants.URL_APP_Key, content); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryIdiom---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryIdiom-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - - public static Call>> queryHistory(String content, final int what, final MyCallBack myCallBack) { - - Call>> call = BuildApi.getMobAPIService().queryHistory(Constants.URL_APP_Key, content); - call.enqueue(new Callback>>() { - @Override - public void onResponse(Call>> call, Response>> response) { - if (response.isSuccessful()) { - MobBaseEntity> body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryHistory---success:" + body.toString()); - myCallBack.onSuccessList(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call>> call, Throwable t) { - KLog.e("queryHistory-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - - public static Call> queryHealth(String content, int pageIndex, int pageSize, final int what, final MyCallBack myCallBack) { - - Call> call = BuildApi.getMobAPIService().queryHealth(Constants.URL_APP_Key, content, pageIndex, pageSize); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - MobBaseEntity body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryHealth---success:" + body.toString()); - myCallBack.onSuccess(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - KLog.e("queryHealth-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - public static Call>> queryByTrainNo(String trainNum, final int what, final MyCallBack myCallBack) { Call>> call = BuildApi.getMobAPIService().queryByTrainNo(Constants.URL_APP_Key, trainNum); @@ -713,111 +194,6 @@ public void onFailure(Call>> call, Thro } - public static Call>> queryCarList(final int what, final MyCallBack myCallBack) { - - Call>> call = BuildApi.getMobAPIService().queryCarList(Constants.URL_APP_Key); - call.enqueue(new Callback>>() { - @Override - public void onResponse(Call>> call, Response>> response) { - if (response.isSuccessful()) { - MobBaseEntity> body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryCarList---success:" + body.toString()); - myCallBack.onSuccessList(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call>> call, Throwable t) { - KLog.e("queryCarList-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - - public static Call>> queryCarItems(String carName, final int what, final MyCallBack myCallBack) { - - Call>> call = BuildApi.getMobAPIService().queryCarItems(Constants.URL_APP_Key, carName); - call.enqueue(new Callback>>() { - @Override - public void onResponse(Call>> call, Response>> response) { - if (response.isSuccessful()) { - MobBaseEntity> body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryCarItems---success:" + body.toString()); - myCallBack.onSuccessList(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call>> call, Throwable t) { - KLog.e("queryCarItems-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } - - public static Call>> queryCarDetails(String cid, final int what, final MyCallBack myCallBack) { - - Call>> call = BuildApi.getMobAPIService().queryCarDetails(Constants.URL_APP_Key, cid); - call.enqueue(new Callback>>() { - @Override - public void onResponse(Call>> call, Response>> response) { - if (response.isSuccessful()) { - MobBaseEntity> body = response.body(); - if (body != null) { - if (body.getMsg().equals("success")) { - KLog.i("queryCarDetails---success:" + body.toString()); - myCallBack.onSuccessList(what, body.getResult()); - } else { - myCallBack.onFail(what, body.getMsg()); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } else { - myCallBack.onFail(what, GET_DATA_FAIL); - } - } - - @Override - public void onFailure(Call>> call, Throwable t) { - KLog.e("queryCarDetails-----onFailure:" + t.toString()); - //数据错误 - myCallBack.onFail(what, NET_FAIL); - } - }); - - return call; - - } public static Call> queryCookCategory(final int what, final MyCallBack myCallBack) { diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/tools/BankCardActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/tools/BankCardActivity.java deleted file mode 100644 index 561e2b2..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/activity/tools/BankCardActivity.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.maning.gankmm.ui.activity.tools; - -import android.os.Bundle; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; -import android.text.TextUtils; -import android.view.MenuItem; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobBankCard; -import com.maning.gankmm.bean.CommonItemEntity; -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.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; -import butterknife.OnClick; - -/** - * 银行卡查询 - */ -@Deprecated -public class BankCardActivity extends BaseActivity { - - @Bind(R.id.toolbar) - Toolbar toolbar; - @Bind(R.id.editTextInput) - MClearEditText editTextInput; - @Bind(R.id.recyclerView) - RecyclerView recyclerView; - private RecycleCommonQueryAdapter recycleCommonQueryAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_bank_card); - ButterKnife.bind(this); - - initMyToolBar(); - - initRecyclerView(); - - } - - private void initRecyclerView() { - LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); - recyclerView.setLayoutManager(linearLayoutManager); - recyclerView.setItemAnimator(new DefaultItemAnimator()); - } - - private void initMyToolBar() { - initBackToolBar(toolbar, "银行卡查询"); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - this.finish(); - return true; - } - return super.onOptionsItemSelected(item); - } - - - @OnClick(R.id.btn_query) - public void btnQuery() { - - KeyboardUtils.hideSoftInput(this); - - //获取输入数据 - String number = editTextInput.getText().toString(); - - if (TextUtils.isEmpty(number)) { - MySnackbar.makeSnackBarRed(toolbar, "银行卡号不能为空"); - return; - } - - showProgressDialog("正在查询..."); - MobApi.queryBankCard(number, 0x001, new MyCallBack() { - @Override - public void onSuccess(int what, Object object) { - dissmissProgressDialog(); - if (object != null) { - MobBankCard result = (MobBankCard) object; - initAdapter(result); - } - } - - @Override - public void onSuccessList(int what, List results) { - - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(toolbar, result); - } - }); - - } - - private void initAdapter(MobBankCard result) { - - HashMap mDatas = new HashMap<>(); - mDatas.put("0", new CommonItemEntity("所属银行:", result.getBank())); - mDatas.put("1", new CommonItemEntity("卡名:", result.getCardName())); - mDatas.put("2", new CommonItemEntity("卡片类型:", result.getCardType())); - mDatas.put("3", new CommonItemEntity("卡号长度:", String.valueOf(result.getCardNumber()))); - mDatas.put("4", new CommonItemEntity("bin码:", result.getBin())); - - if (recycleCommonQueryAdapter == null) { - recycleCommonQueryAdapter = new RecycleCommonQueryAdapter(this, mDatas); - recyclerView.setAdapter(recycleCommonQueryAdapter); - } else { - recycleCommonQueryAdapter.updateDatas(mDatas); - } - - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarDetailActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarDetailActivity.java deleted file mode 100644 index 3c98396..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarDetailActivity.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.maning.gankmm.ui.activity.tools; - -import android.os.Bundle; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobCarDetailsEntity; -import com.maning.gankmm.bean.mob.MobCarItemEntity; -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.RecycleCarDetailsAdapter; -import com.maning.gankmm.ui.base.BaseActivity; -import com.maning.gankmm.utils.MySnackbar; - -import java.util.ArrayList; -import java.util.List; - -import butterknife.Bind; -import butterknife.ButterKnife; - -/** - * 车型详细配置 - */ -@Deprecated -public class CarDetailActivity extends BaseActivity { - - @Bind(R.id.toolbar) - Toolbar mToolbar; - @Bind(R.id.recyclerView) - RecyclerView mRecyclerView; - - public static final String IntentKey_CarItemEntity = "IntentKey_CarItemEntity"; - private MobCarItemEntity mMobCarItemEntity = new MobCarItemEntity(); - - private List mDatas = new ArrayList<>(); - private RecycleCarDetailsAdapter mRecycleCarDetailsAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_car_detail); - ButterKnife.bind(this); - - mMobCarItemEntity = (MobCarItemEntity) getIntent().getSerializableExtra(IntentKey_CarItemEntity); - - initMyToolBar(); - - initRecyclerView(); - - initDatas(); - - } - - private void initDatas() { - - showProgressDialog(); - - MobApi.queryCarDetails(mMobCarItemEntity.getCarId(), 0x001, new MyCallBack() { - @Override - public void onSuccess(int what, Object result) { - - } - - @Override - public void onSuccessList(int what, List results) { - dissmissProgressDialog(); - ArrayList mResult = (ArrayList) results; - initAdapter(mResult); - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(mToolbar, result); - } - }); - - } - - private void initAdapter(ArrayList mResult) { - //处理集合数据 - if (mResult.size() <= 0) { - return; - } - MobCarDetailsEntity mobCarDetailsEntity = mResult.get(0); -// private List baseInfo; //车型基本配置信息 -// private List airConfig; //空调/冰箱配置信息 -// private List carbody; //车身配置信息 -// private List chassis; //底盘配置信息 -// private List controlConfig; //操控配置信息 -// private List engine; //发动机配置信息 -// private List exterConfig; //外部配置信息 -// private List glassConfig; //玻璃/后视镜配置信息 -// private List interConfig; //内部配置信息 -// private List lightConfig; //灯光配置信息 -// private List mediaConfig; //多媒体配置信息 -// private List safetyDevice; //安全装置信息 -// private List seatConfig; //座椅配置信息 -// private List techConfig; //高科技配置信息 -// private List transmission; //变速箱信息 -// private List wheelInfo; // 车轮制动信息 -// private List motorList; //电动机配置信息 - - List baseInfo = mobCarDetailsEntity.getBaseInfo(); - for (int i = 0; i < baseInfo.size(); i++) { - baseInfo.get(i).setType("车型基本配置信息"); - } - List airConfig = mobCarDetailsEntity.getAirConfig(); - for (int i = 0; i < airConfig.size(); i++) { - airConfig.get(i).setType("空调/冰箱配置信息"); - } - List carbody = mobCarDetailsEntity.getCarbody(); - for (int i = 0; i < carbody.size(); i++) { - carbody.get(i).setType("车身配置信息"); - } - List chassis = mobCarDetailsEntity.getChassis(); - for (int i = 0; i < chassis.size(); i++) { - chassis.get(i).setType("底盘配置信息"); - } - List controlConfig = mobCarDetailsEntity.getControlConfig(); - for (int i = 0; i < controlConfig.size(); i++) { - controlConfig.get(i).setType("操控配置信息"); - } - List engine = mobCarDetailsEntity.getEngine(); - for (int i = 0; i < engine.size(); i++) { - engine.get(i).setType("发动机配置信息"); - } - List exterConfig = mobCarDetailsEntity.getExterConfig(); - for (int i = 0; i < exterConfig.size(); i++) { - exterConfig.get(i).setType("外部配置信息"); - } - List glassConfig = mobCarDetailsEntity.getGlassConfig(); - for (int i = 0; i < glassConfig.size(); i++) { - glassConfig.get(i).setType("玻璃/后视镜配置信息"); - } - List interConfig = mobCarDetailsEntity.getInterConfig(); - for (int i = 0; i < interConfig.size(); i++) { - interConfig.get(i).setType("内部配置信息"); - } - List lightConfig = mobCarDetailsEntity.getLightConfig(); - for (int i = 0; i < lightConfig.size(); i++) { - lightConfig.get(i).setType("灯光配置信息"); - } - List mediaConfig = mobCarDetailsEntity.getMediaConfig(); - for (int i = 0; i < mediaConfig.size(); i++) { - mediaConfig.get(i).setType("多媒体配置信息"); - } - List safetyDevice = mobCarDetailsEntity.getSafetyDevice(); - for (int i = 0; i < safetyDevice.size(); i++) { - safetyDevice.get(i).setType("安全装置信息"); - } - List seatConfig = mobCarDetailsEntity.getSeatConfig(); - for (int i = 0; i < seatConfig.size(); i++) { - seatConfig.get(i).setType("座椅配置信息"); - } - List techConfig = mobCarDetailsEntity.getTechConfig(); - for (int i = 0; i < techConfig.size(); i++) { - techConfig.get(i).setType("高科技配置信息"); - } - List transmission = mobCarDetailsEntity.getTransmission(); - for (int i = 0; i < transmission.size(); i++) { - transmission.get(i).setType("变速箱信息"); - } - List wheelInfo = mobCarDetailsEntity.getWheelInfo(); - for (int i = 0; i < wheelInfo.size(); i++) { - wheelInfo.get(i).setType("车轮制动信息"); - } - List motorList = mobCarDetailsEntity.getMotorList(); - for (int i = 0; i < motorList.size(); i++) { - motorList.get(i).setType("电动机配置信息"); - } - mDatas.addAll(baseInfo); - mDatas.addAll(airConfig); - mDatas.addAll(carbody); - mDatas.addAll(chassis); - mDatas.addAll(controlConfig); - mDatas.addAll(engine); - mDatas.addAll(exterConfig); - mDatas.addAll(glassConfig); - mDatas.addAll(interConfig); - mDatas.addAll(lightConfig); - mDatas.addAll(mediaConfig); - mDatas.addAll(safetyDevice); - mDatas.addAll(seatConfig); - mDatas.addAll(techConfig); - mDatas.addAll(transmission); - mDatas.addAll(wheelInfo); - mDatas.addAll(motorList); - - mRecycleCarDetailsAdapter = new RecycleCarDetailsAdapter(mContext, mDatas,mobCarDetailsEntity); - mRecyclerView.setAdapter(mRecycleCarDetailsAdapter); - } - - private void initRecyclerView() { - LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); - mRecyclerView.setLayoutManager(linearLayoutManager); - mRecyclerView.setItemAnimator(new DefaultItemAnimator()); - } - - private void initMyToolBar() { - initBackToolBar(mToolbar, mMobCarItemEntity.getSeriesName()); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - this.finish(); - return true; - } - return super.onOptionsItemSelected(item); - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarItemsActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarItemsActivity.java deleted file mode 100644 index 442b2fc..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarItemsActivity.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.maning.gankmm.ui.activity.tools; - -import android.content.Intent; -import android.os.Bundle; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; -import android.view.View; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobCarEntity; -import com.maning.gankmm.bean.mob.MobCarItemEntity; -import com.maning.gankmm.http.mob.MobApi; -import com.maning.gankmm.http.callback.MyCallBack; -import com.maning.gankmm.listeners.OnItemClickListener; -import com.maning.gankmm.skin.SkinManager; -import com.maning.gankmm.ui.adapter.RecycleCarItemAdapter; -import com.maning.gankmm.ui.base.BaseActivity; -import com.maning.gankmm.utils.MySnackbar; -import com.socks.library.KLog; - -import java.util.ArrayList; -import java.util.List; - -import butterknife.Bind; -import butterknife.ButterKnife; - -@Deprecated -public class CarItemsActivity extends BaseActivity { - - @Bind(R.id.toolbar) - Toolbar mToolbar; - @Bind(R.id.recyclerView) - RecyclerView mRecyclerView; - - public static final String IntentKey_Car = "IntentKey_Car"; - private MobCarEntity.SonBean mSonBean = new MobCarEntity.SonBean(); - private ArrayList mMDatas; - private RecycleCarItemAdapter mRecycleCarItemAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_car_items); - ButterKnife.bind(this); - - mSonBean = (MobCarEntity.SonBean) getIntent().getSerializableExtra(IntentKey_Car); - - initMyToolBar(); - - initRecyclerView(); - - initDatas(); - - } - - private void initDatas() { - showProgressDialog("加载中..."); - MobApi.queryCarItems(mSonBean.getType(), 0x001, new MyCallBack() { - @Override - public void onSuccess(int what, Object result) { - - } - - @Override - public void onSuccessList(int what, List results) { - dissmissProgressDialog(); - mMDatas = (ArrayList) results; - KLog.i(mMDatas.toString()); - - initAdapter(); - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(mToolbar, result); - } - }); - } - - private void initAdapter() { - mRecycleCarItemAdapter = new RecycleCarItemAdapter(mContext, mMDatas); - mRecyclerView.setAdapter(mRecycleCarItemAdapter); - mRecycleCarItemAdapter.setOnItemClickLitener(new OnItemClickListener() { - @Override - public void onItemClick(View view, int position) { - //跳转详情页面 - MobCarItemEntity mobCarItemEntity = mMDatas.get(position); - Intent intent = new Intent(CarItemsActivity.this, CarDetailActivity.class); - intent.putExtra(CarDetailActivity.IntentKey_CarItemEntity, mobCarItemEntity); - mContext.startActivity(intent); - } - }); - } - - private void initRecyclerView() { - LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); - mRecyclerView.setLayoutManager(linearLayoutManager); - mRecyclerView.setItemAnimator(new DefaultItemAnimator()); - } - - private void initMyToolBar() { - initBackToolBar(mToolbar, mSonBean.getType()); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - this.finish(); - return true; - } - return super.onOptionsItemSelected(item); - } -} diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarListActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarListActivity.java deleted file mode 100644 index 9c79443..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/activity/tools/CarListActivity.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.maning.gankmm.ui.activity.tools; - -import android.content.Intent; -import android.os.Bundle; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; -import android.view.View; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.TextView; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobCarEntity; -import com.maning.gankmm.http.mob.MobApi; -import com.maning.gankmm.http.callback.MyCallBack; -import com.maning.gankmm.listeners.OnItemClickListener; -import com.maning.gankmm.skin.SkinManager; -import com.maning.gankmm.ui.adapter.RecycleCarListAdapter; -import com.maning.gankmm.ui.adapter.RecycleCarListSonAdapter; -import com.maning.gankmm.ui.base.BaseActivity; -import com.maning.gankmm.ui.view.WaveSideBarView; -import com.maning.gankmm.utils.MySnackbar; -import com.maning.gankmm.utils.PinyinUtils; -import com.socks.library.KLog; - -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -import butterknife.Bind; -import butterknife.ButterKnife; -import butterknife.OnClick; - -@Deprecated -public class CarListActivity extends BaseActivity { - - @Bind(R.id.toolbar) - Toolbar mToolbar; - @Bind(R.id.recyclerView) - RecyclerView mRecyclerView; - @Bind(R.id.waveSideBarView) - WaveSideBarView mWaveSideBarView; - @Bind(R.id.iv_close) - ImageView mIvClose; - @Bind(R.id.tv_son_name) - TextView mTvSonName; - @Bind(R.id.recyclerViewSon) - RecyclerView mRecyclerViewSon; - @Bind(R.id.ll_son_view) - LinearLayout mLlSonView; - private List mDatas; - private RecycleCarListAdapter mRecycleCarListAdapter; - private Animation mAnimation01; - private Animation mAnimation02; - private RecycleCarListSonAdapter mRecycleCarListSonAdapter; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_car_list); - ButterKnife.bind(this); - - initMyToolBar(); - - initViews(); - - initDatas(); - - initAnim(); - - } - - private void initAnim() { - mAnimation01 = AnimationUtils.loadAnimation(mContext, R.anim.translate_down); - mAnimation02 = AnimationUtils.loadAnimation(mContext, R.anim.translate_up); - } - - private void initViews() { - initRecyclerView(); - - initOtherView(); - - } - - private void initOtherView() { - mWaveSideBarView.setVisibility(View.GONE); - mWaveSideBarView.setOnTouchLetterChangeListener(new WaveSideBarView.OnTouchLetterChangeListener() { - @Override - public void onLetterChange(String letter) { - if (mRecycleCarListAdapter == null) { - return; - } - int pos = mRecycleCarListAdapter.getLetterPosition(letter); - if (pos != -1) { - mRecyclerView.scrollToPosition(pos); - LinearLayoutManager mLayoutManager = (LinearLayoutManager) mRecyclerView.getLayoutManager(); - mLayoutManager.scrollToPositionWithOffset(pos, 0); - } - } - }); - } - - private void initDatas() { - showProgressDialog("正在加载..."); - MobApi.queryCarList(0x001, new MyCallBack() { - @Override - public void onSuccess(int what, Object result) { - - } - - @Override - public void onSuccessList(int what, List results) { - dissmissProgressDialog(); - //处理数据 - mDatas = results; - if (mDatas != null && mDatas.size() > 0) { - //排序处理 - for (int i = 0; i < mDatas.size(); i++) { - MobCarEntity mobCarEntity = mDatas.get(i); - String name = mobCarEntity.getName(); - String namePinYin = PinyinUtils.toPinyin(name); - mobCarEntity.setPinyin(namePinYin); - } - KLog.i("排序前:" + mDatas); - //排序 - Collections.sort(mDatas, new Comparator() { - @Override - public int compare(MobCarEntity l, MobCarEntity r) { - if (l == null || r == null) { - return 0; - } - String lhsSortLetters = l.getPinyin().toUpperCase(); - String rhsSortLetters = r.getPinyin().toUpperCase(); - return lhsSortLetters.compareTo(rhsSortLetters); - } - }); - KLog.i("排序后:" + mDatas); - - //初始化Adapter - initAdapter(); - - } - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(mToolbar, result); - } - }); - } - - private void initAdapter() { - mRecycleCarListAdapter = new RecycleCarListAdapter(this, mDatas); - mRecyclerView.setAdapter(mRecycleCarListAdapter); - mWaveSideBarView.setVisibility(View.VISIBLE); - mRecycleCarListAdapter.setOnItemClickLitener(new OnItemClickListener() { - @Override - public void onItemClick(View view, int position) { - MobCarEntity mobCarEntity = mDatas.get(position); - mTvSonName.setText(mobCarEntity.getName()); - initAdapter2(mobCarEntity.getSon()); - showSonView(); - } - }); - } - - private void initAdapter2(List mSon) { - mRecycleCarListSonAdapter = new RecycleCarListSonAdapter(this, mSon); - mRecyclerViewSon.setAdapter(mRecycleCarListSonAdapter); - mRecycleCarListSonAdapter.setOnItemClickLitener(new OnItemClickListener() { - @Override - public void onItemClick(View view, int position) { - MobCarEntity.SonBean itemData = mRecycleCarListSonAdapter.getItemData(position); - Intent intent = new Intent(CarListActivity.this, CarItemsActivity.class); - intent.putExtra(CarItemsActivity.IntentKey_Car, itemData); - mContext.startActivity(intent); - } - }); - } - - private void initRecyclerView() { - LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); - mRecyclerView.setLayoutManager(linearLayoutManager); - mRecyclerView.setItemAnimator(new DefaultItemAnimator()); - - - LinearLayoutManager linearLayoutManager2 = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); - mRecyclerViewSon.setLayoutManager(linearLayoutManager2); - mRecyclerViewSon.setItemAnimator(new DefaultItemAnimator()); - } - - private void initMyToolBar() { - initBackToolBar(mToolbar, "汽车品牌"); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - this.finish(); - return true; - } - return super.onOptionsItemSelected(item); - } - - - @OnClick(R.id.iv_close) - public void iv_close() { - hideSonView(); - } - - private void showSonView() { - mLlSonView.setVisibility(View.VISIBLE); - mLlSonView.startAnimation(mAnimation02); - - } - - private void hideSonView() { - mLlSonView.startAnimation(mAnimation01); - mAnimation01.setAnimationListener(new Animation.AnimationListener() { - @Override - public void onAnimationStart(Animation animation) { - - } - - @Override - public void onAnimationEnd(Animation animation) { - mLlSonView.setVisibility(View.GONE); - } - - @Override - public void onAnimationRepeat(Animation animation) { - - } - }); - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/tools/IDCardQueryActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/tools/IDCardQueryActivity.java deleted file mode 100644 index f8772b1..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/activity/tools/IDCardQueryActivity.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.maning.gankmm.ui.activity.tools; - -import android.os.Bundle; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; -import android.text.TextUtils; -import android.view.MenuItem; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobIdCardEntity; -import com.maning.gankmm.bean.CommonItemEntity; -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.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; -import butterknife.OnClick; - -/** - * 身份证查询 - */ -@Deprecated -public class IDCardQueryActivity extends BaseActivity { - - @Bind(R.id.toolbar) - Toolbar toolbar; - @Bind(R.id.editTextPhone) - MClearEditText editTextPhone; - @Bind(R.id.recyclerView) - RecyclerView recyclerView; - private RecycleCommonQueryAdapter recycleCommonQueryAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_idcard_query); - ButterKnife.bind(this); - - initMyToolBar(); - - initRecyclerView(); - - } - - private void initRecyclerView() { - LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); - recyclerView.setLayoutManager(linearLayoutManager); - recyclerView.setItemAnimator(new DefaultItemAnimator()); - } - - private void initMyToolBar() { - int currentSkinType = SkinManager.getCurrentSkinType(this); - if (SkinManager.THEME_DAY == currentSkinType) { - initToolBar(toolbar, "身份证查询", R.drawable.gank_ic_back_white); - } else { - initToolBar(toolbar, "身份证查询", R.drawable.gank_ic_back_night); - } - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - this.finish(); - return true; - } - return super.onOptionsItemSelected(item); - } - - - @OnClick(R.id.btn_query) - public void btnQuery() { - - KeyboardUtils.hideSoftInput(this); - - //获取输入 - String number = editTextPhone.getText().toString(); - - if (TextUtils.isEmpty(number)) { - MySnackbar.makeSnackBarRed(toolbar, "身份证号码不能为空"); - return; - } - - showProgressDialog("正在查询..."); - MobApi.queryIDCard(number, 0x001, new MyCallBack() { - @Override - public void onSuccess(int what, Object object) { - dissmissProgressDialog(); - if (object != null) { - MobIdCardEntity result = (MobIdCardEntity) object; - initAdapter(result); - } - } - - @Override - public void onSuccessList(int what, List results) { - - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(toolbar,result); - } - }); - - } - - private void initAdapter(MobIdCardEntity result) { - - HashMap mDatas = new HashMap<>(); - mDatas.put("0", new CommonItemEntity("地区:", result.getArea())); - mDatas.put("1", new CommonItemEntity("生日:", result.getBirthday())); - mDatas.put("2", new CommonItemEntity("性别:", result.getSex())); - - if (recycleCommonQueryAdapter == null) { - recycleCommonQueryAdapter = new RecycleCommonQueryAdapter(this, mDatas); - recyclerView.setAdapter(recycleCommonQueryAdapter); - } else { - recycleCommonQueryAdapter.updateDatas(mDatas); - } - - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/tools/PostCodeActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/tools/PostCodeActivity.java deleted file mode 100644 index d8c2364..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/activity/tools/PostCodeActivity.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.maning.gankmm.ui.activity.tools; - -import android.os.Bundle; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; -import android.text.TextUtils; -import android.view.MenuItem; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.CommonItemEntity; -import com.maning.gankmm.bean.mob.MobPostCodeEntity; -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.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; -import butterknife.OnClick; - -/** - * 邮编查询 - */ -@Deprecated -public class PostCodeActivity extends BaseActivity { - - @Bind(R.id.toolbar) - Toolbar toolbar; - @Bind(R.id.editTextPhone) - MClearEditText editTextPhone; - @Bind(R.id.recyclerView) - RecyclerView recyclerView; - private RecycleCommonQueryAdapter recycleCommonQueryAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_post_code); - ButterKnife.bind(this); - - initMyToolBar(); - - initRecyclerView(); - - } - - private void initRecyclerView() { - LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); - recyclerView.setLayoutManager(linearLayoutManager); - recyclerView.setItemAnimator(new DefaultItemAnimator()); - } - - private void initMyToolBar() { - int currentSkinType = SkinManager.getCurrentSkinType(this); - if (SkinManager.THEME_DAY == currentSkinType) { - initToolBar(toolbar, "邮编查询", R.drawable.gank_ic_back_white); - } else { - initToolBar(toolbar, "邮编查询", R.drawable.gank_ic_back_night); - } - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - this.finish(); - return true; - } - return super.onOptionsItemSelected(item); - } - - - @OnClick(R.id.btn_query) - public void btnQuery() { - - KeyboardUtils.hideSoftInput(this); - - //获取邮政编码 - String number = editTextPhone.getText().toString(); - - if (TextUtils.isEmpty(number)) { - MySnackbar.makeSnackBarRed(toolbar, "邮政编码不能为空"); - return; - } - - - showProgressDialog("正在查询..."); - MobApi.queryPostCode(number, 0x001, new MyCallBack() { - @Override - public void onSuccess(int what, Object object) { - dissmissProgressDialog(); - if (object != null) { - MobPostCodeEntity result = (MobPostCodeEntity) object; - initAdapter(result); - } - } - - @Override - public void onSuccessList(int what, List results) { - - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(toolbar,result); - } - }); - - } - - private void initAdapter(MobPostCodeEntity result) { - - HashMap mDatas = new HashMap<>(); - mDatas.put("0", new CommonItemEntity("省份:", result.getProvince())); - mDatas.put("1", new CommonItemEntity("城市:", result.getCity())); - mDatas.put("2", new CommonItemEntity("区县:", result.getDistrict())); - mDatas.put("3", new CommonItemEntity("详细地址:", result.getAddress().toString())); - - if (recycleCommonQueryAdapter == null) { - recycleCommonQueryAdapter = new RecycleCommonQueryAdapter(this, mDatas); - recyclerView.setAdapter(recycleCommonQueryAdapter); - } else { - recycleCommonQueryAdapter.updateDatas(mDatas); - } - - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/activity/tools/WXArticleActivity.java b/app/src/main/java/com/maning/gankmm/ui/activity/tools/WXArticleActivity.java deleted file mode 100644 index 1832db4..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/activity/tools/WXArticleActivity.java +++ /dev/null @@ -1,249 +0,0 @@ -package com.maning.gankmm.ui.activity.tools; - -import android.graphics.Color; -import android.os.Bundle; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; -import android.view.MenuItem; -import android.view.View; -import android.widget.RelativeLayout; -import android.widget.TextView; - -import com.aspsine.swipetoloadlayout.OnLoadMoreListener; -import com.aspsine.swipetoloadlayout.OnRefreshListener; -import com.aspsine.swipetoloadlayout.SwipeToLoadLayout; -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobWxArticleListEntity; -import com.maning.gankmm.bean.mob.MobWxCategoryEntity; -import com.maning.gankmm.http.mob.MobApi; -import com.maning.gankmm.http.callback.MyCallBack; -import com.maning.gankmm.listeners.OnItemClickListener; -import com.maning.gankmm.skin.SkinManager; -import com.maning.gankmm.ui.adapter.RecycleWxArticleAdapter; -import com.maning.gankmm.ui.adapter.RecycleWxCategoryItemAdapter; -import com.maning.gankmm.ui.base.BaseActivity; -import com.maning.gankmm.utils.IntentUtils; -import com.maning.gankmm.utils.MySnackbar; -import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; - -import java.util.ArrayList; -import java.util.List; - -import butterknife.Bind; -import butterknife.ButterKnife; -import butterknife.OnClick; - -/** - * 微信精选 - */ -@Deprecated -public class WXArticleActivity extends BaseActivity implements OnRefreshListener, OnLoadMoreListener { - - @Bind(R.id.toolbar) - Toolbar toolbar; - @Bind(R.id.tv_title) - TextView tvTitle; - @Bind(R.id.btn_category) - RelativeLayout btnCategory; - @Bind(R.id.swipe_target) - RecyclerView swipeTarget; - @Bind(R.id.swipeToLoadLayout) - SwipeToLoadLayout swipeToLoadLayout; - @Bind(R.id.recyclerViewCategory) - RecyclerView recyclerViewCategory; - @Bind(R.id.rl_bg_category) - RelativeLayout rlBgCategory; - - private ArrayList mobWxCategoryEntityArrayList = new ArrayList<>(); - private ArrayList mobWxArticleListEntityList = new ArrayList<>(); - - private int pageIndex = 1; - private int pageSize = 20; - private MobWxCategoryEntity mobCurrentWxCategoryEntity; - private RecycleWxArticleAdapter recycleWxArticleAdapter; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_wxarticle); - ButterKnife.bind(this); - - initMyToolBar(); - - initViews(); - - queryWXCategory(); - } - - private void initViews() { - - recyclerViewCategory.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); - recyclerViewCategory.setItemAnimator(new DefaultItemAnimator()); - - swipeTarget.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); - swipeTarget.setItemAnimator(new DefaultItemAnimator()); - swipeTarget.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this).color(Color.parseColor("#FFCCCCCC")).build()); - - swipeToLoadLayout.setOnRefreshListener(this); - swipeToLoadLayout.setOnLoadMoreListener(this); - swipeToLoadLayout.setRefreshEnabled(true); - swipeToLoadLayout.setLoadMoreEnabled(true); - - } - - private void initMyToolBar() { - int currentSkinType = SkinManager.getCurrentSkinType(this); - if (SkinManager.THEME_DAY == currentSkinType) { - initToolBar(toolbar, "微信精选", R.drawable.gank_ic_back_white); - } else { - initToolBar(toolbar, "微信精选", R.drawable.gank_ic_back_night); - } - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - this.finish(); - return true; - } - return super.onOptionsItemSelected(item); - } - - public void queryWXCategory() { - showProgressDialog("加载中..."); - MobApi.queryWxArticleCategory(0x001, httpCallBack); - } - - private MyCallBack httpCallBack = new MyCallBack() { - @Override - public void onSuccess(int what, Object result) { - if (what == 0x002) { //加载新数据 - MobWxArticleListEntity mobWxArticleListEntity = (MobWxArticleListEntity) result; - if (mobWxArticleListEntity != null) { - mobWxArticleListEntityList.clear(); - mobWxArticleListEntityList = (ArrayList) mobWxArticleListEntity.getList(); - } - refreshAdapter(); - swipeToLoadLayout.setRefreshing(false); - } else if (what == 0x003) { //加载下一页数据 - MobWxArticleListEntity mobWxArticleListEntity = (MobWxArticleListEntity) result; - if (mobWxArticleListEntity != null) { - mobWxArticleListEntityList.addAll(mobWxArticleListEntity.getList()); - } - refreshAdapter(); - swipeToLoadLayout.setLoadingMore(false); - } - } - - @Override - public void onSuccessList(int what, List results) { - if (what == 0x001) { - dissmissProgressDialog(); - if (results != null && results.size() > 0) { - mobWxCategoryEntityArrayList = (ArrayList) results; - //初始化分类的列表 - initCategoryAdapter(); - } - } - } - - @Override - public void onFail(int what, String result) { - dissmissProgressDialog(); - MySnackbar.makeSnackBarRed(toolbar, result); - if (what == 0x002) { - swipeToLoadLayout.setRefreshing(false); - } else if (what == 0x003) { - swipeToLoadLayout.setLoadingMore(false); - } - } - }; - - private void initCategoryAdapter() { - RecycleWxCategoryItemAdapter recycleWxCategoryItemAdapter = new RecycleWxCategoryItemAdapter(this, mobWxCategoryEntityArrayList); - recyclerViewCategory.setAdapter(recycleWxCategoryItemAdapter); - recycleWxCategoryItemAdapter.setOnItemClickLitener(new OnItemClickListener() { - @Override - public void onItemClick(View view, int position) { - mobCurrentWxCategoryEntity = mobWxCategoryEntityArrayList.get(position); - tvTitle.setText(mobCurrentWxCategoryEntity.getName()); - hideCategroyRecyclerView(); - //加载列表 - loadNewDatas(); - } - }); - } - - private void loadNewDatas() { - //清空 - mobWxArticleListEntityList.clear(); - refreshAdapter(); - - swipeToLoadLayout.setRefreshing(true); - - pageIndex = 1; - MobApi.queryWxArticleList(mobCurrentWxCategoryEntity.getCid(), pageIndex, pageSize, 0x002, httpCallBack); - - } - - private void loadMoreDatas() { - MobApi.queryWxArticleList(mobCurrentWxCategoryEntity.getCid(), pageIndex, pageSize, 0x003, httpCallBack); - } - - private void refreshAdapter() { - pageIndex++; - - //刷新列表 - if (recycleWxArticleAdapter == null) { - recycleWxArticleAdapter = new RecycleWxArticleAdapter(this, mobWxArticleListEntityList); - swipeTarget.setAdapter(recycleWxArticleAdapter); - recycleWxArticleAdapter.setOnItemClickLitener(new OnItemClickListener() { - @Override - public void onItemClick(View view, int position) { - MobWxArticleListEntity.ListBean listBean = mobWxArticleListEntityList.get(position); - IntentUtils.startToWebActivity(mContext, "微信", listBean.getTitle(), listBean.getSourceUrl()); - } - }); - } else { - recycleWxArticleAdapter.updateDatas(mobWxArticleListEntityList); - } - - - } - - - @Override - public void onRefresh() { - loadNewDatas(); - } - - @Override - public void onLoadMore() { - loadMoreDatas(); - } - - @OnClick(R.id.btn_category) - public void btnCategory() { - //隐藏显示列表 - if (rlBgCategory.getVisibility() == View.GONE) { - rlBgCategory.setVisibility(View.VISIBLE); - } else { - hideCategroyRecyclerView(); - } - } - - @OnClick(R.id.rl_bg_category) - public void rl_bg_category() { - //隐藏显示列表 - hideCategroyRecyclerView(); - } - - private void hideCategroyRecyclerView() { - rlBgCategory.setVisibility(View.GONE); - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarDetailsAdapter.java b/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarDetailsAdapter.java deleted file mode 100644 index bd4e4ec..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarDetailsAdapter.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.maning.gankmm.ui.adapter; - -import android.content.Context; -import android.support.v7.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.RelativeLayout; -import android.widget.TextView; - -import com.bumptech.glide.Glide; -import com.bumptech.glide.request.RequestOptions; -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobCarDetailsEntity; - -import java.util.List; - -import butterknife.Bind; -import butterknife.ButterKnife; - -/** - * Created by maning on 16/5/17. - */ -public class RecycleCarDetailsAdapter extends RecyclerView.Adapter { - - private Context context; - private List mDatas; - private LayoutInflater layoutInflater; - private MobCarDetailsEntity mobCarDetailsEntity; - - public RecycleCarDetailsAdapter(Context context, List mDatas, MobCarDetailsEntity mobCarDetailsEntity) { - this.context = context; - this.mDatas = mDatas; - this.mobCarDetailsEntity = mobCarDetailsEntity; - layoutInflater = LayoutInflater.from(this.context); - } - - public void updateDatas(List mDatas) { - this.mDatas = mDatas; - notifyDataSetChanged(); - } - - @Override - public int getItemViewType(int position) { - if (position == 0) { - return 0; - } - return 1; - } - - @Override - public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - - if (viewType == 0) { - View inflate = layoutInflater.inflate(R.layout.item_car_detail_image, parent, false); - return new MyViewHolder2(inflate); - } - View inflate = layoutInflater.inflate(R.layout.item_car_details, parent, false); - return new MyViewHolder(inflate); - } - - @Override - public void onBindViewHolder(final RecyclerView.ViewHolder viewHolderBase, final int position) { - if (viewHolderBase instanceof MyViewHolder2) { - MyViewHolder2 viewHolder2 = (MyViewHolder2) viewHolderBase; - - - RequestOptions options = new RequestOptions(); - options.centerCrop(); - options.placeholder(R.drawable.pic_gray_bg); - Glide.with(context).asBitmap().load(mobCarDetailsEntity.getCarImage()) - .apply(options) - .into(viewHolder2.ivCar); - - } else if (viewHolderBase instanceof MyViewHolder) { - MyViewHolder viewHolder = (MyViewHolder) viewHolderBase; - - viewHolder.rlType.setVisibility(View.GONE); - viewHolder.ivValue.setVisibility(View.GONE); - viewHolder.tvValue.setVisibility(View.VISIBLE); - - MobCarDetailsEntity.DetailItem detailItem = mDatas.get(position-1); - - String type = detailItem.getType(); - String name = detailItem.getName(); - - // 0:未配置;1:标配。 - String value = detailItem.getValue(); - if ("0".equals(value)) { - viewHolder.ivValue.setVisibility(View.VISIBLE); - viewHolder.tvValue.setVisibility(View.GONE); - viewHolder.ivValue.setBackgroundResource(R.drawable.gank_icon_car_circle2); - } else if ("1".equals(value)) { - viewHolder.ivValue.setVisibility(View.VISIBLE); - viewHolder.tvValue.setVisibility(View.GONE); - viewHolder.ivValue.setBackgroundResource(R.drawable.gank_icon_car_circle2); - } - - viewHolder.tvName.setText(name); - viewHolder.tvValue.setText(value); - - if (position == 1) { - viewHolder.rlType.setVisibility(View.VISIBLE); - viewHolder.tvType.setText(type); - } else { - MobCarDetailsEntity.DetailItem detailItem2 = mDatas.get(position - 2); - String type2 = detailItem2.getType(); - if (!type2.equals(type)) { - viewHolder.rlType.setVisibility(View.VISIBLE); - viewHolder.tvType.setText(type); - } - } - } - - } - - @Override - public int getItemCount() { - return mDatas.size() + 1; - } - - class MyViewHolder extends RecyclerView.ViewHolder { - - @Bind(R.id.tv_type) - TextView tvType; - @Bind(R.id.tv_name) - TextView tvName; - @Bind(R.id.tv_value) - TextView tvValue; - @Bind(R.id.rl_type) - RelativeLayout rlType; - @Bind(R.id.iv_value) - ImageView ivValue; - - public MyViewHolder(View itemView) { - super(itemView); - ButterKnife.bind(this, itemView); - } - } - - class MyViewHolder2 extends RecyclerView.ViewHolder { - - @Bind(R.id.iv_car) - ImageView ivCar; - - public MyViewHolder2(View itemView) { - super(itemView); - ButterKnife.bind(this, itemView); - } - } - - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarItemAdapter.java b/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarItemAdapter.java deleted file mode 100644 index 81ef69d..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarItemAdapter.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.maning.gankmm.ui.adapter; - -import android.content.Context; -import android.support.v7.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobCarItemEntity; -import com.maning.gankmm.listeners.OnItemClickListener; - -import java.util.List; - -import butterknife.Bind; -import butterknife.ButterKnife; - -/** - * Created by maning on 16/5/17. - */ -public class RecycleCarItemAdapter extends RecyclerView.Adapter { - - private Context context; - private List mDatas; - private LayoutInflater layoutInflater; - - public RecycleCarItemAdapter(Context context, List mDatas) { - this.context = context; - this.mDatas = mDatas; - layoutInflater = LayoutInflater.from(this.context); - } - - public void updateDatas(List mDatas) { - this.mDatas = mDatas; - notifyDataSetChanged(); - } - - - @Override - public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - - View inflate = layoutInflater.inflate(R.layout.item_car_item, parent, false); - - return new MyViewHolder(inflate); - } - - @Override - public void onBindViewHolder(final MyViewHolder viewHolder, final int position) { - - MobCarItemEntity mobCarItemEntity = mDatas.get(position); - - viewHolder.tvGuidePrice.setText(mobCarItemEntity.getGuidePrice()); - viewHolder.tvSeriesName.setText(mobCarItemEntity.getSeriesName()); - - viewHolder.itemView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (mOnItemClickLitener != null) { - mOnItemClickLitener.onItemClick(view, position); - } - } - }); - - } - - @Override - public int getItemCount() { - return mDatas.size(); - } - - class MyViewHolder extends RecyclerView.ViewHolder { - - @Bind(R.id.tv_guidePrice) - TextView tvGuidePrice; - @Bind(R.id.tv_seriesName) - TextView tvSeriesName; - - public MyViewHolder(View itemView) { - super(itemView); - ButterKnife.bind(this, itemView); - } - } - - - private OnItemClickListener mOnItemClickLitener; - - public void setOnItemClickLitener(OnItemClickListener mOnItemClickLitener) { - this.mOnItemClickLitener = mOnItemClickLitener; - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarListAdapter.java b/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarListAdapter.java deleted file mode 100644 index 408898d..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarListAdapter.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.maning.gankmm.ui.adapter; - -import android.content.Context; -import android.support.v7.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobCarEntity; -import com.maning.gankmm.listeners.OnItemClickListener; - -import java.util.List; - -import butterknife.Bind; -import butterknife.ButterKnife; - -/** - * Created by maning on 16/5/17. - */ -public class RecycleCarListAdapter extends RecyclerView.Adapter { - - private Context context; - private List mDatas; - private LayoutInflater layoutInflater; - - public RecycleCarListAdapter(Context context, List mDatas) { - this.context = context; - this.mDatas = mDatas; - layoutInflater = LayoutInflater.from(this.context); - } - - public void updateDatas(List mDatas) { - this.mDatas = mDatas; - notifyDataSetChanged(); - } - - public int getLetterPosition(String letter) { - for (int i = 0; i < mDatas.size(); i++) { - if (mDatas.get(i).getPinyin().substring(0, 1).equals(letter)) { - return i; - } - } - return -1; - } - - @Override - public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - - View inflate = layoutInflater.inflate(R.layout.item_car_list, parent, false); - - return new MyViewHolder(inflate); - } - - @Override - public void onBindViewHolder(final MyViewHolder viewHolder, final int position) { - viewHolder.tvTitle.setVisibility(View.GONE); - - final MobCarEntity mobCarEntity = mDatas.get(position); - String pinyin = mobCarEntity.getPinyin().substring(0, 1); - String name = mobCarEntity.getName(); - viewHolder.tvName.setText(name); - if (position == 0) { - viewHolder.tvTitle.setVisibility(View.VISIBLE); - viewHolder.tvTitle.setText(pinyin); - } else { - MobCarEntity mobCarEntity2 = mDatas.get(position - 1); - String pinyin2 = mobCarEntity2.getPinyin().substring(0, 1); - if (!pinyin2.equals(pinyin)) { - viewHolder.tvTitle.setVisibility(View.VISIBLE); - viewHolder.tvTitle.setText(pinyin); - } - } - - viewHolder.tvName.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (mOnItemClickLitener != null) { - mOnItemClickLitener.onItemClick(view, position); - } - } - }); - - } - - @Override - public int getItemCount() { - return mDatas.size(); - } - - class MyViewHolder extends RecyclerView.ViewHolder { - - @Bind(R.id.tv_title) - TextView tvTitle; - @Bind(R.id.tv_name) - TextView tvName; - - public MyViewHolder(View itemView) { - super(itemView); - ButterKnife.bind(this, itemView); - } - } - - - private OnItemClickListener mOnItemClickLitener; - - public void setOnItemClickLitener(OnItemClickListener mOnItemClickLitener) { - this.mOnItemClickLitener = mOnItemClickLitener; - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarListSonAdapter.java b/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarListSonAdapter.java deleted file mode 100644 index acdccd4..0000000 --- a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleCarListSonAdapter.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.maning.gankmm.ui.adapter; - -import android.content.Context; -import android.support.v7.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -import com.maning.gankmm.R; -import com.maning.gankmm.bean.mob.MobCarEntity; -import com.maning.gankmm.listeners.OnItemClickListener; - -import java.util.List; - -import butterknife.Bind; -import butterknife.ButterKnife; - -/** - * Created by maning on 16/5/17. - */ -public class RecycleCarListSonAdapter extends RecyclerView.Adapter { - - private Context context; - private List mDatas; - private LayoutInflater layoutInflater; - - public RecycleCarListSonAdapter(Context context, List mDatas) { - this.context = context; - this.mDatas = mDatas; - layoutInflater = LayoutInflater.from(this.context); - } - - @Override - public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - - View inflate = layoutInflater.inflate(R.layout.item_car_list, parent, false); - - return new MyViewHolder(inflate); - } - - public MobCarEntity.SonBean getItemData(int position) { - return mDatas.get(position); - } - - @Override - public void onBindViewHolder(final MyViewHolder viewHolder, final int position) { - viewHolder.tvTitle.setVisibility(View.GONE); - - MobCarEntity.SonBean sonBean = mDatas.get(position); - String type = sonBean.getType(); - String car = sonBean.getCar(); - - if (position == 0) { - viewHolder.tvTitle.setVisibility(View.VISIBLE); - viewHolder.tvTitle.setText(car); - } else { - MobCarEntity.SonBean sonBean2 = mDatas.get(position - 1); - if (!car.equals(sonBean2.getCar())) { - viewHolder.tvTitle.setVisibility(View.VISIBLE); - viewHolder.tvTitle.setText(car); - } - } - - viewHolder.tvName.setText(type); - viewHolder.tvName.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (mOnItemClickLitener != null) { - mOnItemClickLitener.onItemClick(view, position); - } - } - }); - - } - - @Override - public int getItemCount() { - return mDatas.size(); - } - - class MyViewHolder extends RecyclerView.ViewHolder { - - @Bind(R.id.tv_title) - TextView tvTitle; - @Bind(R.id.tv_name) - TextView tvName; - - public MyViewHolder(View itemView) { - super(itemView); - ButterKnife.bind(this, itemView); - } - } - - - private OnItemClickListener mOnItemClickLitener; - - public void setOnItemClickLitener(OnItemClickListener mOnItemClickLitener) { - this.mOnItemClickLitener = mOnItemClickLitener; - } - -} diff --git a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleMoreAdapter.java b/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleMoreAdapter.java index de31ad3..540fcda 100644 --- a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleMoreAdapter.java +++ b/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleMoreAdapter.java @@ -13,23 +13,17 @@ import com.maning.gankmm.R; import com.maning.gankmm.listeners.OnItemClickListener; -import com.maning.gankmm.ui.activity.tools.CarListActivity; import com.maning.gankmm.ui.activity.tools.ChineseCalendarActivity; -import com.maning.gankmm.ui.activity.tools.CookMenuActivity; import com.maning.gankmm.ui.activity.tools.DictionaryActivity; import com.maning.gankmm.ui.activity.tools.FlightActivity; -import com.maning.gankmm.ui.activity.tools.RubbishActivity; import com.maning.gankmm.ui.activity.tools.HistoryTodayActivity; -import com.maning.gankmm.ui.activity.tools.IDCardQueryActivity; import com.maning.gankmm.ui.activity.tools.IPQueryActivity; -import com.maning.gankmm.ui.activity.tools.ScanResultActivity; -import com.maning.gankmm.ui.activity.tools.WorldPhoneCodeActivity; import com.maning.gankmm.ui.activity.tools.LotteryCategoryActivity; -import com.maning.gankmm.ui.activity.tools.OilPriceActivity; import com.maning.gankmm.ui.activity.tools.PhoneAddressActivity; -import com.maning.gankmm.ui.activity.tools.PostCodeActivity; +import com.maning.gankmm.ui.activity.tools.RubbishActivity; +import com.maning.gankmm.ui.activity.tools.ScanResultActivity; import com.maning.gankmm.ui.activity.tools.TrainActivity; -import com.maning.gankmm.ui.activity.tools.WXArticleActivity; +import com.maning.gankmm.ui.activity.tools.WorldPhoneCodeActivity; import com.maning.gankmm.utils.IntentUtils; import com.maning.gankmm.utils.MySnackbar; import com.maning.gankmm.utils.ZxingScanUtils; @@ -88,6 +82,7 @@ public void onBindViewHolder(final RecyclerView.ViewHolder viewHolder, final int } else if (position == 1) { //生活阅读 mDatasItem.add("历史上的今天"); + mDatasItem.add("笑话段子"); } else if (position == 2) { //休闲旅游 mDatasItem.add("周公解梦"); @@ -121,18 +116,10 @@ public void onItemClick(View view, int position) { ZxingScanUtils.open((Activity) context); } else if (title.equals("扫码记录")) { context.startActivity(new Intent(context, ScanResultActivity.class)); - } else if (title.equals("邮编查询")) { - context.startActivity(new Intent(context, PostCodeActivity.class)); - } else if (title.equals("菜谱查询")) { - context.startActivity(new Intent(context, CookMenuActivity.class)); - } else if (title.equals("身份证查询")) { - context.startActivity(new Intent(context, IDCardQueryActivity.class)); } else if (title.equals("IP地址")) { context.startActivity(new Intent(context, IPQueryActivity.class)); } else if (title.equals("中国彩票开奖结果")) { context.startActivity(new Intent(context, LotteryCategoryActivity.class)); - } else if (title.equals("微信精选")) { - context.startActivity(new Intent(context, WXArticleActivity.class)); } else if (title.equals("周公解梦")) { IntentUtils.startToWebActivity(context, "工具", "周公解梦", "http://tools.2345.com/zhgjm.htm"); } else if (title.equals("婚姻匹配")) { @@ -141,14 +128,10 @@ public void onItemClick(View view, int position) { IntentUtils.startToWebActivity(context, "工具", "八字算命", "http://www.jjdzc.com/sm/bz.html"); } else if (title.equals("老黄历")) { context.startActivity(new Intent(context, ChineseCalendarActivity.class)); - } else if (title.equals("电影票房")) { - MySnackbar.makeSnackBarGreen(myViewHolder.recyclerViewItem, "功能暂未开通,敬请期待"); } else if (title.equals("火车票查询")) { context.startActivity(new Intent(context, TrainActivity.class)); } else if (title.equals("航班信息查询")) { context.startActivity(new Intent(context, FlightActivity.class)); - } else if (title.equals("足球五大联赛")) { - MySnackbar.makeSnackBarGreen(myViewHolder.recyclerViewItem, "功能暂未开通,敬请期待"); } else if (title.equals("垃圾分类")) { context.startActivity(new Intent(context, RubbishActivity.class)); } else if (title.equals("历史上的今天")) { @@ -157,11 +140,7 @@ public void onItemClick(View view, int position) { context.startActivity(new Intent(context, WorldPhoneCodeActivity.class)); } else if (title.equals("新华字典")) { context.startActivity(new Intent(context, DictionaryActivity.class)); - } else if (title.equals("全国省市今日油价")) { - context.startActivity(new Intent(context, OilPriceActivity.class)); - } else if (title.equals("汽车信息查询")) { - context.startActivity(new Intent(context, CarListActivity.class)); - } else if (title.equals("驾考题库")) { + } else if (title.equals("笑话段子")) { MySnackbar.makeSnackBarGreen(myViewHolder.recyclerViewItem, "功能暂未开通,敬请期待"); } } diff --git a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleMoreItemAdapter.java b/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleMoreItemAdapter.java index f6f5af1..d73832b 100644 --- a/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleMoreItemAdapter.java +++ b/app/src/main/java/com/maning/gankmm/ui/adapter/RecycleMoreItemAdapter.java @@ -42,6 +42,7 @@ public class RecycleMoreItemAdapter extends RecyclerView.Adapter + + + + + + + diff --git a/app/src/main/res/layout/activity_bank_card.xml b/app/src/main/res/layout/activity_bank_card.xml deleted file mode 100644 index d2bf1e2..0000000 --- a/app/src/main/res/layout/activity_bank_card.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - -