Browse Source

feeds fragment: sort labels alphabetically

Andrew Dolgov 8 months ago
parent
commit
8283345e33

+ 3 - 3
org.fox.ttrss/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="org.fox.ttrss"
-    android:versionCode="496"
-    android:versionName="1.262">
+    android:versionCode="497"
+    android:versionName="1.263">
 
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -216,7 +216,7 @@
 
         <receiver android:name=".util.DeviceBootReceiver">
             <intent-filter>
-                <action android:name="android.intent.action.BOOT_COMPLETED"></action>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
             </intent-filter>
         </receiver>
 

+ 1 - 0
org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java

@@ -76,6 +76,7 @@ public class CommonActivity extends AppCompatActivity implements SharedPreferenc
 
 	public static final int EXCERPT_MAX_LENGTH = 256;
     public static final int EXCERPT_MAX_QUERY_LENGTH = 2048;
+	public static final int LABEL_BASE_INDEX = -1024;
 
 	public static final int PENDING_INTENT_CHROME_SHARE = 1;
 

+ 6 - 3
org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsFragment.java

@@ -241,16 +241,19 @@ public class FeedsFragment extends BaseFeedlistFragment implements OnItemClickLi
 						return a.order_id - b.order_id;
 					else
 						return a.title.toUpperCase().compareTo(b.title.toUpperCase());
-				else if (a.is_cat && !b.is_cat)
+				else if (a.is_cat)
 					return -1;
-				else if (!a.is_cat && b.is_cat) 
+				else if (b.is_cat)
 					return 1;
 				else if (a.order_id != 0 && b.order_id != 0)
 					return a.order_id - b.order_id;
 				else
 					return a.title.toUpperCase().compareTo(b.title.toUpperCase());
 			else
-				return a.id - b.id;
+				if (a.id < CommonActivity.LABEL_BASE_INDEX && b.id < CommonActivity.LABEL_BASE_INDEX)
+					return a.title.toUpperCase().compareTo(b.title.toUpperCase());
+				else
+					return a.id - b.id;
 		}
 		
 	}

+ 1 - 1
tt-rss-android.iml

@@ -13,7 +13,7 @@
     <content url="file://$MODULE_DIR$">
       <excludeFolder url="file://$MODULE_DIR$/.gradle" />
     </content>
-    <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
+    <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>
 </module>