[Libraries] Update gradle, NavLib and Firebase.

This commit is contained in:
Kuba Szczodrzyński 2020-03-24 16:29:45 +01:00
parent 40cdc7d713
commit 37a5bea79b
7 changed files with 135 additions and 34 deletions

View File

@ -128,6 +128,7 @@ dependencies {
implementation "com.mikepenz:iconics-core:${versions.iconics}" implementation "com.mikepenz:iconics-core:${versions.iconics}"
implementation "com.mikepenz:iconics-views:${versions.iconics}" implementation "com.mikepenz:iconics-views:${versions.iconics}"
implementation "com.mikepenz:community-material-typeface:${versions.font_cmd}@aar" implementation "com.mikepenz:community-material-typeface:${versions.font_cmd}@aar"
implementation "com.mikepenz:materialize:1.2.1"
implementation "com.github.kuba2k2:NavLib:${versions.navlib}" implementation "com.github.kuba2k2:NavLib:${versions.navlib}"

View File

@ -31,8 +31,8 @@ import com.mikepenz.iconics.typeface.library.szkolny.font.SzkolnyFont
import com.mikepenz.materialdrawer.model.DividerDrawerItem import com.mikepenz.materialdrawer.model.DividerDrawerItem
import com.mikepenz.materialdrawer.model.ProfileDrawerItem import com.mikepenz.materialdrawer.model.ProfileDrawerItem
import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem import com.mikepenz.materialdrawer.model.interfaces.*
import com.mikepenz.materialdrawer.model.interfaces.IProfile import com.mikepenz.materialdrawer.model.utils.withIsHiddenInMiniDrawer
import kotlinx.coroutines.* import kotlinx.coroutines.*
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
@ -90,7 +90,6 @@ import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem
import pl.szczodrzynski.navlib.drawer.NavDrawer import pl.szczodrzynski.navlib.drawer.NavDrawer
import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem
import pl.szczodrzynski.navlib.drawer.items.withAppTitle
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException
import java.util.* import java.util.*
@ -361,7 +360,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
false false
} }
drawerProfileLongClickListener = { _, profile, _, view -> drawerProfileLongClickListener = { _, profile, _, view ->
if (profile is ProfileDrawerItem) { if (view != null && profile is ProfileDrawerItem) {
showProfileContextMenu(profile, view) showProfileContextMenu(profile, view)
true true
} }
@ -915,7 +914,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
bottomSheet.removeAllContextual() bottomSheet.removeAllContextual()
bottomSheet.toggleGroupEnabled = false bottomSheet.toggleGroupEnabled = false
drawer.close() drawer.close()
drawer.setSelection(target.id, fireOnClick = false) if (drawer.getSelection() != target.id)
drawer.setSelection(target.id, fireOnClick = false)
navView.toolbar.setTitle(target.title ?: target.name) navView.toolbar.setTitle(target.title ?: target.name)
navView.bottomBar.fabEnable = false navView.bottomBar.fabEnable = false
navView.bottomBar.fabExtended = false navView.bottomBar.fabExtended = false
@ -1063,7 +1063,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
val item = DrawerPrimaryItem() val item = DrawerPrimaryItem()
.withIdentifier(target.id.toLong()) .withIdentifier(target.id.toLong())
.withName(target.name) .withName(target.name)
.withHiddenInMiniDrawer(!app.config.ui.miniMenuButtons.contains(target.id)) .withIsHiddenInMiniDrawer(!app.config.ui.miniMenuButtons.contains(target.id))
.also { if (target.description != null) it.withDescription(target.description!!) } .also { if (target.description != null) it.withDescription(target.description!!) }
.also { if (target.icon != null) it.withIcon(target.icon!!) } .also { if (target.icon != null) it.withIcon(target.icon!!) }
.also { if (target.title != null) it.withAppTitle(getString(target.title!!)) } .also { if (target.title != null) it.withAppTitle(getString(target.title!!)) }
@ -1127,7 +1127,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
drawer.addProfileSettings(*drawerProfiles.toTypedArray()) drawer.addProfileSettings(*drawerProfiles.toTypedArray())
} }
private fun showProfileContextMenu(profile: IProfile<*>, view: View) { private fun showProfileContextMenu(profile: IProfile, view: View) {
val profileId = profile.identifier.toInt() val profileId = profile.identifier.toInt()
val popupMenu = PopupMenu(this, view) val popupMenu = PopupMenu(this, view)
popupMenu.menu.add(0, 1, 1, R.string.profile_menu_open_settings) popupMenu.menu.add(0, 1, 1, R.string.profile_menu_open_settings)
@ -1140,7 +1140,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
} }
loadTarget(DRAWER_ITEM_SETTINGS, null) loadTarget(DRAWER_ITEM_SETTINGS, null)
} else if (item.itemId == 2) { } else if (item.itemId == 2) {
ProfileRemoveDialog(this, profileId, profile.name?.getText(this)?.toString() ?: "?") ProfileRemoveDialog(this, profileId, profile.name?.getText(this) ?: "?")
} }
true true
} }

