Android 天气APP(二十二)改动些许UI,职场中的中年危机

这篇具有很好参考价值的文章主要介绍了Android 天气APP(二十二)改动些许UI,职场中的中年危机。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

android:layout_width=“match_parent”

android:layout_height=“wrap_content”>

<TextView

android:layout_width=“@dimen/dp_44”

android:layout_height=“wrap_content”

android:gravity=“center”

android:text=“PM10”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<com.llw.mvplibrary.view.LineProgressbar

android:id=“@+id/progress_pm10”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

app:progressbar_width=“@dimen/dp_80”

app:progressbar_height=“@dimen/dp_10”/>

<TextView

android:id=“@+id/tv_pm10”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:gravity=“center_vertical”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<TextView

android:layout_width=“@dimen/dp_44”

android:layout_height=“wrap_content”

android:gravity=“center”

android:text=“PM2.5”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<com.llw.mvplibrary.view.LineProgressbar

android:id=“@+id/progress_pm25”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

app:progressbar_width=“@dimen/dp_80”

app:progressbar_height=“@dimen/dp_10”/>

<TextView

android:id=“@+id/tv_pm25”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:gravity=“center_vertical”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<LinearLayout

android:layout_width=“@dimen/dp_44”

android:layout_height=“wrap_content”

android:gravity=“center”>

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“NO”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“2”

android:textColor=“@color/blue_one”

android:textSize=“8sp” />

<com.llw.mvplibrary.view.LineProgressbar

android:id=“@+id/progress_no2”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

app:progressbar_width=“@dimen/dp_80”

app:progressbar_height=“@dimen/dp_10”/>

<TextView

android:id=“@+id/tv_no2”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:gravity=“center_vertical”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<LinearLayout

android:layout_width=“@dimen/dp_44”

android:layout_height=“wrap_content”

android:gravity=“center”>

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“SO”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“2”

android:textColor=“@color/blue_one”

android:textSize=“8sp” />

<com.llw.mvplibrary.view.LineProgressbar

android:id=“@+id/progress_so2”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

app:progressbar_width=“@dimen/dp_80”

app:progressbar_height=“@dimen/dp_10”/>

<TextView

android:id=“@+id/tv_so2”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:gravity=“center_vertical”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<LinearLayout

android:layout_width=“@dimen/dp_44”

android:layout_height=“wrap_content”

android:gravity=“center”>

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“O”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“3”

android:textColor=“@color/blue_one”

android:textSize=“8sp” />

<com.llw.mvplibrary.view.LineProgressbar

android:id=“@+id/progress_o3”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

app:progressbar_width=“@dimen/dp_80”

app:progressbar_height=“@dimen/dp_10”/>

<TextView

android:id=“@+id/tv_o3”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:gravity=“center_vertical”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<TextView

android:layout_width=“@dimen/dp_44”

android:layout_height=“wrap_content”

android:gravity=“center”

android:text=“CO”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<com.llw.mvplibrary.view.LineProgressbar

android:id=“@+id/progress_co”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

app:progressbar_width=“@dimen/dp_80”

app:progressbar_height=“@dimen/dp_10”/>

<TextView

android:id=“@+id/tv_co”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<TextView

android:layout_marginLeft=“@dimen/dp_12”

android:text=“监测站空气质量”

android:textColor=“@color/white”

android:textSize=“@dimen/sp_16”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”/>

<androidx.recyclerview.widget.RecyclerView

android:id=“@+id/rv_station”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:overScrollMode=“never” />

<TextView

android:layout_marginLeft=“@dimen/dp_12”

android:text=“未来5天空气质量预报”

android:textColor=“@color/white”

android:textSize=“@dimen/sp_16”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”/>

<androidx.recyclerview.widget.RecyclerView

android:id=“@+id/rv_five_air”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginBottom=“@dimen/dp_12”

android:overScrollMode=“never” />

</androidx.core.widget.NestedScrollView>

Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui

现在可以创建item的布局文件里,这里面有两个列表,自然就需要两个item的布局,

先来看第一个的布局,在layout下新建一个item_more_air_station_list.xml,这个用于展示检测站的空气质量。代码如下:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:orientation=“vertical”

android:padding=“@dimen/dp_12”>

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:background=“@drawable/shape_transparent_12”

