分开应用图标和调试图标
| @@ -1,8 +1,8 @@ | ||||
| #Created by .winboll/winboll_app_build.gradle | ||||
| #Wed May 07 14:05:50 HKT 2025 | ||||
| #Wed May 07 06:42:28 GMT 2025 | ||||
| stageCount=16 | ||||
| libraryProject= | ||||
| baseVersion=15.0 | ||||
| publishVersion=15.0.15 | ||||
| buildCount=0 | ||||
| buildCount=11 | ||||
| baseBetaVersion=15.0.16 | ||||
|   | ||||
| @@ -2,7 +2,10 @@ | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:tools="http://schemas.android.com/tools" > | ||||
|  | ||||
|     <application> | ||||
|     <application | ||||
|         tools:replace="android:icon,android:roundIcon" | ||||
|         android:icon="@drawable/ic_launcher_beta" | ||||
|         android:roundIcon="@drawable/ic_launcher_beta"> | ||||
|  | ||||
|         <!-- Put flavor specific code here --> | ||||
|  | ||||
|   | ||||
| @@ -14,8 +14,8 @@ | ||||
|  | ||||
|     <application | ||||
|         android:allowBackup="true" | ||||
|         android:icon="@drawable/ic_launcher" | ||||
|         android:roundIcon="@drawable/ic_launcher" | ||||
|         android:icon="@drawable/ic_launcher_stage" | ||||
|         android:roundIcon="@drawable/ic_launcher_stage" | ||||
|         android:label="@string/app_name" | ||||
|         android:theme="@style/MyAppTheme" | ||||
|         android:resizeableActivity="true" | ||||
|   | ||||
| @@ -60,6 +60,10 @@ public class App extends GlobalApplication { | ||||
|         //CrashHandler.getInstance().registerGlobal(this); | ||||
|         //CrashHandler.getInstance().registerPart(this); | ||||
|     } | ||||
|      | ||||
|     public static int getAPPIcon() { | ||||
|         return BuildConfig.DEBUG?R.drawable.ic_launcher_beta:R.drawable.ic_launcher_stage; | ||||
|     } | ||||
|  | ||||
|     public static void write(InputStream input, OutputStream output) throws IOException { | ||||
|         byte[] buf = new byte[1024 * 8]; | ||||
|   | ||||
| @@ -16,6 +16,7 @@ import android.graphics.Color; | ||||
| import android.media.RingtoneManager; | ||||
| import android.net.Uri; | ||||
| import android.widget.RemoteViews; | ||||
| import cc.winboll.studio.timestamp.App; | ||||
| import cc.winboll.studio.timestamp.MainActivity; | ||||
| import cc.winboll.studio.timestamp.MainService; | ||||
| import cc.winboll.studio.timestamp.R; | ||||
| @@ -89,10 +90,10 @@ public class NotificationHelper { | ||||
|             //.setContentText(nessageNotificationBean.getContent()) | ||||
|             //.setContent(remoteviews) | ||||
|             .setWhen(System.currentTimeMillis()) | ||||
|             .setSmallIcon(R.drawable.ic_launcher) | ||||
|             .setSmallIcon(App.getAPPIcon()) | ||||
|             //设置红色 | ||||
|             .setColor(Color.parseColor("#F00606")) | ||||
|             .setLargeIcon(BitmapFactory.decodeResource(service.getResources(), R.drawable.ic_launcher)) | ||||
|             .setLargeIcon(BitmapFactory.decodeResource(service.getResources(), App.getAPPIcon())) | ||||
|             .setContentIntent(mForegroundPendingIntent) | ||||
|             .build(); | ||||
|  | ||||
| @@ -105,6 +106,8 @@ public class NotificationHelper { | ||||
|         remoteViews.setTextColor(R.id.tv_timestamp, mContext.getResources().getColor(R.color.colorAccent, null)); | ||||
|         // 这里虽然不能直接设置字体大小,但可以通过反射等方式尝试(不推荐,且有兼容性问题) | ||||
|  | ||||
|         // 设置按钮图片 | ||||
|         remoteViews.setImageViewResource(R.id.iv_copytimestamp, App.getAPPIcon()); | ||||
|         // 创建点击通知后的意图 | ||||
|         Intent intentMain = new Intent(mContext, MainActivity.class); | ||||
|         PendingIntent pendingMainIntent = PendingIntent.getActivity(mContext, 0, intentMain, PendingIntent.FLAG_UPDATE_CURRENT); | ||||
| @@ -121,7 +124,7 @@ public class NotificationHelper { | ||||
|         ); | ||||
|  | ||||
|         // 为按钮设置点击事件 | ||||
|         remoteViews.setOnClickPendingIntent(R.id.btn_copytimestamp, pendingIntent); | ||||
|         remoteViews.setOnClickPendingIntent(R.id.iv_copytimestamp, pendingIntent); | ||||
|  | ||||
|         mForegroundNotification.contentView = remoteViews; | ||||
|         mForegroundNotification.bigContentView = remoteViews; | ||||
| @@ -137,6 +140,8 @@ public class NotificationHelper { | ||||
|         Uri soundUri = Uri.parse("android.resource://" + service.getPackageName() + "/" + R.raw.diweiyi); | ||||
|         AudioPlayerUriUtil.playAudio(service, soundUri); | ||||
|     } | ||||
|      | ||||
|      | ||||
|  | ||||
| //    public void sendSMSNotification(Context context, MessageNotificationBean messageNotificationBean) { | ||||
| //        NotificationManager notificationManager = (NotificationManager) context.getSystemService( | ||||
|   | ||||
| @@ -1,34 +0,0 @@ | ||||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:aapt="http://schemas.android.com/aapt" | ||||
|     android:width="108dp" | ||||
|     android:height="108dp" | ||||
|     android:viewportHeight="108" | ||||
|     android:viewportWidth="108"> | ||||
|     <path | ||||
|         android:fillType="evenOdd" | ||||
|         android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z" | ||||
|         android:strokeColor="#00000000" | ||||
|         android:strokeWidth="1"> | ||||
|         <aapt:attr name="android:fillColor"> | ||||
|             <gradient | ||||
|                 android:endX="78.5885" | ||||
|                 android:endY="90.9159" | ||||
|                 android:startX="48.7653" | ||||
|                 android:startY="61.0927" | ||||
|                 android:type="linear"> | ||||
|                 <item | ||||
|                     android:color="#44000000" | ||||
|                     android:offset="0.0" /> | ||||
|                 <item | ||||
|                     android:color="#00000000" | ||||
|                     android:offset="1.0" /> | ||||
|             </gradient> | ||||
|         </aapt:attr> | ||||
|     </path> | ||||
|     <path | ||||
|         android:fillColor="#FFFFFF" | ||||
|         android:fillType="nonZero" | ||||
|         android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z" | ||||
|         android:strokeColor="#00000000" | ||||
|         android:strokeWidth="1" /> | ||||
| </vector> | ||||
							
								
								
									
										16
									
								
								timestamp/src/main/res/drawable/ic_launcher_beta.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,16 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:clickable="true"> | ||||
|     <item | ||||
|         android:left="1dp"  | ||||
|         android:top="1dp"  | ||||
|         android:right="1dp"  | ||||
|         android:bottom="1dp" | ||||
|         android:drawable="@drawable/ic_launcher_background"/>  | ||||
|     <item  | ||||
|         android:left="1dp"  | ||||
|         android:top="1dp"  | ||||
|         android:right="1dp"  | ||||
|         android:bottom="1dp" | ||||
|         android:drawable="@drawable/ic_launcher_foreground"/> | ||||
| </layer-list> | ||||
| Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB | 
							
								
								
									
										11
									
								
								timestamp/src/main/res/drawable/ic_launcher_stage.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,11 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:clickable="true"> | ||||
|     <!--<item android:drawable="@drawable/ic_launcher_background"/>--> | ||||
|     <item  | ||||
|         android:left="1dp"  | ||||
|         android:top="1dp"  | ||||
|         android:right="1dp"  | ||||
|         android:bottom="1dp" | ||||
|         android:drawable="@drawable/ic_launcher_foreground"/> | ||||
| </layer-list> | ||||
| @@ -16,11 +16,10 @@ | ||||
| 		android:textSize="14sp" | ||||
| 		android:layout_weight="1.0"/> | ||||
|  | ||||
| 	<Button | ||||
| 	<ImageView | ||||
| 		android:layout_width="60dp" | ||||
| 		android:layout_height="60dp" | ||||
| 		android:id="@+id/btn_copytimestamp" | ||||
| 		android:background="@drawable/ic_launcher"/> | ||||
| 		android:id="@+id/iv_copytimestamp"/> | ||||
|  | ||||
| </LinearLayout> | ||||
|  | ||||
|   | ||||
| @@ -1,5 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <background android:drawable="@drawable/ic_launcher_background" /> | ||||
|     <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||||
| </adaptive-icon> | ||||
| @@ -1,5 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <background android:drawable="@drawable/ic_launcher_background" /> | ||||
|     <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||||
| </adaptive-icon> | ||||
| Before Width: | Height: | Size: 3.0 KiB | 
| Before Width: | Height: | Size: 4.9 KiB | 
| Before Width: | Height: | Size: 2.0 KiB | 
| Before Width: | Height: | Size: 2.8 KiB | 
| Before Width: | Height: | Size: 4.5 KiB | 
| Before Width: | Height: | Size: 6.9 KiB | 
| Before Width: | Height: | Size: 6.3 KiB | 
| Before Width: | Height: | Size: 10 KiB | 
| Before Width: | Height: | Size: 9.0 KiB | 
| Before Width: | Height: | Size: 15 KiB | 
 ZhanGSKen
					ZhanGSKen