Code clean

This commit is contained in:
h4h13 2020-02-25 12:14:46 +05:30
parent c42e9cb0df
commit 5bce11177f
12 changed files with 46 additions and 54 deletions

View file

@ -30,13 +30,7 @@ import com.afollestad.materialdialogs.LayoutMode
import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet import com.afollestad.materialdialogs.bottomsheets.BottomSheet
import com.afollestad.materialdialogs.list.listItems import com.afollestad.materialdialogs.list.listItems
import kotlinx.android.synthetic.main.activity_user_info.bannerImage import kotlinx.android.synthetic.main.activity_user_info.*
import kotlinx.android.synthetic.main.activity_user_info.bannerSelect
import kotlinx.android.synthetic.main.activity_user_info.name
import kotlinx.android.synthetic.main.activity_user_info.nameContainer
import kotlinx.android.synthetic.main.activity_user_info.next
import kotlinx.android.synthetic.main.activity_user_info.toolbar
import kotlinx.android.synthetic.main.activity_user_info.userImage
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -142,7 +136,10 @@ class UserInfoActivity : AbsBaseActivity() {
pickImageIntent.putExtra("aspectY", 9) pickImageIntent.putExtra("aspectY", 9)
pickImageIntent.putExtra("scale", true) pickImageIntent.putExtra("scale", true)
//intent.setAction(Intent.ACTION_GET_CONTENT); //intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(pickImageIntent, "Select Picture"), PICK_BANNER_REQUEST) startActivityForResult(
Intent.createChooser(pickImageIntent, "Select Picture"),
PICK_BANNER_REQUEST
)
} }
private fun pickNewPhoto() { private fun pickNewPhoto() {
@ -154,7 +151,10 @@ class UserInfoActivity : AbsBaseActivity() {
pickImageIntent.putExtra("aspectX", 1) pickImageIntent.putExtra("aspectX", 1)
pickImageIntent.putExtra("aspectY", 1) pickImageIntent.putExtra("aspectY", 1)
pickImageIntent.putExtra("scale", true) pickImageIntent.putExtra("scale", true)
startActivityForResult(Intent.createChooser(pickImageIntent, "Select Picture"), PICK_IMAGE_REQUEST) startActivityForResult(
Intent.createChooser(pickImageIntent, "Select Picture"),
PICK_IMAGE_REQUEST
)
} }
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {

View file

@ -219,7 +219,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat() bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
} else { } else {
if (MusicPlayerRemote.playingQueue.isNotEmpty()) { if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
slidingPanel.cardElevation = DensityUtil.dip2px(this, 10f).toFloat() slidingPanel.elevation = DensityUtil.dip2px(this, 10f).toFloat()
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat() bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
bottomSheetBehavior.isHideable = false bottomSheetBehavior.isHideable = false
bottomSheetBehavior.peekHeight = bottomSheetBehavior.peekHeight =

View file

@ -13,11 +13,7 @@ import code.name.monkey.retromusic.util.DensityUtil
import code.name.monkey.retromusic.util.ThemedFastScroller.create import code.name.monkey.retromusic.util.ThemedFastScroller.create
import code.name.monkey.retromusic.views.ScrollingViewOnApplyWindowInsetsListener import code.name.monkey.retromusic.views.ScrollingViewOnApplyWindowInsetsListener
import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.container import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.*
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.empty
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.emptyEmoji
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.emptyText
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.recyclerView
import me.zhanghai.android.fastscroll.FastScroller import me.zhanghai.android.fastscroll.FastScroller
import me.zhanghai.android.fastscroll.FastScrollerBuilder import me.zhanghai.android.fastscroll.FastScrollerBuilder
@ -42,7 +38,6 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
} }
private fun setUpRecyclerView() { private fun setUpRecyclerView() {
recyclerView.layoutManager = layoutManager recyclerView.layoutManager = layoutManager
recyclerView.adapter = adapter recyclerView.adapter = adapter
val fastScroller = create(recyclerView) val fastScroller = create(recyclerView)
@ -52,7 +47,7 @@ abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>,
fastScroller fastScroller
) )
) )
//OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL) checkForPadding()
} }
protected open fun createFastScroller(recyclerView: RecyclerView): FastScroller { protected open fun createFastScroller(recyclerView: RecyclerView): FastScroller {

View file

@ -12,14 +12,14 @@
~ See the GNU General Public License for more details. ~ See the GNU General Public License for more details.
--> -->
<androidx.core.widget.NestedScrollView android:id="@+id/container" <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
android:layout_marginStart="@dimen/toolbar_margin_horizontal" android:layout_marginStart="@dimen/toolbar_margin_horizontal"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<LinearLayout <LinearLayout
@ -59,9 +59,9 @@
android:id="@+id/userImage" android:id="@+id/userImage"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
app:civ_border="false" android:layout_marginBottom="8dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:retroCornerSize="21dp" app:retroCornerSize="21dp"

View file

@ -12,14 +12,14 @@
~ See the GNU General Public License for more details. ~ See the GNU General Public License for more details.
--> -->
<androidx.core.widget.NestedScrollView android:id="@+id/container" <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
android:layout_marginStart="@dimen/toolbar_margin_horizontal" android:layout_marginStart="@dimen/toolbar_margin_horizontal"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
@ -30,10 +30,10 @@
android:id="@+id/userImage" android:id="@+id/userImage"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
app:civ_border="false" android:layout_marginBottom="8dp"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:retroCornerSize="21dp" app:retroCornerSize="21dp"

View file

@ -75,15 +75,16 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_margin="8dp"> android:layout_margin="8dp">
<code.name.monkey.retromusic.views.CircularImageView <code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/userImage" android:id="@+id/userImage"
android:layout_width="72dp" android:layout_width="72dp"
android:layout_height="72dp" android:layout_height="72dp"
android:layout_gravity="center" android:layout_gravity="center"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:civ_border="false" app:retroCornerSize="36dp"
app:civ_shadow="false" app:strokeWidth="2dp"
app:srcCompat="@drawable/ic_person_flat" /> app:srcCompat="@drawable/ic_person_flat"
app:strokeColor="?attr/colorSurface" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -17,8 +17,8 @@
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
style="@style/Toolbar" style="@style/Toolbar"
app:title="@string/profile"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp" app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:title="@string/profile"
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" /> app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
@ -88,17 +88,16 @@
app:layout_constraintStart_toStartOf="@+id/imageContainer" app:layout_constraintStart_toStartOf="@+id/imageContainer"
app:layout_constraintTop_toBottomOf="@id/imageContainer"> app:layout_constraintTop_toBottomOf="@id/imageContainer">
<code.name.monkey.retromusic.views.CircularImageView <code.name.monkey.retromusic.views.RetroShapeableImageView
android:id="@+id/userImage" android:id="@+id/userImage"
android:layout_width="72dp" android:layout_width="72dp"
android:layout_height="72dp" android:layout_height="72dp"
android:layout_gravity="center" android:layout_gravity="center"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:civ_border="true" app:retroCornerSize="36dp"
app:civ_border_color="?android:colorBackground" app:srcCompat="@drawable/ic_person_flat"
app:civ_border_width="2dp" app:strokeColor="?attr/colorSurface"
app:civ_shadow="false" app:strokeWidth="2dp" />
app:srcCompat="@drawable/ic_person_flat" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -11,10 +11,10 @@
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~ See the GNU General Public License for more details. ~ See the GNU General Public License for more details.
--> -->
<androidx.core.widget.NestedScrollView android:id="@+id/container" <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
@ -59,9 +59,9 @@
android:id="@+id/userImage" android:id="@+id/userImage"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
app:civ_border="false" android:layout_marginBottom="8dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:retroCornerSize="21dp" app:retroCornerSize="21dp"

View file

@ -24,16 +24,16 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<code.name.monkey.retromusic.views.RetroShapeableImageView <code.name.monkey.retromusic.views.RetroShapeableImageView
app:retroCornerSize="21dp"
android:id="@+id/userImage" android:id="@+id/userImage"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:civ_border="false" android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:retroCornerSize="21dp"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -19,17 +19,14 @@
android:focusable="true" android:focusable="true"
android:visibility="gone" /> android:visibility="gone" />
<com.google.android.material.card.MaterialCardView <FrameLayout
android:id="@+id/slidingPanel" android:id="@+id/slidingPanel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/colorSurface"
app:behavior_hideable="false" app:behavior_hideable="false"
app:behavior_peekHeight="0dp" app:behavior_peekHeight="0dp"
app:cardBackgroundColor="?attr/colorSurface" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
app:cardCornerRadius="0dp"
app:cardUseCompatPadding="false"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
app:strokeWidth="0dp">
<FrameLayout <FrameLayout
android:id="@+id/playerFragmentContainer" android:id="@+id/playerFragmentContainer"
@ -43,7 +40,7 @@
android:layout_height="48dp" android:layout_height="48dp"
tools:layout="@layout/fragment_mini_player" /> tools:layout="@layout/fragment_mini_player" />
</com.google.android.material.card.MaterialCardView> </FrameLayout>
<code.name.monkey.retromusic.views.BottomNavigationBarTinted <code.name.monkey.retromusic.views.BottomNavigationBarTinted
android:id="@+id/bottomNavigationView" android:id="@+id/bottomNavigationView"

View file

@ -10,7 +10,7 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.3' classpath 'com.android.tools.build:gradle:3.6.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:bundletool:0.9.0' classpath 'com.android.tools.build:bundletool:0.9.0'
classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.7" classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.7"

View file

@ -1,6 +1,6 @@
#Mon Feb 24 22:35:41 IST 2020 #Tue Feb 25 11:08:45 IST 2020
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip