Added navigation graph for settings

This commit is contained in:
Hemanth S 2020-07-24 23:58:15 +05:30
parent 0ebcbd9434
commit 373befcd83
39 changed files with 713 additions and 114 deletions

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<alpha
android:fromAlpha="0"
android:toAlpha="1.0"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
android:interpolator="@android:anim/linear_interpolator"
android:startOffset="66"
android:duration="50"/>
<scale
android:fromXScale="1.1"
android:toXScale="1"
android:fromYScale="1.1"
android:toYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
android:interpolator="@anim/retro_fragment_fast_out_extra_slow_in"
android:duration="300"/>
</set>

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:zAdjustment="top">
<alpha
android:fromAlpha="1"
android:toAlpha="0.0"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
android:interpolator="@android:anim/linear_interpolator"
android:startOffset="66"
android:duration="50"/>
<scale
android:fromXScale="1"
android:toXScale="0.9"
android:fromYScale="1"
android:toYScale="0.9"
android:pivotX="50%"
android:pivotY="50%"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
android:interpolator="@anim/retro_fragment_fast_out_extra_slow_in"
android:duration="300"/>
</set>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="150" />

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="150"
/>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--Taken from https://googleplex-android.googlesource.com/platform/frameworks/base/+/HEAD/core/res/res/interpolator/decelerate_quad.xml-->
<decelerateInterpolator/>

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:shareInterpolator="false">
<alpha
android:duration="50"
android:fillAfter="true"
android:fillBefore="true"
android:fillEnabled="true"
android:fromAlpha="0"
android:interpolator="@android:anim/linear_interpolator"
android:startOffset="35"
android:toAlpha="1.0" />
<scale
android:duration="300"
android:fillAfter="true"
android:fillBefore="true"
android:fillEnabled="true"
android:fromXScale="0.85"
android:fromYScale="0.85"
android:interpolator="@anim/retro_fragment_fast_out_extra_slow_in"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1"
android:toYScale="1"
tools:targetApi="lollipop" />
</set>

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<!-- Fade out, over a black surface, which simulates a black scrim -->
<alpha
android:fromAlpha="1"
android:toAlpha="0.0"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
android:interpolator="@android:anim/linear_interpolator"
android:startOffset="35"
android:duration="50"/>
<scale
android:fromXScale="1"
android:toXScale="1.15"
android:fromYScale="1"
android:toYScale="1.15"
android:pivotX="50%"
android:pivotY="50%"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
android:interpolator="@anim/retro_fragment_fast_out_extra_slow_in"
android:duration="300"/>
</set>

View file

@ -23,10 +23,13 @@
android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<FrameLayout
<androidx.fragment.app.FragmentContainerView
android:id="@+id/contentFrame"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:defaultNavHost="true"
app:navGraph="@navigation/settings_graph" />
</androidx.core.widget.NestedScrollView>
<com.google.android.material.appbar.AppBarLayout

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?colorSurface"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
tools:ignore="UnusedAttribute">
<include layout="@layout/status_bar" />
</FrameLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/mainContent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liftOnScroll="true">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"
app:popupTheme="?attr/toolbarPopupTheme"
app:title="@string/app_name"
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal.Library"
app:titleTextColor="?attr/colorControlNormal"
tools:ignore="UnusedAttribute" />
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height" />
</FrameLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_container"
android:name="code.name.monkey.retromusic.fragments.main.MainFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
app:navGraph="@navigation/retro_graph" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -28,12 +28,12 @@
app:behavior_peekHeight="0dp"
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior">
<FrameLayout
<androidx.fragment.app.FragmentContainerView
android:id="@+id/playerFragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment
<androidx.fragment.app.FragmentContainerView
android:id="@+id/miniPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.MiniPlayerFragment"
android:layout_width="match_parent"

