Skip to content

Instantly share code, notes, and snippets.

Studying android dev-skills.

Ji Sungbin jisungbin

Studying android dev-skills.
View GitHub Profile
View final_module_gradle.gradle
apply plugin: ''
apply plugin: 'kotlin-android'
android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
View useless_dependency.gradle
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles ""
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), ''
View useless_testing_dependencies.gradle
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
jisungbin /
Created Oct 16, 2020 — forked from liangzhitao/
Add column spacing in RecyclerView with GridLayoutManager

Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.

import android.view.View;

View Date.toCalendar()
fun Date.toCalendar(): Calendar {
val calendar = Calendar.getInstance()
calendar.time = this
return calendar
jisungbin / Data+PrettyPrint.swift
Created Sep 22, 2020 — forked from cprovatas/Data+PrettyPrint.swift
Pretty print JSON string from Data in Swift 4.1 (especially useful printing to Xcode console)
View Data+PrettyPrint.swift
import Foundation
extension Data {
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription
guard let object = try? JSONSerialization.jsonObject(with: self, options: []),
let data = try? object, options: [.prettyPrinted]),
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil }
return prettyPrintedString
View ImagePath.kt
fun getAllShownImagesPath(activity: Activity): MutableList<Uri> {
val uriExternal: Uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI
val cursor: Cursor?
val columnIndexID: Int
val listOfAllImages: MutableList<Uri> = mutableListOf()
val projection = arrayOf(MediaStore.Images.Media._ID)
var imageId: Long
cursor = activity.contentResolver.query(uriExternal, projection, null, null, null)
if (cursor != null) {
columnIndexID = cursor.getColumnIndexOrThrow(MediaStore.Images.Media._ID)
View 메봇호출벨.js
const CHANNEL_ID = "call_owner";
const ignoreActionName = "msgbot.call_owner.ignore";//그냥 시스템 전반적으로 유니크하게 하시면 됩니다.
const replyActionName="msgbot.call_owner.reply";
const replyKey="key_reply";
const bot = BotManager.getCurrentBot();
let repliers={};
View android_material_design_colours.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- google's material design colours from -->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
jisungbin /
Created May 7, 2020 — forked from lifeparticle/
Custom Edittext with Line Number
package rupantor.cusedittext;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;