国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示

這篇具有很好參考價值的文章主要介紹了Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

android:background=“@mipmap/icon_100”

android:layout_width=“30dp”

android:layout_height=“30dp”/>

<LinearLayout

android:gravity=“right”

android:layout_width=“@dimen/dp_0”

android:layout_height=“wrap_content”

android:layout_weight=“1”>

<TextView

android:id=“@+id/tv_temp_height”

android:textSize=“@dimen/sp_14”

android:textColor=“#FFF”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”/>

<TextView

android:id=“@+id/tv_temp_low”

android:textSize=“@dimen/sp_14”

android:textColor=“@color/temp_min_tx”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”/>

就是把里面的溫度地段改成了兩個,用不同的顏色區(qū)分開,然后進(jìn)入DailyAdapter

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

照著這個截圖上面的修改就可以了,方法應(yīng)該是都有的。

最后在渲染數(shù)據(jù)的時候增加動畫

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

我在天氣預(yù)報的返回和逐小時天氣的返回數(shù)據(jù)中做了動畫的渲染,注意到用了兩個不同的動畫,一個是底部往上彈,一個是從右往左彈。

運(yùn)行之后效果如下

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

這樣看起來可能舒服一些吧,

二、更多空氣質(zhì)量數(shù)據(jù)展示

下面就要開始寫更多空氣質(zhì)量的頁面展示了。

老樣子,在appui包下新建一個MoreAirActivity,然后修改布局

,在修改之前我們先寫一個自定義View,這當(dāng)然也是需要樣式的

mvplibrarystyles.xml中新增一個樣式

然后在mvplibraryview包中新建一個LineProgressbar,代碼如下:

package com.llw.mvplibrary.view;

import android.animation.ValueAnimator;

import android.annotation.SuppressLint;

import android.content.Context;

import android.content.res.TypedArray;

import android.graphics.Canvas;

import android.graphics.Color;

import android.graphics.Paint;

import android.graphics.RectF;

import android.util.AttributeSet;

import android.view.View;

import android.view.animation.AccelerateInterpolator;

import com.llw.mvplibrary.R;

public class LineProgressbar extends View {

private Paint mPaint;//畫筆

private float mPaintWidth = 6f;//初始畫筆寬度

private int mProgressbarWidth;//控件外邊框?qū)挾?/p>

private int mProgressbarHeight;//控件外邊框高度

private int mPercent = 0;//已轉(zhuǎn)化為0至100范圍的當(dāng)前進(jìn)度,隨動畫時間改變而改變

public LineProgressbar(Context context) {

super(context);

}

@SuppressLint(“Recycle”)

public LineProgressbar(Context context, AttributeSet attrs) {

super(context, attrs);

TypedArray array = getContext().obtainStyledAttributes(attrs, R.styleable.LineProgressbar);

mProgressbarWidth = (int) array.getDimension(R.styleable.LineProgressbar_progressbar_width, 100);

mProgressbarHeight = (int) array.getDimension(R.styleable.LineProgressbar_progressbar_height, 10);

}

public LineProgressbar(Context context, AttributeSet attrs, int defStyleAttr) {

super(context, attrs, defStyleAttr);

}

@Override

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

setMeasuredDimension(mProgressbarWidth, mProgressbarHeight);

}

@Override

@SuppressLint(“DrawAllocation”)

protected void onDraw(Canvas canvas) {

mPaint = new Paint();

//繪制背景

mPaint.setColor(getResources().getColor(R.color.arc_bg_color));

mPaint.setStyle(Paint.Style.FILL);

mPaint.setAntiAlias(true);

mPaint.setStrokeWidth(mPaintWidth);

RectF frameRectF = new RectF(mPaintWidth, mPaintWidth, mProgressbarWidth - mPaintWidth, mProgressbarHeight - mPaintWidth);

canvas.drawRoundRect(frameRectF, 15, 15, mPaint);

//填充內(nèi)部進(jìn)度

mPaint.setPathEffect(null);

mPaint.setColor(Color.WHITE);

mPaint.setStyle(Paint.Style.FILL);

mPaint.setAntiAlias(true);

//內(nèi)部進(jìn)度填充長度,隨動畫時間改變而改變

float percent = (float) mPercent / 100f;

RectF progressRectF = new RectF(mPaintWidth, mPaintWidth, mPaintWidth + percent * (mProgressbarWidth - 2 * mPaintWidth - 2), mProgressbarHeight - mPaintWidth);

canvas.drawRoundRect(progressRectF, 15, 15, mPaint);

}

