forked from github/szkolny
[Libraries] Update gradle, NavLib and Firebase.
This commit is contained in:
parent
40cdc7d713
commit
37a5bea79b
@ -128,6 +128,7 @@ dependencies {
|
||||
implementation "com.mikepenz:iconics-core:${versions.iconics}"
|
||||
implementation "com.mikepenz:iconics-views:${versions.iconics}"
|
||||
implementation "com.mikepenz:community-material-typeface:${versions.font_cmd}@aar"
|
||||
implementation "com.mikepenz:materialize:1.2.1"
|
||||
|
||||
implementation "com.github.kuba2k2:NavLib:${versions.navlib}"
|
||||
|
||||
|
@ -31,8 +31,8 @@ import com.mikepenz.iconics.typeface.library.szkolny.font.SzkolnyFont
|
||||
import com.mikepenz.materialdrawer.model.DividerDrawerItem
|
||||
import com.mikepenz.materialdrawer.model.ProfileDrawerItem
|
||||
import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem
|
||||
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem
|
||||
import com.mikepenz.materialdrawer.model.interfaces.IProfile
|
||||
import com.mikepenz.materialdrawer.model.interfaces.*
|
||||
import com.mikepenz.materialdrawer.model.utils.withIsHiddenInMiniDrawer
|
||||
import kotlinx.coroutines.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
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.drawer.NavDrawer
|
||||
import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem
|
||||
import pl.szczodrzynski.navlib.drawer.items.withAppTitle
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.util.*
|
||||
@ -361,7 +360,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
|
||||
false
|
||||
}
|
||||
drawerProfileLongClickListener = { _, profile, _, view ->
|
||||
if (profile is ProfileDrawerItem) {
|
||||
if (view != null && profile is ProfileDrawerItem) {
|
||||
showProfileContextMenu(profile, view)
|
||||
true
|
||||
}
|
||||
@ -915,7 +914,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
|
||||
bottomSheet.removeAllContextual()
|
||||
bottomSheet.toggleGroupEnabled = false
|
||||
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.bottomBar.fabEnable = false
|
||||
navView.bottomBar.fabExtended = false
|
||||
@ -1063,7 +1063,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
|
||||
val item = DrawerPrimaryItem()
|
||||
.withIdentifier(target.id.toLong())
|
||||
.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.icon != null) it.withIcon(target.icon!!) }
|
||||
.also { if (target.title != null) it.withAppTitle(getString(target.title!!)) }
|
||||
@ -1127,7 +1127,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
|
||||
drawer.addProfileSettings(*drawerProfiles.toTypedArray())
|
||||
}
|
||||
|
||||
private fun showProfileContextMenu(profile: IProfile<*>, view: View) {
|
||||
private fun showProfileContextMenu(profile: IProfile, view: View) {
|
||||
val profileId = profile.identifier.toInt()
|
||||
val popupMenu = PopupMenu(this, view)
|
||||
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)
|
||||
} else if (item.itemId == 2) {
|
||||
ProfileRemoveDialog(this, profileId, profile.name?.getText(this)?.toString() ?: "?")
|
||||
ProfileRemoveDialog(this, profileId, profile.name?.getText(this) ?: "?")
|
||||
}
|
||||
true
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ import android.app.PendingIntent
|
||||
import android.app.PendingIntent.CanceledException
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.google.firebase.iid.zzaq
|
||||
import com.google.firebase.iid.zzv
|
||||
import com.google.firebase.iid.zzad
|
||||
import com.google.firebase.iid.zzaz
|
||||
import com.google.firebase.messaging.zzc
|
||||
import com.google.gson.JsonObject
|
||||
import pl.szczodrzynski.edziennik.*
|
||||
@ -36,7 +36,7 @@ open class FirebaseService : zzc() {
|
||||
|
||||
// apparently this gets the correct intent from some
|
||||
// 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 {
|
||||
val action = intent?.action
|
||||
if (action == "com.google.firebase.messaging.NOTIFICATION_OPEN") {
|
||||
@ -80,7 +80,7 @@ open class FirebaseService : zzc() {
|
||||
val ackBundle = Bundle(
|
||||
"google.message_id" to messageId
|
||||
)
|
||||
zzv.zza(this).zza(2, ackBundle)
|
||||
zzad.zza(this).zza(2, ackBundle)
|
||||
}
|
||||
// check for duplicate message
|
||||
// and add it to queue
|
||||
|
@ -1,6 +1,6 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<merge 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/material_drawer_account_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/material_drawer_account_header_height"
|
||||
@ -35,10 +35,27 @@
|
||||
android:elevation="2dp"
|
||||
android:focusable="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:biv_selectorOnPress="#80ffffff"
|
||||
app:materialDrawerSelectorOnPress="#80ffffff"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
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
|
||||
android:id="@+id/material_drawer_account_header_small_first"
|
||||
style="@style/BezelImageView"
|
||||
@ -50,12 +67,29 @@
|
||||
android:clickable="true"
|
||||
android:elevation="2dp"
|
||||
android:focusable="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="visible"
|
||||
android:scaleType="centerCrop"
|
||||
app:biv_selectorOnPress="#80ffffff"
|
||||
app:materialDrawerSelectorOnPress="#80ffffff"
|
||||
app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_small_second"
|
||||
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
|
||||
android:id="@+id/material_drawer_account_header_small_second"
|
||||
style="@style/BezelImageView"
|
||||
@ -67,12 +101,29 @@
|
||||
android:clickable="true"
|
||||
android:elevation="2dp"
|
||||
android:focusable="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="visible"
|
||||
android:scaleType="centerCrop"
|
||||
app:biv_selectorOnPress="#80ffffff"
|
||||
app:materialDrawerSelectorOnPress="#80ffffff"
|
||||
app:layout_constraintEnd_toStartOf="@id/material_drawer_account_header_small_third"
|
||||
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
|
||||
android:id="@+id/material_drawer_account_header_small_third"
|
||||
style="@style/BezelImageView"
|
||||
@ -84,12 +135,29 @@
|
||||
android:clickable="true"
|
||||
android:elevation="2dp"
|
||||
android:focusable="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="visible"
|
||||
android:scaleType="centerCrop"
|
||||
app:biv_selectorOnPress="#80ffffff"
|
||||
app:materialDrawerSelectorOnPress="#80ffffff"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
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
|
||||
android:id="@+id/material_drawer_text_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
@ -138,4 +206,4 @@
|
||||
android:layout_marginBottom="@dimen/material_drawer_account_header_dropdown_margin_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</merge>
|
||||
|
@ -4,6 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/material_drawer_item_profile"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/material_drawer_vertical_padding"
|
||||
android:paddingLeft="@dimen/material_drawer_vertical_padding"
|
||||
@ -44,7 +46,7 @@
|
||||
android:textDirection="anyRtl"
|
||||
android:textSize="@dimen/material_drawer_item_profile_text"
|
||||
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_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
@ -69,9 +71,37 @@
|
||||
android:textDirection="anyRtl"
|
||||
android:textSize="@dimen/material_drawer_item_profile_description"
|
||||
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_constraintTop_toBottomOf="@id/material_drawer_name"
|
||||
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>
|
18
build.gradle
18
build.gradle
@ -17,6 +17,8 @@ buildscript {
|
||||
]
|
||||
|
||||
versions = [
|
||||
gradleAndroid : "4.0.0-beta03",
|
||||
|
||||
kotlin : ext.kotlin_version,
|
||||
ktx : "1.2.0",
|
||||
|
||||
@ -32,24 +34,24 @@ buildscript {
|
||||
navigationFragment: "1.0.0",
|
||||
legacy : "1.0.0",
|
||||
|
||||
room : "2.2.4",
|
||||
room : "2.2.5",
|
||||
lifecycle : "2.2.0",
|
||||
work : "2.3.2",
|
||||
work : "2.3.4",
|
||||
|
||||
firebase : '17.2.2',
|
||||
firebasemessaging: "20.1.0",
|
||||
firebasemessaging: "20.1.3",
|
||||
play_services : "17.0.0",
|
||||
|
||||
materialdialogs : "0.9.6.0",
|
||||
materialdrawer : "cad66092a6",
|
||||
materialdrawer : "817e45765c367034b03046aaea6e95eeabcb40e9",
|
||||
iconics : "4.0.1",
|
||||
font_cmd : "3.5.95.1-kotlin",
|
||||
|
||||
navlib : "5c8b13c0d9db0d9e822fdae82c8afca6c01ab41e",
|
||||
navlib : "43f5ecdef5ac33a552936684978a3cd022e612a7",
|
||||
|
||||
gifdrawable : "1.2.15",
|
||||
|
||||
retrofit : '2.6.2'
|
||||
retrofit : "2.6.4"
|
||||
]
|
||||
}
|
||||
|
||||
@ -61,11 +63,11 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
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 'com.google.gms:google-services:4.3.3'
|
||||
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
|
||||
// in the individual module build.gradle files
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user