diff --git a/app/src/main/java/com/ray650128/iosclockwidget/IOSClockView.kt b/app/src/main/java/com/ray650128/iosclockwidget/IOSClockView.kt index d1b3095..650310a 100644 --- a/app/src/main/java/com/ray650128/iosclockwidget/IOSClockView.kt +++ b/app/src/main/java/com/ray650128/iosclockwidget/IOSClockView.kt @@ -4,10 +4,12 @@ import android.content.Context import android.graphics.* import android.util.AttributeSet import android.view.View +import android.widget.RemoteViews.RemoteView import java.util.* import kotlin.math.cos import kotlin.math.sin +@RemoteView class IOSClockView: View { constructor(context: Context) : super(context, null) { diff --git a/app/src/main/java/com/ray650128/iosclockwidget/IOSClockWidget.kt b/app/src/main/java/com/ray650128/iosclockwidget/IOSClockWidget.kt index b6c3400..0345da7 100644 --- a/app/src/main/java/com/ray650128/iosclockwidget/IOSClockWidget.kt +++ b/app/src/main/java/com/ray650128/iosclockwidget/IOSClockWidget.kt @@ -37,7 +37,7 @@ internal fun updateAppWidget( val widgetText = context.getString(R.string.appwidget_text) // Construct the RemoteViews object val views = RemoteViews(context.packageName, R.layout.i_o_s_clock_widget) - //views.setTextViewText(R.id.appwidget_text, widgetText) + views.setTextViewText(R.id.appwidget_text, widgetText) // Instruct the widget manager to update the widget appWidgetManager.updateAppWidget(appWidgetId, views) diff --git a/app/src/main/res/drawable/bg_clock_dial.xml b/app/src/main/res/drawable/bg_clock_dial.xml new file mode 100644 index 0000000..5a340f7 --- /dev/null +++ b/app/src/main/res/drawable/bg_clock_dial.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/img_clock_dash.xml b/app/src/main/res/drawable/img_clock_dash.xml new file mode 100644 index 0000000..c3a88e6 --- /dev/null +++ b/app/src/main/res/drawable/img_clock_dash.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/img_hour_hand.xml b/app/src/main/res/drawable/img_hour_hand.xml new file mode 100644 index 0000000..c5f59aa --- /dev/null +++ b/app/src/main/res/drawable/img_hour_hand.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/img_minute_hand.xml b/app/src/main/res/drawable/img_minute_hand.xml new file mode 100644 index 0000000..0cb609a --- /dev/null +++ b/app/src/main/res/drawable/img_minute_hand.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/i_o_s_clock_widget.xml b/app/src/main/res/layout/i_o_s_clock_widget.xml index b15145b..0a3f71f 100644 --- a/app/src/main/res/layout/i_o_s_clock_widget.xml +++ b/app/src/main/res/layout/i_o_s_clock_widget.xml @@ -5,18 +5,22 @@ android:background="@android:color/transparent" android:theme="@style/Theme.IOSClockWidget.AppWidgetContainer"> - + android:layout_above="@+id/appwidget_text" + android:layout_alignParentTop="true" + android:layout_centerHorizontal="true" + android:dial="@drawable/bg_clock_dial" + android:hand_hour="@drawable/img_hour_hand" + android:hand_minute="@drawable/img_minute_hand" /> + android:layout_marginBottom="5dp" /> \ No newline at end of file diff --git a/app/src/main/res/layout/i_o_s_clock_widget_old.xml b/app/src/main/res/layout/i_o_s_clock_widget_old.xml new file mode 100644 index 0000000..3e1f7be --- /dev/null +++ b/app/src/main/res/layout/i_o_s_clock_widget_old.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file