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
// этот файл поместить в корень проекта | |
cmake_minimum_required(VERSION 3.4.1) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") | |
// адаптировать под структуру вашего проекта | |
set(SOURCES src/main/cpp/NativeRootChecker.cpp) | |
add_library(root_checker_jni SHARED ${SOURCES}) |
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
val handler = object : Handler() { | |
fun handleMessage(jObject: JSONObject) { | |
Log.i("Example", "Success: $jObject") | |
} | |
} | |
val runnable = Runnable { | |
val result = "{\"someKey\":\"someValue\"}" | |
val jObject = JSONObject(result) | |
handler.handleMessage(jObject) |
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
data class Category(val id: Int, val name: String, val subCategories: List<SubCategory>) | |
data class SubCategory(val name: String) | |
data class Product(val value: Int, val category: SubCategory) | |
private fun getSubCategories(id: Int) = Observable.just(categories.first { it.id == id }.subCategories) | |
private fun getProductsByCategories() { | |
getSubCategories(categoryId) |
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
class MainActivity : AppCompatActivity() { | |
private lateinit var linearLayoutManager: LinearLayoutManager | |
private lateinit var viewAdapter: RecyclerView.Adapter<*> | |
private var dataset: List<String> = listOf("zero", "one", "two", "three", "four", "five", "six", "seven", "nine", "ten") | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) |