forked from github/szkolny
[Libraries] Update gradle, NavLib and Firebase.
This commit is contained in:
@ -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" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user