Commit b17d6bea authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 8073e9ba
......@@ -45,7 +45,7 @@
<application
android:name=".MintsApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/ic_launcher_main"
android:label="@string/app_name"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
......
......@@ -68,7 +68,7 @@ class InitAppService : IntentService("InitializeService") {
JPushInterface.setDebugMode(BuildConfig.LOG_DEBUG) // 设置开启日志,发布时请关闭日志
JPushInterface.init(this)
val builder = BasicPushNotificationBuilder(applicationContext)
builder.statusBarDrawable = R.mipmap.ic_launcher
builder.statusBarDrawable = R.mipmap.ic_launcher_main
builder.notificationFlags = Notification.FLAG_AUTO_CANCEL //设置为自动消失
builder.notificationDefaults = Notification.DEFAULT_SOUND or Notification.DEFAULT_VIBRATE or Notification.DEFAULT_LIGHTS // 设置为铃声与震动都要
JPushInterface.setDefaultPushNotificationBuilder(builder)
......
......@@ -65,7 +65,7 @@ public class NotifyManager {
.setContentTitle("")
.setContentText("")
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.mipmap.ic_launcher)
.setSmallIcon(R.mipmap.ic_launcher_main)
.setContent(getRemoteViews(water, step))
.setVibrate(new long[]{0})
.build();
......@@ -98,7 +98,7 @@ public class NotifyManager {
// PendingIntent waterPendingIntent = PendingIntent.getActivity(activity, 0, new Intent(activity, WaterActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
remoteViews = new RemoteViews(activity.getPackageName(), R.layout.remoteview);
// remoteViews.setTextViewText(R.id.notify_step, "今日步数 " + step + " 步");
remoteViews.setImageViewResource(R.id.icon, R.mipmap.ic_launcher);
remoteViews.setImageViewResource(R.id.icon, R.mipmap.ic_launcher_main);
remoteViews.setOnClickPendingIntent(R.id.notify_root, mainPendingIntent);
// remoteViews.setOnClickPendingIntent(R.id.notify_drink, waterPendingIntent);
return remoteViews;
......
......@@ -108,10 +108,10 @@ public class UpdateService extends Service {
.setDefaults(Notification.FLAG_FOREGROUND_SERVICE)// 向通知添加声音、闪灯和振动效果的最简单、最一致的方式是使用当前的用户默认设置,使用defaults属性,可以组合:
// Notification.DEFAULT_ALL Notification.DEFAULT_SOUND 添加声音 //
// requires VIBRATE permission
.setSmallIcon(R.mipmap.ic_launcher);
.setSmallIcon(R.mipmap.ic_launcher_main);
contentView = new RemoteViews(getPackageName(), R.layout.notification_item);
contentView.setImageViewResource(R.id.image, R.mipmap.ic_launcher);
contentView.setImageViewResource(R.id.image, R.mipmap.ic_launcher_main);
contentView.setTextViewText(R.id.notificationTitle, "正在下载");
contentView.setTextViewText(R.id.notificationPercent, "0%");
contentView.setProgressBar(R.id.notificationProgress, 100, 0, false);
......
......@@ -34,7 +34,7 @@
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_launcher" />
android:src="@mipmap/ic_launcher_main" />
<RelativeLayout
android:layout_width="match_parent"
......
......@@ -22,7 +22,7 @@
android:layout_height="70dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="50dp"
android:src="@mipmap/ic_launcher" />
android:src="@mipmap/ic_launcher_main" />
<LinearLayout
......
......@@ -27,7 +27,7 @@
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginBottom="100dp"
android:src="@mipmap/ic_launcher"
android:src="@mipmap/ic_launcher_main"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
......
......@@ -11,7 +11,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:drawableTop="@mipmap/ic_launcher"
android:drawableTop="@mipmap/ic_launcher_main"
android:drawablePadding="14dp"
android:text="好赚钱—边看边玩边赚钱"
android:textColor="@color/black"
......
......@@ -25,7 +25,7 @@
android:layout_height="70dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:src="@mipmap/ic_launcher" />
android:src="@mipmap/ic_launcher_main" />
<LinearLayout
android:layout_width="match_parent"
......
......@@ -22,7 +22,7 @@
android:layout_height="110dp"
android:layout_alignParentStart="true"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher" />
android:src="@mipmap/ic_launcher_main" />
<TextView
android:id="@+id/message"
......
......@@ -12,7 +12,7 @@
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:src="@mipmap/ic_launcher" />
android:src="@mipmap/ic_launcher_main" />
<LinearLayout
android:id="@+id/notify_title_root"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment