Browse Source

Use custom notification layout to enable using a full-colour ic0n, also makes it much easier to add m0ar shit laturd =]

Wazakindjes 2 months ago
parent
commit
a8d9b2f837

BIN
app/k0di.apk


+ 3 - 2
app/src/app_k0di/src/main/AndroidManifest.xml

@@ -2,7 +2,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 	xmlns:tools="http://schemas.android.com/tools"
 	package="com.jemoeder.lief.k0di"
-	android:versionName="1.2.3">
+	android:versionName="1.2.4">
 
 	<!-- Need an internet connection to work 0bv lol -->
 	<uses-permission android:name="android.permission.INTERNET" />
@@ -29,7 +29,7 @@
 			android:name="com.jemoeder.lief.k0di.MainActivity"
 			android:label="@string/app_name"
 			android:launchMode="singleTask"
-			android:configChanges="orientation|keyboardHidden"
+			android:configChanges="orientation|keyboardHidden|uiMode"
 			android:windowSoftInputMode="adjustPan">
 			<intent-filter>
 				<action android:name="android.intent.action.MAIN" />
@@ -53,6 +53,7 @@
 		<service
 			android:name="com.jemoeder.lief.k0di.k0diService"
 			android:enabled="true"
+			android:configChanges="uiMode"
 			android:exported="true"
 			android:permission=""
 			tools:ignore="ExportedService" />

+ 4 - 3
app/src/app_k0di/src/main/java/com/jemoeder/lief/k0di/MainActivity.java