View File

@ -9,8 +9,8 @@ import android.app.PendingIntent
import android.app.PendingIntent.CanceledException import android.app.PendingIntent.CanceledException
import android.content.Intent import android.content.Intent
import android.util.Log import android.util.Log
import com.google.firebase.iid.zzaq import com.google.firebase.iid.zzad
import com.google.firebase.iid.zzv import com.google.firebase.iid.zzaz
import com.google.firebase.messaging.zzc import com.google.firebase.messaging.zzc
import com.google.gson.JsonObject import com.google.gson.JsonObject
import pl.szczodrzynski.edziennik.* import pl.szczodrzynski.edziennik.*
@ -36,7 +36,7 @@ open class FirebaseService : zzc() {
// apparently this gets the correct intent from some // apparently this gets the correct intent from some
// kind of queue inside Firebase's InstanceID Receiver // kind of queue inside Firebase's InstanceID Receiver
final override fun zza(intent: Intent?) = zzaq.zza()?.zzb() final override fun zza(intent: Intent?) = zzaz.zza()?.zzb()
final override fun zzb(intent: Intent?): Boolean { final override fun zzb(intent: Intent?): Boolean {
val action = intent?.action val action = intent?.action
if (action == "com.google.firebase.messaging.NOTIFICATION_OPEN") { if (action == "com.google.firebase.messaging.NOTIFICATION_OPEN") {
@ -80,7 +80,7 @@ open class FirebaseService : zzc() {
val ackBundle = Bundle( val ackBundle = Bundle(
"google.message_id" to messageId "google.message_id" to messageId
) )
zzv.zza(this).zza(2, ackBundle) zzad.zza(this).zza(2, ackBundle)
} }
// check for duplicate message // check for duplicate message
// and add it to queue // and add it to queue

View File

@ -1,6 +1,6 @@
<androidx.constraintlayout.widget.ConstraintLayout <merge 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"
android:id="@+id/material_drawer_account_header" android:id="@+id/material_drawer_account_header"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/material_drawer_account_header_height" android:layout_height="@dimen/material_drawer_account_header_height"
@ -35,10 +35,27 @@
android:elevation="2dp" android:elevation="2dp"
android:focusable="true" android:focusable="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:biv_selectorOnPress="#80ffffff" app:materialDrawerSelectorOnPress="#80ffffff"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" /> app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_account_header_current_badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:lines="1"
android:minWidth="20dp"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:singleLine="true"
android:textSize="@dimen/material_drawer_item_badge_text"
app:layout_constraintBottom_toBottomOf="@id/material_drawer_account_header_current"
app:layout_constraintStart_toStartOf="@id/material_drawer_account_header_current"
tools:text="99" />
<com.mikepenz.materialdrawer.view.BezelImageView <com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_first" android:id="@+id/material_drawer_account_header_small_first"
style="@style/BezelImageView" style="@style/BezelImageView"
@ -50,12 +67,29 @@
android:clickable="true" android:clickable="true"
android:elevation="2dp" android:elevation="2dp"
android:focusable="true" android:focusable="true"
android:scaleType="fitCenter"
android:visibility="visible" android:visibility="visible"
android:scaleType="centerCrop" app:materialDrawerSelectorOnPress="#80ffffff"
app:biv_selectorOnPress="#80ffffff"
app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_small_second" app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_small_second"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" /> app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_account_header_small_first_badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:lines="1"
android:minWidth="20dp"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:singleLine="true"
android:textSize="@dimen/material_drawer_item_badge_small_text"
app:layout_constraintBottom_toBottomOf="@id/material_drawer_account_header_small_first"
app:layout_constraintStart_toStartOf="@id/material_drawer_account_header_small_first"
tools:text="99" />
<com.mikepenz.materialdrawer.view.BezelImageView <com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_second" android:id="@+id/material_drawer_account_header_small_second"
style="@style/BezelImageView" style="@style/BezelImageView"
@ -67,12 +101,29 @@
android:clickable="true" android:clickable="true"
android:elevation="2dp" android:elevation="2dp"
android:focusable="true" android:focusable="true"
android:scaleType="fitCenter"
android:visibility="visible" android:visibility="visible"
android:scaleType="centerCrop" app:materialDrawerSelectorOnPress="#80ffffff"
app:biv_selectorOnPress="#80ffffff"
app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_small_third" app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_small_third"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" /> app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_account_header_small_second_badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:lines="1"
android:minWidth="20dp"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:singleLine="true"
android:textSize="@dimen/material_drawer_item_badge_small_text"
app:layout_constraintBottom_toBottomOf="@id/material_drawer_account_header_small_second"
app:layout_constraintStart_toStartOf="@id/material_drawer_account_header_small_second"
tools:text="99" />
<com.mikepenz.materialdrawer.view.BezelImageView <com.mikepenz.materialdrawer.view.BezelImageView
android:id="@+id/material_drawer_account_header_small_third" android:id="@+id/material_drawer_account_header_small_third"
style="@style/BezelImageView" style="@style/BezelImageView"
@ -84,12 +135,29 @@
android:clickable="true" android:clickable="true"
android:elevation="2dp" android:elevation="2dp"
android:focusable="true" android:focusable="true"
android:scaleType="fitCenter"
android:visibility="visible" android:visibility="visible"
android:scaleType="centerCrop" app:materialDrawerSelectorOnPress="#80ffffff"
app:biv_selectorOnPress="#80ffffff"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" /> app:layout_constraintTop_toBottomOf="@+id/material_drawer_statusbar_guideline" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_account_header_small_third_badge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:lines="1"
android:minWidth="20dp"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:singleLine="true"
android:textSize="@dimen/material_drawer_item_badge_small_text"
app:layout_constraintBottom_toBottomOf="@id/material_drawer_account_header_small_third"
app:layout_constraintStart_toStartOf="@id/material_drawer_account_header_small_third"
tools:text="99" />
<androidx.constraintlayout.widget.Guideline <androidx.constraintlayout.widget.Guideline
android:id="@+id/material_drawer_text_guideline" android:id="@+id/material_drawer_text_guideline"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -138,4 +206,4 @@
android:layout_marginBottom="@dimen/material_drawer_account_header_dropdown_margin_bottom" android:layout_marginBottom="@dimen/material_drawer_account_header_dropdown_margin_bottom"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </merge>

View File

@ -4,6 +4,8 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/material_drawer_item_profile" android:layout_height="@dimen/material_drawer_item_profile"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="@dimen/material_drawer_vertical_padding" android:paddingStart="@dimen/material_drawer_vertical_padding"
android:paddingLeft="@dimen/material_drawer_vertical_padding" android:paddingLeft="@dimen/material_drawer_vertical_padding"
@ -44,7 +46,7 @@
android:textDirection="anyRtl" android:textDirection="anyRtl"
android:textSize="@dimen/material_drawer_item_profile_text" android:textSize="@dimen/material_drawer_item_profile_text"
app:layout_constraintBottom_toTopOf="@id/material_drawer_email" app:layout_constraintBottom_toTopOf="@id/material_drawer_email"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toStartOf="@+id/material_drawer_badge_container"
app:layout_constraintStart_toEndOf="@id/material_drawer_profileIcon" app:layout_constraintStart_toEndOf="@id/material_drawer_profileIcon"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" app:layout_constraintVertical_chainStyle="packed"
@ -69,9 +71,37 @@
android:textDirection="anyRtl" android:textDirection="anyRtl"
android:textSize="@dimen/material_drawer_item_profile_description" android:textSize="@dimen/material_drawer_item_profile_description"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toStartOf="@+id/material_drawer_badge_container"
app:layout_constraintStart_toEndOf="@id/material_drawer_profileIcon" app:layout_constraintStart_toEndOf="@id/material_drawer_profileIcon"
app:layout_constraintTop_toBottomOf="@id/material_drawer_name" app:layout_constraintTop_toBottomOf="@id/material_drawer_name"
tools:text="Some drawer text" /> tools:text="Some drawer text" />
<LinearLayout
android:id="@+id/material_drawer_badge_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:clipToPadding="false"
android:gravity="center"
android:paddingStart="@dimen/material_drawer_padding"
android:paddingLeft="@dimen/material_drawer_padding"
android:paddingEnd="0dp"
android:paddingRight="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/material_drawer_badge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:gravity="center"
android:lines="1"
android:minWidth="20dp"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:singleLine="true"
android:textSize="@dimen/material_drawer_item_primary_text"
tools:text="99" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -17,6 +17,8 @@ buildscript {
] ]
versions = [ versions = [
gradleAndroid : "4.0.0-beta03",
kotlin : ext.kotlin_version, kotlin : ext.kotlin_version,
ktx : "1.2.0", ktx : "1.2.0",
@ -32,24 +34,24 @@ buildscript {
navigationFragment: "1.0.0", navigationFragment: "1.0.0",
legacy : "1.0.0", legacy : "1.0.0",
room : "2.2.4", room : "2.2.5",
lifecycle : "2.2.0", lifecycle : "2.2.0",
work : "2.3.2", work : "2.3.4",
firebase : '17.2.2', firebase : '17.2.2',
firebasemessaging: "20.1.0", firebasemessaging: "20.1.3",
play_services : "17.0.0", play_services : "17.0.0",
materialdialogs : "0.9.6.0", materialdialogs : "0.9.6.0",
materialdrawer : "cad66092a6", materialdrawer : "817e45765c367034b03046aaea6e95eeabcb40e9",
iconics : "4.0.1", iconics : "4.0.1",
font_cmd : "3.5.95.1-kotlin", font_cmd : "3.5.95.1-kotlin",
navlib : "5c8b13c0d9db0d9e822fdae82c8afca6c01ab41e", navlib : "43f5ecdef5ac33a552936684978a3cd022e612a7",
gifdrawable : "1.2.15", gifdrawable : "1.2.15",
retrofit : '2.6.2' retrofit : "2.6.4"
] ]
} }
@ -61,11 +63,11 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.0-beta01' classpath "com.android.tools.build:gradle:${versions.gradleAndroid}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath 'me.tatarka:gradle-retrolambda:3.7.0' classpath 'me.tatarka:gradle-retrolambda:3.7.0'
classpath 'com.google.gms:google-services:4.3.3' classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.28.1' classpath 'io.fabric.tools:gradle:1.28.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View File

@ -3,4 +3,4 @@ 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-6.2-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-all.zip