android:gravity=“center_horizontal”

android:orientation=“vertical”

android:padding=“@dimen/dp_12”>

<TextView

android:id=“@+id/tv_station_name”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:textColor=“@color/white”

android:textSize=“@dimen/sp_18” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“@dimen/dp_20”

android:orientation=“vertical”>

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:orientation=“horizontal”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“空气质量”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_air_category”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“@dimen/dp_12”

android:orientation=“horizontal”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“空气质量指数”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_aqi”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“@dimen/dp_12”

android:orientation=“horizontal”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“主要污染物”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_primary”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“PM10”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_pm10”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“PM2.5”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_pm25”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“二氧化氮”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_no2”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“二氧化硫”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_so2”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“一氧化碳”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_o3”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“12dp”>

<TextView

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:text=“臭氧”

android:textColor=“@color/blue_one”

android:textSize=“12sp” />

<TextView

android:id=“@+id/tv_co”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“center”

android:textColor=“@color/white”

android:textSize=“12sp” />

Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui

比较的简单,下面在layout下创建item_more_air_five_list.xml,用于展示当前城市未来五天的空气质量预报。布局如下:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:orientation=“vertical”

android:padding=“@dimen/dp_12”>

<LinearLayout

android:layout_width=“wrap_content”

android:layout_height=“match_parent”

android:background=“@drawable/shape_transparent_12”

android:gravity=“center_horizontal”

android:orientation=“vertical”

android:padding=“@dimen/dp_12”>

<LinearLayout

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:gravity=“center”

android:orientation=“vertical”>

<TextView

android:id=“@+id/tv_date_info”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:textColor=“@color/white”

android:textSize=“@dimen/sp_18” />

<TextView

android:id=“@+id/tv_date”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:textColor=“@color/white”

android:textSize=“@dimen/sp_14” />

<LinearLayout

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”>

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“AQI指数”

android:textColor=“@color/white” />

<TextView

android:id=“@+id/tv_aqi”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginLeft=“@dimen/dp_20”

android:text=“空气质量”

android:textColor=“@color/white” />

<LinearLayout

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginTop=“@dimen/dp_4”>

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“空气质量”

android:textColor=“@color/white” />

<TextView

android:id=“@+id/tv_category”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginLeft=“@dimen/dp_20”

android:text=“空气质量”

android:textColor=“@color/white” />

<LinearLayout

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginTop=“@dimen/dp_4”>

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“污染物”

android:textColor=“@color/white” />

<TextView

android:id=“@+id/tv_primary”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginLeft=“@dimen/dp_20”

android:text=“空气质量”

android:textColor=“@color/white” />

Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui

因为这个查询多天的空气质量之前并没有写上去,所以要在ApiService中新增一个,同时需要在app的bean包下面新建一个数据实体MoreAirFiveResponse,代码如下:

package com.llw.goodweather.bean;

import java.util.List;

public class MoreAirFiveResponse {

/**

  • code : 200

  • updateTime : 2020-08-06T09:28+08:00

  • fxLink : http://hfx.link/2ax4

  • daily : [{“fxDate”:“2020-08-06”,“aqi”:“60”,“level”:“2”,“category”:“良”,“primary”:“NA”},{“fxDate”:“2020-08-07”,“aqi”:“90”,“level”:“2”,“category”:“良”,“primary”:“NA”},{“fxDate”:“2020-08-08”,“aqi”:“100”,“level”:“2”,“category”:“良”,“primary”:“NA”},{“fxDate”:“2020-08-09”,“aqi”:“110”,“level”:“3”,“category”:“轻度污染”,“primary”:“NA”},{“fxDate”:“2020-08-10”,“aqi”:“90”,“level”:“2”,“category”:“良”,“primary”:“NA”}]

  • refer : {“sources”:[“cnemc”],“license”:[“no commercial use”]}

*/

private String code;

private String updateTime;

private String fxLink;

private ReferBean refer;

private List daily;

public String getCode() {

return code;

}

public void setCode(String code) {

this.code = code;

}

public String getUpdateTime() {

return updateTime;

}

public void setUpdateTime(String updateTime) {

this.updateTime = updateTime;

}

public String getFxLink() {

return fxLink;

}

public void setFxLink(String fxLink) {

this.fxLink = fxLink;

}

public ReferBean getRefer() {

return refer;

}

public void setRefer(ReferBean refer) {

this.refer = refer;

}

public List getDaily() {

return daily;

}

public void setDaily(List daily) {

this.daily = daily;

}

public static class ReferBean {

private List sources;

private List license;

public List getSources() {

return sources;

}

public void setSources(List sources) {

this.sources = sources;

}

public List getLicense() {

return license;

}

public void setLicense(List license) {

this.license = license;

}

}

public static class DailyBean {

/**

  • fxDate : 2020-08-06

  • aqi : 60

  • level : 2

  • category : 良

  • primary : NA

*/

private String fxDate;

private String aqi;

private String level;

private String category;

private String primary;

public String getFxDate() {

return fxDate;

}

public void setFxDate(String fxDate) {

this.fxDate = fxDate;

}

public String getAqi() {

return aqi;

}

public void setAqi(String aqi) {

this.aqi = aqi;

}

public String getLevel() {

return level;

}

public void setLevel(String level) {

this.level = level;

}

public String getCategory() {

return category;

}

public void setCategory(String category) {

this.category = category;

}

public String getPrimary() {

return primary;

}

public void setPrimary(String primary) {

this.primary = primary;

}

}

}

