Skip to content

Instantly share code, notes, and snippets.

Avatar

Nurseiit Tursunkulov NurseyitTursunkulov

  • Bishkek Kyrgyzstan (Central Asia)
View GitHub Profile
View MainViewModel.xml
class MainViewModel(
val lonLatOfBishkek: LonLat,
private val app: Application,
val mainUseCase: MainUseCase,
private val loginUseCase: LoginUseCase,
presenterState: MainPresenterState,
globalNavigationState: GlobalNavigationState
) : AndroidViewModel(app), SuggestSession.SuggestListener,
MainPresenterState by presenterState,
View gist:6a7f497c56cb051b9c6ffb8707896c35
class MainMapsFragment : Fragment(), CameraListener {
var lonLatOfBishkek: LonLat = LonLat(42.831698, 74.621554)
private val MAPKIT_API_KEY = "5e4b8c11-3756-4222-ae2d-062f9e631c4f"
private var mapObjects: MapObjectCollection? = null
private val DRAGGABLE_PLACEMARK_CENTER = Point(42.831698, 74.621554)
private lateinit var searchManager: SearchManager
val viewModel: MainViewModel by sharedViewModel()
View LocationDisplayFragment
class LocationDisplayFragment : Fragment(R.layout.fragment_location_display) {
val viewModel: MainViewModel by sharedViewModel()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
tv_display_pickup.setOnClickListener {
with(viewModel) {
currentIsPickupLocation = true
openBottomSheetFragment()
View location.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
View content_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".android.ui.main.MainActivity"
tools:showIn="@layout/activity_main">
View Main.kt
var count = 0
fun main(args: Array<String>) {
getKardsFromUser()
val kards = getKardsFromUser()
howManyTimesVasyaLookedKards(kards)
println(count)
View Main.java
package com.company;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
static int counter = 0;