@@ -151,7 +151,8 @@ public class MainActivity extends AppCompatActivity {
 		muhres = getResources();
 
 		wrapass.notifMan = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
-		wrapass.col_notif = ContextCompat.getColor(muhctx, R.color.notification_main);
+		wrapass.col_notification_main = ContextCompat.getColor(muhctx, R.color.notification_colour);
+		wrapass.col_notification_title_darkmode = ContextCompat.getColor(muhctx, R.color.notification_colour_title_darkmode);
 
 		muhparent = findViewById(R.id.muhparent);
 		sb_bgcol = ContextCompat.getColor(muhctx, R.color.snackbar_background);
@@ -172,8 +173,8 @@ public class MainActivity extends AppCompatActivity {
 		//dimen_txt_h2 = (muhres.getDimension(R.dimen.text_header2) / dpscale);
 		dimen_txt_h2 = muhres.getDimension(R.dimen.text_header2);
 		dimen_btn_minwidth = muhres.getDimensionPixelOffset(R.dimen.button_minwidth);
-		dimen_btn_padding_h = (int) (muhres.getDimension/*PixelOffset*/(R.dimen.button_padding_h) * dpscale + 0.5f);
-		dimen_btn_padding_v = (int) (muhres.getDimension/*PixelOffset*/(R.dimen.button_padding_v) * dpscale + 0.5f);
+		dimen_btn_padding_h = (int)(muhres.getDimension/*PixelOffset*/(R.dimen.button_padding_h) * dpscale + 0.5f);
+		dimen_btn_padding_v = (int)(muhres.getDimension/*PixelOffset*/(R.dimen.button_padding_v) * dpscale + 0.5f);
 
 		st0rem_current = findViewById(R.id.mainact_st0rem_name);
 		Button st0rem_store = findViewById(R.id.mainact_st0rem_store);

+ 124 - 97
app/src/app_k0di/src/main/java/com/jemoeder/lief/k0di/k0diService.java

@@ -14,9 +14,12 @@ import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.res.Configuration;
 import android.os.IBinder;
 import android.support.design.widget.Snackbar;
 import android.support.v4.app.NotificationCompat;
+import android.view.View;
+import android.widget.RemoteViews;
 
 import org.json.JSONObject;
 
@@ -32,6 +35,7 @@ public class k0diService extends Service {
 	@Override
 	public void onCreate() {
 		wrapass = (k0diWrapper)getApplication();
+		checkemDarkm00d(null);
 
 		IntentFilter ifilter_lastcmd = new IntentFilter();
 		IntentFilter ifilter_st0rem = new IntentFilter();
@@ -69,6 +73,27 @@ public class k0diService extends Service {
 		super.onDestroy();
 	}
 
+	@Override
+	public void onConfigurationChanged(Configuration newConfig) {
+		// Check again for dark m00d imo
+		checkemDarkm00d(newConfig);
+
+		super.onConfigurationChanged(newConfig);
+	}
+
+	void checkemDarkm00d(Configuration config) {
+		if(config == null)
+			config = getResources().getConfiguration();
+
+		boolean cur = wrapass.system_darkmode;
+		boolean isdark = ((config.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES);
+		wrapass.system_darkmode = isdark;
+		if(wrapass.svcrunning) {
+			if((!cur && isdark) || (cur && !isdark))
+				showNotif(true);
+		}
+	}
+
 	private void removeNotif() {
 		wrapass.svcrunning = false;
 		wrapass.notifMan.cancel(k0diWrapper.NOTIF_ACTIVE);
@@ -77,98 +102,98 @@ public class k0diService extends Service {
 	}
 
 	private void showNotif(boolean forcem) {
-		boolean showact_lastcmd = false;
-		boolean showact_rest0rem = false;
+		if(wrapass.svcrunning && !forcem)
+			return;
+
 		NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(wrapass.muhctx, wrapass.channelname);
+		RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.muhnotification);
+
+		// For handling button clicks lol
+		// st0rem is always visible 0fc
+		Intent switchIntent_st0rem = new Intent(k0diWrapper.iaction_st0remnotif);
+		PendingIntent pSwitchIntent_st0rem = PendingIntent.getBroadcast(wrapass.muhctx, 0, switchIntent_st0rem, PendingIntent.FLAG_UPDATE_CURRENT);
+		contentView.setOnClickPendingIntent(R.id.muhnotification_btn_st0rem, pSwitchIntent_st0rem);
 
-		// Add actions for (re)st0rem =]
+		// Add action for rest0rem =]
+		contentView.setViewVisibility(R.id.muhnotification_btn_rest0rem, View.INVISIBLE);
 		if(wrapass.st0rem_name != null && wrapass.st0rem_pos != null && wrapass.st0rem_time != null) {
-			Intent rest0remIntent = new Intent(k0diWrapper.iaction_rest0remnotif);
-			PendingIntent rest0remPIntent = PendingIntent.getBroadcast(wrapass.muhctx, 0, rest0remIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-			notifBuilder.addAction(R.drawable.ic_action_rest0remnotif, "rest0rem", rest0remPIntent);
-			showact_rest0rem = true;
+			contentView.setViewVisibility(R.id.muhnotification_btn_rest0rem, View.VISIBLE);
+			Intent switchIntent_rest0rem = new Intent(k0diWrapper.iaction_rest0remnotif);
+			PendingIntent pSwitchIntent_rest0rem = PendingIntent.getBroadcast(wrapass.muhctx, 0, switchIntent_rest0rem, PendingIntent.FLAG_UPDATE_CURRENT);
+			contentView.setOnClickPendingIntent(R.id.muhnotification_btn_rest0rem, pSwitchIntent_rest0rem);
 		}
 
-		Intent st0remIntent = new Intent(k0diWrapper.iaction_st0remnotif);
-		PendingIntent st0remPIntent = PendingIntent.getBroadcast(wrapass.muhctx, 0, st0remIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-		notifBuilder.addAction(R.drawable.ic_action_st0remnotif, "st0rem", st0remPIntent);
-
+		// And "skip that shit again" lel
+		contentView.setViewVisibility(R.id.muhnotification_btn_lastcmd, View.INVISIBLE);
 		if(wrapass.lastcmd_order >= 0) {
 			try {
 				JSONObject jayson_sc = wrapass.sh0rtcuts.getJSONObject(wrapass.lastcmd_order);
 				String sc_name = jayson_sc.get("name").toString();
 				String skippem = jayson_sc.getString(k0diWrapper.CMD_SKIP);
-				Intent lastcmdIntent = new Intent(k0diWrapper.iaction_lastcmdnotif);
-				lastcmdIntent.putExtra(k0diWrapper.CMD_SKIP, skippem);
-				PendingIntent lastcmdPIntent = PendingIntent.getBroadcast(wrapass.muhctx, 0, lastcmdIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-				notifBuilder.addAction(R.drawable.ic_action_lastcmdnotif, sc_name, lastcmdPIntent);
-				notifBuilder.setContentTitle("Skip that shit again lol");
-				notifBuilder.setContentText(sc_name);
-				showact_lastcmd = true;
+
+				contentView.setTextViewText(R.id.muhcontent_title, "Skip that shit again lol");
+				contentView.setTextViewText(R.id.muhcontent_text, sc_name);
+
+				// Because apparently Android is too damn retarded to apply the proper colour for dark mode when using the following in XML:
+				// android:textAppearance="@style/TextAppearance.Compat.Notification.Title"
+				if(wrapass.system_darkmode)
+					contentView.setTextColor(R.id.muhcontent_title, wrapass.col_notification_title_darkmode);
+
+				contentView.setViewVisibility(R.id.muhnotification_btn_lastcmd, View.VISIBLE);
+				Intent switchIntent_lastcmd = new Intent(k0diWrapper.iaction_lastcmdnotif);
+				switchIntent_lastcmd.putExtra(k0diWrapper.CMD_SKIP, skippem);
+				PendingIntent pSwitchIntent_lastcmd = PendingIntent.getBroadcast(wrapass.muhctx, 0, switchIntent_lastcmd, PendingIntent.FLAG_UPDATE_CURRENT);
+				contentView.setOnClickPendingIntent(R.id.muhnotification_btn_lastcmd, pSwitchIntent_lastcmd);
 			}
 			catch(Exception fuckoff) {
 				wrapass.muhmain.doSnackbar("Unable to add button to notification: " + fuckoff.getMessage(), Snackbar.LENGTH_INDEFINITE, true);
 			}
 		}
 
-		if(!wrapass.svcrunning || forcem) {
-			// Cuz apparently Android doesn't use different defaults if the channel was already created bef0
-			//wrapass.muhprefs_ed.remove("deleted_notifchan_20190314").commit();
-			//wrapass.muhprefs_ed.remove("deleted_notifchan_20190610").commit();
-			if(!wrapass.muhprefs.getBoolean("deleted_notifchan_20190610", false)) {
-				wrapass.notifMan.deleteNotificationChannel(wrapass.channelname);
-				wrapass.muhprefs_ed.putBoolean("deleted_notifchan_20190610", true).commit();
-			}
-
-			NotificationChannel notifChannel = new NotificationChannel(wrapass.channelname, wrapass.channelname, NotificationManager.IMPORTANCE_HIGH);
-			notifChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
-			notifChannel.setShowBadge(false);
-			notifChannel.setImportance(NotificationManager.IMPORTANCE_HIGH);
-			notifChannel.setLightColor(0);
-			notifChannel.setSound(null, null);
-			notifChannel.setBypassDnd(true);
-
-			wrapass.notifMan.createNotificationChannel(notifChannel);
-			notifBuilder.setChannelId(wrapass.channelname);
-
-			Intent returnIntent = new Intent(wrapass.muhctx, MainActivity.class);
-			//returnIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
-			PendingIntent returnPIntent = PendingIntent.getActivity(wrapass.muhctx, 0, returnIntent, 0);
-
-			notifBuilder.setAutoCancel(false);
-			notifBuilder.setCategory(NotificationCompat.CATEGORY_SERVICE);
-			notifBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
-			notifBuilder.setSmallIcon(R.mipmap.ic_launcher);
-			//notifBuilder.setLargeIcon(BitmapFactory.decodeResource(muhres, R.mipmap.ic_launcher));
-			notifBuilder.setContentIntent(returnPIntent);
-			notifBuilder.setOngoing(true);
-			notifBuilder.setShowWhen(false);
-			notifBuilder.setColor(wrapass.col_notif);
-			notifBuilder.setBadgeIconType(NotificationCompat.BADGE_ICON_NONE);
-
-			// s0em backwards compatibility shit imo tbh
-			notifBuilder.setPriority(NotificationCompat.PRIORITY_MAX);
-			notifBuilder.setLights(0, 0, 0);
-			notifBuilder.setSound(null);
-
-			/* Mite be useful someday lmao
-			RemoteViews mContentView = new RemoteViews(getPackageName(), R.layout.notif_k0di);
-			notifBuilder.setCustomBigContentView(mContentView);*/
-
-			// This shit must match the amount of actions we actually have =]
-			android.support.v4.media.app.NotificationCompat.MediaStyle styl0 = new android.support.v4.media.app.NotificationCompat.MediaStyle();
-			if(showact_lastcmd && showact_rest0rem)
-				styl0.setShowActionsInCompactView(0, 1, 2);
-			else if(showact_lastcmd || showact_rest0rem)
-				styl0.setShowActionsInCompactView(0, 1);
-			else
-				styl0.setShowActionsInCompactView(0);
-			notifBuilder.setStyle(styl0);
-
-			wrapass.nActive = notifBuilder.build();
-			startForeground(k0diWrapper.NOTIF_ACTIVE, wrapass.nActive);
-			wrapass.svcrunning = true;
+		// Cuz apparently Android doesn't use different defaults if the channel was already created bef0
+		//wrapass.muhprefs_ed.remove("deleted_notifchan_20190314").commit();
+		//wrapass.muhprefs_ed.remove("deleted_notifchan_20190610").commit();
+		//wrapass.muhprefs_ed.remove("deleted_notifchan_20210722").commit();
+		if(!wrapass.muhprefs.getBoolean("deleted_notifchan_20210722", false)) {
+			wrapass.notifMan.deleteNotificationChannel(wrapass.channelname);
+			wrapass.muhprefs_ed.putBoolean("deleted_notifchan_20210722", true).commit();
 		}
+
+		NotificationChannel notifChannel = new NotificationChannel(wrapass.channelname, wrapass.channelname, NotificationManager.IMPORTANCE_HIGH);
+		notifChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
+		notifChannel.setShowBadge(false);
+		notifChannel.setImportance(NotificationManager.IMPORTANCE_HIGH);
+		notifChannel.setLightColor(0);
+		notifChannel.setSound(null, null);
+		notifChannel.setBypassDnd(true);
+
+		wrapass.notifMan.createNotificationChannel(notifChannel);
+		notifBuilder.setChannelId(wrapass.channelname);
+
+		Intent returnIntent = new Intent(wrapass.muhctx, MainActivity.class);
+		//returnIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
+		PendingIntent returnPIntent = PendingIntent.getActivity(wrapass.muhctx, 0, returnIntent, 0);
+
+		notifBuilder.setAutoCancel(false);
+		notifBuilder.setCategory(NotificationCompat.CATEGORY_SERVICE);
+		notifBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
+		notifBuilder.setSmallIcon(R.mipmap.ic_launcher);
+		//notifBuilder.setLargeIcon(BitmapFactory.decodeResource(muhres, R.mipmap.ic_launcher));
+		notifBuilder.setContentIntent(returnPIntent);
+		notifBuilder.setOngoing(true);
+		notifBuilder.setShowWhen(false);
+		notifBuilder.setColor(wrapass.col_notification_main);
+		notifBuilder.setCustomContentView(contentView);
+		notifBuilder.setBadgeIconType(NotificationCompat.BADGE_ICON_NONE);
+
+		// s0em backwards compatibility shit imo tbh
+		notifBuilder.setPriority(NotificationCompat.PRIORITY_MAX);
+		notifBuilder.setLights(0, 0, 0);
+		notifBuilder.setSound(null);
+
+		wrapass.nActive = notifBuilder.build();
+		startForeground(k0diWrapper.NOTIF_ACTIVE, wrapass.nActive);
+		wrapass.svcrunning = true;
 	}
 
 	protected class BCReceiverNotification extends BroadcastReceiver {
@@ -178,33 +203,35 @@ public class k0diService extends Service {
 		@Override
 		public void onReceive(Context context, Intent intent) {
 			String action = intent.getAction();
-			if(action != null) {
-				boolean doit = false;
-				if(action.equals(k0diWrapper.iaction_lastcmdnotif)) {
-					String skippem = intent.getStringExtra(k0diWrapper.CMD_SKIP);
-					if(skippem != null && !skippem.isEmpty()) {
-						wrapass.muhmain.doHapticc(wrapass.VIBEMS_DEFAULT);
-						wrapass.muhcmds.add(new k0dicmd(k0diWrapper.CMD_SKIP, skippem, null, null));
-						doit = true;
-					}
-				}
-				else if(action.equals(k0diWrapper.iaction_st0remnotif)) {
+			if(action == null)
+				return;
+
+			boolean doit = false;
+			if(action.equals(k0diWrapper.iaction_lastcmdnotif)) {
+				String skippem = intent.getStringExtra(k0diWrapper.CMD_SKIP);
+				if(skippem != null && !skippem.isEmpty()) {
 					wrapass.muhmain.doHapticc(wrapass.VIBEMS_DEFAULT);
-					wrapass.muhcmds.add(new k0dicmd(k0diWrapper.CMD_STORE, null, null, null));
+					wrapass.muhcmds.add(new k0dicmd(k0diWrapper.CMD_SKIP, skippem, null, null));
 					doit = true;
 				}
-				else if(action.equals(k0diWrapper.iaction_rest0remnotif)) {
-					if(wrapass.st0rem_name != null && wrapass.st0rem_pos != null && wrapass.st0rem_time != null) {
-						wrapass.muhmain.doHapticc(wrapass.VIBEMS_DEFAULT);
-						wrapass.muhcmds.add(new k0dicmd(k0diWrapper.CMD_RESTORE, wrapass.st0rem_name, wrapass.st0rem_pos, wrapass.st0rem_time));
-						doit = true;
-					}
-				}
-				if(doit && !wrapass.stickydrawer) {
-					Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
-					context.sendBroadcast(it);
+			}
+			else if(action.equals(k0diWrapper.iaction_st0remnotif)) {
+				wrapass.muhmain.doHapticc(wrapass.VIBEMS_DEFAULT);
+				wrapass.muhcmds.add(new k0dicmd(k0diWrapper.CMD_STORE, null, null, null));
+				doit = true;
+			}
+			else if(action.equals(k0diWrapper.iaction_rest0remnotif)) {
+				if(wrapass.st0rem_name != null && wrapass.st0rem_pos != null && wrapass.st0rem_time != null) {
+					wrapass.muhmain.doHapticc(wrapass.VIBEMS_DEFAULT);
+					wrapass.muhcmds.add(new k0dicmd(k0diWrapper.CMD_RESTORE, wrapass.st0rem_name, wrapass.st0rem_pos, wrapass.st0rem_time));
+					doit = true;
 				}
 			}
+
+			if(doit && !wrapass.stickydrawer) {
+				Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
+				context.sendBroadcast(it);
+			}
 		}
 	}
 }

+ 3 - 1
app/src/app_k0di/src/main/java/com/jemoeder/lief/k0di/k0diWrapper.java

@@ -56,7 +56,9 @@ public class k0diWrapper extends Application {
 	public final static String iaction_rest0remnotif = "rest0rem_fromnotif";
 	public NotificationManager notifMan;
 	public Notification nActive;
-	public int col_notif;
+	public int col_notification_main;
+	public int col_notification_title_darkmode;
+	public boolean system_darkmode;
 
 	// Misc
 	public Context muhctx;

+ 94 - 0
app/src/app_k0di/src/main/res/layout/muhnotification.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="wrap_content"
+	android:layout_height="match_parent"
+	android:paddingBottom="@dimen/notification_padding_bottom">
+
+	<RelativeLayout
+		android:id="@+id/muhnotification_header"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:layout_marginTop="@dimen/notification_margin_top"
+		android:layout_marginStart="@dimen/notification_margin_left">
+
+		<ImageView
+			android:id="@+id/muhicon"
+			android:layout_width="@dimen/notification_iconsize"
+			android:layout_height="@dimen/notification_iconsize"
+			android:src="@mipmap/ic_launcher"
+			android:contentDescription="@string/app_name" />
+		<TextView
+			android:textSize="@dimen/notification_titlesize"
+			android:textColor="@color/notification_colour"
+			android:text="@string/app_name"
+			android:id="@+id/muhtitle"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:layout_marginTop="@dimen/notification_title_margin_top"
+			android:layout_marginStart="@dimen/notification_title_margin_left"
+			android:layout_alignTop="@id/muhicon"
+			android:layout_toEndOf="@id/muhicon" />
+	</RelativeLayout>
+
+	<LinearLayout
+		android:id="@+id/muhnotification_content"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:layout_marginTop="@dimen/notification_content_margin_top"
+		android:layout_marginStart="@dimen/notification_content_margin_left"
+		android:layout_below="@+id/muhnotification_header"
+		android:orientation="vertical">
+
+		<TextView
+			android:id="@+id/muhcontent_title"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:text=""
+			android:textAppearance="@style/TextAppearance.Compat.Notification.Title" />
+		<TextView
+			android:id="@+id/muhcontent_text"
+			android:layout_width="@dimen/notification_lastcmd_width"
+			android:layout_height="wrap_content"
+			android:ellipsize="end"
+			android:maxLines="1"
+			android:text=""
+			android:textAppearance="@style/TextAppearance.Compat.Notification" />
+	</LinearLayout>
+
+	<LinearLayout
+		android:id="@+id/muhnotification_actions"
+		android:layout_width="wrap_content"
+		android:layout_height="wrap_content"
+		android:orientation="horizontal"
+		android:layout_alignParentEnd="true"
+		android:layout_marginTop="@dimen/notification_actions_margin_top"
+		android:layout_marginEnd="@dimen/notification_actions_margin_right"
+		android:layout_below="@+id/muhnotification_header">
+
+		<ImageView
+			android:id="@+id/muhnotification_btn_rest0rem"
+			android:layout_width="@dimen/notification_actions_iconsize"
+			android:layout_height="@dimen/notification_actions_iconsize"
+			android:src="@drawable/ic_action_rest0remnotif"
+			android:tint="@color/notification_colour"
+			android:visibility="invisible"
+			android:contentDescription="@string/st0rem_restore" />
+		<ImageView
+			android:id="@+id/muhnotification_btn_st0rem"
+			android:layout_width="@dimen/notification_actions_iconsize"
+			android:layout_height="@dimen/notification_actions_iconsize"
+			android:layout_marginStart="@dimen/notification_actions_spacing"
+			android:src="@drawable/ic_action_st0remnotif"
+			android:tint="@color/notification_colour"
+			android:contentDescription="@string/st0rem_store" />
+		<ImageView
+			android:id="@+id/muhnotification_btn_lastcmd"
+			android:layout_width="@dimen/notification_actions_iconsize"
+			android:layout_height="@dimen/notification_actions_iconsize"
+			android:layout_marginStart="@dimen/notification_actions_spacing"
+			android:src="@drawable/ic_action_lastcmdnotif"
+			android:tint="@color/notification_colour"
+			android:visibility="invisible"
+			android:contentDescription="@string/notification_desc" />
+	</LinearLayout>
+</RelativeLayout>

+ 0 - 93
app/src/app_k0di/src/main/res/layout/notif_k0di.xml

@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
-This shit is just an attempt at using a custom notification layout lel
-P sure it's pretty much functional but the built-in ones are much easier to
-work with (at least for now xd)
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-	xmlns:tools="http://schemas.android.com/tools"
-	android:layout_width="match_parent"
-	android:layout_height="wrap_content"
-	android:id="@+id/notif_parent"
-	tools:keep="@layout/notif_k0di">
-
-	<ImageView
-		android:src="@mipmap/ic_launcher"
-		android:id="@+id/notif_icon"
-		android:layout_width="wrap_content"
-		android:layout_height="36dp"
-		android:layout_alignParentStart="true"
-		android:layout_marginTop="12dp"
-		tools:ignore="ContentDescription" />
-
-	<TextView
-		android:id="@+id/notif_title"
-		android:layout_width="wrap_content"
-		android:layout_height="wrap_content"
-		android:text="@string/app_name"
-		android:layout_alignTop="@+id/notif_icon"
-		android:layout_toEndOf="@+id/notif_icon"
-		android:textColor="@color/notification_main"
-		style="@style/TextAppearance.Compat.Notification.Title" />
-
-	<TextView
-		android:id="@+id/notif_subtitle"
-		android:layout_width="match_parent"
-		android:layout_height="wrap_content"
-		android:text="@string/notification_desc"
-		android:layout_below="@id/notif_title"
-		android:layout_alignStart="@id/notif_title"
-		style="@style/TextAppearance.Compat.Notification.Title" />
-
-	<!--<GridLayout
-		android:layout_width="match_parent"
-		android:layout_height="wrap_content"
-		android:layout_below="@id/notif_subtitle"
-		android:layout_alignStart="@id/notif_icon"
-		android:orientation="horizontal"
-		android:paddingStart="16dp"
-		android:paddingEnd="16dp"
-		android:horizontalSpacing="8dp">-->
-
-		<Button
-			android:id="@+id/notif_sc_1"
-			android:layout_width="wrap_content"
-			android:layout_height="28dp"
-			android:layout_below="@id/notif_subtitle"
-			android:layout_alignParentEnd="true"
-			android:layout_marginEnd="12dp"
-			android:text="Top lels"
-			android:background="@android:color/transparent"
-			android:textColor="@color/notification_main"
-			android:textAllCaps="false"
-			tools:ignore="HardcodedText" />
-
-		<Button
-			android:id="@+id/notif_sc_2"
-			android:layout_width="wrap_content"
-			android:layout_height="28dp"
-			android:layout_below="@id/notif_sc_1"
-			android:layout_alignParentEnd="true"
-			android:layout_marginEnd="12dp"
-			android:text="Top keks"
-			android:background="@android:color/transparent"
-			android:textColor="@color/notification_main"
-			android:textAllCaps="false"
-			tools:ignore="HardcodedText" />
-
-		<Button
-			android:id="@+id/notif_sc_3"
-			android:layout_width="wrap_content"
-			android:layout_height="28dp"
-			android:layout_below="@id/notif_sc_2"
-			android:layout_alignParentEnd="true"
-			android:layout_marginEnd="12dp"
-			android:text="Ayy lmao"
-			android:background="@android:color/transparent"
-			android:textColor="@color/notification_main"
-			android:textAllCaps="false"
-			tools:ignore="HardcodedText" />
-	<!--</GridLayout>-->
-</RelativeLayout>

+ 2 - 1
app/src/app_k0di/src/main/res/values/colors.xml

@@ -10,7 +10,8 @@
 	<color name="gucci">#00CC36</color>
 	<color name="RIP">#CC0036</color>
 	<color name="divider">#ABABAB</color>
-	<color name="notification_main">#B5589C</color>
+	<color name="notification_colour">#B5589C</color>
+	<color name="notification_colour_title_darkmode">#DDDDDD</color>
 
 	<!-- Other text related shit 0bv -->
 	<color name="text_prefheader">@color/colorAccent</color>

+ 16 - 0
app/src/app_k0di/src/main/res/values/dimens.xml

@@ -1,5 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+	<!-- Notification p00p -->
+	<dimen name="notification_padding_bottom">15dp</dimen>
+	<dimen name="notification_margin_top">16dp</dimen>
+	<dimen name="notification_margin_left">15dp</dimen>
+	<dimen name="notification_iconsize">18dp</dimen>
+	<dimen name="notification_title_margin_top">1dp</dimen>
+	<dimen name="notification_title_margin_left">6dp</dimen>
+	<dimen name="notification_titlesize">12sp</dimen>
+	<dimen name="notification_content_margin_top">4dp</dimen>
+	<dimen name="notification_content_margin_left">16dp</dimen>
+	<dimen name="notification_lastcmd_width">215dp</dimen>
+	<dimen name="notification_actions_margin_top">15dp</dimen>
+	<dimen name="notification_actions_margin_right">32dp</dimen>
+	<dimen name="notification_actions_iconsize">24dp</dimen>
+	<dimen name="notification_actions_spacing">28dp</dimen>
+
 	<!-- prefheader and header1 are always in bold -->
 	<dimen name="text_prefheader">20sp</dimen>
 	<dimen name="text_header1">18sp</dimen>

+ 2 - 2
app/src/app_k0di/version.properties

@@ -1,2 +1,2 @@
-#Tue Jul 20 12:49:17 CEST 2021
-VERSION_CODE=2045
+#Fri Jul 23 11:20:56 CEST 2021
+VERSION_CODE=2158