mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-05-19 13:14:20 +02:00
Some improvements
This commit is contained in:
parent
b78894b33c
commit
24a8a0dc00
@ -562,6 +562,9 @@ public class RetrofitPeertubeAPI {
|
|||||||
lang = lang.split("-")[0] + "-" + lang.split("-")[1].toUpperCase();
|
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);
|
Call<Map<String, String>> translations = initTranslation().getTranslations(lang);
|
||||||
try {
|
try {
|
||||||
Response<Map<String, String>> response = translations.execute();
|
Response<Map<String, String>> response = translations.execute();
|
||||||
|
@ -56,6 +56,7 @@ public class CommentData {
|
|||||||
private String url;
|
private String url;
|
||||||
@SerializedName("videoId")
|
@SerializedName("videoId")
|
||||||
private String videoId;
|
private String videoId;
|
||||||
|
private boolean isReply = false;
|
||||||
|
|
||||||
|
|
||||||
public AccountData.Account getAccount() {
|
public AccountData.Account getAccount() {
|
||||||
@ -161,6 +162,14 @@ public class CommentData {
|
|||||||
public void setVideoId(String videoId) {
|
public void setVideoId(String videoId) {
|
||||||
this.videoId = videoId;
|
this.videoId = videoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isReply() {
|
||||||
|
return isReply;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReply(boolean reply) {
|
||||||
|
isReply = reply;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CommentPosted{
|
public static class CommentPosted{
|
||||||
|
@ -206,7 +206,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
|
|
||||||
Spanned commentSpan;
|
Spanned commentSpan;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
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
|
else
|
||||||
commentSpan = Html.fromHtml(comment.getText());
|
commentSpan = Html.fromHtml(comment.getText());
|
||||||
holder.comment_content.setText(commentSpan, TextView.BufferType.SPANNABLE);
|
holder.comment_content.setText(commentSpan, TextView.BufferType.SPANNABLE);
|
||||||
|
@ -84,24 +84,6 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
|
|||||||
|
|
||||||
startForeground(1, notification);
|
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;
|
return START_NOT_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,18 @@
|
|||||||
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
|
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
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
|
<TextView
|
||||||
android:id="@+id/comment_date"
|
android:id="@+id/comment_date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -71,23 +83,11 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/comment_date" />
|
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
|
<TextView
|
||||||
android:id="@+id/comment_content"
|
android:id="@+id/comment_content"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="5dp"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user