CLICK ME
yes, even hidden code blocks!
print("hello world!")| import android.content.Context | |
| import android.net.ConnectivityManager | |
| import android.net.NetworkCapabilities | |
| import android.os.Build | |
| val Context.isConnected: Boolean | |
| get() { | |
| val connectivityManager = this.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
| return when { | |
| Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> { |
| apply plugin: 'com.android.application' | |
| apply from: "$rootDir/common.gradle" | |
| apply plugin: 'androidx.navigation.safeargs.kotlin' | |
| android { | |
| defaultConfig { | |
| applicationId app_config.app_id | |
| setProperty("archivesBaseName", app_config.archive_file) | |
| } |
| import android.annotation.TargetApi; | |
| import android.content.Context; | |
| import android.content.res.ColorStateList; | |
| import android.graphics.Canvas; | |
| import android.graphics.Color; | |
| import android.graphics.Paint; | |
| import android.os.Build; | |
| import android.text.Editable; | |
| import android.util.AttributeSet; | |
| import android.util.TypedValue; |
You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.
The RecyclerView has to use a GridLayoutManager.
This is a porting of the class SimpleSectionedListAdapter provided by Google
If you are looking for a sectioned list RecyclerView.Adapter you can take a look here
| /* | |
| * Copyright (c) 2017 Emil Davtyan | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files (the | |
| * "Software"), to deal in the Software without restriction, including | |
| * without limitation the rights to use, copy, modify, merge, publish, | |
| * distribute, sublicense, and/or sell copies of the Software, and to | |
| * permit persons to whom the Software is furnished to do so, subject to | |
| * the following conditions: |
| /* | |
| * Copyright (c) 2017 Emil Davtyan | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files (the | |
| * "Software"), to deal in the Software without restriction, including | |
| * without limitation the rights to use, copy, modify, merge, publish, | |
| * distribute, sublicense, and/or sell copies of the Software, and to | |
| * permit persons to whom the Software is furnished to do so, subject to | |
| * the following conditions: |