ApiService中新增如下接口

/**

  • 空气质量5天预报

  • @param location 城市id

  • @return 返回空气质量5天预报数据

*/

@GET(“/v7/air/5d?key=3086e91d66c04ce588a7f538f917c7f4”)

Call airFiveWeather(@Query(“location”) String location);

现在可以创建一个新的订阅器了,在appcontract包下新建一个MoreAirContract,代码如下:

package com.llw.goodweather.contract;

import com.llw.goodweather.api.ApiService;

import com.llw.goodweather.bean.AirNowResponse;

import com.llw.goodweather.bean.DailyResponse;

import com.llw.goodweather.bean.MoreAirFiveResponse;

import com.llw.goodweather.bean.NewSearchCityResponse;

import com.llw.mvplibrary.base.BasePresenter;

import com.llw.mvplibrary.base.BaseView;

import com.llw.mvplibrary.net.NetCallBack;

import com.llw.mvplibrary.net.ServiceGenerator;

import retrofit2.Call;

import retrofit2.Response;

/**

  • 更多空气质量数据订阅器

*/

public class MoreAirContract {

public static class MoreAirPresenter extends BasePresenter {

/**

  • 搜索城市 搜索站点的城市id,用于查询空气质量

  • @param location 城市名

*/

public void searchCityId(String location) {//注意这里的4表示新的搜索城市地址接口

ApiService service = ServiceGenerator.createService(ApiService.class, 4);//指明访问的地址

service.newSearchCity(location,“exact”).enqueue(new NetCallBack() {

@Override

public void onSuccess(Call call, Response response) {

if(getView() != null){

getView().getSearchCityIdResult(response);

}

}

@Override

public void onFailed() {

if(getView() != null){

getView().getDataFailed();

}

}

});

}

/**

  • 空气质量 V7

  • @param location 城市id

*/

public void air(String location) {

ApiService service = ServiceGenerator.createService(ApiService.class,3);

service.airNowWeather(location).enqueue(new NetCallBack() {

@Override

public void onSuccess(Call call, Response response) {

if(getView() != null){

getView().getMoreAirResult(response);

}

}

@Override

public void onFailed() {

if(getView() != null){

getView().getDataFailed();

}

}

});

}

/**

  • 五天空气质量数据 V7

  • @param location 城市id

*/

public void airFive(String location) {

ApiService service = ServiceGenerator.createService(ApiService.class,3);

service.airFiveWeather(location).enqueue(new NetCallBack() {

@Override

public void onSuccess(Call call, Response response) {

if(getView() != null){

getView().getMoreAirFiveResult(response);

}

}

@Override

public void onFailed() {

if(getView() != null){

getView().getDataFailed();

}

}

});

}

}

public interface IMoreAirView extends BaseView {

//搜索城市Id

void getSearchCityIdResult(Response response);

//空气质量返回数据 V7

void getMoreAirResult(Response response);

//五天空气质量数据返回 V7

void getMoreAirFiveResult(Response response);

//错误返回

void getDataFailed();

}

}