View file

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/now_playing"
app:startDestination="@id/mainPlayerFragment">
<fragment
android:id="@+id/playerFragment"
android:name="code.name.monkey.retromusic.fragments.player.normal.PlayerFragment"
android:label="PlayerFragment" />
<fragment
android:id="@+id/adaptiveFragment"
android:name="code.name.monkey.retromusic.fragments.player.adaptive.AdaptiveFragment"
android:label="AdaptiveFragment" />
<fragment
android:id="@+id/blurPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.blur.BlurPlayerFragment"
android:label="BlurPlayerFragment" />
<fragment
android:id="@+id/cardBlurFragment"
android:name="code.name.monkey.retromusic.fragments.player.cardblur.CardBlurFragment"
android:label="CardBlurFragment" />
<fragment
android:id="@+id/cardFragment"
android:name="code.name.monkey.retromusic.fragments.player.card.CardFragment"
android:label="CardFragment" />
<fragment
android:id="@+id/circlePlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.circle.CirclePlayerFragment"
android:label="CirclePlayerFragment" />
<fragment
android:id="@+id/classicPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.classic.ClassicPlayerFragment"
android:label="ClassicPlayerFragment" />
<fragment
android:id="@+id/colorFragment"
android:name="code.name.monkey.retromusic.fragments.player.color.ColorFragment"
android:label="ColorFragment" />
<fragment
android:id="@+id/fitFragment"
android:name="code.name.monkey.retromusic.fragments.player.fit.FitFragment"
android:label="FitFragment" />
<fragment
android:id="@+id/flatPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.flat.FlatPlayerFragment"
android:label="FlatPlayerFragment" />
<fragment
android:id="@+id/fullPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.full.FullPlayerFragment"
android:label="FullPlayerFragment" />
<fragment
android:id="@+id/gradientPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.gradient.GradientPlayerFragment"
android:label="GradientPlayerFragment" />
<fragment
android:id="@+id/materialFragment"
android:name="code.name.monkey.retromusic.fragments.player.material.MaterialFragment"
android:label="MaterialFragment" />
<fragment
android:id="@+id/peakPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.peak.PeakPlayerFragment"
android:label="PeakPlayerFragment" />
<fragment
android:id="@+id/plainPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.plain.PlainPlayerFragment"
android:label="PlainPlayerFragment" />
<fragment
android:id="@+id/simplePlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment"
android:label="SimplePlayerFragment" />
<fragment
android:id="@+id/tinyPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment"
android:label="TinyPlayerFragment" />
<fragment
android:id="@+id/mainPlayerFragment"
android:name="code.name.monkey.retromusic.fragments.player.MainPlayerFragment"
android:label="MainPlayerFragment">
<action
android:id="@+id/action_mainPlayerFragment_to_adaptiveFragment"
app:destination="@id/adaptiveFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_cardBlurFragment"
app:destination="@id/cardBlurFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_circlePlayerFragment"
app:destination="@id/circlePlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_blurPlayerFragment"
app:destination="@id/blurPlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_classicPlayerFragment"
app:destination="@id/classicPlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_plainPlayerFragment"
app:destination="@id/plainPlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_flatPlayerFragment"
app:destination="@id/flatPlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_gradientPlayerFragment"
app:destination="@id/gradientPlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_cardFragment"
app:destination="@id/cardFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_fitFragment"
app:destination="@id/fitFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_simplePlayerFragment"
app:destination="@id/simplePlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_fullPlayerFragment"
app:destination="@id/fullPlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_colorFragment"
app:destination="@id/colorFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_peakPlayerFragment"
app:destination="@id/peakPlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_tinyPlayerFragment"
app:destination="@id/tinyPlayerFragment" />
<action
android:id="@+id/action_mainPlayerFragment_to_materialFragment"
app:destination="@id/materialFragment" />
<action
android:id="@+id/action_mainPlayer_to_playerFragment"
app:destination="@id/playerFragment" />
</fragment>
</navigation>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/retro_graph"
app:startDestination="@id/mainFragment">
<fragment
android:id="@+id/mainFragment"
android:name="code.name.monkey.retromusic.fragments.main.MainFragment"
android:label="MainFragment"
tools:layout="@layout/fragment_main" />
<fragment
android:id="@+id/albumsFragment"
android:name="code.name.monkey.retromusic.fragments.albums.AlbumsFragment"
android:label="AlbumsFragment" />
<fragment
android:id="@+id/artistsFragment"
android:name="code.name.monkey.retromusic.fragments.artists.ArtistsFragment"
android:label="ArtistsFragment" />
<fragment
android:id="@+id/songsFragment"
android:name="code.name.monkey.retromusic.fragments.songs.SongsFragment"
android:label="SongsFragment" />
<fragment
android:id="@+id/genresFragment"
android:name="code.name.monkey.retromusic.fragments.genres.GenresFragment"
android:label="GenresFragment" />
<fragment
android:id="@+id/playlistsFragment"
android:name="code.name.monkey.retromusic.fragments.playlists.PlaylistsFragment"
android:label="PlaylistsFragment" />
</navigation>

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/settings_graph"
app:startDestination="@id/mainSettingsFragment">
<fragment
android:id="@+id/mainSettingsFragment"
android:name="code.name.monkey.retromusic.fragments.settings.MainSettingsFragment"
android:label="MainSettingsFragment"
tools:layout="@layout/fragment_main_settings">
<action
android:id="@+id/action_mainSettingsFragment_to_themeSettingsFragment"
app:destination="@id/themeSettingsFragment"
app:enterAnim="@anim/retro_fragment_open_enter"
app:exitAnim="@anim/retro_fragment_open_exit"
app:popEnterAnim="@anim/retro_fragment_close_enter"
app:popExitAnim="@anim/retro_fragment_close_exit" />
<action
android:id="@+id/action_mainSettingsFragment_to_imageSettingFragment"
app:destination="@id/imageSettingFragment"
app:enterAnim="@anim/retro_fragment_open_enter"
app:exitAnim="@anim/retro_fragment_open_exit"
app:popEnterAnim="@anim/retro_fragment_close_enter"
app:popExitAnim="@anim/retro_fragment_close_exit" />
<action
android:id="@+id/action_mainSettingsFragment_to_nowPlayingSettingsFragment"
app:destination="@id/nowPlayingSettingsFragment"
app:enterAnim="@anim/retro_fragment_open_enter"
app:exitAnim="@anim/retro_fragment_open_exit"
app:popEnterAnim="@anim/retro_fragment_close_enter"
app:popExitAnim="@anim/retro_fragment_close_exit" />
<action
android:id="@+id/action_mainSettingsFragment_to_audioSettings"
app:destination="@id/audioSettings"
app:enterAnim="@anim/retro_fragment_open_enter"
app:exitAnim="@anim/retro_fragment_open_exit"
app:popEnterAnim="@anim/retro_fragment_close_enter"
app:popExitAnim="@anim/retro_fragment_close_exit" />
<action
android:id="@+id/action_mainSettingsFragment_to_otherSettingsFragment"
app:destination="@id/otherSettingsFragment"
app:enterAnim="@anim/retro_fragment_open_enter"
app:exitAnim="@anim/retro_fragment_open_exit"
app:popEnterAnim="@anim/retro_fragment_close_enter"
app:popExitAnim="@anim/retro_fragment_close_exit" />
<action
android:id="@+id/action_mainSettingsFragment_to_personalizeSettingsFragment"
app:destination="@id/personalizeSettingsFragment" />
<action
android:id="@+id/action_mainSettingsFragment_to_notificationSettingsFragment"
app:destination="@id/notificationSettingsFragment"
app:enterAnim="@anim/retro_fragment_open_enter"
app:exitAnim="@anim/retro_fragment_open_exit"
app:popEnterAnim="@anim/retro_fragment_close_enter"
app:popExitAnim="@anim/retro_fragment_close_exit" />
</fragment>
<fragment
android:id="@+id/audioSettings"
android:name="code.name.monkey.retromusic.fragments.settings.AudioSettings"
android:label="AudioSettings" />
<fragment
android:id="@+id/imageSettingFragment"
android:name="code.name.monkey.retromusic.fragments.settings.ImageSettingFragment"
android:label="ImageSettingFragment" />
<fragment
android:id="@+id/notificationSettingsFragment"
android:name="code.name.monkey.retromusic.fragments.settings.NotificationSettingsFragment"
android:label="NotificationSettingsFragment" />
<fragment
android:id="@+id/nowPlayingSettingsFragment"
android:name="code.name.monkey.retromusic.fragments.settings.NowPlayingSettingsFragment"
android:label="NowPlayingSettingsFragment" />
<fragment
android:id="@+id/otherSettingsFragment"
android:name="code.name.monkey.retromusic.fragments.settings.OtherSettingsFragment"
android:label="OtherSettingsFragment" />
<fragment
android:id="@+id/personalizeSettingsFragment"
android:name="code.name.monkey.retromusic.fragments.settings.PersonalizeSettingsFragment"
android:label="PersonalizeSettingsFragment" />
<fragment
android:id="@+id/themeSettingsFragment"
android:name="code.name.monkey.retromusic.fragments.settings.ThemeSettingsFragment"
android:label="ThemeSettingsFragment" />
</navigation>