public void setProgress(String progress, int maxProgress) {

int percent = 0;

//得出當(dāng)前progress占最大進(jìn)度值百分比(0-100)

if (progress.contains(“.”)) {//float或者double類型

percent = ((int) Float.parseFloat(progress) * 10) * 100 / (maxProgress * 10);

} else {//int類型

percent = Integer.parseInt(progress) * 100 / maxProgress;

}

if (percent < 0) {

percent = 0;

}

if (percent > 100) {

percent = 100;

}

//屬性動畫

ValueAnimator animator = ValueAnimator.ofInt(0, percent);

animator.setDuration(1000);

animator.setInterpolator(new AccelerateInterpolator());

animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

@Override

public void onAnimationUpdate(ValueAnimator valueAnimator) {

mPercent = (int) valueAnimator.getAnimatedValue();

invalidate();

}

});

animator.start();

}

}

現(xiàn)在可以看布局文件activity_more_air.xml了,代碼如下:

里面用到的背景圖片

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

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

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

xmlns:app=“http://schemas.android.com/apk/res-auto”

xmlns:tools=“http://schemas.android.com/tools”

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:background=“@drawable/more_air_bg”

android:fitsSystemWindows=“true”

android:orientation=“vertical”

tools:context=“.ui.MoreAirActivity”>

<androidx.appcompat.widget.Toolbar

android:id=“@+id/toolbar”

android:layout_width=“match_parent”

android:layout_height=“?attr/actionBarSize”

app:contentInsetLeft=“@dimen/dp_16”

app:layout_constraintEnd_toEndOf=“parent”

app:layout_constraintLeft_toLeftOf=“parent”

app:layout_constraintTop_toTopOf=“parent”

app:navigationIcon=“@mipmap/icon_return_white”

app:popupTheme=“@style/AppTheme.PopupOverlay”>

<TextView

android:id=“@+id/tv_title”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

android:text=“更多空氣質(zhì)量”

android:textColor=“@color/white”

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

</androidx.appcompat.widget.Toolbar>

<androidx.core.widget.NestedScrollView

android:overScrollMode=“never”

android:layout_width=“match_parent”

android:layout_height=“match_parent”>

<LinearLayout

android:orientation=“vertical”

android:layout_width=“match_parent”

android:layout_height=“match_parent”>

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_margin=“@dimen/dp_12”

android:background=“@drawable/shape_transparent_12”

android:orientation=“vertical”

android:padding=“@dimen/dp_12”>

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”>

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:text=“實時空氣質(zhì)量”

android:textColor=“@color/white”

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

<TextView

android:id=“@+id/tv_old_time”

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:gravity=“right”

android:text=“上次更新時間:”

android:textColor=“@color/white”

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

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:layout_marginTop=“@dimen/dp_12”>

<LinearLayout

android:layout_width=“0dp”

android:layout_height=“match_parent”

android:layout_weight=“1”

android:gravity=“center”

android:orientation=“vertical”>

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_marginBottom=“8dp”

android:text=“污染指數(shù)”

android:textColor=“#DAEBEE”

android:textSize=“14sp” />

<com.llw.mvplibrary.view.RoundProgressBar

android:id=“@+id/rpb_aqi”

android:layout_width=“120dp”

android:layout_height=“120dp”

android:layout_gravity=“center”

app:round_bg_color=“#C6D7F4”

app:round_progress_color=“#FBFEF7” />

<LinearLayout

android:layout_width=“0dp”

android:layout_height=“wrap_content”

android:layout_weight=“1”

android:orientation=“vertical”>

<LinearLayout

android:gravity=“center_vertical”

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=“監(jiān)測站空氣質(zhì)量”

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天空氣質(zhì)量預(yù)報”

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、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

現(xiàn)在可以創(chuàng)建item的布局文件里,這里面有兩個列表,自然就需要兩個item的布局,

先來看第一個的布局,在layout下新建一個item_more_air_station_list.xml,這個用于展示檢測站的空氣質(zhì)量。代碼如下:

<?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=“空氣質(zhì)量”

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=“空氣質(zhì)量指數(shù)”

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、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