里面有三个请求和返回以及一个异常返回,因为空气质量比较特殊,所以我需要先使用搜索城市接口,将MainActivity中传递过来的上级城市(监测站)先查询一次,得到这个城市的id,再通过这个id去请求当前空气质量和未来五天空气质量的接口,这样才能拿到数据。以便于展示。

下面创建两个列表数据适配器,在appadapter包下新建MoreAirStationAdapter,用于展示检测站点的数据

package com.llw.goodweather.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;

import com.chad.library.adapter.base.BaseViewHolder;

import com.llw.goodweather.R;

import com.llw.goodweather.bean.AirNowResponse;

import java.util.List;

/**

  • 更多空气质量之空气站点列表适配器

*/

public class MoreAirStationAdapter extends BaseQuickAdapter<AirNowResponse.StationBean, BaseViewHolder> {

public MoreAirStationAdapter(int layoutResId, @Nullable List<AirNowResponse.StationBean> data) {

super(layoutResId, data);

}

@Override

protected void convert(BaseViewHolder helper, AirNowResponse.StationBean item) {

helper.setText(R.id.tv_station_name, item.getName())//监测站名称

.setText(R.id.tv_air_category, item.getCategory())//空气质量

.setText(R.id.tv_aqi, item.getAqi())//空气质量指数

.setText(R.id.tv_primary, item.getPrimary().equals(“NA”) ? “无污染” : item.getPrimary())//污染物

.setText(R.id.tv_pm10, item.getPm10())//pm10

.setText(R.id.tv_pm25, item.getPm2p5())//pm2.5

.setText(R.id.tv_no2, item.getNo2())//二氧化氮

.setText(R.id.tv_so2, item.getSo2())//二氧化硫

.setText(R.id.tv_o3, item.getO3())//臭氧

.setText(R.id.tv_co, item.getCo());//一氧化碳

}

}

OK,再创建一个MoreAirFiveAdapter,代码如下:

package com.llw.goodweather.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;

import com.chad.library.adapter.base.BaseViewHolder;

import com.llw.goodweather.R;

import com.llw.goodweather.bean.MoreAirFiveResponse;

import com.llw.goodweather.utils.DateUtils;

import java.util.List;

/**

  • 5天空气质量预报适配器

*/

public class MoreAirFiveAdapter extends BaseQuickAdapter<MoreAirFiveResponse.DailyBean, BaseViewHolder> {

public MoreAirFiveAdapter(int layoutResId, @Nullable List<MoreAirFiveResponse.DailyBean> data) {

super(layoutResId, data);

}

@Override

protected void convert(BaseViewHolder helper, MoreAirFiveResponse.DailyBean item) {

helper.setText(R.id.tv_date_info, DateUtils.Week(item.getFxDate()))//日期描述

.setText(R.id.tv_date, DateUtils.dateSplit(item.getFxDate()))//日期

.setText(R.id.tv_aqi,item.getAqi())//空气质量指数

.setText(R.id.tv_category,item.getCategory())//空气质量描述

.setText(R.id.tv_primary, item.getPrimary().equals(“NA”) ? “无污染” : item.getPrimary());//污染物

}

}

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip204888 (备注Android)
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui

结尾

最后小编想说:不论以后选择什么方向发展,目前重要的是把Android方面的技术学好,毕竟其实对于程序员来说,要学习的知识内容、技术有太多太多,要想不被环境淘汰就只有不断提升自己,从来都是我们去适应环境,而不是环境来适应我们!

当程序员容易,当一个优秀的程序员是需要不断学习的,从初级程序员到高级程序员,从初级架构师到资深架构师,或者走向管理,从技术经理到技术总监,每个阶段都需要掌握不同的能力。早早确定自己的职业方向,才能在工作和能力提升中甩开同龄人。

想要拿高薪实现技术提升薪水得到质的飞跃。最快捷的方式,就是有人可以带着你一起分析,这样学习起来最为高效,所以为了大家能够顺利进阶中高级、架构师,我特地为大家准备了一套高手学习的源码和框架视频等精品Android架构师教程,保证你学了以后保证薪资上升一个台阶。

当你有了学习线路,学习哪些内容,也知道以后的路怎么走了,理论看多了总要实践的。

Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui

高级UI,自定义View

UI这块知识是现今使用者最多的。当年火爆一时的Android入门培训,学会这小块知识就能随便找到不错的工作了。

