Skip to content

Commit

Permalink
wrap inside scroll view
Browse files Browse the repository at this point in the history
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
  • Loading branch information
parneet-guraya committed Feb 29, 2024
1 parent 13c3238 commit 4009d6f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 67 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4361,7 +4361,7 @@ class ChatActivity :
val lon = data.get("longitude")!!
metaData =
"{\"type\":\"geo-location\",\"id\":\"geo:$lat,$lon\",\"latitude\":\"$lat\"," +
"\"longitude\":\"$lon\",\"name\":\"$name\"}"
"\"longitude\":\"$lon\",\"name\":\"$name\"}"
}

when (type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class FileAttachmentPreviewFragment : DialogFragment() {
}

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {

arguments?.let {
files = it.getString(FILE_NAMES_ARG, "")
filesList = it.getStringArrayList(FILES_TO_UPLOAD_ARG)!!
Expand Down Expand Up @@ -100,10 +99,7 @@ class FileAttachmentPreviewFragment : DialogFragment() {
private const val FILES_TO_UPLOAD_ARG = "FILES_TO_UPLOAD_ARG"

@JvmStatic
fun newInstance(
filenames: String,
filesToUpload: MutableList<String>,
): FileAttachmentPreviewFragment {
fun newInstance(filenames: String, filesToUpload: MutableList<String>): FileAttachmentPreviewFragment {
val fileAttachmentFragment = FileAttachmentPreviewFragment()
val args = Bundle()
args.putString(FILE_NAMES_ARG, filenames)
Expand Down
128 changes: 67 additions & 61 deletions app/src/main/res/layout/dialog_file_attachment_preview.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Nextcloud Talk application
~
~ @author Julius Linus
Expand All @@ -18,85 +17,92 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:background="@color/white"
tools:visibility="visible">
tools:background="@color/white">

<com.google.android.material.textview.MaterialTextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_margin"
android:text="@string/nc_add_file"
android:textSize="@dimen/md_title_textsize" />

<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<ScrollView
android:layout_width="match_parent"
android:layout_height="100dp">
android:orientation="vertical">

<com.google.android.material.textview.MaterialTextView
android:id="@+id/dialog_file_attachment_preview_filenames"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_margin"
android:textSize="@dimen/headline_text_size"
tools:text="a.png\nb.png\nc.png"/>
android:text="@string/nc_add_file"
android:textSize="@dimen/md_title_textsize" />

</ScrollView>
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/dialog_file_attachment_preview_layout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_margin">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="100dp">

<com.google.android.material.textview.MaterialTextView
android:id="@+id/dialog_file_attachment_preview_filenames"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/standard_margin"
android:textSize="@dimen/headline_text_size"
tools:text="a.png\nb.png\nc.png" />

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/dialog_file_attachment_preview_caption"
</androidx.core.widget.NestedScrollView>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/dialog_file_attachment_preview_layout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/nc_caption"
android:maxLines="3"
tools:text="a.png\nb.png\nc.png"/>
android:layout_margin="@dimen/standard_margin">

</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/dialog_file_attachment_preview_caption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/nc_caption"
android:maxLines="3"
tools:text="a.png\nb.png\nc.png" />

<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_half_margin"
android:gravity="end"
android:orientation="horizontal"
android:paddingStart="@dimen/dialog_padding"
android:paddingEnd="@dimen/dialog_padding"
android:paddingBottom="@dimen/dialog_padding_top_bottom">

<com.google.android.material.button.MaterialButton
android:id="@+id/button_close"
style="@style/Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="@dimen/min_size_clickable_area"
android:text="@string/nc_no" />
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<com.google.android.material.button.MaterialButton
android:id="@+id/button_send"
style="@style/Button.Borderless"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/min_size_clickable_area"
android:text="@string/nc_yes" />
android:layout_marginTop="@dimen/standard_half_margin"
android:gravity="end"
android:orientation="horizontal"
android:paddingStart="@dimen/dialog_padding"
android:paddingEnd="@dimen/dialog_padding"
android:paddingBottom="@dimen/dialog_padding_top_bottom">

<com.google.android.material.button.MaterialButton
android:id="@+id/button_close"
style="@style/Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="@dimen/min_size_clickable_area"
android:text="@string/nc_no" />

<com.google.android.material.button.MaterialButton
android:id="@+id/button_send"
style="@style/Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="@dimen/min_size_clickable_area"
android:text="@string/nc_yes" />

</LinearLayout>
</LinearLayout>
</LinearLayout>

</ScrollView>

0 comments on commit 4009d6f

Please sign in to comment.