mirror of
https://github.com/kuba2k2/NavLib.git
synced 2025-04-03 07:14:28 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a5a1597e40 | ||
![]() |
60cc1171f9 | ||
![]() |
8f10321820 | ||
![]() |
30d86d9618 | ||
![]() |
556d568228 | ||
![]() |
8a0e0438a5 | ||
![]() |
578306480b | ||
![]() |
7430169359 |
@ -42,7 +42,7 @@ dependencies {
|
||||
implementation "com.google.android.material:material:1.3.0"
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
|
||||
implementation "com.mikepenz:iconics-views:5.2.8"
|
||||
implementation "com.mikepenz:iconics-views:5.3.0-b01"
|
||||
implementation "com.mikepenz:community-material-typeface:5.8.55.0-kotlin@aar"
|
||||
|
||||
// implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.15"
|
||||
|
@ -8,6 +8,7 @@ import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.mikepenz.iconics.Iconics
|
||||
import com.mikepenz.iconics.IconicsDrawable
|
||||
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
||||
import com.mikepenz.iconics.utils.actionBar
|
||||
@ -42,6 +43,8 @@ class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
Iconics.respectFontBoundsDefault = true
|
||||
|
||||
if (darkTheme == null)
|
||||
darkTheme = getSharedPreferences("prefs", Context.MODE_PRIVATE).getBoolean("darkTheme", false)
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.4.30'
|
||||
kotlin_version = '1.4.31'
|
||||
|
||||
release = [
|
||||
// major.minor.patch.rc.beta
|
||||
versionName: "0.7.0",
|
||||
versionCode: 70099
|
||||
versionName: "0.8.0",
|
||||
versionCode: 80099
|
||||
]
|
||||
|
||||
setup = [
|
||||
|
@ -39,6 +39,6 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.mikepenz:iconics-core:5.2.8"
|
||||
implementation "com.mikepenz:iconics-typeface-api:5.3.0-b01"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation "androidx.appcompat:appcompat:1.2.0"
|
||||
implementation "androidx.core:core-ktx:1.3.2"
|
||||
implementation "androidx.recyclerview:recyclerview:1.1.0"
|
||||
@ -44,7 +44,7 @@ dependencies {
|
||||
|
||||
api "com.mikepenz:materialize:1.2.1"
|
||||
api "com.mikepenz:materialdrawer:8.3.3"
|
||||
api "com.mikepenz:iconics-core:5.2.8"
|
||||
api "com.mikepenz:iconics-core:5.3.0-b01"
|
||||
api "com.mikepenz:itemanimators:1.1.0"
|
||||
|
||||
compileOnly "pl.droidsonroids.gif:android-gif-drawable:1.2.15"
|
||||
|
@ -1,2 +1 @@
|
||||
-keep class androidx.drawerlayout.widget.DrawerLayout { *; }
|
||||
-keep class androidx.customview.widget.ViewDragHelper { *; }
|
1
navlib/proguard-rules.pro
vendored
1
navlib/proguard-rules.pro
vendored
@ -21,4 +21,3 @@
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-keep class androidx.drawerlayout.widget.DrawerLayout { *; }
|
||||
-keep class androidx.customview.widget.ViewDragHelper { *; }
|
@ -14,7 +14,6 @@ import androidx.appcompat.content.res.AppCompatResources
|
||||
import com.mikepenz.iconics.IconicsDrawable
|
||||
import com.mikepenz.iconics.typeface.IIcon
|
||||
import com.mikepenz.iconics.utils.actionBar
|
||||
import com.mikepenz.iconics.utils.paddingDp
|
||||
import com.mikepenz.iconics.utils.sizeDp
|
||||
import com.mikepenz.materialdrawer.util.DrawerImageLoader
|
||||
import pl.droidsonroids.gif.GifDrawable
|
||||
@ -103,7 +102,6 @@ open class ImageHolder : com.mikepenz.materialdrawer.holder.ImageHolder {
|
||||
this.icon = ii
|
||||
colorList = iconColor
|
||||
sizeDp = 24
|
||||
this.paddingDp = paddingDp
|
||||
}
|
||||
iconRes != -1 -> icon = AppCompatResources.getDrawable(ctx, iconRes)
|
||||
uri != null -> try {
|
||||
|
@ -136,7 +136,7 @@ class NavBottomBar : BottomAppBar {
|
||||
mutate()
|
||||
setDrawableByLayerId(R.id.ic_menu, IconicsDrawable(context).apply {
|
||||
this.icon = NavLibFont.Icon.nav_menu
|
||||
sizeDp = 20
|
||||
sizeDp = 24
|
||||
colorAttr(context, R.attr.colorOnPrimary)
|
||||
})
|
||||
setDrawableByLayerId(R.id.ic_badge, BadgeDrawable(context))
|
||||
@ -146,7 +146,7 @@ class NavBottomBar : BottomAppBar {
|
||||
menu.add(0, -1, 0, "Menu")
|
||||
.setIcon(IconicsDrawable(context).apply {
|
||||
this.icon = NavLibFont.Icon.nav_dots_vertical
|
||||
sizeDp = 20
|
||||
sizeDp = 24
|
||||
colorAttr(context, R.attr.colorOnPrimary)
|
||||
})
|
||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS)
|
||||
|
@ -280,7 +280,6 @@ class NavBottomSheet : CoordinatorLayout {
|
||||
return null
|
||||
return IconicsDrawable(context, icon).apply {
|
||||
sizeDp = 24
|
||||
paddingDp = 4
|
||||
}
|
||||
}
|
||||
|
||||
@ -389,7 +388,7 @@ class NavBottomSheet : CoordinatorLayout {
|
||||
is Drawable -> value
|
||||
is IIcon -> IconicsDrawable(context).apply {
|
||||
icon = value
|
||||
sizeDp = 34
|
||||
sizeDp = 24
|
||||
// colorInt = Color.BLACK
|
||||
}
|
||||
is Int -> context.getDrawableFromRes(value)
|
||||
|
@ -280,19 +280,17 @@ class NavDrawer(
|
||||
val mDrawerLayout = drawerLayout
|
||||
val mDragger = mDrawerLayout::class.java.getDeclaredField(
|
||||
"mLeftDragger"
|
||||
)//mRightDragger for right obviously
|
||||
)
|
||||
mDragger.isAccessible = true
|
||||
val draggerObj = mDragger.get(mDrawerLayout) as ViewDragHelper?
|
||||
draggerObj?.edgeSize = size.toInt()
|
||||
|
||||
val mEdgeSize = draggerObj?.javaClass?.getDeclaredField(
|
||||
"mEdgeSize"
|
||||
// update for SDK >= 29 (Android 10)
|
||||
val useSystemInsets = mDrawerLayout::class.java.getDeclaredField(
|
||||
"sEdgeSizeUsingSystemGestureInsets"
|
||||
)
|
||||
mEdgeSize?.isAccessible = true
|
||||
|
||||
mEdgeSize?.setInt(
|
||||
draggerObj,
|
||||
size.toInt()
|
||||
) //optimal value as for me, you may set any constant in dp
|
||||
useSystemInsets.isAccessible = true
|
||||
useSystemInsets.set(null, false)
|
||||
}
|
||||
catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
@ -477,7 +475,7 @@ class NavDrawer(
|
||||
}
|
||||
|
||||
if (drawer.selectedItemIdentifier != id.toLong() || !fireOnClick)
|
||||
drawer.setSelection(id.toLong(), fireOnClick)
|
||||
drawer.setSelectionAtPosition(drawer.getPosition(id.toLong()), fireOnClick)
|
||||
|
||||
miniDrawer.setSelection(-1L)
|
||||
if (drawerMode == DRAWER_MODE_MINI)
|
||||
|
@ -32,8 +32,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bottom_sheet_background"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingHorizontal="8dp"
|
||||
tools:paddingBottom="48dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
@ -107,4 +106,4 @@
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
</layout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user