Added file name in app file viewers
This commit is contained in:
parent
006d20a4ca
commit
094caa1fa2
2 changed files with 16 additions and 4 deletions
|
@ -65,6 +65,16 @@ class TopBarFragment : GenericFragment<FileViewerTopBarFragmentBinding>() {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
outState.putString("FilePath", plainFilePath)
|
||||
super.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
override fun onViewStateRestored(savedInstanceState: Bundle?) {
|
||||
super.onViewStateRestored(savedInstanceState)
|
||||
plainFilePath = savedInstanceState?.getString("FilePath") ?: plainFilePath
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
if (plainFilePath.isNotEmpty() && plainFilePath != content?.filePath.orEmpty()) {
|
||||
Log.i("[File Viewer] Destroying plain file path: $plainFilePath")
|
||||
|
@ -76,5 +86,6 @@ class TopBarFragment : GenericFragment<FileViewerTopBarFragmentBinding>() {
|
|||
fun setContent(c: Content) {
|
||||
Log.i("[File Viewer] Content file path is: ${c.filePath}")
|
||||
content = c
|
||||
binding.fileName.text = c.name
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:onClick="@{backClickListener}"
|
||||
android:contentDescription="@string/content_description_go_back"
|
||||
android:layout_width="0dp"
|
||||
|
@ -30,14 +29,16 @@
|
|||
android:padding="18dp"
|
||||
android:src="@drawable/back" />
|
||||
|
||||
<View
|
||||
<org.linphone.views.MarqueeTextView
|
||||
android:id="@+id/file_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.6"
|
||||
android:visibility="invisible" />
|
||||
style="@style/toolbar_small_title_font"
|
||||
android:singleLine="true"
|
||||
android:gravity="center"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/export"
|
||||
android:onClick="@{exportClickListener}"
|
||||
android:contentDescription="@string/content_description_export"
|
||||
android:layout_width="0dp"
|
||||
|
|
Loading…
Reference in a new issue