HappyWeather

master
Amanda31415926535 2 years ago
parent db82b3668a
commit 4c2fa3d3d2

@ -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 @@
Simulate Positioning

@ -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,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/app/src/main/java/com/example/simulatepositioning/MainActivity.java" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="false" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="Embedded JDK" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,25 @@
<?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="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="11" 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 @@
Subproject commit db82b3668a6a8e8edbdb82638d55b99135ce7809

@ -0,0 +1 @@
/build

@ -0,0 +1,49 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 33
defaultConfig {
applicationId "com.example.simulatepositioning"
minSdkVersion 15
targetSdkVersion 33
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 'com.amap.api:3dmap:9.2.0'
implementation 'com.amap.api:search:9.2.0'
implementation 'com.amap.api:location:6.1.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.cardview:cardview:1.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'liji.library.dev:citypickerview:0.7.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation ('com.amap.api:location:6.3.0') {
exclude group: 'com.amap.api', module: '3dmap'
}
configurations {
all*.exclude group:'com.google.code.gson', module:'gson' //exclude
}
}
dependencies {
implementation 'com.android.support:support-annotations:28.0.0'
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
}

@ -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.simulatepositioning;
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.simulatepositioning", appContext.getPackageName());
}
}

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.simulatepositioning">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:name="android.hardware.sensor.stepcounter" />
<!-- <uses-feature android:name="feature:android.hardware.sensor.stepdetector" /> &lt;!&ndash; 安卓10.0版本以上必须申请的健身运动权限 &ndash;&gt;-->
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" /> <!-- 用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 用于访问GPS定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 用于访问wifi网络信息wifi信息会用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 用于获取wifi的获取权限wifi信息会用来进行网络定位 -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 用于访问网络,网络定位需要上网 -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- 用于读取手机当前的状态 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 用于写入缓存数据到扩展存储卡 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 用于申请调用A-GPS模块 -->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 用于申请获取蓝牙信息进行室内定位 -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:roundIcon="@drawable/icon"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".BgImage"></activity>
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="b19b379d22b44fa267144b23c2386152" />
<service android:name="com.amap.api.location.APSService" />
<activity android:name=".test"></activity>
<activity android:name=".likeCity" />
<activity android:name=".MainActivity"
android:exported="true"
tools:ignore="IntentFilterExportedReceiver">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -0,0 +1,187 @@
package com.example.simulatepositioning;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.util.Base64;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class BgImage extends AppCompatActivity implements View.OnClickListener {
private ImageButton bgimage1,bgimage2,bgimage3,bgimage4,bgimage5,bgimage6,bgimage7;
private Button btn,add;
private final int IMAGE_RESULT_CODE = 2;
private final int PICK = 1;
private String imgString = "";
Bitmap bitmap=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bg_image);
bgimage1=findViewById(R.id.bgimage1);
bgimage2=findViewById(R.id.bgimage2);
bgimage3=findViewById(R.id.bgimage3);
bgimage4=findViewById(R.id.bgimage4);
bgimage5=findViewById(R.id.bgimage5);
bgimage6=findViewById(R.id.bgimage6);
bgimage7=findViewById(R.id.bgimage7);
btn=findViewById(R.id.btn);
add=findViewById(R.id.add);
bgimage1.setOnClickListener(this);
bgimage2.setOnClickListener(this);
bgimage3.setOnClickListener(this);
bgimage4.setOnClickListener(this);
bgimage5.setOnClickListener(this);
bgimage6.setOnClickListener(this);
bgimage7.setOnClickListener(this);
add.setOnClickListener(this);
btn.setOnClickListener(this);
}
@Override
public void onClick(View view) {
Intent intent;
switch (view.getId()){
case R.id.bgimage1:
intent=new Intent(BgImage.this,MainActivity.class);
intent.putExtra("bgimage",R.drawable.bgimage1+"");
startActivityForResult(intent,1002);
break;
case R.id.bgimage2:
intent=new Intent(BgImage.this,MainActivity.class);
intent.putExtra("bgimage",R.drawable.bgimage2+"");
startActivityForResult(intent,1002);
break;
case R.id.bgimage3:
intent=new Intent(BgImage.this,MainActivity.class);
intent.putExtra("bgimage",R.drawable.bgimage3+"");
startActivityForResult(intent,1002);
break;
case R.id.bgimage4:
intent=new Intent(BgImage.this,MainActivity.class);
intent.putExtra("bgimage",R.drawable.bgimage4+"");
startActivityForResult(intent,1002);
break;
case R.id.bgimage5:
intent=new Intent(BgImage.this,MainActivity.class);
intent.putExtra("bgimage",R.drawable.bgimage5+"");
startActivityForResult(intent,1002);
break;
case R.id.bgimage6:
intent=new Intent(BgImage.this,MainActivity.class);
intent.putExtra("bgimage",R.drawable.bgimage6+"");
startActivityForResult(intent,1002);
break;
case R.id.bgimage7:
intent=new Intent(this,MainActivity.class);
if (bitmap!=null){
// Bundle b = new Bundle();
// b.putParcelable("bgimageBitmap", bitmap);
intent.putExtra("bgimageBitmap",bitmap);
intent.putExtra("bgimage","");
// System.out.println(bitmap);
startActivityForResult(intent,1003);
}else {
intent.putExtra("bgimage",R.drawable.bgimage7+"");
startActivityForResult(intent,1002);
}
break;
case R.id.add:
intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, IMAGE_RESULT_CODE);
break;
case R.id.btn:
intent=new Intent(BgImage.this,MainActivity.class);
intent.putExtra("bgimage","");
startActivityForResult(intent,1002);
break;
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
// 表示 调用照相机拍照
case PICK:
if (resultCode == RESULT_OK) {
Bundle bundle = data.getExtras();
Bitmap bitmap = (Bitmap) bundle.get("data");
imgString = bitmapToBase64(bitmap);
// uploadImg();
}
break;
// 选择图片库的图片
case IMAGE_RESULT_CODE:
if (resultCode == RESULT_OK) {
Uri uri = data.getData();
Bitmap bitmap2 = PhotoUtils.getBitmapFromUri(uri, this);
// imgString = bitmapToBase64(bitmap2);
bitmap=bitmap2;
// byte[]bitmapArray;
// bitmapArray=Base64.decode(imgString, Base64.DEFAULT);
// bitmap= BitmapFactory.decodeByteArray(bitmapArray, 0, bitmapArray.length);
bgimage7.setImageBitmap(bitmap2);//显示图片
}
break;
}
}
// //上传图片文件的操作
// public void uploadImg() {
//
// }
//如上参需要64位编码可调用此方法不需要可以忽略
public static String bitmapToBase64(Bitmap bitmap) {
String result = null;
ByteArrayOutputStream baos = null;
try {
if (bitmap != null) {
baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
baos.flush();
baos.close();
byte[] bitmapBytes = baos.toByteArray();
result = Base64.encodeToString(bitmapBytes, Base64.DEFAULT);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (baos != null) {
baos.flush();
baos.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return result;
}
}

@ -0,0 +1,31 @@
package com.example.simulatepositioning;
import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
public class DatabaseHelper extends SQLiteOpenHelper {
public DatabaseHelper(@Nullable Context context) {//构造方法
super(context, "citydb", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
String sql="create table citys(id INTEGER primary key autoincrement,city varchar(30) not null)";
try {
db.execSQL("drop table if exists citys");//执行数据库命令
db.execSQL(sql);//执行数据库命令
}catch (SQLException e){
e.printStackTrace();
}
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion ) {
}
}

@ -0,0 +1,111 @@
package com.example.simulatepositioning;
public class ForeCast {
private String date;
private String week;
private String dayweather;
private String nightweather;
private String daytemp;
private String nighttemp;
private String daywind;
private String nightwind;
private String daypower;
private String nightpower;
public ForeCast() {
}
public String getDate() {
return date;
}
public ForeCast(String date, String week, String dayweather, String nightweather, String daytemp, String nighttemp, String daywind, String nightwind, String daypower, String nightpower) {
this.date = date;
this.week = week;
this.dayweather = dayweather;
this.nightweather = nightweather;
this.daytemp = daytemp;
this.nighttemp = nighttemp;
this.daywind = daywind;
this.nightwind = nightwind;
this.daypower = daypower;
this.nightpower = nightpower;
}
public void setDate(String date) {
this.date = date;
}
public String getWeek() {
return week;
}
public void setWeek(String week) {
this.week = week;
}
public String getDayweather() {
return dayweather;
}
public void setDayweather(String dayweather) {
this.dayweather = dayweather;
}
public String getNightweather() {
return nightweather;
}
public void setNightweather(String nightweather) {
this.nightweather = nightweather;
}
public String getDaytemp() {
return daytemp;
}
public void setDaytemp(String daytemp) {
this.daytemp = daytemp;
}
public String getNighttemp() {
return nighttemp;
}
public void setNighttemp(String nighttemp) {
this.nighttemp = nighttemp;
}
public String getDaywind() {
return daywind;
}
public void setDaywind(String daywind) {
this.daywind = daywind;
}
public String getNightwind() {
return nightwind;
}
public void setNightwind(String nightwind) {
this.nightwind = nightwind;
}
public String getDaypower() {
return daypower;
}
public void setDaypower(String daypower) {
this.daypower = daypower;
}
public String getNightpower() {
return nightpower;
}
public void setNightpower(String nightpower) {
this.nightpower = nightpower;
}
}

@ -0,0 +1,573 @@
package com.example.simulatepositioning;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.media.MediaPlayer;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.Base64;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import com.lljjcoder.citypickerview.widget.CityPicker;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.*;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
UserDao dao;
List<Map<String,Object>> list;
List<String> listCity=new ArrayList<>();
SimpleAdapter adapter;
// private ListView listView;
private LinearLayout bg;
private Button btn_search;
private ImageButton likes,likeCityBtn,map,share,bgicon;
private EditText et_cityname;
private ImageView iv,iv1,iv2;
private TextView tv_city, tv_weather, tv_temp, tv_wind, tv_humidity, tv_forcast1, tv_forcast2, tv_forcast3,hint;
private WeatherInfo weatherInfo;
String city;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn_search=findViewById(R.id.city);
initialization();
Intent intent = getIntent();//getIntent();获取当前intent对象
if (intent.getStringExtra("city")!=null){
city = intent.getStringExtra("city");
}else {
city = "宁波";
}
if (listCity.contains(city)){
likes.setImageResource(R.drawable.likes);
}else{
likes.setImageResource(R.drawable.like);
}
dao=new UserDao(this);
reFreshData();
getRealWeather();
getForcastWeather();
likes.setOnClickListener(this);
btn_search.setOnClickListener(this);
likeCityBtn.setOnClickListener(this);
map.setOnClickListener(this);
share.setOnClickListener(this);
bgicon.setOnClickListener(this);
// btn_search.setOnClickListener(this);
}
private void initialization() {
// listView=findViewById(R.id.listView);
// btn_search = findViewById(R.id.search);
// et_cityname = findViewById(R.id.cityname);
iv = findViewById(R.id.ima);
iv1 = findViewById(R.id.ima1);
iv2 = findViewById(R.id.ima2);
tv_city = findViewById(R.id.city);
tv_weather = findViewById(R.id.weather);
tv_temp = findViewById(R.id.temp);
tv_wind = findViewById(R.id.wind);
tv_humidity = findViewById(R.id.humidity);
map = findViewById(R.id.map);
share = findViewById(R.id.share);
tv_forcast1 = findViewById(R.id.forcast1);
tv_forcast2 = findViewById(R.id.forcast2);
tv_forcast3 = findViewById(R.id.forcast3);
likes=findViewById(R.id.like);
bgicon=findViewById(R.id.bgicon);
hint=findViewById(R.id.hint);
likeCityBtn=findViewById(R.id.likeCityBtn);
// listView=findViewById(R.id.listView);
bg=findViewById(R.id.bg);
}
private void reFreshData() { //加载所有的数据,用于初始化,添加,删除,修改后的数据
List<String> cityList=dao.getAll();
list=new ArrayList<>();
listCity=new ArrayList<>();
if (cityList!=null && cityList.size()!=0){
for (String c:cityList){
Map<String,Object> map=new HashMap<>();
map.put("city",c);
listCity.add(c);
// map.put("username",user.getUsername());
// map.put("password",user.getPassword());
// map.put("phone",user.getPhone());
list.add(map);
}
if (listCity.contains(city)){
likes.setImageResource(R.drawable.likes);
}else{
likes.setImageResource(R.drawable.like);
}
adapter =new SimpleAdapter(this,list,R.layout.item,new String[]{"city"},
new int[]{R.id.likeCity});
// listView.setAdapter(adapter);
}
}
private void insertData() {//添加城市
dao.insert(city);
reFreshData();
}
private void deleteData() {
dao.delete(city);
reFreshData();
}
@Override
public void onClick(View view) {
if (view.getId()==R.id.city){//城市选择
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm.isActive()) {
imm.hideSoftInputFromWindow(view.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
selectAddress();//调用CityPicker选取区域
}
}else if (view.getId()==R.id.like){//收藏城市
if (listCity.contains(city)){
deleteData();
Toast.makeText(MainActivity.this, "提示:\n取消关注成功", Toast.LENGTH_SHORT).show();
likes.setImageResource(R.drawable.like);
}else{
insertData();
Toast.makeText(MainActivity.this, "提示:\n关注成功", Toast.LENGTH_SHORT).show();
likes.setImageResource(R.drawable.likes);
}
}else if (view.getId()==R.id.likeCityBtn){//进入收藏城市的页面
Intent intent=new Intent(MainActivity.this,likeCity.class);
startActivity(intent);
}else if (view.getId()==R.id.map){
Intent intent=new Intent(MainActivity.this,test.class);
startActivity(intent);
}else if(view.getId()==R.id.share){
allShare();
}else if (view.getId()==R.id.bgicon){
Intent intent=new Intent(MainActivity.this,BgImage.class);
startActivity(intent);
}
// city="温州";
// getRealWeather();
// getForcastWeather();
}
private void selectAddress() {
CityPicker cityPicker = new CityPicker.Builder(MainActivity.this)
.textSize(14)
.title("地址选择")
.titleBackgroundColor("#FFFFFF")
.confirTextColor("#696969")
.cancelTextColor("#696969")
.province("浙江省")
.city("温州市")
.district("龙港市")
.textColor(Color.parseColor("#000000"))
.provinceCyclic(true)
.cityCyclic(false)
.districtCyclic(false)
.visibleItemsCount(7)
.itemPadding(10)
.onlyShowProvinceAndCity(false)
.build();
cityPicker.show();
//监听方法,获取选择结果
cityPicker.setOnCityItemClickListener(new CityPicker.OnCityItemClickListener() {
@Override
public void onSelected(String... citySelected) {
//省份
String province = citySelected[0];
// Log.i("city",citySelected[0]);
// String city=citySelected[0]+citySelected[1]+citySelected[2];
// btn_search.setText(city);
//城市
// city = citySelected[1];
//区县(如果设定了两级联动,那么该项返回空)
city = citySelected[2];
if (!listCity.contains(city)){
likes.setImageResource(R.drawable.like);
}else{
likes.setImageResource(R.drawable.likes);
}
getRealWeather();
getForcastWeather();
//邮编
String code = citySelected[3];
//为TextView赋值
}
});
}
private void getForcastWeather() {
String url1 = "\t\n" +
"https://restapi.amap.com/v3/weather/weatherInfo?city=CITY&key=d209ea0ac7747a98d2868cc61d2554be&extensions=base";
url1 = url1.replace("CITY", city);
// String url1="";
OkHttpClient client = new OkHttpClient();
final Request request = new Request.Builder().url(url1).build();
Call call = client.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this, "city:"+city, Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String json = response.body().string();
try {
JSONObject object = new JSONObject(json);
String status = object.getString("status");
if (status.equals("1")) {
JSONArray array = object.getJSONArray("forecasts");
JSONObject obj2 = (JSONObject) array.get(0);
JSONArray array2 = obj2.getJSONArray("casts");
final List<ForeCast> list = new ArrayList<>();
for (int i = 0; i < array2.length(); i++) {
JSONObject for_obj = (JSONObject) array2.get(i);
String date = for_obj.getString("date");
String week = for_obj.getString("week");
String dayweather = for_obj.getString("dayweather");
String nightweather = for_obj.getString("nightweather");
String daytemp = for_obj.getString("daytemp");
String nighttemp = for_obj.getString("nighttemp");
String daywind = for_obj.getString("daywind");
String nightwind = for_obj.getString("nightwind");
String daypower = for_obj.getString("daypower");
String nightpower = for_obj.getString("nightpower");
ForeCast fc = new ForeCast(date, week, dayweather, nightweather, daytemp, nighttemp, daywind, nightwind, daypower, nightpower);
list.add(fc);
}
runOnUiThread(
new Runnable() {
@Override
public void run() {
System.out.println(list);
ForeCast fc1 = list.get(0);
StringBuffer sb1 = new StringBuffer();
sb1.append("今天 · ");
String we=fc1.getDayweather()+"转"+fc1.getNightweather();
sb1.append(we).append(" ");
for (int i = we.length(); i <30 ; i++) {
sb1.append(" ");
}
iv.setImageResource(getWeather(we));
sb1.append(fc1.getDaytemp()+"°").append("/").append(fc1.getNighttemp()+"°");
// sb1.append("白天:").append(fc1.getDaywind()).append("风").append(fc1.getDaypower()).append("级\n");
// sb1.append("晚上:").append(fc1.getNightwind()).append("风").append(fc1.getNightpower()).append("级");
tv_forcast1.setText(sb1.toString());
// 轮播走马灯提示语句state
String hintText="";
if (Math.abs(Integer.parseInt(fc1.getDaytemp())-Integer.parseInt(fc1.getNighttemp()))>=8){
hintText+="今日昼夜温差较大,晚归请携带外套出门,防止感冒";
}else if (Integer.parseInt(fc1.getDaytemp())>30){
hintText+="今天明天温度较高,高温徘徊暑气难消,注意防暑";
}else if (Integer.parseInt(fc1.getDaytemp())>18){
hintText+="今天温度凉爽,慎防流感,请特别注意增减衣服保暖防寒";
}
if (fc1.getNightweather().indexOf("雨")!=-1){
hintText+=" 行走时,请不要在光面大理石上停留,避免滑倒,尽量走有安全防范措施的通道";
}else if (fc1.getNightweather().indexOf("云")!=-1){
hintText+=" 悠悠的云里有淡淡的诗,淡淡的诗里有绵绵的喜悦,绵绵的喜悦里有我轻轻的问候,气候即将转冷,请注意身体!";
}else if (fc1.getNightweather().indexOf("雪")!=-1){
hintText+=" 老年人、小孩尽量少出门以避免不必要伤害,雪天路滑,出行时请您注意防滑";
}else if (fc1.getNightweather().indexOf("雾")!=-1){
hintText+=" 大雾/雾霾 天气请减少外出";
}else if (fc1.getNightweather().indexOf("风")!=-1){
hintText+=" 勿在玻璃门、窗、广告牌,大树附近停留,对容易坠落之物体(如空调、空调架、广告牌)进行检查,确保不会坠落,及时收取阳台晾晒的衣物和物品,以免发生丢失或掉落砸伤他人";
}
hint.setText(hintText);
// 轮播走马灯提示语句stop
ForeCast fc2 = list.get(1);
StringBuffer sb2 = new StringBuffer();
sb2.append("明天 · ");
we=fc2.getDayweather()+"转"+fc2.getNightweather();
sb2.append(we).append(" ");
for (int i = we.length(); i <30 ; i++) {
sb2.append(" ");
}
iv1.setImageResource(getWeather(we));
sb2.append(fc2.getDaytemp()+"°").append("/").append(fc2.getNighttemp()+"°");
// sb2.append("白天:").append(fc2.getDaywind()).append("风").append(fc2.getDaypower()).append("级\n");
// sb2.append("晚上:").append(fc2.getNightwind()).append("风").append(fc2.getNightpower()).append("级");
tv_forcast2.setText(sb2.toString());
ForeCast fc3 = list.get(2);
StringBuffer sb3 = new StringBuffer();
sb3.append("后天 · ");
we=fc3.getDayweather()+"转"+fc3.getNightweather();
sb3.append(we).append(" ");
for (int i = we.length(); i <30 ; i++) {
sb3.append(" ");
}
iv2.setImageResource(getWeather(we));
sb3.append(fc3.getDaytemp()+"°").append("/").append(fc3.getNighttemp()+"°");
// sb3.append("白天:").append(fc3.getDaywind()).append("风").append(fc3.getDaypower()).append("级\n");
// sb3.append("晚上:").append(fc3.getNightwind()).append("风").append(fc3.getNightpower()).append("级");
tv_forcast3.setText(sb3.toString());
}
}
);
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public static Integer getWeather(String weather){
if (weather.indexOf("晴")!=-1){
return R.drawable.a0;
}else if (weather.indexOf("多云")!=-1){
return R.drawable.a4;
}else if (weather.indexOf("阴")!=-1){
return R.drawable.a9;
}else if (weather.indexOf("雪")!=-1){
return R.drawable.a17;
}else if (weather.indexOf("雨")!=-1){
return R.drawable.a14;
}
return R.drawable.a0;
}
//当前天气
private void getRealWeather() {
String realUrl = "https://restapi.amap.com/v3/weather/weatherInfo?city=CITY&key=d209ea0ac7747a98d2868cc61d2554be&extensions=base";
realUrl = realUrl.replace("CITY", city);
OkHttpClient client = new OkHttpClient();
final Request request = new Request.Builder().url(realUrl).build();
Call call = client.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, final IOException e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
System.out.println("错误信息:"+e);
Toast.makeText(MainActivity.this, "请求失败", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String json = response.body().string();
try {
JSONObject object = new JSONObject(json);
String status = object.getString("status");
if (status.equals("1")) {
JSONArray array = object.getJSONArray("lives");
JSONObject real_obj = (JSONObject) array.get(0);
String city = real_obj.getString("city");
final String weather = real_obj.getString("weather");
int temp = real_obj.getInt("temperature");
String winddirection = real_obj.getString("winddirection");
String windpower = real_obj.getString("windpower");
int hunidity = real_obj.getInt("humidity");
String reporttime = real_obj.getString("reporttime");
weatherInfo = new WeatherInfo(city, weather, temp, winddirection, windpower, hunidity, reporttime);
runOnUiThread(new Runnable() {
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
public void run() {
if (weatherInfo.getWeather().indexOf("雨")!=-1){
musicMp3(R.raw.yu);
}else{
musicMp3(R.raw.qing);
}
tv_city.setText(weatherInfo.getCity());
tv_weather.setText(weatherInfo.getWeather());
iv.setImageResource(Util.getPicByWeather(weatherInfo.getWeather()));
tv_temp.setText(weatherInfo.getTemperature()+"");
Intent intent = getIntent();//getIntent();获取当前intent对象
if (intent.getStringExtra("bgimage")!=null && !intent.getStringExtra("bgimage").equals("")){
bg.setBackgroundResource(Integer.parseInt(intent.getStringExtra("bgimage")));
}else{
if (intent.getParcelableExtra("bgimageBitmap")!=null){
// Bundle b=intent.getExtras();
Bitmap bmp=(Bitmap) intent.getParcelableExtra("bgimageBitmap");
BitmapDrawable bd=new BitmapDrawable(bmp);
bg.setBackground(bd);
}else{
bg.setBackgroundResource(getBgImage(weatherInfo.getWeather()));
}
}
tv_wind.setText(weatherInfo.getWinddirection() + weatherInfo.getWindpower() + "级");
tv_humidity.setText("湿度" + weatherInfo.getHumidity());
}
});
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
private MediaPlayer mp;
private String path;
private void musicMp3(Integer str) {
// path= Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)+"/qing.mp3";
// mp= new MediaPlayer();
try {
mp= MediaPlayer.create(this,str);
// mp.setDataSource(path);
// mp.prepare();
mp.setLooping(true);
mp.start();
} catch (Exception e) {
e.printStackTrace();
}
}
private Integer getBgImage(String we) {
if (we.indexOf("晴")!=-1){
return R.drawable.qing;
}else if (we.indexOf("多云")!=-1){
return R.drawable.yu;
}else if (we.indexOf("阴")!=-1){
return R.drawable.ying;
}else if (we.indexOf("雨")!=-1){
return R.drawable.yu;
}
return R.drawable.qing;
}
/**
* Android
* APP
*/
public void allShare(){
Intent share_intent = new Intent();
share_intent.setAction(Intent.ACTION_SEND);//设置分享行为
share_intent.setType("text/plain");//设置分享内容的类型
share_intent.putExtra(Intent.EXTRA_SUBJECT, "我在"+city);//添加分享内容标题
share_intent.putExtra(Intent.EXTRA_TEXT, "我在"+city+"天气为:"+tv_weather.getText()+",湿度:"+tv_humidity.getText()+",当前气温:"+tv_temp.getText()+"°");//添加分享内容
//创建分享的Dialog
share_intent = Intent.createChooser(share_intent, "share");
startActivity(share_intent);
}
/**
* Android
* @param appName:
*/
private void share(String appName) {
Intent share_intent = new Intent();
share_intent.setAction(Intent.ACTION_SEND);
share_intent.setType("text/plain");
share_intent.putExtra(Intent.EXTRA_SUBJECT, "我在"+city);//添加分享内容标题
share_intent.putExtra(Intent.EXTRA_TEXT, "我在"+city+"天气为:"+tv_weather+",湿度:"+tv_humidity+",当前气温:"+tv_temp+"°");//添加分享内容
//创建分享的Dialog
share_intent = Intent.createChooser(share_intent, "share");
startActivity(share_intent);
}
}

@ -0,0 +1,206 @@
package com.example.simulatepositioning;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
public class PhotoUtils {
private static final String TAG = "PhotoUtils";
/**
* @param activity activity
* @param imageUri
* @param requestCode
*/
public static void takePicture(Activity activity, Uri imageUri, int requestCode) {
//调用系统相机
Intent intentCamera = new Intent();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
intentCamera.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); //添加这一句表示对目标应用临时授权该Uri所代表的文件
}
intentCamera.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
//将拍照结果保存至photo_file的Uri中不保留在相册中
intentCamera.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
activity.startActivityForResult(intentCamera, requestCode);
}
/**
* @param activity activity
* @param requestCode
*/
public static void openPic(Activity activity, int requestCode) {
Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);
photoPickerIntent.setType("image/*");
activity.startActivityForResult(photoPickerIntent, requestCode);
}
/**
* @param activity activity
* @param orgUri Uri
* @param desUri Uri
* @param aspectX X
* @param aspectY Y
* @param width
* @param height
* @param requestCode
*/
public static void cropImageUri(Activity activity, Uri orgUri, Uri desUri, int aspectX, int aspectY, int width, int height, int requestCode) {
Intent intent = new Intent("com.android.camera.action.CROP");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
}
intent.setDataAndType(orgUri, "image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", aspectX);
intent.putExtra("aspectY", aspectY);
intent.putExtra("outputX", width);
intent.putExtra("outputY", height);
intent.putExtra("scale", true);
//将剪切的图片保存到目标Uri中
intent.putExtra(MediaStore.EXTRA_OUTPUT, desUri);
intent.putExtra("return-data", false);
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
intent.putExtra("noFaceDetection", true);
activity.startActivityForResult(intent, requestCode);
}
/**
* uri
*
* @param uri Uri
* @param mContext
* @return Bitmap
*/
public static Bitmap getBitmapFromUri(Uri uri, Context mContext) {
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(mContext.getContentResolver(), uri);
return bitmap;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* @param context
* @param uri Uri
* @return UriString
*/
@SuppressLint("NewApi")
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
String pathHead = "file:///";
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
if ("primary".equalsIgnoreCase(type)) {
return pathHead + Environment.getExternalStorageDirectory() + "/" + split[1];
}
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
final Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
return pathHead + getDataColumn(context, contentUri, null, null);
}
// MediaProvider
else if (isMediaDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
Uri contentUri = null;
if ("image".equals(type)) {
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if ("video".equals(type)) {
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if ("audio".equals(type)) {
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
final String selection = "_id=?";
final String[] selectionArgs = new String[]{split[1]};
return pathHead + getDataColumn(context, contentUri, selection, selectionArgs);
}
}
// MediaStore (and general)
else if ("content".equalsIgnoreCase(uri.getScheme())) {
return pathHead + getDataColumn(context, uri, null, null);
}
// File
else if ("file".equalsIgnoreCase(uri.getScheme())) {
return pathHead + uri.getPath();
}
return null;
}
/**
* Get the value of the data column for this Uri. This is useful for
* MediaStore Uris, and other file-based ContentProviders.
*
* @param context The context.
* @param uri The Uri to query.
* @param selection (Optional) Filter used in the query.
* @param selectionArgs (Optional) Selection arguments used in the query.
* @return The value of the _data column, which is typically a file path.
*/
private static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
Cursor cursor = null;
final String column = "_data";
final String[] projection = {column};
try {
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
if (cursor != null && cursor.moveToFirst()) {
final int column_index = cursor.getColumnIndexOrThrow(column);
return cursor.getString(column_index);
}
} finally {
if (cursor != null)
cursor.close();
}
return null;
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is ExternalStorageProvider.
*/
private static boolean isExternalStorageDocument(Uri uri) {
return "com.android.externalstorage.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is DownloadsProvider.
*/
private static boolean isDownloadsDocument(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is MediaProvider.
*/
private static boolean isMediaDocument(Uri uri) {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
}

@ -0,0 +1,71 @@
package com.example.simulatepositioning;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import java.util.ArrayList;
import java.util.*;
public class UserDao {
private DatabaseHelper dbhelper;
private SQLiteDatabase db;//增删改查的操作
UserDao(Context context){
dbhelper=new DatabaseHelper(context);
}
public void insert(String city){//添加数据
ContentValues values =new ContentValues();
values.put("city",city);
db=dbhelper.getWritableDatabase();
db.insert("citys",null,values);
db.close();
}
// 数据修改
public void update(String city){
db=dbhelper.getWritableDatabase();
ContentValues values=new ContentValues();
values.put("city",city);
db.update("citys",values,"city=?",new String[]{String.valueOf(city)});
db.close();
}
// 数据删除
public void delete(String city){
db=dbhelper.getWritableDatabase();
db.delete("citys","city=?",new String[]{city});
// db.execSQL("delete from citys where city=" + city);
db.close();
}
// 查询全部数据
public List<String> getAll(){
List<String> city=new ArrayList<>();
db=dbhelper.getReadableDatabase();
Cursor cursor = db.query("citys",new String[]{"id","city"},null,
null,null,null,null);
if (cursor.getCount()>0){
while (cursor.moveToNext()){
System.out.println("测试输出:"+cursor.getString(1));
city.add(cursor.getString(1)+"");
}
}
return city;
}
// 条件查询
public List<String> query(String city){
List<String> users=new ArrayList<>();
db=dbhelper.getReadableDatabase();
Cursor cursor = db.query("citys",new String[]{"city"},"city=?",
new String[]{city},null,null,null);
if (cursor.getCount()>0){
while (cursor.moveToNext()){
String c=cursor.getString(0);
users.add(c);
}
}
return users;
}
}

@ -0,0 +1,37 @@
package com.example.simulatepositioning;
import java.util.HashMap;
import java.util.Map;
public class Util {
static Map<String,String> city;
static {
city = new HashMap<>();
city.put("杭州","330100");
city.put("宁波","330200");
city.put("温州","330300");
city.put("嘉兴","330400");
city.put("湖州","330500");
city.put("绍兴","330400");
}
public static String getCodeByName(String name){
return city.get(name);
}
static Map<String,Integer> pics;
static {
pics=new HashMap<>();
pics.put("晴",R.drawable.a0);
pics.put("多云",R.drawable.a4);
pics.put("阴",R.drawable.a9);
pics.put("大雪",R.drawable.a17);
pics.put("雨",R.drawable.a14);
pics.put("小雨",R.drawable.a13);
pics.put("中雨",R.drawable.a14);
pics.put("大雨",R.drawable.a15);
pics.put("雨夹雪",R.drawable.a20);
}
public static Integer getPicByWeather(String weather){
return pics.get(weather);
}
}

@ -0,0 +1,77 @@
package com.example.simulatepositioning;
public class WeatherInfo {
private String city;
private String weather;
private int temperature;
private String winddirection;
private String windpower;
private int humidity;
private String reporttime;
public WeatherInfo(String city, String weather, int temperature, String winddirection, String windpower, int humidity, String reporttime) {
this.city = city;
this.weather = weather;
this.temperature = temperature;
this.winddirection = winddirection;
this.windpower = windpower;
this.humidity = humidity;
this.reporttime = reporttime;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getWeather() {
return weather;
}
public void setWeather(String weather) {
this.weather = weather;
}
public int getTemperature() {
return temperature;
}
public void setTemperature(int temperature) {
this.temperature = temperature;
}
public String getWinddirection() {
return winddirection;
}
public void setWinddirection(String winddirection) {
this.winddirection = winddirection;
}
public String getWindpower() {
return windpower;
}
public void setWindpower(String windpower) {
this.windpower = windpower;
}
public int getHumidity() {
return humidity;
}
public void setHumidity(int humidity) {
this.humidity = humidity;
}
public String getReporttime() {
return reporttime;
}
public void setReporttime(String reporttime) {
this.reporttime = reporttime;
}
}

@ -0,0 +1,190 @@
package com.example.simulatepositioning;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class likeCity extends AppCompatActivity {
UserDao dao;
List<Map<String, Object>> list;
List<String> city=new ArrayList<>();
SimpleAdapter adapter;
private ListView listView;
Map<String, Object> map;
private WeatherInfo weatherInfo;
private TextView hint;
// private String gethum;
// private String getweather;
// private int tqimage;
// private int bgimage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_like_city);
listView = findViewById(R.id.listView);
hint=findViewById(R.id.hint);
dao = new UserDao(this);
reFreshData();
listView.setAdapter(new MyBaseAdapter());
}
class MyBaseAdapter extends BaseAdapter {
@Override
public int getCount() {
return city.size();
}
@Override
public Object getItem(int position) {
return list.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {//组装数据
View view=View.inflate(likeCity.this,R.layout.item,null);//在list_item中有两个id,现在要把他们拿过来
TextView likeCity=(TextView) view.findViewById(R.id.likeCity);
final TextView hum=(TextView) view.findViewById(R.id.hum);
final TextView qw=(TextView) view.findViewById(R.id.qw);
final ImageView tqImage=(ImageView)view.findViewById(R.id.tqImage);
final LinearLayout bg=view.findViewById(R.id.bg);
//组件一拿到,开始组装
likeCity.setText(city.get(position));
String realUrl = "https://restapi.amap.com/v3/weather/weatherInfo?city=CITY&key=d72b046349b274bf3d90c1ba900407fc&extensions=base";
realUrl = realUrl.replace("CITY", city.get(position));
OkHttpClient client = new OkHttpClient();
final Request request = new Request.Builder().url(realUrl).build();
Call call = client.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, final IOException e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
System.out.println("错误信息:"+e);
Toast.makeText(likeCity.this, "请求失败", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String json = response.body().string();
try {
JSONObject object = new JSONObject(json);
String status = object.getString("status");
if (status.equals("1")) {
JSONArray array = object.getJSONArray("lives");
JSONObject real_obj = (JSONObject) array.get(0);
final String city = real_obj.getString("city");
final String weather = real_obj.getString("weather");
final int temp = real_obj.getInt("temperature");
final String winddirection = real_obj.getString("winddirection");
final String windpower = real_obj.getString("windpower");
final int hunidity = real_obj.getInt("humidity");
final String reporttime = real_obj.getString("reporttime");
runOnUiThread(new Runnable() {
@Override
public void run() {
weatherInfo = new WeatherInfo(city, weather, temp, winddirection, windpower, hunidity, reporttime);
qw.setText(weatherInfo.getTemperature()+"°");
hum.setText("湿度 "+weatherInfo.getHumidity());
bg.setBackgroundResource(getBgImage(weatherInfo.getWeather()));
tqImage.setImageResource(Util.getPicByWeather(weatherInfo.getWeather()));
}
});
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
//组装玩开始返回
return view;
}
}
private Integer getBgImage(String we) {
if (we.indexOf("晴")!=-1){
return R.drawable.qingmp;
}else if (we.indexOf("多云")!=-1){
return R.drawable.yump;
}else if (we.indexOf("阴")!=-1){
return R.drawable.yingmp;
}else if (we.indexOf("雨")!=-1){
return R.drawable.yump;
}
return R.drawable.qingmp;
}
private void reFreshData() { //加载所有的数据,用于初始化,添加,删除,修改后的数据
List<String> cityList = dao.getAll();
city=new ArrayList<>();
list = new ArrayList<>();
if (cityList.size()==0){
hint.setText("未查询到数据");
}else{
hint.setText("一共收藏了:"+cityList.size()+"个城市");
}
if (cityList != null && cityList.size() != 0) {
for (String c : cityList) {
// map = new HashMap<>();
// map.put("city", c);
// map.put("hum", c);
// map.put("qw", c);
city.add(c);
// map.put("username",user.getUsername());
// map.put("password",user.getPassword());
// map.put("phone",user.getPhone());
// list.add(map);
}
// adapter = new SimpleAdapter(this, list, R.layout.item, new String[]{"city"},
// new int[]{R.id.likeCity});
//ListView绑定适配器
// listView.setAdapter(adapter);
}
}
}

@ -0,0 +1,192 @@
package com.example.simulatepositioning;
import android.content.Intent;
import android.os.Bundle;
//import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.amap.api.maps.AMap;
import com.amap.api.maps.MapView;
import com.amap.api.maps.MapsInitializer;
import com.amap.api.maps.model.MyLocationStyle;
import java.text.SimpleDateFormat;
import java.util.Date;
public class test extends AppCompatActivity implements View.OnClickListener {
private String city;
//声明AMapLocationClientOption对象
public AMapLocationClientOption mLocationOption = null;
//声明AMapLocationClient类对象
public AMapLocationClient mLocationClient = null;
//声明定位回调监听器
public AMapLocationListener mLocationListener = new AMapLocationListener() {
@Override
public void onLocationChanged(AMapLocation amapLocation) {
if (amapLocation != null) {
if (amapLocation.getErrorCode() == 0) {
//可在其中解析amapLocation获取相应内容。
amapLocation.getLocationType();//获取当前定位结果来源,如网络定位结果,详见定位类型表
amapLocation.getLatitude();//获取纬度
amapLocation.getLongitude();//获取经度
amapLocation.getAccuracy();//获取精度信息
// dizhi.setText(amapLocation.getAddress());
amapLocation.getAddress();//地址如果option中设置isNeedAddress为false则没有此结果网络定位结果中会有地址信息GPS定位不返回地址信息。
amapLocation.getCountry();//国家信息
amapLocation.getProvince();//省信息
amapLocation.getCity();//城市信息
// dizhi.setText(amapLocation.getCity());
dizhi.setText(amapLocation.getCity());
city=amapLocation.getCity();
// city="龙港市";
amapLocation.getDistrict();//城区信息
amapLocation.getStreet();//街道信息
amapLocation.getStreetNum();//街道门牌号信息
amapLocation.getCityCode();//城市编码
amapLocation.getAdCode();//地区编码
amapLocation.getAoiName();//获取当前定位点的AOI信息
amapLocation.getBuildingId();//获取当前室内定位的建筑物Id
amapLocation.getFloor();//获取当前室内定位的楼层
amapLocation.getGpsAccuracyStatus();//获取GPS的当前状态
//获取定位时间
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(amapLocation.getTime());
df.format(date);
} else {
//定位失败时可通过ErrCode错误码信息来确定失败的原因errInfo是错误信息详见错误码表。
Log.e("AmapError", "location Error, ErrCode:"
+ amapLocation.getErrorCode() + ", errInfo:"
+ amapLocation.getErrorInfo());
}
}
}
};
private MapView mMapView;
private AMap aMap;
private Button dizhi;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
MapsInitializer.updatePrivacyShow(this,true,true);
MapsInitializer.updatePrivacyAgree(this,true);
dizhi = findViewById(R.id.dizhi);
dizhi.setOnClickListener(this);
//获取地图控件引用
mMapView = (MapView) findViewById(R.id.mapview);
//在activity执行onCreate时执行mMapView.onCreate(savedInstanceState),创建地图
mMapView.onCreate(savedInstanceState);
if (aMap == null) {
aMap = mMapView.getMap();
}
try {
dingwei();
} catch (Exception e) {
e.printStackTrace();
}
/* routeSearch = new RouteSearch(this);
routeSearch.setRouteSearchListener(this);*/
}
private void dingwei() throws Exception {
MyLocationStyle myLocationStyle;
myLocationStyle = new MyLocationStyle();//初始化定位蓝点样式类myLocationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE);//连续定位、且将视角移动到地图中心点定位点依照设备方向旋转并且会跟随设备移动。1秒1次定位如果不设置myLocationType默认也会执行此种模式。
myLocationStyle.interval(2000); //设置连续定位模式下的定位间隔,只在连续定位模式下生效,单次定位模式下不会生效。单位为毫秒。
aMap.setMyLocationStyle(myLocationStyle);//设置定位蓝点的Style
//aMap.getUiSettings().setMyLocationButtonEnabled(true);设置默认定位按钮是否显示,非必需设置。
aMap.setMyLocationEnabled(true);// 设置为true表示启动显示定位蓝点false表示隐藏定位蓝点并不进行定位默认是false。
//初始化定位
mLocationClient = new AMapLocationClient(getApplicationContext());
//设置定位回调监听
mLocationClient.setLocationListener(mLocationListener);
//初始化AMapLocationClientOption对象
mLocationOption = new AMapLocationClientOption();
//设置定位模式为AMapLocationMode.Hight_Accuracy高精度模式。
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
//设置定位间隔,单位毫秒,默认为2000ms最低1000ms。
mLocationOption.setInterval(1000);
//设置是否返回地址信息(默认返回地址信息)
mLocationOption.setNeedAddress(true);
//单位是毫秒默认30000毫秒建议超时时间不要低于8000毫秒。
mLocationOption.setHttpTimeOut(20000);
//给定位客户端对象设置定位参数
mLocationClient.setLocationOption(mLocationOption);
//启动定位
mLocationClient.startLocation();
}
@Override
protected void onDestroy() {
super.onDestroy();
//在activity执行onDestroy时执行mMapView.onDestroy(),销毁地图
mMapView.onDestroy();
mLocationClient.onDestroy();//销毁定位客户端,同时销毁本地定位服务。
}
@Override
protected void onResume() {
super.onResume();
//在activity执行onResume时执行mMapView.onResume (),重新绘制加载地图
mMapView.onResume();
}
@Override
protected void onPause() {
super.onPause();
//在activity执行onPause时执行mMapView.onPause (),暂停地图的绘制
mMapView.onPause();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
//在activity执行onSaveInstanceState时执行mMapView.onSaveInstanceState (outState),保存地图当前的状态
mMapView.onSaveInstanceState(outState);
}
@Override
protected void onStop() {
super.onStop();
mLocationClient.stopLocation();//停止定位后,本地定位服务并不会被销毁
}
@Override
public void onClick(View view) {
Intent intent=new Intent(test.this,MainActivity.class);
intent.putExtra("city",city);
startActivityForResult(intent,1001);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="5dip"/>
<solid android:color="#ffffff"/>
</shape>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<corners android:radius="60dip" />
<solid android:color="#ffffff" />
</shape>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/whileBg"/>
<!-- 圆角 <corners android:radius="15dp"/>-->
<corners
android:topRightRadius="15dp"
android:bottomRightRadius="15dp"
android:bottomLeftRadius="15dp"
android:topLeftRadius="15dp"/>
<!-- <stroke android:width="1dp" android:color="#212121"/>-->
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
>
<corners android:radius="50dip"/>
<stroke
android:width="1dip"
android:color="#ffffff" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save