Fix Scroll in MainFragment

This commit is contained in:
tzugen 2021-12-22 13:26:58 +01:00
parent 8d5675f461
commit 4a996f8edc
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
4 changed files with 198 additions and 188 deletions

View File

@ -40,6 +40,7 @@ android {
buildFeatures {
buildConfig = false
viewBinding true
}
}

View File

@ -58,6 +58,11 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
viewBinding true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8

View File

@ -4,7 +4,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.TextView
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
@ -21,7 +21,7 @@ import org.moire.ultrasonic.util.Util
*/
class MainFragment : Fragment(), KoinComponent {
private lateinit var list: LinearLayout
private lateinit var list: ScrollView
private lateinit var musicTitle: TextView
private lateinit var artistsButton: TextView
private lateinit var albumsButton: TextView

View File

@ -1,211 +1,215 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@+id/main_list"
<ScrollView xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="fill_parent"
a:layout_height="fill_parent"
a:orientation="vertical">
a:id="@+id/main_list">
<TextView
a:id="@+id/main_music"
<LinearLayout
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:paddingStart="6dp"
a:text="@string/main.music"
a:textAllCaps="true"
a:textAppearance="?android:attr/textAppearanceSmall"
a:textColor="@color/cyan"
a:textStyle="bold" />
a:orientation="vertical">
<TextView
a:id="@+id/main_artists_button"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.artists_title"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_music"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:paddingStart="6dp"
a:text="@string/main.music"
a:textAllCaps="true"
a:textAppearance="?android:attr/textAppearanceSmall"
a:textColor="@color/cyan"
a:textStyle="bold" />
<TextView
a:id="@+id/main_albums_button"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_title"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_artists_button"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.artists_title"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_genres_button"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.genres_title"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_button"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_title"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_songs"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:paddingStart="6dp"
a:text="@string/main.songs_title"
a:textAllCaps="true"
a:textAppearance="?android:attr/textAppearanceSmall"
a:textColor="@color/cyan"
a:textStyle="bold" />
<TextView
a:id="@+id/main_genres_button"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.genres_title"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_songs_button"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.songs_random"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_songs"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:paddingStart="6dp"
a:text="@string/main.songs_title"
a:textAllCaps="true"
a:textAppearance="?android:attr/textAppearanceSmall"
a:textColor="@color/cyan"
a:textStyle="bold" />
<TextView
a:id="@+id/main_songs_starred"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.songs_starred"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_songs_button"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.songs_random"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:paddingStart="6dp"
a:text="@string/main.albums_title"
a:textAllCaps="true"
a:textAppearance="?android:attr/textAppearanceSmall"
a:textColor="@color/cyan"
a:textStyle="bold" />
<TextView
a:id="@+id/main_songs_starred"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.songs_starred"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_newest"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_newest"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:paddingStart="6dp"
a:text="@string/main.albums_title"
a:textAllCaps="true"
a:textAppearance="?android:attr/textAppearanceSmall"
a:textColor="@color/cyan"
a:textStyle="bold" />
<TextView
a:id="@+id/main_albums_recent"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_recent"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_newest"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_newest"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_frequent"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_frequent"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_recent"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_recent"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_highest"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_highest"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_frequent"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_frequent"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_random"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_random"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_highest"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_highest"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_starred"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_starred"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_random"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_random"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_alphaByName"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_alphaByName"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_starred"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_starred"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_alphaByArtist"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_alphaByArtist"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_albums_alphaByName"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_alphaByName"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_videos_title"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:paddingStart="6dp"
a:text="@string/main.videos"
a:textAllCaps="true"
a:textAppearance="?android:attr/textAppearanceSmall"
a:textColor="@color/cyan"
a:textStyle="bold" />
<TextView
a:id="@+id/main_albums_alphaByArtist"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.albums_alphaByArtist"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_videos"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.videos"
a:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
a:id="@+id/main_videos_title"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:paddingStart="6dp"
a:text="@string/main.videos"
a:textAllCaps="true"
a:textAppearance="?android:attr/textAppearanceSmall"
a:textColor="@color/cyan"
a:textStyle="bold" />
</LinearLayout>
<TextView
a:id="@+id/main_videos"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:gravity="center_vertical"
a:minHeight="40dip"
a:paddingStart="6dip"
a:paddingEnd="6dip"
a:text="@string/main.videos"
a:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</ScrollView>