This file contains hidden or 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.app.Service; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.os.Bundle; | |
import android.os.IBinder; | |
import android.support.v4.content.LocalBroadcastManager; |
This file contains hidden or 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
/** | |
* Checkstyle tasks | |
* Usage: | |
* - place this file under root dir of your project at /gradle directory | |
* - apply script from your gradle file: | |
* apply from : "{rootDir}/gradle/checkstyle.gradle" | |
* | |
* To configure checkstyle use configs at: | |
* "{rootDir}/config/checkstyle/checkstyle.xml" - for main projects | |
* "{rootDir}/config/checkstyle/checkstyle-test.xml" - for tests |
This file contains hidden or 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
// Using Lambdas on Kotlin | |
val items = ArrayList<String>() | |
items.sortBy { item -> | |
item.length() | |
} | |
//or more implicity | |
items.sortBy { it.length() } | |
//------------------------------------------------------------------------------ |
This file contains hidden or 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.v7.widget.RecyclerView; | |
public class RecyclerViewSwipeListener extends RecyclerView.OnFlingListener { | |
private static final int SWIPE_VELOCITY_THRESHOLD = 2000; | |
boolean mIsScrollingVertically; | |
// change swipe listener depending on whether we are scanning items horizontally or vertically | |
RecyclerViewSwipeListener(boolean vertical) { |
This file contains hidden or 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.some.site.dialpad | |
import android.content.Context | |
import android.os.Bundle | |
import android.view.KeyEvent | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.activity.result.contract.ActivityResultContracts | |
import androidx.fragment.app.Fragment |