This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME} | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
import android.view.ViewGroup | |
#end | |
#parse("File Header.java") | |
class ${NAME}(private var items: MutableList<${ITEM_TYPE}>): RecyclerView.Adapter<${VIEWHOLDER}>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ${VIEWHOLDER} { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
/** | |
* Created by Windows on 16-01-2015. | |
*/ | |
/* | |
* Copyright 2014 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity | |
import android.support.annotation.IdRes | |
import android.view.View | |
fun <T : View> Activity.bind(@IdRes idRes: Int): Lazy<T> { | |
@Suppress("UNCHECKED_CAST") | |
return unsafeLazy { findViewById(idRes) as T } | |
} | |
fun <T : View> View.bind(@IdRes idRes: Int): Lazy<T> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.Nullable; | |
import android.util.Base64; | |
import java.nio.ByteBuffer; | |
import java.security.SecureRandom; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.mobileapplab.datademo; | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.database.sqlite.SQLiteOpenHelper; | |
/** | |
* Class that wraps the most common database operations. This example assumes you want a single table and data entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package despotoski.nikola.appbarlayoutsamples.view; | |
import android.animation.IntEvaluator; | |
import android.animation.ValueAnimator; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.design.widget.AppBarLayout; | |
import android.support.design.widget.CoordinatorLayout; | |
import android.support.v4.view.ViewCompat; | |
import android.support.v4.view.ViewPropertyAnimatorCompat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DatePickerFragment extends DialogFragment | |
implements DatePickerDialog.OnDateSetListener { | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
// Use the current date as the default date in the picker | |
final Calendar c = Calendar.getInstance(); | |
final int year = c.get(Calendar.YEAR); | |
final int month = c.get(Calendar.MONTH); | |
final int day = c.get(Calendar.DAY_OF_MONTH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright 2016 Google Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.videointro; | |
import java.io.IOException; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.AssetFileDescriptor; | |
import android.media.MediaPlayer; | |
import android.os.Build; | |
import android.util.AttributeSet; |
OlderNewer