mirror of
				https://framagit.org/tom79/fedilab-tube
				synced 2025-06-05 21:09:11 +02:00 
			
		
		
		
	Some improvements
This commit is contained in:
		| @@ -562,6 +562,9 @@ public class RetrofitPeertubeAPI { | ||||
|                 lang = lang.split("-")[0] + "-" + lang.split("-")[1].toUpperCase(); | ||||
|             } | ||||
|         } | ||||
|         if( lang == null || lang.trim().length() == 0) { | ||||
|             lang = "en"; | ||||
|         } | ||||
|         Call<Map<String, String>> translations = initTranslation().getTranslations(lang); | ||||
|         try { | ||||
|             Response<Map<String, String>> response = translations.execute(); | ||||
|   | ||||
| @@ -56,6 +56,7 @@ public class CommentData { | ||||
|         private String url; | ||||
|         @SerializedName("videoId") | ||||
|         private String videoId; | ||||
|         private boolean isReply = false; | ||||
|  | ||||
|  | ||||
|         public AccountData.Account getAccount() { | ||||
| @@ -161,6 +162,14 @@ public class CommentData { | ||||
|         public void setVideoId(String videoId) { | ||||
|             this.videoId = videoId; | ||||
|         } | ||||
|  | ||||
|         public boolean isReply() { | ||||
|             return isReply; | ||||
|         } | ||||
|  | ||||
|         public void setReply(boolean reply) { | ||||
|             isReply = reply; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public static class CommentPosted{ | ||||
|   | ||||
| @@ -206,7 +206,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo | ||||
|  | ||||
|         Spanned commentSpan; | ||||
|         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) | ||||
|             commentSpan = Html.fromHtml(comment.getText(), Html.FROM_HTML_MODE_LEGACY); | ||||
|             commentSpan = Html.fromHtml(comment.getText(), Html.FROM_HTML_MODE_COMPACT); | ||||
|         else | ||||
|             commentSpan = Html.fromHtml(comment.getText()); | ||||
|         holder.comment_content.setText(commentSpan, TextView.BufferType.SPANNABLE); | ||||
|   | ||||
| @@ -84,24 +84,6 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver | ||||
|  | ||||
|             startForeground(1, notification); | ||||
|         } | ||||
|         Thread thread = new Thread() { | ||||
|  | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 peertubeInformation = new PeertubeInformation(); | ||||
|                 peertubeInformation.setCategories(new LinkedHashMap<>()); | ||||
|                 peertubeInformation.setLanguages(new LinkedHashMap<>()); | ||||
|                 peertubeInformation.setLicences(new LinkedHashMap<>()); | ||||
|                 peertubeInformation.setPrivacies(new LinkedHashMap<>()); | ||||
|                 peertubeInformation.setPlaylistPrivacies(new LinkedHashMap<>()); | ||||
|                 peertubeInformation.setTranslations(new LinkedHashMap<>()); | ||||
|                 peertubeInformation = new RetrofitPeertubeAPI(RetrieveInfoService.this).getPeertubeInformation(); | ||||
|                 stopForeground(true); | ||||
|  | ||||
|             } | ||||
|         }; | ||||
|         thread.start(); | ||||
|  | ||||
|         return START_NOT_STICKY; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -47,6 +47,18 @@ | ||||
|             app:layout_constraintStart_toEndOf="@+id/comment_account_profile" | ||||
|             app:layout_constraintTop_toTopOf="parent" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/comment_account_username" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginTop="2dp" | ||||
|             android:layout_marginStart="5dp" | ||||
|             android:ellipsize="end" | ||||
|             android:singleLine="true" | ||||
|             android:textSize="12sp" | ||||
|             app:layout_constraintStart_toEndOf="@+id/comment_account_profile" | ||||
|             app:layout_constraintTop_toBottomOf="@+id/comment_account_displayname" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/comment_date" | ||||
|             android:layout_width="wrap_content" | ||||
| @@ -71,23 +83,11 @@ | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintTop_toBottomOf="@+id/comment_date" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/comment_account_username" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginTop="10dp" | ||||
|             android:ellipsize="end" | ||||
|             android:singleLine="true" | ||||
|             android:textSize="12sp" | ||||
|             app:layout_constraintBottom_toBottomOf="@+id/comment_account_profile" | ||||
|             app:layout_constraintStart_toEndOf="@+id/comment_account_profile" | ||||
|             app:layout_constraintTop_toBottomOf="@+id/comment_account_displayname" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/comment_content" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginTop="10dp" | ||||
|             android:layout_marginTop="5dp" | ||||
|             android:textIsSelectable="true" | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user