不过很显然现在远远不够了,拒绝无休止的CV,亲自去项目实战,读源码,研究原理吧!

Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui

本文已被CODING开源项目:《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》收录

一个人可以走的很快,但一群人才能走的更远。如果你从事以下工作或对以下感兴趣,欢迎戳这里加入程序员的圈子,让我们一起学习成长!

AI人工智能、Android移动开发、AIGC大模型、C C#、Go语言、Java、Linux运维、云计算、MySQL、PMP、网络安全、Python爬虫、UE5、UI设计、Unity3D、Web前端开发、产品经理、车载开发、大数据、鸿蒙、计算机网络、嵌入式物联网、软件测试、数据结构与算法、音视频开发、Flutter、IOS开发、PHP开发、.NET、安卓逆向、云计算文章来源地址https://www.toymoban.com/news/detail-852746.html

.id.tv_category,item.getCategory())//空气质量描述

.setText(R.id.tv_primary, item.getPrimary().equals(“NA”) ? “无污染” : item.getPrimary());//污染物

}

}

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
[外链图片转存中…(img-6ouYveBS-1712099849262)]
[外链图片转存中…(img-dfg92Gjw-1712099849263)]
[外链图片转存中…(img-eyB8XaZh-1712099849263)]
[外链图片转存中…(img-6M18rayr-1712099849264)]
[外链图片转存中…(img-by9coDok-1712099849264)]
[外链图片转存中…(img-y5eQnb6p-1712099849264)]
Android 天气APP(二十二)改动些许UI,职场中的中年危机,2024年程序员学习,android,ui

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip204888 (备注Android)
[外链图片转存中…(img-4wHdTOtB-1712099849265)]

结尾

最后小编想说:不论以后选择什么方向发展,目前重要的是把Android方面的技术学好,毕竟其实对于程序员来说,要学习的知识内容、技术有太多太多,要想不被环境淘汰就只有不断提升自己,从来都是我们去适应环境,而不是环境来适应我们!

当程序员容易,当一个优秀的程序员是需要不断学习的,从初级程序员到高级程序员,从初级架构师到资深架构师,或者走向管理,从技术经理到技术总监,每个阶段都需要掌握不同的能力。早早确定自己的职业方向,才能在工作和能力提升中甩开同龄人。

想要拿高薪实现技术提升薪水得到质的飞跃。最快捷的方式,就是有人可以带着你一起分析,这样学习起来最为高效,所以为了大家能够顺利进阶中高级、架构师,我特地为大家准备了一套高手学习的源码和框架视频等精品Android架构师教程,保证你学了以后保证薪资上升一个台阶。

当你有了学习线路,学习哪些内容,也知道以后的路怎么走了,理论看多了总要实践的。

[外链图片转存中…(img-zTxG0vEg-1712099849265)]

高级UI,自定义View

UI这块知识是现今使用者最多的。当年火爆一时的Android入门培训,学会这小块知识就能随便找到不错的工作了。

不过很显然现在远远不够了,拒绝无休止的CV,亲自去项目实战,读源码,研究原理吧!

[外链图片转存中…(img-rJEz2Bh3-1712099849265)]

本文已被CODING开源项目:《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》收录

一个人可以走的很快,但一群人才能走的更远。如果你从事以下工作或对以下感兴趣,欢迎戳这里加入程序员的圈子,让我们一起学习成长!

AI人工智能、Android移动开发、AIGC大模型、C C#、Go语言、Java、Linux运维、云计算、MySQL、PMP、网络安全、Python爬虫、UE5、UI设计、Unity3D、Web前端开发、产品经理、车载开发、大数据、鸿蒙、计算机网络、嵌入式物联网、软件测试、数据结构与算法、音视频开发、Flutter、IOS开发、PHP开发、.NET、安卓逆向、云计算