比較的簡單,下面在layout下創(chuàng)建item_more_air_five_list.xml,用于展示當(dāng)前城市未來五天的空氣質(zhì)量預(yù)報。布局如下:

<?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指數(shù)”

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=“空氣質(zhì)量”

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=“空氣質(zhì)量”

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=“空氣質(zhì)量”

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=“空氣質(zhì)量”

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

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

因為這個查詢多天的空氣質(zhì)量之前并沒有寫上去,所以要在ApiService中新增一個,同時需要在app的bean包下面新建一個數(shù)據(jù)實體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”,“l(fā)evel”:“2”,“category”:“良”,“primary”:“NA”},{“fxDate”:“2020-08-07”,“aqi”:“90”,“l(fā)evel”:“2”,“category”:“良”,“primary”:“NA”},{“fxDate”:“2020-08-08”,“aqi”:“100”,“l(fā)evel”:“2”,“category”:“良”,“primary”:“NA”},{“fxDate”:“2020-08-09”,“aqi”:“110”,“l(fā)evel”:“3”,“category”:“輕度污染”,“primary”:“NA”},{“fxDate”:“2020-08-10”,“aqi”:“90”,“l(fā)evel”:“2”,“category”:“良”,“primary”:“NA”}]

  • refer : {“sources”:[“cnemc”],“l(fā)icense”:[“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中新增如下接口

/**

  • 空氣質(zhì)量5天預(yù)報

  • @param location 城市id

  • @return 返回空氣質(zhì)量5天預(yù)報數(shù)據(jù)

*/

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

Call airFiveWeather(@Query(“l(fā)ocation”) String location);

現(xiàn)在可以創(chuàng)建一個新的訂閱器了,在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;

/**

  • 更多空氣質(zhì)量數(shù)據(jù)訂閱器

*/

public class MoreAirContract {

public static class MoreAirPresenter extends BasePresenter {

/**

  • 搜索城市 搜索站點的城市id,用于查詢空氣質(zhì)量

  • @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();

}

}

});

}

/**

  • 空氣質(zhì)量 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();

}

}

});

}

/**

  • 五天空氣質(zhì)量數(shù)據(jù) 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);

//空氣質(zhì)量返回數(shù)據(jù) V7

自我介紹一下,小編13年上海交大畢業(yè),曾經(jīng)在小公司待過,也去過華為、OPPO等大廠,18年進(jìn)入阿里一直到現(xiàn)在。

深知大多數(shù)Android工程師,想要提升技能,往往是自己摸索成長或者是報班學(xué)習(xí),但對于培訓(xùn)機(jī)構(gòu)動則幾千的學(xué)費,著實壓力不小。自己不成體系的自學(xué)效果低效又漫長,而且極易碰到天花板技術(shù)停滯不前!

因此收集整理了一份《2024年Android移動開發(fā)全套學(xué)習(xí)資料》,初衷也很簡單,就是希望能夠幫助到想自學(xué)提升又不知道該從何學(xué)起的朋友,同時減輕大家的負(fù)擔(dān)。
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

既有適合小白學(xué)習(xí)的零基礎(chǔ)資料,也有適合3年以上經(jīng)驗的小伙伴深入學(xué)習(xí)提升的進(jìn)階課程,基本涵蓋了95%以上Android開發(fā)知識點,真正體系化!

由于文件比較大,這里只是將部分目錄大綱截圖出來,每個節(jié)點里面都包含大廠面經(jīng)、學(xué)習(xí)筆記、源碼講義、實戰(zhàn)項目、講解視頻,并且后續(xù)會持續(xù)更新

如果你覺得這些內(nèi)容對你有幫助,可以添加V獲?。簐ip204888 (備注Android)
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

總結(jié)

最后為了幫助大家深刻理解Android相關(guān)知識點的原理以及面試相關(guān)知識,這里放上相關(guān)的我搜集整理的14套騰訊、字節(jié)跳動、阿里、百度等2021最新面試真題解析,我把技術(shù)點整理成了視頻和PDF(實際上比預(yù)期多花了不少精力),包知識脈絡(luò) + 諸多細(xì)節(jié)。

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活
網(wǎng)上學(xué)習(xí) Android的資料一大堆,但如果學(xué)到的知識不成體系,遇到問題時只是淺嘗輒止,不再深入研究,那么很難做到真正的技術(shù)提升。

本文已被CODING開源項目:《Android學(xué)習(xí)筆記總結(jié)+移動架構(gòu)視頻+大廠面試真題+項目實戰(zhàn)源碼》收錄

一個人可以走的很快,但一群人才能走的更遠(yuǎn)。如果你從事以下工作或?qū)σ韵赂信d趣,歡迎戳這里加入程序員的圈子,讓我們一起學(xué)習(xí)成長!

AI人工智能、Android移動開發(fā)、AIGC大模型、C C#、Go語言、Java、Linux運(yùn)維、云計算、MySQL、PMP、網(wǎng)絡(luò)安全、Python爬蟲、UE5、UI設(shè)計、Unity3D、Web前端開發(fā)、產(chǎn)品經(jīng)理、車載開發(fā)、大數(shù)據(jù)、鴻蒙、計算機(jī)網(wǎng)絡(luò)、嵌入式物聯(lián)網(wǎng)、軟件測試、數(shù)據(jù)結(jié)構(gòu)與算法、音視頻開發(fā)、Flutter、IOS開發(fā)、PHP開發(fā)、.NET、安卓逆向、云計算文章來源地址http://www.zghlxwxcb.cn/news/detail-845718.html

taFailed();

}

}

});

}

/**

  • 五天空氣質(zhì)量數(shù)據(jù) 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);

//空氣質(zhì)量返回數(shù)據(jù) V7

自我介紹一下,小編13年上海交大畢業(yè),曾經(jīng)在小公司待過,也去過華為、OPPO等大廠,18年進(jìn)入阿里一直到現(xiàn)在。

深知大多數(shù)Android工程師,想要提升技能,往往是自己摸索成長或者是報班學(xué)習(xí),但對于培訓(xùn)機(jī)構(gòu)動則幾千的學(xué)費,著實壓力不小。自己不成體系的自學(xué)效果低效又漫長,而且極易碰到天花板技術(shù)停滯不前!

因此收集整理了一份《2024年Android移動開發(fā)全套學(xué)習(xí)資料》,初衷也很簡單,就是希望能夠幫助到想自學(xué)提升又不知道該從何學(xué)起的朋友,同時減輕大家的負(fù)擔(dān)。
[外鏈圖片轉(zhuǎn)存中…(img-Nl114m1B-1712146775355)]
[外鏈圖片轉(zhuǎn)存中…(img-Og2d8Ppm-1712146775355)]
[外鏈圖片轉(zhuǎn)存中…(img-y2Wvgq4y-1712146775356)]
[外鏈圖片轉(zhuǎn)存中…(img-fPSJJcYq-1712146775356)]
[外鏈圖片轉(zhuǎn)存中…(img-rlzkj4yA-1712146775356)]
[外鏈圖片轉(zhuǎn)存中…(img-4yDwTbdx-1712146775357)]
Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示,2024年程序員學(xué)習(xí),android,ui,生活

既有適合小白學(xué)習(xí)的零基礎(chǔ)資料,也有適合3年以上經(jīng)驗的小伙伴深入學(xué)習(xí)提升的進(jìn)階課程,基本涵蓋了95%以上Android開發(fā)知識點,真正體系化!

由于文件比較大,這里只是將部分目錄大綱截圖出來,每個節(jié)點里面都包含大廠面經(jīng)、學(xué)習(xí)筆記、源碼講義、實戰(zhàn)項目、講解視頻,并且后續(xù)會持續(xù)更新

如果你覺得這些內(nèi)容對你有幫助,可以添加V獲?。簐ip204888 (備注Android)
[外鏈圖片轉(zhuǎn)存中…(img-fKjpB2eN-1712146775357)]

總結(jié)

最后為了幫助大家深刻理解Android相關(guān)知識點的原理以及面試相關(guān)知識,這里放上相關(guān)的我搜集整理的14套騰訊、字節(jié)跳動、阿里、百度等2021最新面試真題解析,我把技術(shù)點整理成了視頻和PDF(實際上比預(yù)期多花了不少精力),包知識脈絡(luò) + 諸多細(xì)節(jié)。

[外鏈圖片轉(zhuǎn)存中…(img-vZaDN2ov-1712146775357)]
[外鏈圖片轉(zhuǎn)存中…(img-qcW8X11g-1712146775357)]

[外鏈圖片轉(zhuǎn)存中…(img-pOypNa0I-1712146775358)]

[外鏈圖片轉(zhuǎn)存中…(img-B6uTUF5B-1712146775358)]
網(wǎng)上學(xué)習(xí) Android的資料一大堆,但如果學(xué)到的知識不成體系,遇到問題時只是淺嘗輒止,不再深入研究,那么很難做到真正的技術(shù)提升。

本文已被CODING開源項目:《Android學(xué)習(xí)筆記總結(jié)+移動架構(gòu)視頻+大廠面試真題+項目實戰(zhàn)源碼》收錄

一個人可以走的很快,但一群人才能走的更遠(yuǎn)。如果你從事以下工作或?qū)σ韵赂信d趣,歡迎戳這里加入程序員的圈子,讓我們一起學(xué)習(xí)成長!

AI人工智能、Android移動開發(fā)、AIGC大模型、C C#、Go語言、Java、Linux運(yùn)維、云計算、MySQL、PMP、網(wǎng)絡(luò)安全、Python爬蟲、UE5、UI設(shè)計、Unity3D、Web前端開發(fā)、產(chǎn)品經(jīng)理、車載開發(fā)、大數(shù)據(jù)、鴻蒙、計算機(jī)網(wǎng)絡(luò)、嵌入式物聯(lián)網(wǎng)、軟件測試、數(shù)據(jù)結(jié)構(gòu)與算法、音視頻開發(fā)、Flutter、IOS開發(fā)、PHP開發(fā)、.NET、安卓逆向、云計算

到了這里,關(guān)于Android 天氣APP(二十二)改動些許UI、增加更多空氣質(zhì)量數(shù)據(jù)和生活建議數(shù)據(jù)展示的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • kotlin 編寫一個簡單的天氣預(yù)報app(二)增加搜索城市功能

    kotlin 編寫一個簡單的天氣預(yù)報app(二)增加搜索城市功能

    在activity_main.xml里增加輸入框來輸入城市,在輸入款旁邊增加搜索按鈕來進(jìn)行查詢。 然后原來顯示helloworld的TextView用來顯示結(jié)果。 增加搜索按鈕 使用broadcast的方式把收到的天氣信息發(fā)送到界面顯示。 Android的廣播機(jī)制是一種用于在應(yīng)用程序內(nèi)和應(yīng)用程序之間傳遞消息和事件的

    2024年02月14日
    瀏覽(28)
  • Android——數(shù)據(jù)存儲(二)(二十二)

    Android——數(shù)據(jù)存儲(二)(二十二)

    1.1 知識點 (1)了解SQLite數(shù)據(jù)庫的基本作用; (2)掌握數(shù)據(jù)庫操作輔助類:SQLiteDatabase的使用; (3)可以使用命令操作SQLite數(shù)據(jù)庫; (4)可以完成數(shù)據(jù)庫的CRUD操作; (5)掌握數(shù)據(jù)庫查詢及Cursor接口的使用。 1.2 具體內(nèi)容 在Android當(dāng)中,本身提供了一種微型的嵌入式數(shù)據(jù)庫

    2024年02月09日
    瀏覽(20)
  • 【Android從零單排系列二十二】《Android視圖控件——GridView》

    目錄 前言 一 GridView基本介紹 二 GridView使用方法 三 GridView常見屬性及方法 四 總結(jié) 小伙伴們,在上文中我們介紹了Android視圖組件ExpandableListView,本文我們繼續(xù)盤點,介紹一下視圖控件的GridView。 GridView是一個在Android中常用的布局控件,它可以以網(wǎng)格形式展示數(shù)據(jù),類似于表

    2024年02月10日
    瀏覽(24)
  • Android——一個簡單的天氣APP

    Android——一個簡單的天氣APP

    EasyWeather演示效果視頻 此天氣數(shù)據(jù)源采用心知天氣API(試用版),免費版獲取數(shù)據(jù)有限,只能獲取普通的溫度、濕度等,例如壓力、云量、可見度等均獲取不到,試用版相當(dāng)于正式版,可以獲取大部分?jǐn)?shù)據(jù),試用日期是14天。 首頁不同城市天氣頁面之間的滑動采用的是 ViewPager

    2023年04月26日
    瀏覽(20)
  • Android實現(xiàn)-心知天氣API接口開發(fā)(天氣預(yù)報app)

    Android實現(xiàn)-心知天氣API接口開發(fā)(天氣預(yù)報app)

    自己開發(fā)app之心知天氣APP程序代碼粘貼即可用。完整代碼附最后。 第一步:去知心天氣注冊開發(fā)者賬號查看自己的token。注冊好登錄進(jìn)去--控制臺---免費版--秘鑰。這里的秘鑰就是自己的token。(有興趣的可以看開發(fā)文檔,這里就不多介紹了) ?第二步,下載素材包。點擊文檔

    2024年02月03日
    瀏覽(24)
  • 基于Android實現(xiàn)的天氣預(yù)測APP

    基于Android實現(xiàn)的天氣預(yù)測APP

    網(wǎng)絡(luò)數(shù)據(jù)源使用 Retrofit 庫訪問彩云 API 提供的 Webservice 接口來實現(xiàn)。 Retrofit 通過封裝絡(luò)請求和數(shù)據(jù)解析,極地提升了開發(fā)效率。并且持定義數(shù)據(jù)解析在封裝所有網(wǎng)絡(luò)請求的 API 時,我使用了協(xié)程技術(shù)來簡化 Retrofit 回調(diào)的寫法。 1.1.1 數(shù)據(jù)存儲 本地數(shù)據(jù)源使用 SharedPreferences 持久

    2024年02月01日
    瀏覽(24)
  • Android Studio 實現(xiàn)天氣預(yù)報App (簡單方便展示內(nèi)容超多)

    Android Studio 實現(xiàn)天氣預(yù)報App (簡單方便展示內(nèi)容超多)

    ?? 文章末尾有獲取完整項目源碼方式 ?? 目錄 前言 一、任務(wù)介紹 1.1 背景 1.2目的和意義 二、?實現(xiàn)介紹 視頻演示 2.1 啟動頁實現(xiàn) 2.2注冊頁面實現(xiàn) 2.3 登陸頁面實現(xiàn) 2.4 首頁實現(xiàn) 2.5 城市管理列表頁面實現(xiàn)??????????????? 三、獲取源碼 ????????在使用Android Studio開發(fā)

    2024年04月24日
    瀏覽(27)
  • Android 9.0 無源碼app增加授予相關(guān)權(quán)限

    在9.0的系統(tǒng)rom產(chǎn)品開發(fā)中,對于一些無源碼app需要增加一些權(quán)限,比如懸浮窗權(quán)限,由于app內(nèi)部沒申請這個權(quán)限,所以需要系統(tǒng)適配默認(rèn)授予這個權(quán)限, 就需要在PMS解析安裝app的時候 授予懸浮窗權(quán)限就可以了 在pms管理解析安裝app中,是通過PackageManage的getPackageArchiveInfo()實

    2024年02月02日
    瀏覽(28)
  • 安卓大作業(yè):使用Android Studio開發(fā)天氣預(yù)報APP(使用sqlite數(shù)據(jù)庫)

    安卓大作業(yè):使用Android Studio開發(fā)天氣預(yù)報APP(使用sqlite數(shù)據(jù)庫)

    今天我來分享一下如何使用Android Studio開發(fā)一個天氣預(yù)報APP。在文中,我們將使用第三方接口獲取實時天氣數(shù)據(jù),并顯示在APP界面上。 首先,打開Android Studio并創(chuàng)建一個新的項目。在創(chuàng)建新項目時,我們需要設(shè)置項目名稱、包名和支持的最低API級別。 為了獲取實時天氣數(shù)據(jù),

    2024年02月08日
    瀏覽(31)
  • Android UI-SlidingMenu側(cè)滑菜單效果,教你如何增加拿到BAT大廠offer幾率

    Android UI-SlidingMenu側(cè)滑菜單效果,教你如何增加拿到BAT大廠offer幾率

    savedInstanceState, “mContent”); } if (mContent == null) { mContent = new TodayFragment(); } // 設(shè)置左側(cè)滑動菜單 setBehindContentView(R.layout.menu_frame_left); getSupportFragmentManager().beginTransaction() .replace(R.id.menu_frame, new LeftFragment()).commit(); // 實例化滑動菜單對象 SlidingMenu sm = getSlidingMenu(); // 設(shè)置可以左右

    2024年04月17日
    瀏覽(97)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包