- Use spaces to fill in the gaps between words.
- Each line should contain as many words as possible.
- Use '\n' to separate lines.
- Gap between words can't differ by more than one space.
- Lines should end with a word not a space.
- '\n' is not included in the length of a line.
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
/** | |
* Kotlin Extensions for simpler, easier and funw way | |
* of launching of Activities | |
*/ | |
inline fun <reified T : Any> Activity.launchActivity ( | |
requestCode: Int = -1, | |
options: Bundle? = null, | |
noinline init: Intent.() -> Unit = {}) | |
{ |
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
class LifecycleGetter<T : View>(var lifecycleOwner: LifecycleOwner, var view: T) | |
fun <T : View> T.observe(lifecycleOwner: LifecycleOwner): LifecycleGetter<T> { | |
return LifecycleGetter(lifecycleOwner, this) | |
} | |
fun <T : TextView> LifecycleGetter<T>.liveText(liveData: LiveData<String>): LifecycleGetter<T> { | |
liveData.observe(lifecycleOwner, Observer { | |
this.view.text = it | |
}) |
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
// Usage: | |
// drawable1.bytesEqualTo(drawable2) | |
// drawable1.pixelsEqualTo(drawable2) | |
// bitmap1.bytesEqualTo(bitmap1) | |
// bitmap1.pixelsEqualTo(bitmap2) | |
fun <T : Drawable> T.bytesEqualTo(t: T?) = toBitmap().bytesEqualTo(t?.toBitmap(), true) | |
fun <T : Drawable> T.pixelsEqualTo(t: T?) = toBitmap().pixelsEqualTo(t?.toBitmap(), true) |
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
var shouldShowRequestPermissionRational = false | |
for(permission in permissions) { | |
if (shouldShowRequestPermissionRationale(permission)) { | |
shouldShowRequestPermissionRational = true | |
break | |
} | |
} |
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 Balram Pandey on 12/29/16. | |
*/ | |
public class EncryptionInterceptor implements Interceptor { | |
private static final String TAG = EncryptionInterceptor.class.getSimpleName(); | |
private static final boolean DEBUG = true; |
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.novonetworks.eng.core.util; | |
/* | |
* Created by orange on 2016-12-29. | |
*/ | |
import android.util.Log; | |
import com.crashlytics.android.Crashlytics; |
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
android.permission.ACCESS_ALL_DOWNLOADS | |
android.permission.ACCESS_BLUETOOTH_SHARE | |
android.permission.ACCESS_CACHE_FILESYSTEM | |
android.permission.ACCESS_CHECKIN_PROPERTIES | |
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY | |
android.permission.ACCESS_DOWNLOAD_MANAGER | |
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED | |
android.permission.ACCESS_DRM_CERTIFICATES | |
android.permission.ACCESS_EPHEMERAL_APPS | |
android.permission.ACCESS_FM_RADIO |
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
#!/bin/bash | |
function monitor_adb () { | |
adb start-server | |
echo "[$(date)] adb started" | |
while [ "$(adb shell echo 1)" ]; do sleep 5; done | |
echo "[$(date)] adb is broken, restarting" |
NewerOlder