到了这里,关于Android 天气APP(二十二)改动些许UI,职场中的中年危机的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Android——数据存储(二)(二十二)

    1.1 知识点 (1)了解SQLite数据库的基本作用; (2)掌握数据库操作辅助类:SQLiteDatabase的使用; (3)可以使用命令操作SQLite数据库; (4)可以完成数据库的CRUD操作; (5)掌握数据库查询及Cursor接口的使用。 1.2 具体内容 在Android当中,本身提供了一种微型的嵌入式数据库

    2024年02月09日
    浏览(28)
  • 【Android从零单排系列二十二】《Android视图控件——GridView》

    目录 前言 一 GridView基本介绍 二 GridView使用方法 三 GridView常见属性及方法 四 总结 小伙伴们,在上文中我们介绍了Android视图组件ExpandableListView,本文我们继续盘点,介绍一下视图控件的GridView。 GridView是一个在Android中常用的布局控件,它可以以网格形式展示数据,类似于表

    2024年02月10日
    浏览(33)
  • Android——一个简单的天气APP

    EasyWeather演示效果视频 此天气数据源采用心知天气API(试用版),免费版获取数据有限,只能获取普通的温度、湿度等,例如压力、云量、可见度等均获取不到,试用版相当于正式版,可以获取大部分数据,试用日期是14天。 首页不同城市天气页面之间的滑动采用的是 ViewPager

    2023年04月26日
    浏览(33)
  • Android实现-心知天气API接口开发(天气预报app)

    自己开发app之心知天气APP程序代码粘贴即可用。完整代码附最后。 第一步:去知心天气注册开发者账号查看自己的token。注册好登录进去--控制台---免费版--秘钥。这里的秘钥就是自己的token。(有兴趣的可以看开发文档,这里就不多介绍了)  第二步,下载素材包。点击文档

    2024年02月03日
    浏览(99)
  • 基于Android实现的天气预测APP

    网络数据源使用 Retrofit 库访问彩云 API 提供的 Webservice 接口来实现。 Retrofit 通过封装络请求和数据解析,极地提升了开发效率。并且持定义数据解析在封装所有网络请求的 API 时,我使用了协程技术来简化 Retrofit 回调的写法。 1.1.1 数据存储 本地数据源使用 SharedPreferences 持久

    2024年02月01日
    浏览(39)
  • Android Studio 实现天气预报App (简单方便展示内容超多)

    🍅 文章末尾有获取完整项目源码方式 🍅 目录 前言 一、任务介绍 1.1 背景 1.2目的和意义 二、 实现介绍 视频演示 2.1 启动页实现 2.2注册页面实现 2.3 登陆页面实现 2.4 首页实现 2.5 城市管理列表页面实现                三、获取源码         在使用Android Studio开发

    2024年04月24日
    浏览(37)
  • 安卓大作业:使用Android Studio开发天气预报APP(使用sqlite数据库)

    今天我来分享一下如何使用Android Studio开发一个天气预报APP。在文中,我们将使用第三方接口获取实时天气数据,并显示在APP界面上。 首先,打开Android Studio并创建一个新的项目。在创建新项目时,我们需要设置项目名称、包名和支持的最低API级别。 为了获取实时天气数据,

    2024年02月08日
    浏览(46)
  • Android问题笔记二十五:在构建提示“Could not resolve all files for configuration ‘:app:debugRuntimeClasspath”

    专栏分享 点击跳转=Unity3D特效百例 点击跳转=案例项目实战源码 点击跳转=游戏脚本-辅助自动化 点击跳转=Android控件全解手册 点击跳转=Scratch编程案例 点击跳转=软考全系列 众所周知,人生是一个漫长的流程,不断 克服困难 ,不断反思前进的过程。在这个过程中会产生很多对

    2024年02月03日
    浏览(38)
  • Android开发详解:第3章《App UI 设计》

    View View类在Android中可以理解为视图。它占据屏幕上的一个矩形区域,负责提供控件绘制和事件处理的方法。如果把Android界面比喻成窗户,那么每块玻璃都是一个view,View类是所有UI控件。 View类位于android.view包中;文本框控件TextView是View类的子类,位于android.widget包中。 在A

    2024年02月04日
    浏览(33)
  • Android Ble蓝牙App(四)UI优化和描述符

      上一篇中了解了特性和属性,同时显示设备蓝牙服务下的特性和属性,本文中就需要来使用这些特性和属性来完成一些功能。 Ble蓝牙App(一)扫描 Ble蓝牙App(二)连接与发现服务 Ble蓝牙App(三)特性和属性 Ble蓝牙App(四)UI优化和描述符 Ble蓝牙App(五)数据操作   

    2024年02月13日
    浏览(30)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包