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

Commit 00a71b4e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add smart space to custom clock faces." into qt-dev

parents 53e38f26 69956805
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import java.util.TimeZone;
public interface ClockPlugin extends Plugin {

    String ACTION = "com.android.systemui.action.PLUGIN_CLOCK";
    int VERSION = 4;
    int VERSION = 5;

    /**
     * Get the name of the clock face.
@@ -71,6 +71,14 @@ public interface ClockPlugin extends Plugin {
        return null;
    }

    /**
     * Returns the preferred Y position of the clock.
     *
     * @param totalHeight Height of the parent container.
     * @return preferred Y position.
     */
    int getPreferredY(int totalHeight);

    /**
     * Allows the plugin to clean up resources when no longer needed.
     *
+0 −16
Original line number Diff line number Diff line
@@ -19,22 +19,6 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent"
  >
  <TextClock
      android:id="@+id/digital_clock"
      android:paddingStart="20dp"
      android:layout_marginTop="72dp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="top|left"
      android:textSize="44dp"
      android:letterSpacing="0.05"
      android:textColor="?attr/wallpaperTextColor"
      android:singleLine="true"
      style="@style/widget_big"
      android:format12Hour="@string/keyguard_widget_12_hours_format"
      android:format24Hour="@string/keyguard_widget_24_hours_format"
      android:elegantTextHeight="false"
  />
  <com.android.keyguard.clock.ImageClock
      android:id="@+id/analog_clock"
      android:layout_width="wrap_content"
+0 −16
Original line number Diff line number Diff line
@@ -19,22 +19,6 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent"
  >
  <TextClock
      android:id="@+id/digital_clock"
      android:paddingStart="20dp"
      android:layout_marginTop="72dp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="top|left"
      android:textSize="44dp"
      android:letterSpacing="0.05"
      android:textColor="?attr/wallpaperTextColor"
      android:singleLine="true"
      style="@style/widget_big"
      android:format12Hour="@string/keyguard_widget_12_hours_format"
      android:format24Hour="@string/keyguard_widget_24_hours_format"
      android:elegantTextHeight="false"
  />
  <com.android.keyguard.clock.ImageClock
      android:id="@+id/analog_clock"
      android:layout_width="wrap_content"
+14 −0
Original line number Diff line number Diff line
@@ -297,6 +297,20 @@ public class KeyguardClockSwitch extends RelativeLayout {
        return mClockView.getTextSize();
    }

    /**
     * Returns the preferred Y position of the clock.
     *
     * @param totalHeight Height of the parent container.
     * @return preferred Y position.
     */
    int getPreferredY(int totalHeight) {
        if (mClockPlugin != null) {
            return mClockPlugin.getPreferredY(totalHeight);
        } else {
            return totalHeight / 2;
        }
    }

    /**
     * Refresh the time of the clock, due to either time tick broadcast or doze time tick alarm.
     */
+10 −0
Original line number Diff line number Diff line
@@ -241,6 +241,16 @@ public class KeyguardStatusView extends GridLayout implements
        return mClockView.getTextSize();
    }

    /**
     * Returns the preferred Y position of the clock.
     *
     * @param totalHeight The height available to position the clock.
     * @return Y position of clock.
     */
    public int getClockPreferredY(int totalHeight) {
        return mClockView.getPreferredY(totalHeight);
    }

    private void updateLogoutView() {
        if (mLogoutView == null) {
            return;
Loading