Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict
This commit is contained in:
Prince kushwaha 2021-06-18 19:00:14 +05:30 committed by GitHub
parent 808f21a1f2
commit b202f553f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 308 additions and 9 deletions

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/mainBackground"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/caption_language_textview"
style="@style/CaptionTextLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:text="Caption"
android:textColor="?attr/caption_description_text_color"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
android:id="@+id/caption_text"
style="@style/CaptionTextLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:textColor="?attr/caption_description_text_color"
android:textStyle="normal" />
</LinearLayout>
</LinearLayout>

View file

@ -23,6 +23,20 @@
layout="@layout/layout_edit_categories" />
</LinearLayout>
<LinearLayout
android:id="@+id/dummy_caption_description_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:elevation="35dp"
android:orientation="vertical"
android:visibility="gone"
android:weightSum="10">
<include
layout="@layout/show_captions_descriptions" />
</LinearLayout>
<ImageView
android:id="@+id/mediaDetailImageFailed"
android:layout_height="wrap_content"
@ -190,6 +204,15 @@
tools:text="Description of the media goes here. This can potentially be fairly long, and will need to wrap across multiple lines. We hope it looks nice though." />
</LinearLayout>
<TextView
android:id="@+id/show_caption_description_textview"
style="@style/MediaDetailTextLabelGeneric"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dimen_10"
android:text="@string/media_detail_in_all_languages" />
<View
android:background="?attr/mediaDetailSpacerColor"
android:layout_width="match_parent"

View file

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_20"
android:background="?attr/mainBackground"
android:elevation="30dp"
android:padding="@dimen/dimen_10">
<TextView
android:id="@+id/caption_label"
style="@style/MediaDetailTextLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Captions"
android:textColor="?attr/caption_description_text_color" />
<ListView
android:id="@+id/caption_listview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/caption_label" />
<TextView
android:id="@+id/description_label"
style="@style/MediaDetailTextLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/caption_listview"
android:layout_marginTop="@dimen/dimen_10"
android:text="Descriptions"
android:textColor="?attr/caption_description_text_color" />
<ProgressBar
android:id="@+id/pb_circular"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="?attr/mainBackground"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone" />
<WebView
android:id="@+id/description_webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/description_label"
android:layout_marginTop="@dimen/dimen_10"
android:layout_marginBottom="@dimen/dimen_20"
android:background="?attr/mainBackground"
tools:ignore="WebViewLayout" />
</RelativeLayout>