Browse Source

Use custom notification layout to remove way excessive padding -.- Also enables using a full-colour icon [=[=[=[=[=

Wazakindjes 2 months ago
parent
commit
e3495f565a

BIN
app/Meqqy.apk


+ 1 - 1
app/src/app_Meqqy/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.meqqy"
-	android:versionName="1.1.1">
+	android:versionName="1.1.2">
 
 	<!-- Need an internet connection to work 0bv lol -->
 	<uses-permission android:name="android.permission.INTERNET" />

+ 5 - 1
app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MainActivity.java

@@ -33,6 +33,7 @@ import android.view.MotionEvent;
 import android.view.View;
 import android.widget.Button;
 import android.widget.NumberPicker;
+import android.widget.RemoteViews;
 import android.widget.SeekBar;
 import android.widget.TextView;
 
@@ -145,8 +146,11 @@ public class MainActivity extends AppCompatActivity {
 		notifBuilder.setContentIntent(returnPIntent);
 		notifBuilder.setOngoing(true);
 		notifBuilder.setShowWhen(false);
-		notifBuilder.setColor(ContextCompat.getColor(muhctx, R.color.notification_iconcolour));
+		notifBuilder.setColor(ContextCompat.getColor(muhctx, R.color.notification_colour));
+		notifBuilder.setContent(new RemoteViews(getPackageName(), R.layout.muhnotification));
 		notifBuilder.setBadgeIconType(NotificationCompat.BADGE_ICON_NONE);
+
+		// s0em backwards compatibility shit imo tbh
 		notifBuilder.setPriority(NotificationCompat.PRIORITY_HIGH);
 		notifBuilder.setLights(0, 0, 0);
 		notifBuilder.setSound(null);

+ 24 - 0
app/src/app_Meqqy/src/main/res/layout/muhnotification.xml

@@ -0,0 +1,24 @@
+<?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">
+	<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"
+		android:layout_marginTop="@dimen/notification_margin_top"
+		android:layout_marginStart="@dimen/notification_margin_left" />
+	<TextView
+		android:textSize="@dimen/notification_titlesize"
+		android:textColor="@color/notification_colour"
+		android:text="@string/app_name"
+		android:id="@+id/title"
+		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>

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

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

+ 8 - 0
app/src/app_Meqqy/src/main/res/values/dimens.xml

@@ -1,5 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+	<!-- Notification p00p -->
+	<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>
+
 	<!-- prefheader and header1 are always in bold -->
 	<dimen name="text_prefheader">20sp</dimen>
 	<dimen name="text_header1">18sp</dimen>

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

@@ -1,2 +1,2 @@
-#Sat Jul 17 14:05:31 CEST 2021
-VERSION_CODE=267
+#Fri Jul 23 11:21:03 CEST 2021
+VERSION_CODE=284