mirror of
https://github.com/kuba2k2/NavLib.git
synced 2025-01-17 22:06:44 -06:00
Update Gradle and libraries, migrate Iconics to v5
This commit is contained in:
parent
642d297cd0
commit
43fc2f10df
4
.idea/gradle.xml
generated
4
.idea/gradle.xml
generated
@ -1,8 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
<option name="testRunner" value="PLATFORM" />
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
@ -10,10 +12,10 @@
|
|||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
<option value="$PROJECT_DIR$/navlib" />
|
<option value="$PROJECT_DIR$/navlib" />
|
||||||
|
<option value="$PROJECT_DIR$/navlib-font" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
<option name="testRunner" value="PLATFORM" />
|
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
30
.idea/jarRepositories.xml
generated
Normal file
30
.idea/jarRepositories.xml
generated
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="BintrayJCenter" />
|
||||||
|
<option name="name" value="BintrayJCenter" />
|
||||||
|
<option name="url" value="https://jcenter.bintray.com/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven" />
|
||||||
|
<option name="name" value="maven" />
|
||||||
|
<option name="url" value="https://jitpack.io" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="Google" />
|
||||||
|
<option name="name" value="Google" />
|
||||||
|
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -5,7 +5,7 @@
|
|||||||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||||
</configurations>
|
</configurations>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
1
.idea/runConfigurations.xml
generated
1
.idea/runConfigurations.xml
generated
@ -3,6 +3,7 @@
|
|||||||
<component name="RunConfigurationProducerService">
|
<component name="RunConfigurationProducerService">
|
||||||
<option name="ignoredProducers">
|
<option name="ignoredProducers">
|
||||||
<set>
|
<set>
|
||||||
|
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||||
|
@ -34,18 +34,19 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
implementation "androidx.appcompat:appcompat:${versions.appcompat}"
|
implementation "androidx.appcompat:appcompat:1.2.0"
|
||||||
implementation "androidx.legacy:legacy-support-v4:${versions.legacy}"
|
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||||
api("com.github.kuba2k2:MaterialDrawer:${versions.materialdrawer}") {
|
api("com.github.kuba2k2:MaterialDrawer:817e45765c") {
|
||||||
exclude module: 'library-iconics'
|
exclude module: 'library-iconics'
|
||||||
}
|
}
|
||||||
implementation "com.mikepenz:iconics-core:${versions.iconics}"
|
implementation "com.mikepenz:iconics-core:5.2.8"
|
||||||
implementation "com.mikepenz:iconics-views:${versions.iconics}"
|
implementation "com.mikepenz:iconics-views:5.2.8"
|
||||||
implementation "com.mikepenz:community-material-typeface:${versions.font_cmd}@aar"
|
implementation "com.mikepenz:community-material-typeface:5.8.55.0-kotlin@aar"
|
||||||
implementation "androidx.core:core-ktx:${versions.ktx}"
|
implementation "androidx.core:core-ktx:1.3.2"
|
||||||
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
|
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
|
||||||
implementation "com.google.android.material:material:${versions.material}"
|
implementation "com.google.android.material:material:1.3.0"
|
||||||
implementation "pl.droidsonroids.gif:android-gif-drawable:${versions.gifdrawable}"
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
||||||
|
// implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.15"
|
||||||
implementation 'androidx.multidex:multidex:2.0.1'
|
implementation 'androidx.multidex:multidex:2.0.1'
|
||||||
implementation project(":navlib")
|
implementation project(":navlib")
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import android.graphics.PorterDuffColorFilter
|
|||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory
|
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory
|
||||||
import pl.droidsonroids.gif.GifDrawable
|
|
||||||
import pl.szczodrzynski.navlib.ImageHolder
|
import pl.szczodrzynski.navlib.ImageHolder
|
||||||
import pl.szczodrzynski.navlib.crc16
|
import pl.szczodrzynski.navlib.crc16
|
||||||
import pl.szczodrzynski.navlib.drawer.IDrawerProfile
|
import pl.szczodrzynski.navlib.drawer.IDrawerProfile
|
||||||
@ -57,7 +56,7 @@ class DrawerProfile(
|
|||||||
/* if you want to use GIFs as profile drawables, add
|
/* if you want to use GIFs as profile drawables, add
|
||||||
implementation "pl.droidsonroids.gif:android-gif-drawable:${versions.gifdrawable}"
|
implementation "pl.droidsonroids.gif:android-gif-drawable:${versions.gifdrawable}"
|
||||||
*/
|
*/
|
||||||
return GifDrawable(image ?: "")
|
return null//GifDrawable(image ?: "")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return RoundedBitmapDrawableFactory.create(context.resources, image ?: "")
|
return RoundedBitmapDrawableFactory.create(context.resources, image ?: "")
|
||||||
@ -89,4 +88,4 @@ class DrawerProfile(
|
|||||||
override fun applyImageTo(imageView: ImageView) {
|
override fun applyImageTo(imageView: ImageView) {
|
||||||
getImageHolder(imageView.context).applyTo(imageView)
|
getImageHolder(imageView.context).applyTo(imageView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@ import android.view.Gravity
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.mikepenz.iconics.IconicsColor
|
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
import com.mikepenz.iconics.IconicsSize
|
|
||||||
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
||||||
|
import com.mikepenz.iconics.utils.actionBar
|
||||||
|
import com.mikepenz.iconics.utils.paddingDp
|
||||||
import com.mikepenz.materialdrawer.holder.StringHolder
|
import com.mikepenz.materialdrawer.holder.StringHolder
|
||||||
import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem
|
import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem
|
||||||
import com.mikepenz.materialdrawer.model.interfaces.*
|
import com.mikepenz.materialdrawer.model.interfaces.*
|
||||||
@ -27,6 +27,7 @@ import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet.Companion.SORT_MODE_DE
|
|||||||
import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet.Companion.TOGGLE_GROUP_SORTING_ORDER
|
import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet.Companion.TOGGLE_GROUP_SORTING_ORDER
|
||||||
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem
|
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.colorAttr
|
||||||
import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem
|
import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem
|
||||||
import pl.szczodrzynski.navlib.getColorFromAttr
|
import pl.szczodrzynski.navlib.getColorFromAttr
|
||||||
import pl.szczodrzynski.navlib.withIcon
|
import pl.szczodrzynski.navlib.withIcon
|
||||||
@ -211,7 +212,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
navView.bottomSheet.enableDragToOpen = isChecked
|
navView.bottomSheet.enableDragToOpen = isChecked
|
||||||
}
|
}
|
||||||
|
|
||||||
navView.bottomBar.fabIcon = CommunityMaterial.Icon2.cmd_pencil
|
navView.bottomBar.fabIcon = CommunityMaterial.Icon3.cmd_pencil
|
||||||
navView.bottomBar.fabExtendedText = "Compose"
|
navView.bottomBar.fabExtendedText = "Compose"
|
||||||
navView.bottomBar.fabExtended = false
|
navView.bottomBar.fabExtended = false
|
||||||
|
|
||||||
@ -239,13 +240,13 @@ class MainActivity : AppCompatActivity() {
|
|||||||
.withSelected(true)
|
.withSelected(true)
|
||||||
.withIdentifier(1)
|
.withIdentifier(1)
|
||||||
.withBadgeStyle(badgeStyle)
|
.withBadgeStyle(badgeStyle)
|
||||||
.withIcon(CommunityMaterial.Icon.cmd_google_home),
|
.withIcon(CommunityMaterial.Icon2.cmd_google_home),
|
||||||
|
|
||||||
DrawerPrimaryItem()
|
DrawerPrimaryItem()
|
||||||
.withIdentifier(2)
|
.withIdentifier(2)
|
||||||
.withName("Settings")
|
.withName("Settings")
|
||||||
.withBadgeStyle(badgeStyle)
|
.withBadgeStyle(badgeStyle)
|
||||||
.withIcon(CommunityMaterial.Icon2.cmd_settings),
|
.withIcon(CommunityMaterial.Icon.cmd_cog_outline),
|
||||||
|
|
||||||
DrawerPrimaryItem().withName("iOS")
|
DrawerPrimaryItem().withName("iOS")
|
||||||
.withIdentifier(60)
|
.withIdentifier(60)
|
||||||
@ -263,7 +264,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
.withIdentifier(62)
|
.withIdentifier(62)
|
||||||
.withIsHiddenInMiniDrawer(true)
|
.withIsHiddenInMiniDrawer(true)
|
||||||
.withBadgeStyle(badgeStyle)
|
.withBadgeStyle(badgeStyle)
|
||||||
.withIcon(CommunityMaterial.Icon.cmd_fingerprint),
|
.withIcon(CommunityMaterial.Icon2.cmd_fingerprint),
|
||||||
|
|
||||||
DrawerPrimaryItem().withName("HDR enable/disable")
|
DrawerPrimaryItem().withName("HDR enable/disable")
|
||||||
.withTag(0)
|
.withTag(0)
|
||||||
@ -276,12 +277,12 @@ class MainActivity : AppCompatActivity() {
|
|||||||
.withDescription("Because we all hate ads")
|
.withDescription("Because we all hate ads")
|
||||||
.withIdentifier(64)
|
.withIdentifier(64)
|
||||||
.withBadgeStyle(badgeStyle)
|
.withBadgeStyle(badgeStyle)
|
||||||
.withIcon(CommunityMaterial.Icon.cmd_adchoices),
|
.withIcon(CommunityMaterial.Icon2.cmd_google_ads),
|
||||||
|
|
||||||
DrawerPrimaryItem().withName("Wonderful browsing experience and this is a long string")
|
DrawerPrimaryItem().withName("Wonderful browsing experience and this is a long string")
|
||||||
.withIdentifier(65)
|
.withIdentifier(65)
|
||||||
.withBadgeStyle(badgeStyle)
|
.withBadgeStyle(badgeStyle)
|
||||||
.withIcon(CommunityMaterial.Icon2.cmd_internet_explorer)
|
.withIcon(CommunityMaterial.Icon3.cmd_microsoft_internet_explorer)
|
||||||
)
|
)
|
||||||
|
|
||||||
//setAccountHeaderBackground("/sdcard/ban.gif")
|
//setAccountHeaderBackground("/sdcard/ban.gif")
|
||||||
@ -303,10 +304,11 @@ class MainActivity : AppCompatActivity() {
|
|||||||
.withName("Add Account")
|
.withName("Add Account")
|
||||||
.withDescription("Add new GitHub Account")
|
.withDescription("Add new GitHub Account")
|
||||||
.withIcon(
|
.withIcon(
|
||||||
IconicsDrawable(context, CommunityMaterial.Icon2.cmd_plus)
|
IconicsDrawable(context, CommunityMaterial.Icon3.cmd_plus).apply {
|
||||||
.actionBar()
|
actionBar()
|
||||||
.padding { IconicsSize.dp(5) }
|
paddingDp = 5
|
||||||
.color { IconicsColor.colorInt(getColorFromAttr(context, R.attr.materialDrawerPrimaryText)) }
|
colorAttr(context, R.attr.materialDrawerPrimaryText)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
.withOnDrawerItemClickListener { v, item, position ->
|
.withOnDrawerItemClickListener { v, item, position ->
|
||||||
Toast.makeText(context, "Add account", Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, "Add account", Toast.LENGTH_SHORT).show()
|
||||||
@ -314,7 +316,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
},
|
},
|
||||||
ProfileSettingDrawerItem()
|
ProfileSettingDrawerItem()
|
||||||
.withName("Manage Account")
|
.withName("Manage Account")
|
||||||
.withIcon(CommunityMaterial.Icon2.cmd_settings)
|
.withIcon(CommunityMaterial.Icon.cmd_cog_outline)
|
||||||
)
|
)
|
||||||
|
|
||||||
drawerItemSelectedListener = { id, position, drawerItem ->
|
drawerItemSelectedListener = { id, position, drawerItem ->
|
||||||
@ -363,7 +365,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
this += BottomSheetPrimaryItem(true)
|
this += BottomSheetPrimaryItem(true)
|
||||||
.withId(1)
|
.withId(1)
|
||||||
.withTitle("Compose")
|
.withTitle("Compose")
|
||||||
.withIcon(CommunityMaterial.Icon2.cmd_pencil)
|
.withIcon(CommunityMaterial.Icon3.cmd_pencil)
|
||||||
.withOnClickListener(View.OnClickListener {
|
.withOnClickListener(View.OnClickListener {
|
||||||
Toast.makeText(this@MainActivity, "Compose message", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this@MainActivity, "Compose message", Toast.LENGTH_SHORT).show()
|
||||||
})
|
})
|
||||||
@ -371,7 +373,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
this += BottomSheetPrimaryItem(false)
|
this += BottomSheetPrimaryItem(false)
|
||||||
.withId(3)
|
.withId(3)
|
||||||
.withTitle("Synchronise")
|
.withTitle("Synchronise")
|
||||||
.withIcon(CommunityMaterial.Icon2.cmd_sync)
|
.withIcon(CommunityMaterial.Icon3.cmd_sync)
|
||||||
.withOnClickListener(View.OnClickListener {
|
.withOnClickListener(View.OnClickListener {
|
||||||
Toast.makeText(this@MainActivity, "Synchronising...", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this@MainActivity, "Synchronising...", Toast.LENGTH_SHORT).show()
|
||||||
})
|
})
|
||||||
@ -403,7 +405,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
textInputEnabled = true
|
textInputEnabled = true
|
||||||
textInputHint = "Search"
|
textInputHint = "Search"
|
||||||
textInputHelperText = "0 messages found"
|
textInputHelperText = "0 messages found"
|
||||||
textInputIcon = CommunityMaterial.Icon2.cmd_magnify
|
textInputIcon = CommunityMaterial.Icon3.cmd_magnify
|
||||||
textInputChangedListener = object : NavBottomSheet.OnTextInputChangedListener {
|
textInputChangedListener = object : NavBottomSheet.OnTextInputChangedListener {
|
||||||
override fun onTextChanged(s: String, start: Int, before: Int, count: Int) {
|
override fun onTextChanged(s: String, start: Int, before: Int, count: Int) {
|
||||||
navView.toolbar.subtitle = s
|
navView.toolbar.subtitle = s
|
||||||
|
47
build.gradle
47
build.gradle
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.3.61'
|
kotlin_version = '1.4.30'
|
||||||
|
|
||||||
release = [
|
release = [
|
||||||
// major.minor.patch.rc.beta
|
// major.minor.patch.rc.beta
|
||||||
@ -11,46 +11,9 @@ buildscript {
|
|||||||
]
|
]
|
||||||
|
|
||||||
setup = [
|
setup = [
|
||||||
compileSdk: 28,
|
compileSdk: 30,
|
||||||
buildTools: "28.0.3",
|
|
||||||
minSdk : 16,
|
minSdk : 16,
|
||||||
targetSdk : 28
|
targetSdk : 30
|
||||||
]
|
|
||||||
|
|
||||||
versions = [
|
|
||||||
gradleAndroid : "4.0.0-beta03",
|
|
||||||
|
|
||||||
kotlin : ext.kotlin_version,
|
|
||||||
ktx : "1.2.0",
|
|
||||||
|
|
||||||
androidX : '1.0.0',
|
|
||||||
annotation : '1.1.0',
|
|
||||||
recyclerView : '1.2.0-alpha01',
|
|
||||||
material : '1.2.0-alpha05',
|
|
||||||
appcompat : '1.2.0-alpha03',
|
|
||||||
constraintLayout : '2.0.0-beta4',
|
|
||||||
cardview : '1.0.0',
|
|
||||||
gridLayout : '1.0.0',
|
|
||||||
navigation : "2.0.0",
|
|
||||||
navigationFragment: "1.0.0",
|
|
||||||
legacy : "1.0.0",
|
|
||||||
|
|
||||||
room : "2.2.5",
|
|
||||||
lifecycle : "2.2.0",
|
|
||||||
work : "2.3.4",
|
|
||||||
|
|
||||||
firebase : '17.2.2',
|
|
||||||
firebasemessaging: "20.1.3",
|
|
||||||
play_services : "17.0.0",
|
|
||||||
|
|
||||||
materialdialogs : "0.9.6.0",
|
|
||||||
materialdrawer : "817e45765c367034b03046aaea6e95eeabcb40e9",
|
|
||||||
iconics : "4.0.1",
|
|
||||||
font_cmd : "3.5.95.1-kotlin",
|
|
||||||
|
|
||||||
gifdrawable : "1.2.15",
|
|
||||||
|
|
||||||
retrofit : "2.6.4"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,8 +22,8 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "com.android.tools.build:gradle:${versions.gradleAndroid}"
|
classpath "com.android.tools.build:gradle:4.2.0-beta06"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
||||||
// 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
|
||||||
|
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
|
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.7.1-all.zip
|
||||||
|
1
navlib-font/.gitignore
vendored
Normal file
1
navlib-font/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -24,8 +24,8 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dataBinding {
|
buildFeatures {
|
||||||
enabled = true
|
dataBinding = true
|
||||||
}
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
@ -36,24 +36,21 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
implementation "androidx.annotation:annotation:${versions.annotation}"
|
implementation "androidx.appcompat:appcompat:1.2.0"
|
||||||
implementation "androidx.appcompat:appcompat:${versions.appcompat}"
|
implementation "androidx.core:core-ktx:1.3.2"
|
||||||
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
|
implementation "androidx.recyclerview:recyclerview:1.1.0"
|
||||||
implementation "androidx.core:core-ktx:${versions.ktx}"
|
implementation "com.google.android.material:material:1.3.0"
|
||||||
implementation "androidx.gridlayout:gridlayout:1.0.0"
|
|
||||||
implementation "androidx.legacy:legacy-support-v4:${versions.legacy}"
|
|
||||||
implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}"
|
|
||||||
implementation "com.google.android.material:material:${versions.material}"
|
|
||||||
|
|
||||||
api("com.github.kuba2k2:MaterialDrawer:${versions.materialdrawer}") {
|
api("com.github.kuba2k2:MaterialDrawer:817e45765c") {
|
||||||
exclude module: 'library-iconics'
|
exclude module: 'library-iconics'
|
||||||
}
|
}
|
||||||
api "com.mikepenz:community-material-typeface:${versions.font_cmd}@aar"
|
api "com.mikepenz:iconics-core:5.2.8"
|
||||||
api "com.mikepenz:iconics-core:${versions.iconics}"
|
|
||||||
implementation "com.mikepenz:materialize:1.2.1"
|
|
||||||
implementation "com.mikepenz:itemanimators:1.1.0"
|
implementation "com.mikepenz:itemanimators:1.1.0"
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
implementation "pl.droidsonroids.gif:android-gif-drawable:${versions.gifdrawable}"
|
compileOnly "pl.droidsonroids.gif:android-gif-drawable:1.2.15"
|
||||||
|
api "com.mikepenz:materialize:1.2.1"
|
||||||
|
|
||||||
implementation 'com.balysv:material-ripple:1.0.2'
|
implementation "com.balysv:material-ripple:1.0.2"
|
||||||
|
|
||||||
|
implementation project(":navlib-font")
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,9 @@ import android.widget.ImageView
|
|||||||
import androidx.annotation.ColorInt
|
import androidx.annotation.ColorInt
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import androidx.appcompat.content.res.AppCompatResources
|
import androidx.appcompat.content.res.AppCompatResources
|
||||||
import com.mikepenz.iconics.IconicsColor
|
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
import com.mikepenz.iconics.typeface.IIcon
|
import com.mikepenz.iconics.typeface.IIcon
|
||||||
|
import com.mikepenz.iconics.utils.actionBar
|
||||||
import com.mikepenz.iconics.utils.paddingDp
|
import com.mikepenz.iconics.utils.paddingDp
|
||||||
import com.mikepenz.iconics.utils.sizeDp
|
import com.mikepenz.iconics.utils.sizeDp
|
||||||
import com.mikepenz.materialdrawer.util.DrawerImageLoader
|
import com.mikepenz.materialdrawer.util.DrawerImageLoader
|
||||||
@ -99,10 +99,11 @@ open class ImageHolder : com.mikepenz.materialdrawer.holder.ImageHolder {
|
|||||||
val uri = uri
|
val uri = uri
|
||||||
|
|
||||||
when {
|
when {
|
||||||
ii != null -> icon = IconicsDrawable(ctx, ii).apply {
|
ii != null -> icon = IconicsDrawable(ctx).apply {
|
||||||
color(IconicsColor.colorList(iconColor))
|
this.icon = ii
|
||||||
sizeDp(24)
|
colorList = iconColor
|
||||||
paddingDp(paddingDp)
|
sizeDp = 24
|
||||||
|
this.paddingDp = paddingDp
|
||||||
}
|
}
|
||||||
iconRes != -1 -> icon = AppCompatResources.getDrawable(ctx, iconRes)
|
iconRes != -1 -> icon = AppCompatResources.getDrawable(ctx, iconRes)
|
||||||
uri != null -> try {
|
uri != null -> try {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package pl.szczodrzynski.navlib
|
package pl.szczodrzynski.navlib
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.drawable.LayerDrawable
|
import android.graphics.drawable.LayerDrawable
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
@ -13,8 +14,7 @@ import com.google.android.material.floatingactionbutton.ExtendedFloatingActionBu
|
|||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
import com.mikepenz.iconics.typeface.IIcon
|
import com.mikepenz.iconics.typeface.IIcon
|
||||||
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
import com.mikepenz.iconics.typeface.library.navlibfont.NavLibFont
|
||||||
import com.mikepenz.iconics.utils.colorInt
|
|
||||||
import com.mikepenz.iconics.utils.sizeDp
|
import com.mikepenz.iconics.utils.sizeDp
|
||||||
import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet
|
import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet
|
||||||
import pl.szczodrzynski.navlib.drawer.NavDrawer
|
import pl.szczodrzynski.navlib.drawer.NavDrawer
|
||||||
@ -89,11 +89,19 @@ class NavBottomBar : BottomAppBar {
|
|||||||
/**
|
/**
|
||||||
* Set the FAB's icon.
|
* Set the FAB's icon.
|
||||||
*/
|
*/
|
||||||
var fabIcon: IIcon = CommunityMaterial.Icon.cmd_android
|
var fabIcon: IIcon? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
field = value
|
field = value
|
||||||
fabView?.setImageDrawable(IconicsDrawable(context, value).colorInt(R.attr.colorFabIcon).sizeDp(24))
|
fabView?.setImageDrawable(IconicsDrawable(context).apply {
|
||||||
fabExtendedView?.icon = IconicsDrawable(context, value).colorInt(R.attr.colorFabIcon).sizeDp(24)
|
icon = value
|
||||||
|
colorAttr(context, R.attr.colorFabIcon)
|
||||||
|
sizeDp = 24
|
||||||
|
})
|
||||||
|
fabExtendedView?.icon = IconicsDrawable(context).apply {
|
||||||
|
icon = value
|
||||||
|
colorAttr(context, R.attr.colorFabIcon)
|
||||||
|
sizeDp = 24
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Set the ExtendedFAB's text.
|
* Set the ExtendedFAB's text.
|
||||||
@ -112,6 +120,7 @@ class NavBottomBar : BottomAppBar {
|
|||||||
fabExtendedView?.setOnClickListener(onClickListener)
|
fabExtendedView?.setOnClickListener(onClickListener)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
private fun create(attrs: AttributeSet?, defStyle: Int) {
|
private fun create(attrs: AttributeSet?, defStyle: Int) {
|
||||||
setOnTouchListener { _, event ->
|
setOnTouchListener { _, event ->
|
||||||
if (bottomSheet?.enable != true || bottomSheet?.enableDragToOpen != true)
|
if (bottomSheet?.enable != true || bottomSheet?.enableDragToOpen != true)
|
||||||
@ -125,20 +134,21 @@ class NavBottomBar : BottomAppBar {
|
|||||||
val icon = ContextCompat.getDrawable(context, R.drawable.ic_menu_badge) as LayerDrawable?
|
val icon = ContextCompat.getDrawable(context, R.drawable.ic_menu_badge) as LayerDrawable?
|
||||||
icon?.apply {
|
icon?.apply {
|
||||||
mutate()
|
mutate()
|
||||||
setDrawableByLayerId(R.id.ic_menu, IconicsDrawable(context)
|
setDrawableByLayerId(R.id.ic_menu, IconicsDrawable(context).apply {
|
||||||
.icon(CommunityMaterial.Icon2.cmd_menu)
|
this.icon = NavLibFont.Icon.nav_menu
|
||||||
.sizeDp(20)
|
sizeDp = 20
|
||||||
.colorInt(getColorFromAttr(context, R.attr.colorOnPrimary)))
|
colorAttr(context, R.attr.colorOnPrimary)
|
||||||
|
})
|
||||||
setDrawableByLayerId(R.id.ic_badge, BadgeDrawable(context))
|
setDrawableByLayerId(R.id.ic_badge, BadgeDrawable(context))
|
||||||
}
|
}
|
||||||
navigationIcon = icon
|
navigationIcon = icon
|
||||||
|
|
||||||
menu.add(0, -1, 0, "Menu")
|
menu.add(0, -1, 0, "Menu")
|
||||||
.setIcon(
|
.setIcon(IconicsDrawable(context).apply {
|
||||||
IconicsDrawable(context)
|
this.icon = NavLibFont.Icon.nav_dots_vertical
|
||||||
.icon(CommunityMaterial.Icon.cmd_dots_vertical)
|
sizeDp = 20
|
||||||
.sizeDp(20)
|
colorAttr(context, R.attr.colorOnPrimary)
|
||||||
.colorInt(getColorFromAttr(context, R.attr.colorOnPrimary)))
|
})
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS)
|
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS)
|
||||||
|
|
||||||
setNavigationOnClickListener {
|
setNavigationOnClickListener {
|
||||||
|
@ -5,13 +5,12 @@ import android.content.res.Configuration.ORIENTATION_PORTRAIT
|
|||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Build.VERSION.SDK_INT
|
import android.os.Build.VERSION.SDK_INT
|
||||||
import android.os.Build.VERSION_CODES.*
|
import android.os.Build.VERSION_CODES
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.View.*
|
import android.view.View.*
|
||||||
import android.view.Window
|
import android.view.Window
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.core.graphics.ColorUtils
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import com.mikepenz.materialize.util.KeyboardUtil
|
import com.mikepenz.materialize.util.KeyboardUtil
|
||||||
@ -185,12 +184,12 @@ class SystemBarsUtil(private val activity: Activity) {
|
|||||||
// #3 SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN makes the activity not resize when keyboard is open
|
// #3 SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN makes the activity not resize when keyboard is open
|
||||||
// Samsung TouchWiz - app will go fullscreen. There is a problem though, see #3.
|
// Samsung TouchWiz - app will go fullscreen. There is a problem though, see #3.
|
||||||
var targetAppFullscreen = false
|
var targetAppFullscreen = false
|
||||||
if (SDK_INT >= KITKAT) {
|
if (SDK_INT >= VERSION_CODES.KITKAT) {
|
||||||
targetAppFullscreen = true
|
targetAppFullscreen = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (SDK_INT in KITKAT until LOLLIPOP) {
|
if (SDK_INT in VERSION_CODES.KITKAT until VERSION_CODES.LOLLIPOP) {
|
||||||
// API 19-20 (KitKat 4.4) - set gradient status bar
|
// API 19-20 (KitKat 4.4) - set gradient status bar
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
|
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
|
||||||
// take FallbackGradient color
|
// take FallbackGradient color
|
||||||
@ -198,7 +197,7 @@ class SystemBarsUtil(private val activity: Activity) {
|
|||||||
// disable darker even if [statusBarDarker] == true BUT gradient fallback is not COLOR_HALF_TRANSPARENT
|
// disable darker even if [statusBarDarker] == true BUT gradient fallback is not COLOR_HALF_TRANSPARENT
|
||||||
//targetStatusBarDarker = targetStatusBarDarker && targetStatusBarFallbackGradient == COLOR_HALF_TRANSPARENT
|
//targetStatusBarDarker = targetStatusBarDarker && targetStatusBarFallbackGradient == COLOR_HALF_TRANSPARENT
|
||||||
}
|
}
|
||||||
else if (SDK_INT >= LOLLIPOP) {
|
else if (SDK_INT >= VERSION_CODES.LOLLIPOP) {
|
||||||
// API 21+ (Lollipop 5.0+) - set transparent status bar
|
// API 21+ (Lollipop 5.0+) - set transparent status bar
|
||||||
if (statusBarTranslucent) {
|
if (statusBarTranslucent) {
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
|
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
|
||||||
@ -206,17 +205,17 @@ class SystemBarsUtil(private val activity: Activity) {
|
|||||||
else {
|
else {
|
||||||
window.statusBarColor = Color.TRANSPARENT
|
window.statusBarColor = Color.TRANSPARENT
|
||||||
}
|
}
|
||||||
if (SDK_INT < M && targetStatusBarLight) {
|
if (SDK_INT < VERSION_CODES.M && targetStatusBarLight) {
|
||||||
// take FallbackLight color
|
// take FallbackLight color
|
||||||
targetStatusBarMode = TARGET_MODE_LIGHT
|
targetStatusBarMode = TARGET_MODE_LIGHT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SDK_INT >= M && targetStatusBarLight) {
|
if (SDK_INT >= VERSION_CODES.M && targetStatusBarLight) {
|
||||||
// API 23+ (Marshmallow 6.0+) - set the status bar icons to dark color if [statusBarLight] is true
|
// API 23+ (Marshmallow 6.0+) - set the status bar icons to dark color if [statusBarLight] is true
|
||||||
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
||||||
}
|
}
|
||||||
// FOR SAMSUNG/SONY DEVICES (TouchWiz 4.1-4.3)
|
// FOR SAMSUNG/SONY DEVICES (TouchWiz 4.1-4.3)
|
||||||
if (SDK_INT < KITKAT) {
|
if (SDK_INT < VERSION_CODES.KITKAT) {
|
||||||
val libs = activity.packageManager.systemSharedLibraryNames
|
val libs = activity.packageManager.systemSharedLibraryNames
|
||||||
var reflect: String? = null
|
var reflect: String? = null
|
||||||
// TODO galaxy s3 - opening keyboard does not resize activity if fullscreen
|
// TODO galaxy s3 - opening keyboard does not resize activity if fullscreen
|
||||||
@ -282,20 +281,20 @@ class SystemBarsUtil(private val activity: Activity) {
|
|||||||
|
|
||||||
// TODO navigation bar options like status bar
|
// TODO navigation bar options like status bar
|
||||||
// NAVIGATION BAR
|
// NAVIGATION BAR
|
||||||
if (SDK_INT >= KITKAT && (SDK_INT < LOLLIPOP || !navigationBarTransparent)) {
|
if (SDK_INT >= VERSION_CODES.KITKAT && (SDK_INT < VERSION_CODES.LOLLIPOP || !navigationBarTransparent)) {
|
||||||
// API 19-20 (KitKat 4.4) - set gradient navigation bar
|
// API 19-20 (KitKat 4.4) - set gradient navigation bar
|
||||||
// API 21+ (Lollipop 5.0+) - set half-transparent navigation bar if [navigationBarTransparent] is false
|
// API 21+ (Lollipop 5.0+) - set half-transparent navigation bar if [navigationBarTransparent] is false
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
|
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDK_INT >= LOLLIPOP && navigationBarTransparent) {
|
if (SDK_INT >= VERSION_CODES.LOLLIPOP && navigationBarTransparent) {
|
||||||
// API 21+ (Lollipop 5.0+) - set fully transparent navigation bar if [navigationBarTransparent] is true
|
// API 21+ (Lollipop 5.0+) - set fully transparent navigation bar if [navigationBarTransparent] is true
|
||||||
window.navigationBarColor = Color.TRANSPARENT
|
window.navigationBarColor = Color.TRANSPARENT
|
||||||
}
|
}
|
||||||
|
|
||||||
// PADDING
|
// PADDING
|
||||||
if (insetsListener != null) {
|
if (insetsListener != null) {
|
||||||
if (SDK_INT >= LOLLIPOP && false) {
|
if (SDK_INT >= VERSION_CODES.LOLLIPOP && false) {
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(insetsListener!!) { _, insets ->
|
ViewCompat.setOnApplyWindowInsetsListener(insetsListener!!) { _, insets ->
|
||||||
Log.d("NavLib", "Got insets left = ${insets.systemWindowInsetLeft}, top = ${insets.systemWindowInsetTop}, right = ${insets.systemWindowInsetRight}, bottom = ${insets.systemWindowInsetBottom}")
|
Log.d("NavLib", "Got insets left = ${insets.systemWindowInsetLeft}, top = ${insets.systemWindowInsetTop}, right = ${insets.systemWindowInsetRight}, bottom = ${insets.systemWindowInsetBottom}")
|
||||||
if (insetsApplied)
|
if (insetsApplied)
|
||||||
|
@ -120,7 +120,9 @@ fun hasNavigationBar(context: Context): Boolean {
|
|||||||
return hasNavigationBar
|
return hasNavigationBar
|
||||||
}
|
}
|
||||||
|
|
||||||
fun IconicsDrawable.colorAttr(context: Context, @AttrRes attrRes: Int) = colorInt(getColorFromAttr(context, attrRes))
|
fun IconicsDrawable.colorAttr(context: Context, @AttrRes attrRes: Int) {
|
||||||
|
colorInt = getColorFromAttr(context, attrRes)
|
||||||
|
}
|
||||||
|
|
||||||
fun getColorFromAttr(context: Context, @AttrRes color: Int): Int {
|
fun getColorFromAttr(context: Context, @AttrRes color: Int): Int {
|
||||||
val typedValue = TypedValue()
|
val typedValue = TypedValue()
|
||||||
|
@ -5,7 +5,6 @@ import android.content.Context
|
|||||||
import android.graphics.PorterDuff
|
import android.graphics.PorterDuff
|
||||||
import android.graphics.PorterDuffColorFilter
|
import android.graphics.PorterDuffColorFilter
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.system.Os.close
|
|
||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
@ -28,13 +27,12 @@ import com.google.android.material.textfield.TextInputEditText
|
|||||||
import com.google.android.material.textfield.TextInputLayout
|
import com.google.android.material.textfield.TextInputLayout
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
import com.mikepenz.iconics.typeface.IIcon
|
import com.mikepenz.iconics.typeface.IIcon
|
||||||
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
import com.mikepenz.iconics.typeface.library.navlibfont.NavLibFont
|
||||||
import com.mikepenz.iconics.utils.paddingDp
|
import com.mikepenz.iconics.utils.paddingDp
|
||||||
import com.mikepenz.iconics.utils.sizeDp
|
import com.mikepenz.iconics.utils.sizeDp
|
||||||
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem
|
|
||||||
import pl.szczodrzynski.navlib.*
|
import pl.szczodrzynski.navlib.*
|
||||||
import pl.szczodrzynski.navlib.bottomsheet.items.IBottomSheetItem
|
|
||||||
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem
|
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem
|
||||||
|
import pl.szczodrzynski.navlib.bottomsheet.items.IBottomSheetItem
|
||||||
|
|
||||||
|
|
||||||
class NavBottomSheet : CoordinatorLayout {
|
class NavBottomSheet : CoordinatorLayout {
|
||||||
@ -280,7 +278,10 @@ class NavBottomSheet : CoordinatorLayout {
|
|||||||
private fun toggleGroupGetIconicsDrawable(context: Context, icon: IIcon?): Drawable? {
|
private fun toggleGroupGetIconicsDrawable(context: Context, icon: IIcon?): Drawable? {
|
||||||
if (icon == null)
|
if (icon == null)
|
||||||
return null
|
return null
|
||||||
return IconicsDrawable(context, icon).sizeDp(24).paddingDp(4)
|
return IconicsDrawable(context, icon).apply {
|
||||||
|
sizeDp = 24
|
||||||
|
paddingDp = 4
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toggleGroupAddItem(id: Int, text: String, @DrawableRes icon: Int, defaultSortOrder: Int = SORT_MODE_ASCENDING) {
|
fun toggleGroupAddItem(id: Int, text: String, @DrawableRes icon: Int, defaultSortOrder: Int = SORT_MODE_ASCENDING) {
|
||||||
@ -337,8 +338,8 @@ class NavBottomSheet : CoordinatorLayout {
|
|||||||
}
|
}
|
||||||
button.tag = tag
|
button.tag = tag
|
||||||
button.icon = toggleGroupGetIconicsDrawable(context, when (sortingMode) {
|
button.icon = toggleGroupGetIconicsDrawable(context, when (sortingMode) {
|
||||||
SORT_MODE_ASCENDING -> CommunityMaterial.Icon2.cmd_sort_ascending
|
SORT_MODE_ASCENDING -> NavLibFont.Icon.nav_sort_ascending
|
||||||
SORT_MODE_DESCENDING -> CommunityMaterial.Icon2.cmd_sort_descending
|
SORT_MODE_DESCENDING -> NavLibFont.Icon.nav_sort_descending
|
||||||
else -> null
|
else -> null
|
||||||
})
|
})
|
||||||
if (sortingMode != null) {
|
if (sortingMode != null) {
|
||||||
@ -386,7 +387,11 @@ class NavBottomSheet : CoordinatorLayout {
|
|||||||
set(value) {
|
set(value) {
|
||||||
textInputLayout.startIconDrawable = when (value) {
|
textInputLayout.startIconDrawable = when (value) {
|
||||||
is Drawable -> value
|
is Drawable -> value
|
||||||
is IIcon -> IconicsDrawable(context, value).sizeDp(24)/*.colorInt(Color.BLACK)*/
|
is IIcon -> IconicsDrawable(context).apply {
|
||||||
|
icon = value
|
||||||
|
sizeDp = 34
|
||||||
|
// colorInt = Color.BLACK
|
||||||
|
}
|
||||||
is Int -> context.getDrawableFromRes(value)
|
is Int -> context.getDrawableFromRes(value)
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import androidx.annotation.StringRes
|
|||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.mikepenz.iconics.IconicsDrawable
|
import com.mikepenz.iconics.IconicsDrawable
|
||||||
import com.mikepenz.iconics.typeface.IIcon
|
import com.mikepenz.iconics.typeface.IIcon
|
||||||
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
|
||||||
import com.mikepenz.iconics.utils.sizeDp
|
import com.mikepenz.iconics.utils.sizeDp
|
||||||
import pl.szczodrzynski.navlib.ImageHolder
|
import pl.szczodrzynski.navlib.ImageHolder
|
||||||
import pl.szczodrzynski.navlib.R
|
import pl.szczodrzynski.navlib.R
|
||||||
@ -42,10 +41,11 @@ data class BottomSheetPrimaryItem(override val isContextual: Boolean = true) : I
|
|||||||
override fun bindViewHolder(viewHolder: ViewHolder) {
|
override fun bindViewHolder(viewHolder: ViewHolder) {
|
||||||
viewHolder.root.setOnClickListener(onClickListener)
|
viewHolder.root.setOnClickListener(onClickListener)
|
||||||
|
|
||||||
viewHolder.image.setImageDrawable(IconicsDrawable(viewHolder.text.context)
|
viewHolder.image.setImageDrawable(IconicsDrawable(viewHolder.text.context).apply {
|
||||||
.icon(iconicsIcon ?: CommunityMaterial.Icon.cmd_android)
|
icon = iconicsIcon
|
||||||
.colorAttr(viewHolder.text.context, android.R.attr.textColorSecondary)
|
colorAttr(viewHolder.text.context, android.R.attr.textColorSecondary)
|
||||||
.sizeDp(24))
|
sizeDp = 24
|
||||||
|
})
|
||||||
|
|
||||||
viewHolder.description.visibility = View.VISIBLE
|
viewHolder.description.visibility = View.VISIBLE
|
||||||
when {
|
when {
|
||||||
|
@ -1 +1 @@
|
|||||||
include ':app', ':navlib'
|
include ':app', ':navlib', ':navlib-font'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user