Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
Rx化城市
Browse files Browse the repository at this point in the history
  • Loading branch information
xcc3641 committed Feb 28, 2016
1 parent a8f5326 commit 7593618
Show file tree
Hide file tree
Showing 18 changed files with 260 additions and 155 deletions.
65 changes: 58 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,59 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
#built application files
*.apk
*.ap_


# files for the dex VM
*.dex


# Java class files
*.class


# generated files
bin/
gen/


# Local configuration file (sdk path, etc)
local.properties


# Windows thumbnail db
Thumbs.db


# OSX files
.DS_Store
/build
/captures


# Eclipse project files
.classpath
.project


# Android Studio
.idea
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
.gradle
build/


# Signing files
.signing/


# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
*.iml
Binary file removed app/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 19
targetSdkVersion 23
versionCode 3
versionName "2.0.2"
versionName "2.0.3"
}
buildTypes {
release {
Expand Down
21 changes: 15 additions & 6 deletions app/src/main/java/com/xiecc/seeWeather/base/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,26 @@ public class BaseActivity extends AppCompatActivity {
*/
public void setStatusBarColor(int color) {
/**
* Android4.4以上可用
* Android4.4以上 但是抽屉有点冲突,目前就重写一个方法暂时解决4.4的问题
*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {

getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintResource(color);
}
}


public void setStatusBarColorForKitkat(int color) {
/**
* Android4.4
*/
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
//Window window = getWindow();
//window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
//window.setStatusBarColor(color);
tintManager.setStatusBarTintResource(color);
}
}
}
16 changes: 6 additions & 10 deletions app/src/main/java/com/xiecc/seeWeather/base/BaseApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class BaseApplication extends Application {
public static Context mAppContext = null;



@Override public void onCreate() {
super.onCreate();
mAppContext = getApplicationContext();
Expand All @@ -27,15 +26,12 @@ public class BaseApplication extends Application {
/**
* 如果存在SD卡则将缓存写入SD卡,否则写入手机内存
*/
try {
if (getApplicationContext().getExternalCacheDir() != null && ExistSDCard()) {
cacheDir = getApplicationContext().getExternalCacheDir().toString();
Log.d("sd卡", cacheDir);
}
else {
cacheDir = getApplicationContext().getCacheDir().toString();
}
} catch (Exception e) {

if (getApplicationContext().getExternalCacheDir() != null && ExistSDCard()) {
cacheDir = getApplicationContext().getExternalCacheDir().toString();

}
else {
cacheDir = getApplicationContext().getCacheDir().toString();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public List<Province> loadProvinces(SQLiteDatabase db) {

do {
Province province = new Province();
province.setProSort(cursor.getInt(cursor.getColumnIndex("ProSort")));
province.setProName(cursor.getString(cursor.getColumnIndex("ProName")));
province.ProSort = cursor.getInt(cursor.getColumnIndex("ProSort"));
province.ProName = cursor.getString(cursor.getColumnIndex("ProName"));
list.add(province);
} while (cursor.moveToNext());
}
Expand Down
19 changes: 3 additions & 16 deletions app/src/main/java/com/xiecc/seeWeather/modules/domain/City.java
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
package com.xiecc.seeWeather.modules.domain;

import java.io.Serializable;

/**
* Created by hugo on 2015/9/30 0030.
*/
public class City {
public class City implements Serializable{

public String CityName;
public int ProID;


public String getCityName() {
return CityName;
}

public int getProID() {
return ProID;
}

public void setCityName(String cityName) {
CityName = cityName;
}

public void setProID(int proID) {
ProID = proID;
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
package com.xiecc.seeWeather.modules.domain;

import java.io.Serializable;

/**
* Created by hugo on 2015/9/30 0030.
*/
public class Province {

private String ProName;
private int ProSort;

public class Province implements Serializable{

public String getProName() {
return ProName;
}
public String ProName;
public int ProSort;

public int getProSort() {
return ProSort;
}

public void setProName(String proName) {
ProName = proName;
}

public void setProSort(int proSort) {
ProSort = proSort;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class Setting {
public static final String AUTO_UPDATE = "change_update_time"; //自动更新时长
public static final String CITY_NAME = "城市";//选择城市
public static final String HOUR = "小时";//当前小时
public static final String HOUR_SELECT = "hour_select"; //设置更新频率的联动-需要改进

public static final String API_TOKEN = "7db041d0c3013b63e4bed2a554f02d85";//fir.im api_token
public static final String KEY = "282f3846df6b41178e4a2218ae083ea7";// 和风天气 key
Expand Down
Loading

0 comments on commit 7593618

Please sign in to comment.