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

Commit

Permalink
Tweaks to the refresh toast
Browse files Browse the repository at this point in the history
A couple of refactorings
Updated CHANGELOG
  • Loading branch information
rock3r committed Jul 11, 2013
1 parent c3a1581 commit 524bb8e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
Released on 11th July 2013

- NEW: weather is now cached to reduce "???" messages while searching for a location
- NEW: you can now force the widget texts language (auto, English or Italian, for now)
- FIX: removed 1 minute refresh interval (was only meant for debugging)
- FIX: removed buttons from loading layouts, they couldn't do anything anyway
- FIX: removed minor bug when switching from loading layout to "real" layout (could have caused issues to poorly written launchers)
Expand Down
2 changes: 1 addition & 1 deletion res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@
<color name="temp_hot_dark">#ffb14545</color>
<color name="temp_warm_dark">#ff009300</color>
<color name="temp_wtf_dark">#ff265baf</color>
<color name="toast_bg">#20000000</color>
<color name="toast_bg">#30000000</color>
</resources>
1 change: 1 addition & 0 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<dimen name="spacing_single">8dp</dimen>
<dimen name="widget_margin">8dp</dimen>
<dimen name="spacing_triple">24dp</dimen>
<dimen name="toast_yoffset">100dp</dimen>

</resources>
19 changes: 12 additions & 7 deletions src/net/frakbot/FWeather/util/TrackerHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@
import net.frakbot.FWeather.global.Const;

/**
* Helper for the Google Analytics tracking.
* <p/>
* Created by Francesco Pontillo on 03/07/13.
*/
public class TrackerHelper {

private static final String TAG = TrackerHelper.class.getSimpleName();

public static void activityStart(Activity context) {
EasyTracker.getInstance().activityStart(context);
public static void activityStart(Activity activity) {
EasyTracker.getInstance().activityStart(activity);
}

public static void activityStop(Activity context) {
EasyTracker.getInstance().activityStop(context);
public static void activityStop(Activity activity) {
EasyTracker.getInstance().activityStop(activity);
}

public static void sendException(Context context, String description, boolean fatal) {
Expand All @@ -30,11 +32,14 @@ public static void sendException(Context context, String description, boolean fa
public static void preferenceChange(Context context, String preferenceKey, Long value) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean track = prefs.getBoolean(Const.Preferences.ANALYTICS, false);

if (track) {
EasyTracker.getTracker().sendEvent(
Const.Preferences.PREFERENCE, Const.Preferences.CHANGE, preferenceKey, value);
EasyTracker.getTracker()
.sendEvent(Const.Preferences.PREFERENCE, Const.Preferences.CHANGE,
preferenceKey, value);
FLog.d(context, TAG, "Tracked preference changed event");
} else {
}
else {
FLog.d(context, TAG, "Could not track preference changed event, analytics is disabled by user");
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/net/frakbot/FWeather/util/WidgetHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.content.Intent;
import android.text.Html;
import android.text.Spanned;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Toast;
Expand Down Expand Up @@ -327,6 +328,7 @@ public static Toast makeToast(Context c, int text, int duration) {
Toast t = new Toast(c);
t.setView(view);
t.setDuration(duration);
t.setGravity(Gravity.BOTTOM, 0, c.getResources().getDimensionPixelSize(R.dimen.toast_yoffset));
return t;
}
}

0 comments on commit 524bb8e

Please sign in to comment.