@ -0,0 +1,14 @@
|
|||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
/.idea/caches
|
||||||
|
/.idea/libraries
|
||||||
|
/.idea/modules.xml
|
||||||
|
/.idea/workspace.xml
|
||||||
|
/.idea/navEditor.xml
|
||||||
|
/.idea/assetWizardSettings.xml
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
|
/captures
|
||||||
|
.externalNativeBuild
|
||||||
|
.cxx
|
@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
@ -0,0 +1 @@
|
|||||||
|
My Application
|
@ -0,0 +1,116 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<codeStyleSettings language="XML">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||||
|
</indentOptions>
|
||||||
|
<arrangement>
|
||||||
|
<rules>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>xmlns:android</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>xmlns:.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*:id</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*:name</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>name</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>style</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<rule>
|
||||||
|
<match>
|
||||||
|
<AND>
|
||||||
|
<NAME>.*</NAME>
|
||||||
|
<XML_ATTRIBUTE />
|
||||||
|
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||||
|
</AND>
|
||||||
|
</match>
|
||||||
|
<order>BY_NAME</order>
|
||||||
|
</rule>
|
||||||
|
</section>
|
||||||
|
</rules>
|
||||||
|
</arrangement>
|
||||||
|
</codeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<bytecodeTargetLevel target="11" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="testRunner" value="GRADLE" />
|
||||||
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="corretto-11" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven" />
|
||||||
|
<option name="name" value="maven" />
|
||||||
|
<option name="url" value="https://maven.aliyun.com/repository/google/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven2" />
|
||||||
|
<option name="name" value="maven2" />
|
||||||
|
<option name="url" value="https://maven.aliyun.com/repository/jcenter/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="BintrayJCenter" />
|
||||||
|
<option name="name" value="BintrayJCenter" />
|
||||||
|
<option name="url" value="https://jcenter.bintray.com/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="Google" />
|
||||||
|
<option name="name" value="Google" />
|
||||||
|
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Embedded JDK" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectType">
|
||||||
|
<option name="id" value="Android" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RenderSettings">
|
||||||
|
<option name="showDecorations" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,35 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 29
|
||||||
|
buildToolsVersion "30.0.3"
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "com.example.myapplication"
|
||||||
|
minSdkVersion 23
|
||||||
|
targetSdkVersion 29
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.1'
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||||
|
testImplementation 'junit:junit:4.12'
|
||||||
|
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
|
||||||
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||||
|
implementation 'org.xutils:xutils:3.7.6'
|
||||||
|
implementation 'com.squareup.picasso:picasso:2.5.2'
|
||||||
|
implementation 'com.google.code.gson:gson:2.2.4'
|
||||||
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
|
implementation 'com.google.android.material:material:1.3.0-alpha02'
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.example.myapplication;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumented test, which will execute on an Android device.
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class ExampleInstrumentedTest {
|
||||||
|
@Test
|
||||||
|
public void useAppContext() {
|
||||||
|
// Context of the app under test.
|
||||||
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
|
|
||||||
|
assertEquals("com.example.myapplication", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.example.myapplication">
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:name=".base.UniteApp"
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@mipmap/bj"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
|
android:supportsRtl="true"
|
||||||
|
android:theme="@style/AppTheme">
|
||||||
|
<activity android:name=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name=".city_manager.CityManagerActivity" />
|
||||||
|
<activity android:name=".city_manager.SearchCityActivity" />
|
||||||
|
<activity android:name=".city_manager.DeleteCityActivity" />
|
||||||
|
<activity android:name=".MoreActivity"></activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.example.myapplication;
|
||||||
|
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
public static void main(String arg[]) throws ParseException {
|
||||||
|
String str="202009222245";
|
||||||
|
SimpleDateFormat sf1 = new SimpleDateFormat("yyyyMMddHHmm");
|
||||||
|
SimpleDateFormat sf2 =new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||||
|
String sfstr = "";
|
||||||
|
sfstr = sf2.format(sf1.parse(str));
|
||||||
|
System.out.println(sfstr);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.example.myapplication.base;
|
||||||
|
|
||||||
|
|
||||||
|
import org.xutils.common.Callback;
|
||||||
|
import org.xutils.http.RequestParams;
|
||||||
|
import org.xutils.x;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
public class BaseActivity extends AppCompatActivity implements Callback.CommonCallback<String>{
|
||||||
|
|
||||||
|
public void loadData(String url){
|
||||||
|
RequestParams params = new RequestParams(url);
|
||||||
|
x.http().get(params,this);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String result) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable ex, boolean isOnCallback) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancelled(CancelledException cex) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinished() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.example.myapplication.base;
|
||||||
|
|
||||||
|
|
||||||
|
import org.xutils.common.Callback;
|
||||||
|
import org.xutils.http.RequestParams;
|
||||||
|
import org.xutils.x;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
/*xutils加载网络数据的步骤
|
||||||
|
* 1.声明整体模块
|
||||||
|
* 2.执行网络请求操作
|
||||||
|
* */
|
||||||
|
public class BaseFragment extends Fragment implements Callback.CommonCallback<String>{
|
||||||
|
|
||||||
|
public void loadData(String path){
|
||||||
|
RequestParams params = new RequestParams(path);
|
||||||
|
x.http().get(params,this);
|
||||||
|
}
|
||||||
|
// 获取数据成功时,会回调的接口
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String result) {
|
||||||
|
|
||||||
|
}
|
||||||
|
// 获取数据失败时,会调用的接口
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable ex, boolean isOnCallback) {
|
||||||
|
|
||||||
|
}
|
||||||
|
// 取消请求时,会调用的接口
|
||||||
|
@Override
|
||||||
|
public void onCancelled(CancelledException cex) {
|
||||||
|
|
||||||
|
}
|
||||||
|
// 请求完成后,会回调的接口
|
||||||
|
@Override
|
||||||
|
public void onFinished() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.example.myapplication.base;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import com.example.myapplication.db.DBManager;
|
||||||
|
import org.xutils.x;
|
||||||
|
|
||||||
|
public class UniteApp extends Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
x.Ext.init(this);
|
||||||
|
DBManager.initDB(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.example.myapplication.city_manager;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
import com.example.myapplication.R;
|
||||||
|
import com.example.myapplication.db.DBManager;
|
||||||
|
import com.example.myapplication.db.DatabaseBean;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
public class CityManagerActivity extends AppCompatActivity implements View.OnClickListener{
|
||||||
|
ImageView addIv,backIv,deleteIv;
|
||||||
|
ListView cityLv;
|
||||||
|
List<DatabaseBean> mDatas; //显示列表数据源
|
||||||
|
private CityManagerAdapter adapter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_city_manager);
|
||||||
|
addIv = findViewById(R.id.city_iv_add);
|
||||||
|
backIv = findViewById(R.id.city_iv_back);
|
||||||
|
deleteIv = findViewById(R.id.city_iv_delete);
|
||||||
|
cityLv = findViewById(R.id.city_lv);
|
||||||
|
mDatas = new ArrayList<>();
|
||||||
|
// 添加点击监听事件
|
||||||
|
addIv.setOnClickListener(this);
|
||||||
|
deleteIv.setOnClickListener(this);
|
||||||
|
backIv.setOnClickListener(this);
|
||||||
|
// 设置适配器
|
||||||
|
adapter = new CityManagerAdapter(this, mDatas);
|
||||||
|
cityLv.setAdapter(adapter);
|
||||||
|
}
|
||||||
|
/* 获取数据库当中真实数据源,添加到原有数据源当中,提示适配器更新*/
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
List<DatabaseBean> list = DBManager.queryAllInfo();
|
||||||
|
mDatas.clear();
|
||||||
|
mDatas.addAll(list);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
switch (v.getId()) {
|
||||||
|
case R.id.city_iv_add:
|
||||||
|
int cityCount = DBManager.getCityCount();
|
||||||
|
if (cityCount<5) {
|
||||||
|
Intent intent = new Intent(this, SearchCityActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}else {
|
||||||
|
Toast.makeText(this,"存储城市数量已达上限,请删除后再增加",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case R.id.city_iv_back:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
case R.id.city_iv_delete:
|
||||||
|
Intent intent1 = new Intent(this, DeleteCityActivity.class);
|
||||||
|
startActivity(intent1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package com.example.myapplication.city_manager;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
|
||||||
|
import com.example.myapplication.R;
|
||||||
|
import com.example.myapplication.db.DBManager;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
public class DeleteCityActivity extends AppCompatActivity implements View.OnClickListener{
|
||||||
|
ImageView errorIv,rightIv;
|
||||||
|
ListView deleteLv;
|
||||||
|
List<String>mDatas; //listview的数据源
|
||||||
|
List<String>deleteCitys; //表示存储了删除的城市信息
|
||||||
|
private DeleteCityAdapter adapter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_delete_city);
|
||||||
|
errorIv = findViewById(R.id.delete_iv_error);
|
||||||
|
rightIv = findViewById(R.id.delete_iv_right);
|
||||||
|
deleteLv = findViewById(R.id.delete_lv);
|
||||||
|
mDatas = DBManager.queryAllCityName();
|
||||||
|
deleteCitys = new ArrayList<>();
|
||||||
|
// 设置点击监听事件
|
||||||
|
errorIv.setOnClickListener(this);
|
||||||
|
rightIv.setOnClickListener(this);
|
||||||
|
// 适配器的设置
|
||||||
|
adapter = new DeleteCityAdapter(this, mDatas, deleteCitys);
|
||||||
|
deleteLv.setAdapter(adapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
switch (v.getId()) {
|
||||||
|
case R.id.delete_iv_error:
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
builder.setTitle("提示信息").setMessage("您确定要舍弃更改么?")
|
||||||
|
.setPositiveButton("舍弃更改", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
finish(); //关闭当前的activity
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.setNegativeButton("取消",null);
|
||||||
|
builder.create().show();
|
||||||
|
break;
|
||||||
|
case R.id.delete_iv_right:
|
||||||
|
for (int i = 0; i < deleteCitys.size(); i++) {
|
||||||
|
String city = deleteCitys.get(i);
|
||||||
|
// 调用删除城市的函数
|
||||||
|
int i1 = DBManager.deleteInfoByCity(city);
|
||||||
|
}
|
||||||
|
// 删除成功返回上一级页面
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.example.myapplication.city_manager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import com.example.myapplication.R;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DeleteCityAdapter extends BaseAdapter{
|
||||||
|
Context context;
|
||||||
|
List<String>mDatas;
|
||||||
|
List<String>deleteCitys;
|
||||||
|
|
||||||
|
public DeleteCityAdapter(Context context, List<String> mDatas,List<String>deleteCitys) {
|
||||||
|
this.context = context;
|
||||||
|
this.mDatas = mDatas;
|
||||||
|
this.deleteCitys = deleteCitys;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return mDatas.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getItem(int position) {
|
||||||
|
return mDatas.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
ViewHolder holder = null;
|
||||||
|
if (convertView == null) {
|
||||||
|
convertView = LayoutInflater.from(context).inflate(R.layout.item_deletecity,null);
|
||||||
|
holder = new ViewHolder(convertView);
|
||||||
|
convertView.setTag(holder);
|
||||||
|
}else{
|
||||||
|
holder = (ViewHolder) convertView.getTag();
|
||||||
|
}
|
||||||
|
final String city = mDatas.get(position);
|
||||||
|
holder.tv.setText(city);
|
||||||
|
holder.iv.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mDatas.remove(city);
|
||||||
|
deleteCitys.add(city);
|
||||||
|
notifyDataSetChanged(); //删除了提示适配器更新
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ViewHolder{
|
||||||
|
TextView tv;
|
||||||
|
ImageView iv;
|
||||||
|
public ViewHolder(View itemView){
|
||||||
|
tv = itemView.findViewById(R.id.item_delete_tv);
|
||||||
|
iv = itemView.findViewById(R.id.item_delete_iv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
package com.example.myapplication.city_manager;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.GridView;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.example.myapplication.MainActivity;
|
||||||
|
import com.example.myapplication.R;
|
||||||
|
import com.example.myapplication.base.BaseActivity;
|
||||||
|
import com.example.myapplication.bean.WeatherBean;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
public class SearchCityActivity extends BaseActivity implements View.OnClickListener{
|
||||||
|
EditText searchEt;
|
||||||
|
ImageView submitIv;
|
||||||
|
GridView searchGv;
|
||||||
|
String[]hotCitys = {"北京","上海","广州","深圳","珠海","佛山","南京","苏州","厦门",
|
||||||
|
"长沙","成都","福州","杭州","武汉","青岛","西安","太原","沈阳","重庆","天津","南宁","运城","郑州","北海"};
|
||||||
|
private ArrayAdapter<String> adapter;
|
||||||
|
//腾讯api
|
||||||
|
String url1 = "https://wis.qq.com/weather/common?source=pc&weather_type=observe|index|rise|alarm|air|tips|forecast_24h&province=";
|
||||||
|
String url2 = "&city=";
|
||||||
|
String city;
|
||||||
|
String provice;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_search_city);
|
||||||
|
searchEt = findViewById(R.id.search_et);
|
||||||
|
submitIv = findViewById(R.id.search_iv_submit);
|
||||||
|
searchGv = findViewById(R.id.search_gv);
|
||||||
|
submitIv.setOnClickListener(this);
|
||||||
|
// 设置适配器
|
||||||
|
adapter = new ArrayAdapter<>(this, R.layout.item_hotcity, hotCitys);
|
||||||
|
searchGv.setAdapter(adapter);
|
||||||
|
setListener();
|
||||||
|
}
|
||||||
|
/* 设置监听事件*/
|
||||||
|
private void setListener() {
|
||||||
|
searchGv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
city = hotCitys[position];
|
||||||
|
// 获取省份
|
||||||
|
provice=GetProvice(city);
|
||||||
|
String url = url1+provice+url2+city;
|
||||||
|
loadData(url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
switch (v.getId()) {
|
||||||
|
case R.id.search_iv_submit:
|
||||||
|
city = searchEt.getText().toString();
|
||||||
|
if (!TextUtils.isEmpty(city)) {
|
||||||
|
// 判断是否能够找到这个城市
|
||||||
|
provice=GetProvice(city);
|
||||||
|
String url = url1+provice+url2+city;
|
||||||
|
loadData(url);
|
||||||
|
}else {
|
||||||
|
Toast.makeText(this,"输入内容不能为空!",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String result) {
|
||||||
|
WeatherBean weatherBean = new Gson().fromJson(result, WeatherBean.class);
|
||||||
|
if (weatherBean.getData().getIndex().getClothes()!=null) {
|
||||||
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
city=provice+" "+city;
|
||||||
|
intent.putExtra("city",city);
|
||||||
|
startActivity(intent);
|
||||||
|
}else{
|
||||||
|
Toast.makeText(this,"暂时未收入此城市天气信息...",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String GetProvice(String city) {
|
||||||
|
String[]Citys = {"北京","上海","广东省 广州","广东省 深圳","广东省 珠海","广东省 佛山",
|
||||||
|
"江苏省 南京","江苏省 苏州","福建省 厦门","湖南省 长沙","四川省 成都","福建省 福州","浙江省 杭州",
|
||||||
|
"湖北省 武汉","山东省 青岛","陕西省 西安","山西省 太原","辽宁省 沈阳","重庆","天津","广西省 南宁","广西省 北海"};
|
||||||
|
for(int i=0;i<Citys.length;i++){
|
||||||
|
if(Citys[i].contains(city)){
|
||||||
|
if(Citys[i].split(" ").length>1)
|
||||||
|
{ provice =Citys[i].split(" ")[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
provice = Citys[i].split(" ")[0];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return provice;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.example.myapplication.db;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
|
|
||||||
|
public class DBHelper extends SQLiteOpenHelper{
|
||||||
|
|
||||||
|
public DBHelper(Context context){
|
||||||
|
super(context,"forecast.db",null,1);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onCreate(SQLiteDatabase db) {
|
||||||
|
// 创建表的操作
|
||||||
|
String sql = "create table info(_id integer primary key autoincrement,city varchar(20) unique not null,content text not null)";
|
||||||
|
db.execSQL(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.example.myapplication.db;
|
||||||
|
|
||||||
|
public class DatabaseBean {
|
||||||
|
private int _id;
|
||||||
|
private String city;
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
public DatabaseBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatabaseBean(int _id, String city, String content) {
|
||||||
|
this._id = _id;
|
||||||
|
this.city = city;
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int get_id() {
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set_id(int _id) {
|
||||||
|
this._id = _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:fillType="evenOdd"
|
||||||
|
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:strokeColor="#00000000">
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
<gradient
|
||||||
|
android:endX="78.5885"
|
||||||
|
android:endY="90.9159"
|
||||||
|
android:startX="48.7653"
|
||||||
|
android:startY="61.0927"
|
||||||
|
android:type="linear">
|
||||||
|
<item
|
||||||
|
android:color="#44000000"
|
||||||
|
android:offset="0.0" />
|
||||||
|
<item
|
||||||
|
android:color="#00000000"
|
||||||
|
android:offset="1.0" />
|
||||||
|
</gradient>
|
||||||
|
</aapt:attr>
|
||||||
|
</path>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFF"
|
||||||
|
android:fillType="nonZero"
|
||||||
|
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:strokeColor="#00000000" />
|
||||||
|
</vector>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<corners android:radius="10dp"></corners>
|
||||||
|
<solid android:color="#A8F2FB"></solid>
|
||||||
|
</shape>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<corners android:radius="10dp"></corners>
|
||||||
|
<solid android:color="#83D3F8"></solid>
|
||||||
|
|
||||||
|
</shape>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<corners android:radius="3dp"></corners>
|
||||||
|
<solid android:color="#FAFFF0"/>
|
||||||
|
</shape>
|
@ -0,0 +1,170 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:fillColor="#008577"
|
||||||
|
android:pathData="M0,0h108v108h-108z" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M9,0L9,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,0L19,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M29,0L29,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M39,0L39,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M49,0L49,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M59,0L59,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M69,0L69,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M79,0L79,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M89,0L89,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M99,0L99,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,9L108,9"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,19L108,19"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,29L108,29"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,39L108,39"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,49L108,49"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,59L108,59"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,69L108,69"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,79L108,79"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,89L108,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,99L108,99"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,29L89,29"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,39L89,39"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,49L89,49"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,59L89,59"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,69L89,69"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,79L89,79"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M29,19L29,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M39,19L39,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M49,19L49,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M59,19L59,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M69,19L69,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M79,19L79,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
</vector>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<corners android:radius="5dp"></corners>
|
||||||
|
<stroke android:width="1dp"
|
||||||
|
android:color="#505050"/>
|
||||||
|
</shape>
|
@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@mipmap/bigcitysky">
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/city_top_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="#F5F5F5">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/city_iv_back"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:src="@mipmap/icon_back"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/city_iv_delete"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@mipmap/icon_write"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginRight="10dp"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/city_tv_title"
|
||||||
|
android:text="城市管理"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</RelativeLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/city_line"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DCDCDC"
|
||||||
|
android:layout_below="@id/city_top_layout"/>
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/city_lv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/city_line"
|
||||||
|
android:divider="@null"></ListView>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/city_iv_add"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/icon_add"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_margin="30dp"
|
||||||
|
android:background="#FFF0F0"
|
||||||
|
android:padding="3dp" />
|
||||||
|
</RelativeLayout>
|
@ -0,0 +1,46 @@
|
|||||||
|
<?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="@mipmap/bg6"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".city_manager.DeleteCityActivity">
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="#F5F5F5"
|
||||||
|
android:id="@+id/delete_top_layout">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/delete_iv_error"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@mipmap/icon_error"
|
||||||
|
android:layout_marginLeft="5dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/delete_iv_right"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@mipmap/icon_right"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginRight="5dp"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/delete_tv_title"
|
||||||
|
android:text="城市管理"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</RelativeLayout>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#DCDCDC"/>
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/delete_lv"
|
||||||
|
android:divider="@null"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"></ListView>
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/main_out_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@mipmap/bg">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/main_bottom_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_alignParentBottom="true">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/main_iv_add"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@mipmap/icon_add"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/main_iv_more"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@mipmap/icon_more"
|
||||||
|
android:layout_alignParentRight="true"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/main_layout_point"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_centerInParent="true">
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/main_vp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_above="@id/main_bottom_layout">
|
||||||
|
</androidx.viewpager.widget.ViewPager>
|
||||||
|
</RelativeLayout>
|
@ -0,0 +1,170 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout 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="@mipmap/snow"
|
||||||
|
tools:context=".MoreActivity">
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:background="#F5F5F5"
|
||||||
|
android:id="@+id/more_top_layout">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/more_iv_back"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:src="@mipmap/icon_back"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/more_tv_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="更多设置"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_centerInParent="true"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/more_line1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/more_top_layout"
|
||||||
|
android:background="#dcdcdc"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/more_tv_exchangebg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="改变壁纸"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:drawableLeft="@mipmap/more_bg"
|
||||||
|
android:layout_below="@id/more_line1"
|
||||||
|
android:drawablePadding="20dp"
|
||||||
|
android:padding="10dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/more_line2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/more_tv_exchangebg"
|
||||||
|
android:background="#DCDCDC"/>
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/more_rg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/more_line2"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/more_rb_green"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:background="#C5EDD1"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="青瓦白墙"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/more_rb_pink"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:background="#FCAFAE"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="粉状玉砌"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/more_rb_blue"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:background="#87CEEB"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="蓝色梦想"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/more_tv_version"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="当前版本"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:drawableLeft="@mipmap/more_version"
|
||||||
|
android:layout_below="@id/more_rg"
|
||||||
|
android:drawablePadding="20dp"
|
||||||
|
android:padding="10dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/more_line3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/more_tv_version"
|
||||||
|
android:background="#DCDCDC"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/more_tv_cache"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="清除缓存"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:drawableLeft="@mipmap/more_cache"
|
||||||
|
android:layout_below="@id/more_line3"
|
||||||
|
android:drawablePadding="20dp"
|
||||||
|
android:padding="10dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/more_line4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/more_tv_cache"
|
||||||
|
android:background="#DCDCDC"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/more_tv_share"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="分享软件"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:drawableLeft="@mipmap/more_share"
|
||||||
|
android:layout_below="@id/more_line4"
|
||||||
|
android:drawablePadding="20dp"
|
||||||
|
android:padding="10dp"/>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/more_line5"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/more_tv_share"
|
||||||
|
android:background="#dcdcdc" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/more_tv_ai"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_below="@+id/more_line5"
|
||||||
|
android:drawableLeft="@mipmap/more_music"
|
||||||
|
android:drawablePadding="20dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="音乐播放器"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/more_line6"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/more_tv_ai"
|
||||||
|
android:background="#dcdcdc" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/more_music"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_below="@+id/more_line6"
|
||||||
|
android:drawableLeft="@mipmap/more_ai1"
|
||||||
|
android:drawablePadding="20dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="Siri同学(人工智障)"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@mipmap/bg6"
|
||||||
|
android:padding="10dp">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/search_iv_submit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:src="@mipmap/icon_search"/>
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/search_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:layout_toLeftOf="@id/search_iv_submit"
|
||||||
|
android:hint="搜索国内城市:"
|
||||||
|
android:background="@drawable/searchbg"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/search_tv"
|
||||||
|
android:layout_below="@id/search_et"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="热门城市"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
<GridView
|
||||||
|
android:id="@+id/search_gv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/search_tv"
|
||||||
|
android:numColumns="3"
|
||||||
|
></GridView>
|
||||||
|
</RelativeLayout>
|
@ -0,0 +1,217 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@mipmap/bg"
|
||||||
|
android:id="@+id/out_layout">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/frag_layout"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" >
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="10dp">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_tv_tips"
|
||||||
|
style="@style/todaytext"
|
||||||
|
android:text="✌待到初雪落,故人应当归✌"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginLeft="85dp"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:typeface="serif"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_tv_city"
|
||||||
|
style="@style/todaytext"
|
||||||
|
android:text="广西省 南宁"
|
||||||
|
android:layout_marginLeft="168dp"
|
||||||
|
android:textSize="25sp"
|
||||||
|
android:layout_below="@+id/frag_tv_tips"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_tv_currenttemp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="30℃"
|
||||||
|
android:textSize="70sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_below="@id/frag_tv_condition"
|
||||||
|
android:layout_marginLeft="120dp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_tv_condition"
|
||||||
|
style="@style/todaytext"
|
||||||
|
android:text="晴天"
|
||||||
|
android:layout_below="@id/frag_tv_city"
|
||||||
|
android:layout_marginLeft="176dp"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_tv_date"
|
||||||
|
android:text="2021-05-01"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
style="@style/todaytext"
|
||||||
|
android:layout_below="@+id/frag_tv_temprange"
|
||||||
|
android:layout_marginLeft="125dp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_tv_wind"
|
||||||
|
style="@style/todaytext"
|
||||||
|
android:layout_below="@id/frag_tv_currenttemp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text="湿度 83%"
|
||||||
|
android:layout_marginLeft="90dp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_tv_line1"
|
||||||
|
android:layout_width="2dp"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_toRightOf="@id/frag_tv_wind"
|
||||||
|
android:background="#2E8B40"
|
||||||
|
android:layout_alignBottom="@id/frag_tv_wind"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_tv_temprange"
|
||||||
|
style="@style/todaytext"
|
||||||
|
android:text="气压 1003hPa"
|
||||||
|
android:layout_toRightOf="@id/frag_tv_line1"
|
||||||
|
android:layout_alignBottom="@id/frag_tv_wind"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:background="@drawable/frag_bg1"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="👇今日外出游玩指南👇"
|
||||||
|
style="@style/indextext"
|
||||||
|
android:layout_gravity="center"></TextView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 用于表示指数信息的线性布局-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/frag_index_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@drawable/frag_bg"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:layout_marginTop="-11dp">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_index_tv_dress"
|
||||||
|
style="@style/indextext"
|
||||||
|
android:text="穿衣指数"
|
||||||
|
android:drawableBottom="@mipmap/icon_cloth"/>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#E0E0E0"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_index_tv_washcar"
|
||||||
|
style="@style/indextext"
|
||||||
|
android:text="洗车指数"
|
||||||
|
android:drawableBottom="@mipmap/icon_car"/>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#E0E0E0"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_index_tv_cold"
|
||||||
|
style="@style/indextext"
|
||||||
|
android:text="感冒指数"
|
||||||
|
android:drawableBottom="@mipmap/icon_ganmao"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dp"
|
||||||
|
android:background="#E0E0E0"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_index_tv_sport"
|
||||||
|
style="@style/indextext"
|
||||||
|
android:text="运动指数"
|
||||||
|
android:drawableBottom="@mipmap/icon_sport"/>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#E0E0E0"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_index_tv_rays"
|
||||||
|
style="@style/indextext"
|
||||||
|
android:text="紫外线指数"
|
||||||
|
android:drawableBottom="@mipmap/icon_light"/>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#E0E0E0"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/frag_index_tv_umbrella"
|
||||||
|
style="@style/indextext"
|
||||||
|
android:text="雨伞指数"
|
||||||
|
android:drawableBottom="@mipmap/icon_umbrella"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<pl.droidsonroids.gif.GifImageView
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:id="@+id/frag_iv_today"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:src="@mipmap/gificon"
|
||||||
|
android:layout_gravity="center"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:background="@drawable/frag_bg1"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="👇近七天的天气情况👇"
|
||||||
|
style="@style/indextext"
|
||||||
|
android:layout_gravity="center"></TextView>
|
||||||
|
</LinearLayout>
|
||||||
|
<!-- 用于显示未来七天的天气情况-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/frag_center_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:background="@drawable/frag_bg"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
|
></LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
@ -0,0 +1,79 @@
|
|||||||
|
<?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"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:padding="5dp">
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/item_city_cv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="3dp"
|
||||||
|
app:cardCornerRadius="10dp"
|
||||||
|
app:cardElevation="5dp"
|
||||||
|
app:contentPadding="10dp">
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@mipmap/bg4">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_city_tv_city"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:text="北京"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_city_tv_temp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="40sp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:text="12℃"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/item_city_line1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dp"
|
||||||
|
android:layout_below="@id/item_city_tv_temp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="#2E8B57"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_city_tv_condition"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_below="@id/item_city_line1"
|
||||||
|
android:text="天气:晴"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_city_line2"
|
||||||
|
android:layout_width="2dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_toRightOf="@id/item_city_tv_condition"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:background="#2E8B57"
|
||||||
|
android:layout_below="@id/item_city_line1"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_city_wind"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_toRightOf="@id/item_city_line2"
|
||||||
|
android:layout_below="@id/item_city_line1"
|
||||||
|
android:text="西南风2级"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_city_temprange"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/item_city_line1"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:text="16~9℃"
|
||||||
|
android:layout_marginRight="20dp"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,40 @@
|
|||||||
|
<?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"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
|
||||||
|
android:padding="5dp">
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/item_delete_cv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
app:cardElevation="5dp"
|
||||||
|
app:cardCornerRadius="10dp"
|
||||||
|
app:contentPadding="20dp"
|
||||||
|
>
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/item_delete_iv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/icon_laji"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_delete_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="北京"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:layout_toRightOf="@id/item_delete_iv"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="北京"
|
||||||
|
android:background="@drawable/hotbg">
|
||||||
|
|
||||||
|
</TextView>
|
@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent" android:layout_height="match_parent"
|
||||||
|
android:padding="5dp">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_center_tv_date"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="周六"
|
||||||
|
android:textSize="16sp"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_center_tv_con"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="晴"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_toRightOf="@id/item_center_tv_date"
|
||||||
|
android:layout_marginLeft="10dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_center_tv_winddirection"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="微风"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_toRightOf="@+id/item_center_tv_con"
|
||||||
|
android:layout_marginLeft="2dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_center_tv_temp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:text="9~-1℃"/>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:id="@+id/item_center_iv"
|
||||||
|
android:layout_toLeftOf="@id/item_center_tv_temp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:src="@mipmap/icon_add"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dp"
|
||||||
|
android:background="#E0E0E0"
|
||||||
|
android:layout_below="@id/item_center_tv_date"
|
||||||
|
android:layout_marginTop="5dp"/>
|
||||||
|
</RelativeLayout>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
After Width: | Height: | Size: 222 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 278 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 684 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 457 KiB |
After Width: | Height: | Size: 679 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 14 MiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 466 B |
After Width: | Height: | Size: 870 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 4.7 MiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 222 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 278 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 684 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 278 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 14 KiB |