Code refactor

Added new lyrics view and code refactor
This commit is contained in:
Hemanth S 2020-06-30 23:15:47 +05:30
parent e5407592c5
commit 8a2b803286
22 changed files with 1151 additions and 1065 deletions

View file

@ -8,11 +8,8 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:elevation="0dp"
app:elevation="0dp">
android:layout_width="match_parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
@ -22,7 +19,7 @@
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"
app:navigationIcon="@drawable/ic_keyboard_arrow_down_black_24dp"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:subtitleTextAppearance="@style/TextViewCaption"
app:titleMargin="0dp"
app:titleMarginStart="0dp"
@ -30,38 +27,15 @@
tools:subtitle="@tools:sample/full_names"
tools:title="@tools:sample/full_names" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
style="@style/TabLayoutStyle"
android:background="@android:color/transparent"
app:tabTextAppearance="@style/TabTextAppearance">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/synced_lyrics" />
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/normal_lyrics" />
</com.google.android.material.tabs.TabLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewPager"
<code.name.monkey.retromusic.lyrics.LrcView
android:id="@+id/lyricsView"
app:lrcLabel="@string/no_lyrics_found"
app:lrcPadding="16dp"
app:lrcTextGravity="left"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/fab"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:text="@string/edit"
app:icon="@drawable/ic_edit_white_24dp" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -84,6 +84,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:background="?attr/roundSelector"
app:layout_constraintBottom_toTopOf="@+id/volumeFragmentContainer"
app:layout_constraintEnd_toStartOf="@+id/nextButton"

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/action_search"
app:showAsAction="ifRoom" />
</menu>

View file

@ -212,7 +212,7 @@
<item>sr</item>
<item>sk</item>
<item>es</item>
<item>sw</item>
<item>sv</item>
<item>ta</item>
<item>te</item>
<item>tr</item>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="lrc_normal_text_color">#9E9E9E</color>
<color name="lrc_current_text_color">#FF4081</color>
<color name="lrc_timeline_text_color">#F8BBD0</color>
<color name="lrc_timeline_color">#809E9E9E</color>
<color name="lrc_time_text_color">#809E9E9E</color>
</resources>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="lrc_animation_duration">1000</integer>
<dimen name="lrc_text_size">16sp</dimen>
<dimen name="lrc_time_text_size">12sp</dimen>
<dimen name="lrc_divider_height">16dp</dimen>
<dimen name="lrc_timeline_height">1dp</dimen>
<dimen name="lrc_drawable_width">30dp</dimen>
<dimen name="lrc_time_width">40dp</dimen>
</resources>

View file

@ -14,25 +14,24 @@
<resources>
<declare-styleable name="LrcView">
<attr name="lrcTextSize" format="dimension"/>
<attr name="lrcLineSpaceSize" format="dimension"/>
<attr name="lrcNormalTextColor" format="reference|color"/>
<attr name="lrcCurrentTextColor" format="reference|color"/>
<attr name="lrcTouchDelay" format="integer"/>
<attr name="noLrcTextSize" format="dimension"/>
<attr name="noLrcTextColor" format="reference|color"/>
<attr name="indicatorLineHeight" format="dimension"/>
<attr name="indicatorTextSize" format="dimension"/>
<attr name="indicatorTextColor" format="reference|color"/>
<attr name="currentIndicateLrcColor" format="reference|color"/>
<attr name="indicatorTouchDelay" format="integer"/>
<attr name="indicatorLineColor" format="reference|color"/>
<attr name="indicatorStartEndMargin" format="dimension"/>
<attr name="iconLineGap" format="dimension"/>
<attr name="playIconWidth" format="dimension"/>
<attr name="playIconHeight" format="dimension"/>
<attr name="playIcon" format="reference"/>
<attr name="isLrcCurrentTextBold" format="boolean"/>
<attr name="isLrcIndicatorTextBold" format="boolean"/>
<attr name="lrcTextSize" format="dimension" />
<attr name="lrcNormalTextSize" format="dimension" />
<attr name="lrcDividerHeight" format="dimension" />
<attr name="lrcNormalTextColor" format="reference|color" />
<attr name="lrcCurrentTextColor" format="reference|color" />
<attr name="lrcTimelineTextColor" format="reference|color" />
<attr name="lrcAnimationDuration" format="integer" />
<attr name="lrcLabel" format="string" />
<attr name="lrcPadding" format="dimension" />
<attr name="lrcTimelineColor" format="reference|color" />
<attr name="lrcTimelineHeight" format="dimension" />
<attr name="lrcPlayDrawable" format="reference" />
<attr name="lrcTimeTextColor" format="reference|color" />
<attr name="lrcTimeTextSize" format="dimension" />
<attr name="lrcTextGravity">
<enum name="center" value="0" />
<enum name="left" value="1" />
<enum name="right" value="2" />
</attr>
</declare-styleable>
</resources>

View file

@ -856,6 +856,7 @@
<string name="share_summary">Share the app with your friends and family</string>
<string name="help_summary">Need more help?</string>
<string name="gradient">Gradient</string>
<string name="user_name">User Name</string>
<plurals name="albumSongs">
<item quantity="one">Song</item>