From c7cba6826a1e47e4f5ae15ee6336dfdf0e81391e Mon Sep 17 00:00:00 2001 From: maning <154292322@qq.com> Date: Wed, 30 Sep 2020 16:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B4=E6=9D=A1=E9=85=8D=E7=BD=AE=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gankmm/ui/presenter/impl/GirlPresenterImpl.java | 11 +++++++++-- .../ui/presenter/impl/SettingPresenterImpl.java | 3 ++- app/src/main/res/values/strings.xml | 7 ++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/maning/gankmm/ui/presenter/impl/GirlPresenterImpl.java b/app/src/main/java/com/maning/gankmm/ui/presenter/impl/GirlPresenterImpl.java index cc4b237..38f48a1 100644 --- a/app/src/main/java/com/maning/gankmm/ui/presenter/impl/GirlPresenterImpl.java +++ b/app/src/main/java/com/maning/gankmm/ui/presenter/impl/GirlPresenterImpl.java @@ -97,9 +97,16 @@ public void onFail(int code, String message) { @Override public void getRandomDatas() { - //查看配置的干活类型:默认Android + //查看配置的干活类型:默认Android, //Android,iOS,Flutter,frontend,backend,app String headLineType = SharePreUtil.getStringData(context, Constants.SPSwitcherDataType, "Android"); - GankApi2.getRandomDatas("GanHuo", headLineType, 10, new CommonHttpCallback() { + if ("前端".equals(headLineType)) { + headLineType = "frontend"; + } else if ("后端".equals(headLineType)) { + headLineType = "backend"; + } else if ("APP".equals(headLineType)) { + headLineType = "app"; + } + GankApi2.getRandomDatas("Article", headLineType, 10, new CommonHttpCallback() { @Override public void onSuccess(Gank2CategoryTypeListBean result) { randomLists = result.getData(); diff --git a/app/src/main/java/com/maning/gankmm/ui/presenter/impl/SettingPresenterImpl.java b/app/src/main/java/com/maning/gankmm/ui/presenter/impl/SettingPresenterImpl.java index 58e3dfb..3671c18 100644 --- a/app/src/main/java/com/maning/gankmm/ui/presenter/impl/SettingPresenterImpl.java +++ b/app/src/main/java/com/maning/gankmm/ui/presenter/impl/SettingPresenterImpl.java @@ -109,7 +109,8 @@ public void configurationHeadLine() { @Override public void onSelection(MaterialDialog dialog, View itemView, int position, CharSequence text) { //保存选择的类型 - SharePreUtil.saveStringData(context, Constants.SPSwitcherDataType, String.valueOf(text)); + String result = String.valueOf(text); + SharePreUtil.saveStringData(context, Constants.SPSwitcherDataType, result); mView.updateHeadLine(String.valueOf(text)); } }); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5dcce9c..de411b2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -63,13 +63,14 @@ 设置 取消 - + Android iOS - 休息视频 - 拓展资源 + Flutter 前端 + 后端 + APP