tweaking some dialog styles
This commit is contained in:
parent
42327429ce
commit
a918034c06
9 changed files with 153 additions and 149 deletions
|
@ -16,14 +16,14 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac
|
|||
|
||||
init {
|
||||
val view = activity.layoutInflater.inflate(R.layout.dialog_rename_song, null).apply {
|
||||
song_title.setText(track.title)
|
||||
song_artist.setText(track.artist)
|
||||
song_album.setText(track.album)
|
||||
title.setText(track.title)
|
||||
artist.setText(track.artist)
|
||||
album.setText(track.album)
|
||||
val filename = track.path.getFilenameFromPath()
|
||||
file_name.setText(filename.substring(0, filename.lastIndexOf(".")))
|
||||
extension.setText(track.path.getFilenameExtension())
|
||||
if (isRPlus()) {
|
||||
arrayOf(file_name_label, file_name, extension_label, extension).forEach {
|
||||
arrayOf(file_name_hint, extension_hint).forEach {
|
||||
it.beGone()
|
||||
}
|
||||
}
|
||||
|
@ -34,11 +34,11 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac
|
|||
.setNegativeButton(R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(view, this, R.string.rename_song) { alertDialog ->
|
||||
alertDialog.showKeyboard(view.song_title)
|
||||
alertDialog.showKeyboard(view.title)
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||
val newTitle = view.song_title.value
|
||||
val newArtist = view.song_artist.value
|
||||
val newAlbum = view.song_album.value
|
||||
val newTitle = view.title.value
|
||||
val newArtist = view.artist.value
|
||||
val newAlbum = view.album.value
|
||||
val newFilename = view.file_name.value
|
||||
val newFileExtension = view.extension.value
|
||||
|
||||
|
|
|
@ -11,18 +11,20 @@ class SleepTimerCustomDialog(val activity: Activity, val callback: (seconds: Int
|
|||
private val view = activity.layoutInflater.inflate(R.layout.dialog_custom_sleep_timer_picker, null)
|
||||
|
||||
init {
|
||||
view.minutes_hint.hint = activity.getString(R.string.minutes_raw).replaceFirstChar { it.uppercaseChar() }
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(view, this, R.string.sleep_timer) { alertDialog ->
|
||||
alertDialog.showKeyboard(view.dialog_custom_sleep_timer_value)
|
||||
dialog = alertDialog
|
||||
alertDialog.showKeyboard(view.minutes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun dialogConfirmed() {
|
||||
val value = view.dialog_custom_sleep_timer_value.value
|
||||
val value = view.minutes.value
|
||||
val minutes = Integer.valueOf(if (value.isEmpty()) "0" else value)
|
||||
callback(minutes * 60)
|
||||
activity.hideKeyboard()
|
||||
|
|
|
@ -21,69 +21,62 @@
|
|||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/tracks_nested_scrollview"
|
||||
<RelativeLayout
|
||||
android:id="@+id/tracks_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/tracks_holder"
|
||||
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
|
||||
android:id="@+id/tracks_fastscroller"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/current_track_bar">
|
||||
|
||||
<com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller
|
||||
android:id="@+id/tracks_fastscroller"
|
||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||
android:id="@+id/tracks_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/current_track_bar">
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:layoutAnimation="@anim/layout_animation"
|
||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||
android:id="@+id/tracks_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:layoutAnimation="@anim/layout_animation"
|
||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
||||
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
|
||||
|
||||
</com.qtalk.recyclerviewfastscroller.RecyclerViewFastScroller>
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/tracks_placeholder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:alpha="0.8"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:text="@string/no_items_found"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:textStyle="italic"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/tracks_placeholder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:alpha="0.8"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:text="@string/no_items_found"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:textStyle="italic"
|
||||
android:visibility="gone" />
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/tracks_placeholder_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tracks_placeholder"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/ripple_all_corners"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:text="@string/add_folder_to_playlist"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/tracks_placeholder_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tracks_placeholder"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/ripple_all_corners"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:text="@string/add_folder_to_playlist"
|
||||
android:textSize="@dimen/bigger_text_size"
|
||||
android:visibility="gone" />
|
||||
<include
|
||||
layout="@layout/view_current_track_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<include
|
||||
layout="@layout/view_current_track_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</RelativeLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
android:id="@+id/sorting_dialog_radio_ascending"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:text="@string/ascending"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
|
||||
|
@ -42,7 +41,6 @@
|
|||
android:id="@+id/sorting_dialog_radio_descending"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:text="@string/descending"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
</RadioGroup>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/dialog_custom_sleep_timer_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -9,23 +8,23 @@
|
|||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/dialog_custom_sleep_timer_value"
|
||||
android:layout_width="wrap_content"
|
||||
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||
android:id="@+id/minutes_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:digits="0123456789"
|
||||
android:ems="6"
|
||||
android:inputType="number"
|
||||
android:maxLength="5"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
android:hint="@string/minutes_raw">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/dialog_custom_sleep_timer_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/activity_margin"
|
||||
android:text="@string/minutes_raw"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/minutes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/activity_margin"
|
||||
android:digits="0123456789"
|
||||
android:inputType="number"
|
||||
android:maxLength="5"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
|
||||
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/export_playlist_scrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
@ -37,7 +36,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:hint="@string/filename_without_m3u">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/export_playlist_filename"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:hint="@string/title">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/new_playlist_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -9,90 +9,104 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/activity_margin">
|
||||
android:paddingTop="@dimen/medium_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/song_title_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:text="@string/title" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/song_title"
|
||||
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||
android:id="@+id/title_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_marginBottom="@dimen/activity_margin"
|
||||
android:inputType="textCapWords"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
android:hint="@string/title">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/song_artist_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:text="@string/artist" />
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textCapWords"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/song_artist"
|
||||
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||
android:id="@+id/artist_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_marginBottom="@dimen/activity_margin"
|
||||
android:inputType="textCapWords"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
android:hint="@string/artist">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/song_album_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:text="@string/album" />
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/artist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textCapWords"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/song_album"
|
||||
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||
android:id="@+id/album_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_marginBottom="@dimen/activity_margin"
|
||||
android:inputType="textCapWords"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
android:hint="@string/album">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/file_name_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:text="@string/filename" />
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/album"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textCapWords"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/file_name"
|
||||
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||
android:id="@+id/file_name_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:layout_marginBottom="@dimen/activity_margin"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
android:hint="@string/filename">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/extension_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/small_margin"
|
||||
android:text="@string/extension" />
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/file_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textCapWords"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
android:id="@+id/extension"
|
||||
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||
android:id="@+id/extension_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/activity_margin"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
android:layout_marginStart="@dimen/activity_margin"
|
||||
android:layout_marginEnd="@dimen/activity_margin"
|
||||
android:hint="@string/extension">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/extension"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
|
|
@ -3,5 +3,4 @@
|
|||
android:id="@+id/small_radio_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:textSize="@dimen/normal_text_size" />
|
||||
|
|
Loading…
Reference in a new issue