Skip to content

Commit 164db75

Browse files
committed
add drawable, init in onCreate
1 parent 2da2974 commit 164db75

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

widget-helper/src/main/java/heyalex/widgethelper/NotificationDelegate.kt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package heyalex.widgethelper
22

3-
import android.R
43
import android.annotation.TargetApi
54
import android.app.Notification
65
import android.app.NotificationChannel

widget-helper/src/main/java/heyalex/widgethelper/WidgetUpdateService.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import java.lang.annotation.AnnotationFormatError;
1515
import java.util.Arrays;
1616

17+
import androidx.annotation.Nullable;
18+
1719
/**
1820
* Update Service that helps update widget by ComponentName and Ids
1921
*/
@@ -38,10 +40,15 @@ public class WidgetUpdateService extends IntentService {
3840

3941
public WidgetUpdateService() {
4042
super("WidgetUpdateService");
43+
setIntentRedelivery(true);
44+
}
45+
46+
@Override
47+
public void onCreate() {
48+
super.onCreate();
4149
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
4250
startForeground(NOTIFICATION_ID, NotificationDelegate.getNotification(this));
4351
}
44-
setIntentRedelivery(true);
4552
}
4653

4754
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24"
6+
android:tint="#FFFFFF">
7+
<group android:scaleX="0.84249085"
8+
android:scaleY="0.84249085"
9+
android:translateX="1.8901099"
10+
android:translateY="1.8901099">
11+
<path
12+
android:fillColor="@android:color/white"
13+
android:pathData="M12,4L12,1L8,5l4,4L12,6c3.31,0 6,2.69 6,6 0,1.01 -0.25,1.97 -0.7,2.8l1.46,1.46C19.54,15.03 20,13.57 20,12c0,-4.42 -3.58,-8 -8,-8zM12,18c-3.31,0 -6,-2.69 -6,-6 0,-1.01 0.25,-1.97 0.7,-2.8L5.24,7.74C4.46,8.97 4,10.43 4,12c0,4.42 3.58,8 8,8v3l4,-4 -4,-4v3z"/>
14+
</group>
15+
</vector>
Loading
Loading
Loading

0 commit comments

Comments
 (0)