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

Commit f1aaf272 authored by Adnan Begovic's avatar Adnan Begovic Committed by Steve Kondik
Browse files

Revert "Keyguard: Create lockscreen weather, move weatherimpl to utils."

This reverts commit d855e463.

Change-Id: Iff2982cdb2afc0c227be75f0437ac4cf8630d8b8
parent a29b6f37
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@
    <uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
    <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE" />
    <uses-permission android:name="android.permission.TRUST_LISTENER" />
    <uses-permission android:name="com.cyanogenmod.lockclock.permission.READ_WEATHER" />

    <application android:label="@string/app_name"
        android:process="com.android.systemui"
+8 −18
Original line number Diff line number Diff line
@@ -34,12 +34,6 @@
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|top"
        android:orientation="vertical" >
        <LinearLayout
            android:id="@+id/keyguard_clock_and_weather_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:orientation="horizontal"  >
        <TextClock
            android:id="@+id/clock_view"
            android:layout_width="wrap_content"
@@ -52,10 +46,6 @@
            android:format24Hour="@string/keyguard_widget_24_hours_format"
            android:layout_marginBottom="@dimen/bottom_text_spacing_digital" />

            <include layout="@layout/keyguard_weather_view" />

        </LinearLayout>

        <include layout="@layout/keyguard_status_area" />
        <TextView
            android:id="@+id/owner_info"
+0 −56
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2015, The CyanogenMod Project
**
** Licensed under the Apache License, Version 2.0 (the "License")
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<!-- This is a view that shows general weather information in Keyguard. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/keyguard_weather_view"
        android:layout_centerHorizontal="true"
        android:layout_gravity="bottom"
        android:paddingBottom="14dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"   >

    <ImageView
        android:id="@+id/weather_image"
        android:scaleType="centerCrop"
        android:layout_width="wrap_content"
        android:layout_marginBottom="-10dp"
        android:layout_height="wrap_content" />

    <TextView
        android:textColor="@color/clock_white"
        android:textSize="16sp"
        android:layout_gravity="center_horizontal"
        android:includeFontPadding="false"
        android:id="@+id/temperature"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <TextView
        android:textColor="@color/clock_white"
        android:textSize="16sp"
        android:layout_gravity="center_horizontal"
        android:includeFontPadding="false"
        android:visibility="gone"
        android:id="@+id/city"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>
 No newline at end of file
+1 −32
Original line number Diff line number Diff line
@@ -23,10 +23,8 @@ import android.app.ActivityManager;
import android.app.AlarmManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.provider.AlarmClock;
import android.provider.Settings;
import android.text.TextUtils;
@@ -37,32 +35,23 @@ import android.util.Slog;
import android.util.TypedValue;
import android.view.View;
import android.widget.GridLayout;
import android.widget.ImageView;
import android.widget.TextClock;
import android.widget.TextView;

import com.android.internal.util.cm.WeatherController;
import com.android.internal.util.cm.WeatherControllerImpl;
import com.android.internal.widget.LockPatternUtils;

import java.util.Locale;

public class KeyguardStatusView extends GridLayout implements
        WeatherController.Callback  {
public class KeyguardStatusView extends GridLayout {
    private static final boolean DEBUG = KeyguardConstants.DEBUG;
    private static final String TAG = "KeyguardStatusView";

    private LockPatternUtils mLockPatternUtils;

    private ImageView mWeatherIcon;
    private TextView mAlarmStatusView;
    private TextClock mDateView;
    private TextClock mClockView;
    private TextView mOwnerInfo;
    private TextView mTemperatureText;
    private TextView mWeatherCity;

    private WeatherController mWeatherController;

    private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {

@@ -107,7 +96,6 @@ public class KeyguardStatusView extends GridLayout implements

    public KeyguardStatusView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mWeatherController = new WeatherControllerImpl(mContext);
    }

    private void setEnableMarquee(boolean enabled) {
@@ -125,9 +113,6 @@ public class KeyguardStatusView extends GridLayout implements
        mDateView.setShowCurrentUserTime(true);
        mClockView.setShowCurrentUserTime(true);
        mOwnerInfo = (TextView) findViewById(R.id.owner_info);
        mWeatherIcon = (ImageView) findViewById(R.id.weather_image);
        mWeatherCity = (TextView) findViewById(R.id.city);
        mTemperatureText = (TextView) findViewById(R.id.temperature);
        mLockPatternUtils = new LockPatternUtils(getContext());
        final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
        setEnableMarquee(screenOn);
@@ -204,14 +189,12 @@ public class KeyguardStatusView extends GridLayout implements
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mInfoCallback);
        mWeatherController.addCallback(this);
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mInfoCallback);
        mWeatherController.removeCallback(this);
    }

    public int getAppWidgetId() {
@@ -233,20 +216,6 @@ public class KeyguardStatusView extends GridLayout implements
        return false;
    }

    @Override
    public void onWeatherChanged(WeatherController.WeatherInfo info) {
        if (info.temp == null || info.condition == null) {
            mTemperatureText.setText(null);
            mTemperatureText.setText(0);
            mWeatherCity.setText("--");
            mWeatherIcon.setImageDrawable(null);
        } else {
            mTemperatureText.setText(info.temp);
            mWeatherCity.setText(info.city);
            mWeatherIcon.setImageDrawable(info.conditionDrawable);
        }
    }

    // DateFormat.getBestDateTimePattern is extremely expensive, and refresh is called often.
    // This is an optimization to ensure we only recompute the patterns when the inputs change.
    private static final class Patterns {
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,6 @@ import android.widget.TextView;

import com.android.internal.statusbar.StatusBarIcon;
import com.android.internal.util.cm.ActionUtils;
import com.android.internal.util.cm.WeatherControllerImpl;
import com.android.keyguard.KeyguardHostView.OnDismissAction;
import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.BatteryMeterView;
@@ -185,6 +184,7 @@ import com.android.systemui.statusbar.policy.SecurityControllerImpl;
import com.android.systemui.statusbar.policy.SuControllerImpl;
import com.android.systemui.statusbar.policy.UserInfoController;
import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.statusbar.policy.WeatherControllerImpl;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.stack.NotificationStackScrollLayout.OnChildLocationsChangedListener;
Loading