Browse Source

Fuck notification badges, also properly hide notification if connection == rip

Wazakindjes 2 years ago
parent
commit
f5420b55e9

BIN
app/Meqqy.apk


+ 1 - 1
app/src/.idea/misc.xml

@@ -29,7 +29,7 @@
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 2 - 2
app/src/app_Meqqy/src/main/AndroidManifest.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 	package="com.jemoeder.lief.meqqy"
-	android:versionCode="260"
-	android:versionName="1.14">
+	android:versionCode="261"
+	android:versionName="1.15">
 
 	<!-- Need an internet connection to work 0bv lol -->
 	<uses-permission android:name="android.permission.INTERNET" />

+ 6 - 8
app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MainActivity.java

@@ -141,9 +141,11 @@ public class MainActivity extends AppCompatActivity {
 		notifBuilder.setOngoing(true);
 		notifBuilder.setShowWhen(false);
 		notifBuilder.setColor(ContextCompat.getColor(muhctx, R.color.notification_iconcolour));
+		notifBuilder.setBadgeIconType(NotificationCompat.BADGE_ICON_NONE);
 
 		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
 			NotificationChannel notifChannel = new NotificationChannel(muhchanActive, muhchanActive, NotificationManager.IMPORTANCE_DEFAULT);
+			notifChannel.setShowBadge(false);
 			wrapass.notifMan.createNotificationChannel(notifChannel);
 			notifBuilder.setChannelId(muhchanActive);
 		}
@@ -311,10 +313,8 @@ public class MainActivity extends AppCompatActivity {
 		findViewById(R.id.mainact_button_voldown).setTag(muhres.getString(R.string.cmd_voldown) + volstep_s);
 		findViewById(R.id.mainact_button_volup).setTag(muhres.getString(R.string.cmd_volup) + volstep_s);
 
-		if(notifactive) {
-			if(muhsock != null) {
-				kservShow();
-			}
+		if(notifactive && muhsock != null) {
+			kservShow();
 		}
 		else {
 			kservRemove();
@@ -415,10 +415,8 @@ public class MainActivity extends AppCompatActivity {
 
 	// Flips enabled status for all editable and button controls =]]
 	private void setControlsEnabled(boolean flag) {
-		if(flag) {
-			if(notifactive) {
-				kservShow();
-			}
+		if(flag && notifactive && muhsock != null) {
+			kservShow();
 		}
 		else {
 			kservRemove();