Skip to content

Instantly share code, notes, and snippets.

View ludovicroland's full-sized avatar

Ludovic ROLAND ludovicroland

View GitHub Profile
@ludovicroland
ludovicroland / PULL_REQUEST_TEMPLATE
Created April 29, 2019 08:21 — forked from riggaroo/PULL_REQUEST_TEMPLATE
Pull request template format. Add this file to your .github folder
<!--- Provide a general summary of your changes in the Title above -->
<!--- If there is no changelog entry, label this PR as trivial to bypass the Danger warning -->
## Description
<!--- Describe your changes in detail -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState)
verticalLayout {
padding = dip(30)
editText {
hint = "Name"
textSize = 24f
import kotlinx.android.synthetic.main.search_fragment.*
class SearchFragment : Fragment(), View.OnClickListener
{
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View
{
return inflater.inflate(R.layout.search_fragment, container, false)
}
<?xml version="1.0" encoding="utf-8"?>
<Button
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/validate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/validate"
/>
if(compassView is ImageView)
{
compassView.scaleType = ImageView.ScaleType.CENTER_INSIDE
}
open class CompassActivity : AppCompatActivity()
{
protected open fun onBroadcastReceiver(context: Context, intent: Intent)
{
//...
}
}
val calendar = Calendar.getInstance() //final Calendar calendar = Calendar.getInstance()
var calendar = Calendar.getInstance() //Calendar calendar = Calendar.getInstance()
fun myFunction(a: Int)
{
//...
}
{
val a: Int? = null
//…
myFunction(a!!)
}
fun myFunction(a: Int)
{
//...
}
{
val a: Int? = null
//…
myFunction(a)
}
val length = array?.size ?: -1