Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c6408ca authored by Daniel Hillenbrand's avatar Daniel Hillenbrand Committed by Gerrit Code Review
Browse files

Merge "Lockscreen: make lockscreen weather time more friendly" into jellybean

parents 95f70ba2 f2d46f9b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@
                android:gravity="right"
                android:layout_below="@id/weather_condition"
                android:layout_alignParentRight="true"
                android:textSize="6sp"
                android:textSize="8sp"
                android:textColor="?android:attr/textColorSecondary" />

        </RelativeLayout>
+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@
                android:layout_below="@id/weather_condition"
                android:layout_alignParentRight="true"
                android:gravity="right"
                android:textSize="6sp"
                android:textSize="8sp"
                android:textColor="?android:attr/textColorSecondary" />

        </RelativeLayout>
+1 −0
Original line number Diff line number Diff line
@@ -3815,6 +3815,7 @@
  <java-symbol type="string" name="weather_no_data" />
  <java-symbol type="string" name="weather_tap_to_refresh" />
  <java-symbol type="string" name="weather_refreshing" />
  <java-symbol type="string" name="weather_last_sync_just_now" />
  <java-symbol type="id" name="weather_panel" />
  <java-symbol type="id" name="weather_city" />
  <java-symbol type="id" name="weather_condition" />
+1 −0
Original line number Diff line number Diff line
@@ -3705,6 +3705,7 @@
    <string name="weather_no_data">No data</string>
    <string name="weather_tap_to_refresh">Tap to refresh</string>
    <string name="weather_refreshing">Refreshing</string>
    <string name="weather_last_sync_just_now">Just now</string>

    <!-- Options that show upon long-pressing a key on the physical keyboard -->
    <string name="symbol_picker_A">\u00C0\u00C1\u00C2\u00C4\u00C6\u00C3\u00C5\u0104\u0100</string>
+8 −4
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.os.Message;
import android.provider.Settings;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
@@ -441,10 +442,13 @@ class KeyguardStatusViewManager implements OnClickListener {
                mWeatherCondition.setVisibility(View.VISIBLE);
            }
            if (mWeatherUpdateTime != null) {
                Date lastTime = new Date(mWeatherInfo.last_sync);
                String date = DateFormat.getDateFormat(getContext()).format(lastTime);
                String time = DateFormat.getTimeFormat(getContext()).format(lastTime);
                mWeatherUpdateTime.setText(date + " " + time);
                long now = System.currentTimeMillis();
                if (now - w.last_sync < 60000) {
                    mWeatherUpdateTime.setText(R.string.weather_last_sync_just_now);
                } else {
                    mWeatherUpdateTime.setText(DateUtils.getRelativeTimeSpanString(
                            w.last_sync, now, DateUtils.MINUTE_IN_MILLIS));
                }
                mWeatherUpdateTime.setVisibility(showTimestamp ? View.VISIBLE : View.GONE);
            }
            if (mWeatherTempsPanel != null && mWeatherTemp != null && mWeatherLowHigh != null) {