Skip to content

Commit

Permalink
fix: added scrollview in open shortcut and added extensión url to name
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Jun 18, 2024
1 parent ed88b71 commit f353ed7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.RemoteException
import android.text.TextUtils
import android.util.TypedValue
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.widget.FrameLayout
import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.TextView
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AlertDialog
Expand Down Expand Up @@ -1376,19 +1376,25 @@ class FileDisplayActivity : FileActivity(),
setTextColor(ContextCompat.getColor(this@FileDisplayActivity, android.R.color.black))
setTextSize(TypedValue.COMPLEX_UNIT_SP, 16f)
}

val urlTextView = TextView(this).apply {
text = url
maxLines = 1
ellipsize = TextUtils.TruncateAt.MIDDLE
setTextColor(ContextCompat.getColor(this@FileDisplayActivity, android.R.color.black))
setTextSize(TypedValue.COMPLEX_UNIT_SP, 16f)
}
val scrollView = ScrollView(this).apply {
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
addView(urlTextView)
}

val layout = LinearLayout(this).apply {
orientation = LinearLayout.VERTICAL
setPadding(62, 0, 62, 70)
addView(messageTextView)
addView(urlTextView)
addView(scrollView)
}

val dialog = AlertDialog.Builder(this@FileDisplayActivity)
Expand Down
35 changes: 19 additions & 16 deletions owncloudApp/src/main/res/layout/create_shortcut_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,9 @@
android:id="@+id/create_shortcut_dialog_url_value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/url_suffix"
android:inputType="textNoSuggestions"
android:textSize="15sp" />

<TextView
android:id="@+id/url_suffix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:text="@string/create_shortcut_dialog_url_extension"
android:textColor="@color/black"
android:textSize="15sp" />
</RelativeLayout>

</com.google.android.material.textfield.TextInputLayout>
Expand Down Expand Up @@ -96,13 +86,26 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/create_shortcut_dialog_name_file_value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
android:textSize="15sp" />

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/create_shortcut_dialog_name_file_value"
android:layout_toStartOf="@+id/url_suffix"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
android:textSize="15sp" />

<TextView
android:id="@+id/url_suffix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:text="@string/create_shortcut_dialog_url_extension"
android:textColor="@color/black"
android:textSize="15sp" />
</RelativeLayout>

</com.google.android.material.textfield.TextInputLayout>

</RelativeLayout>
Expand Down

0 comments on commit f353ed7

Please sign in to comment.