Skip to content

Commit

Permalink
1.1.8 修复多项bug
Browse files Browse the repository at this point in the history
  • Loading branch information
WangDaYeeeeee committed Feb 25, 2016
1 parent b9b0905 commit 57d5c4a
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 42 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "wangdaye.com.geometricweather"
minSdkVersion 19
targetSdkVersion 23
versionCode 116
versionName "1.1.6"
versionCode 118
versionName "1.1.8"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void run()

private void refreshUI() {
// refresh the notification UI
if(juheResult == null) {
if(this.juheResult == null) {
Toast.makeText(this,
getString(R.string.send_notification_error),
Toast.LENGTH_SHORT).show();
Expand All @@ -176,8 +176,8 @@ private void refreshUI() {
isDay = false;
}

JuheResult.WeatherNow weatherNow = juheResult.result.data.realtime.weatherNow;
List<JuheResult.Weather> weathers = juheResult.result.data.weather;
JuheResult.WeatherNow weatherNow = this.juheResult.result.data.realtime.weatherNow;
List<JuheResult.Weather> weathers = this.juheResult.result.data.weather;

String weatherKind = JuheWeather.getWeatherKind(weatherNow.weatherInfo);
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Expand Down Expand Up @@ -207,17 +207,17 @@ private void refreshUI() {
+ "/"
+ weathers.get(0).info.day.get(2)
+ "°");
String[] time = juheResult.result.data.realtime.time.split(":");
String text = juheResult.result.data.realtime.city_name
String[] time = this.juheResult.result.data.realtime.time.split(":");
String text = this.juheResult.result.data.realtime.city_name
+ "."
+ time[0]
+ ":"
+ time[1];
view.setTextViewText(R.id.notification_base_text_remark, text);
builder.setContent(view);

Intent intent = new Intent(NotificationService.this, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(NotificationService.this, 0, intent, 0);
Intent intent = new Intent(this, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
builder.setContentIntent(pendingIntent);
// text color
String textColor = sharedPreferences.getString(getString(R.string.key_notification_text_color),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,15 +886,20 @@ public void onAnimationEnd(Animator animation) {
}

public void animatorCancel() {
for (AnimatorSet anAnimatorSetsShow : animatorSetsShow) {
if (anAnimatorSetsShow != null) {
anAnimatorSetsShow.pause();
anAnimatorSetsShow.cancel();
if (animatorSetsShow != null) {
for (AnimatorSet anAnimatorSetsShow : animatorSetsShow) {
if (anAnimatorSetsShow != null) {
anAnimatorSetsShow.pause();
anAnimatorSetsShow.cancel();
}
}
} for (AnimatorSet anAnimatorSetsIcon : animatorSetsIcon) {
if (anAnimatorSetsIcon != null) {
anAnimatorSetsIcon.pause();
anAnimatorSetsIcon.cancel();
}
if (animatorSetsIcon != null) {
for (AnimatorSet anAnimatorSetsIcon : animatorSetsIcon) {
if (anAnimatorSetsIcon != null) {
anAnimatorSetsIcon.pause();
anAnimatorSetsIcon.cancel();
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ protected void onCreate(Bundle savedInstanceState) {
boolean watchedIntroduce = sharedPreferences.getBoolean(getString(R.string.key_watched_introduce), false);
if (! watchedIntroduce) {
this.requestPermission();
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(getString(R.string.key_watched_introduce), true);
editor.apply();
Intent intent = new Intent(this, IntroduceActivity.class);
startActivity(intent);
} else {
createApp();
}
Expand All @@ -130,9 +125,9 @@ protected void onStart() {

@Override
protected void onStop() {
if (animatorSwitch) {
if (started && animatorSwitch) {
this.weatherFragment.animatorCancel();
} else {
} else if (started) {
this.liteWeatherFragment.animatorCancel();
}
super.onStop();
Expand Down Expand Up @@ -271,6 +266,12 @@ private void requestPermission() {
LOCATION_PERMISSIONS_REQUEST_CODE);
}
} else {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(getString(R.string.key_watched_introduce), true);
editor.apply();
Intent intent = new Intent(this, IntroduceActivity.class);
startActivity(intent);
this.createApp();
}
}
Expand All @@ -279,6 +280,12 @@ private void requestPermission() {
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permission, @NonNull int[] grantResult) {
switch (requestCode) {
case LOCATION_PERMISSIONS_REQUEST_CODE:
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(getString(R.string.key_watched_introduce), true);
editor.apply();
Intent intent = new Intent(this, IntroduceActivity.class);
startActivity(intent);
this.createApp();
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,25 +819,36 @@ public void onAnimationEnd(Animator animation) {
}

public void animatorCancel() {
for (AnimatorSet anAnimatorSetsShow : animatorSetsShow) {
if (anAnimatorSetsShow != null) {
anAnimatorSetsShow.pause();
anAnimatorSetsShow.cancel();
if (animatorSetsShow != null) {
for (AnimatorSet anAnimatorSetsShow : animatorSetsShow) {
if (anAnimatorSetsShow != null) {
anAnimatorSetsShow.pause();
anAnimatorSetsShow.cancel();
}
}
} for (AnimatorSet anAnimatorSetsIcon : animatorSetsIcon) {
if (anAnimatorSetsIcon != null) {
anAnimatorSetsIcon.pause();
anAnimatorSetsIcon.cancel();
}
if (animatorSetsIcon != null) {
for (AnimatorSet anAnimatorSetsIcon : animatorSetsIcon) {
if (anAnimatorSetsIcon != null) {
anAnimatorSetsIcon.pause();
anAnimatorSetsIcon.cancel();
}
}
} for (AnimatorSet anAnimatorSetsAnimal : animatorSetsAnimal) {
if (anAnimatorSetsAnimal != null) {
anAnimatorSetsAnimal.pause();
anAnimatorSetsAnimal.cancel();
}
if (animatorSetsAnimal != null) {
for (AnimatorSet anAnimatorSetsAnimal : animatorSetsAnimal) {
if (anAnimatorSetsAnimal != null) {
anAnimatorSetsAnimal.pause();
anAnimatorSetsAnimal.cancel();
}
}
} for (AnimatorSet anAnimatorSetsTouch : animatorSetsTouch) {
if (anAnimatorSetsTouch != null) {
anAnimatorSetsTouch.pause();
anAnimatorSetsTouch.cancel();
}
if (animatorSetsTouch != null) {
for (AnimatorSet anAnimatorSetsTouch : animatorSetsTouch) {
if (anAnimatorSetsTouch != null) {
anAnimatorSetsTouch.pause();
anAnimatorSetsTouch.cancel();
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<string name="app_name">Geometric weather</string>
<string name="package_name">wangdaye.com.geometricweather</string>

<string name="version_code">版本号\n1.1.6</string>
<string name="note">代码注释\n修复:修复了初次启动应用时fc的bug\n修复:修复了删除城市后刷新fc的bug\n修复:修复了重复申请权限的bug\n优化:优化了退出程序时的动画机制</string>
<string name="version_code">版本号\n1.1.8</string>
<string name="note">代码注释\n优化:优化了app介绍的启动逻辑</string>

<string name="introduce_title_1">Geometric Weather</string>
<string name="introduce_title_2">快捷入口</string>
Expand Down
Binary file added history/GeometricWeather-1.1.7.apk
Binary file not shown.

0 comments on commit 57d5c4a

Please sign in to comment.