Improve translation view
This commit is contained in:
parent
b361d01eeb
commit
fb5ab86b84
|
@ -712,6 +712,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
View status_reply_indicator_top, reply_indicator_dot, status_reply_indicator_bottom, status_reply_indicator_diag_top, status_reply_indicator_diag_bottom;
|
View status_reply_indicator_top, reply_indicator_dot, status_reply_indicator_bottom, status_reply_indicator_diag_top, status_reply_indicator_diag_bottom;
|
||||||
CardView main_card_container;
|
CardView main_card_container;
|
||||||
LinearLayout main_linear_container;
|
LinearLayout main_linear_container;
|
||||||
|
View translation_border_view;
|
||||||
public View getView() {
|
public View getView() {
|
||||||
return itemView;
|
return itemView;
|
||||||
}
|
}
|
||||||
|
@ -839,6 +840,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||||
main_card_container = itemView.findViewById(R.id.main_card_container);
|
main_card_container = itemView.findViewById(R.id.main_card_container);
|
||||||
main_linear_container = itemView.findViewById(R.id.main_linear_container);
|
main_linear_container = itemView.findViewById(R.id.main_linear_container);
|
||||||
|
translation_border_view = itemView.findViewById(R.id.translation_border_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateAnimatedEmoji() {
|
void updateAnimatedEmoji() {
|
||||||
|
@ -2291,6 +2293,12 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
if (status.isTranslationShown() && status.getContentSpanTranslated() != null) {
|
if (status.isTranslationShown() && status.getContentSpanTranslated() != null) {
|
||||||
holder.status_content_translated.setText(status.getContentSpanTranslated(), TextView.BufferType.SPANNABLE);
|
holder.status_content_translated.setText(status.getContentSpanTranslated(), TextView.BufferType.SPANNABLE);
|
||||||
holder.status_content_translated_container.setVisibility(View.VISIBLE);
|
holder.status_content_translated_container.setVisibility(View.VISIBLE);
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
holder.translation_border_view.setBackgroundResource(R.drawable.translation_border_android4);
|
||||||
|
}else{
|
||||||
|
holder.translation_border_view.setBackgroundResource(R.drawable.translation_border);
|
||||||
|
}
|
||||||
|
|
||||||
} else { //Toot is not translated
|
} else { //Toot is not translated
|
||||||
holder.status_content_translated_container.setVisibility(View.GONE);
|
holder.status_content_translated_container.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<stroke
|
<stroke
|
||||||
android:width="1dp"
|
android:width="1dp"
|
||||||
android:color="@color/colorAccent" />
|
android:color="?colorAccent" />
|
||||||
<corners android:radius="4dp" />
|
<corners android:radius="4dp" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/mastodonC4" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
|
@ -403,9 +403,9 @@
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
android:id="@+id/translation_border_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/translation_border"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/translation_border_top" />
|
app:layout_constraintTop_toBottomOf="@id/translation_border_top" />
|
||||||
|
|
||||||
|
|
|
@ -343,9 +343,9 @@
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
android:id="@+id/translation_border_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/translation_border"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/translation_border_top" />
|
app:layout_constraintTop_toBottomOf="@id/translation_border_top" />
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@
|
||||||
android:background="?attr/cardviewColor"
|
android:background="?attr/cardviewColor"
|
||||||
android:paddingStart="2dp"
|
android:paddingStart="2dp"
|
||||||
android:paddingEnd="2dp"
|
android:paddingEnd="2dp"
|
||||||
android:text="Translation"
|
android:text="@string/translation"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
|
@ -299,9 +299,9 @@
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
android:id="@+id/translation_border_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/translation_border"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/translation_border_top" />
|
app:layout_constraintTop_toBottomOf="@id/translation_border_top" />
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@
|
||||||
android:background="?attr/backgroundColor"
|
android:background="?attr/backgroundColor"
|
||||||
android:paddingStart="2dp"
|
android:paddingStart="2dp"
|
||||||
android:paddingEnd="2dp"
|
android:paddingEnd="2dp"
|
||||||
android:text="Translation"
|
android:text="@string/translation"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
|
@ -277,9 +277,9 @@
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
android:id="@+id/translation_border_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/translation_border"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/translation_border_top" />
|
app:layout_constraintTop_toBottomOf="@id/translation_border_top" />
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@
|
||||||
android:background="?attr/backgroundColor"
|
android:background="?attr/backgroundColor"
|
||||||
android:paddingStart="2dp"
|
android:paddingStart="2dp"
|
||||||
android:paddingEnd="2dp"
|
android:paddingEnd="2dp"
|
||||||
android:text="Translation"
|
android:text="@string/translation"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue