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 leetcode | |
| import org.junit.Test | |
| import kotlin.test.assertEquals | |
| internal class RomanToIntegerTest { | |
| val sut = RomanToInteger() |
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
| // Get drawable object | |
| val mDivider = ContextCompat.getDrawable(mWatchListRcv.context, R.drawable.divider_vertical) | |
| // Create a DividerItemDecoration whose orientation is Horizontal | |
| val hItemDecoration = DividerItemDecoration(mWatchListRcv.context, | |
| DividerItemDecoration.VERTICAL) | |
| // Set the drawable on it | |
| hItemDecoration.setDrawable(mDivider!!) | |
| // val mDividerItemDecoration = DividerItemDecoration(mWatchListRcv.context, | |
| // linearLayoutManager.orientation) |
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
| // Implements swipe to delete | |
| ItemTouchHelper helper = new ItemTouchHelper( | |
| new ItemTouchHelper.SimpleCallback(0, | |
| (ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT)) { | |
| @Override | |
| public boolean onMove(RecyclerView rV, | |
| RecyclerView.ViewHolder viewHolder, | |
| RecyclerView.ViewHolder target) { | |
| return false; | |
| } |
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 localDate = Date() | |
| val localDateTimeFormat2 = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US) | |
| localDateTimeFormat2.timeZone = TimeZone.getTimeZone("America/New_York") | |
| val day = localDateTimeFormat2.format(localDate) | |
| val localDateTime = LocalDateTime.parse(day, | |
| DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")) | |
| Timber.d("localdate is $localDateTime dayOfMonth ${localDateTime.dayOfMonth}" + | |
| " month ${localDateTime.month} " + | |
| " hour ${localDateTime.hour}") |
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
| items = SortedList<Watchlist>(Watchlist::class.java, object : SortedList.Callback<Watchlist>() { | |
| override fun areItemsTheSame(item1: Watchlist?, item2: Watchlist?): Boolean { | |
| return item1 == item2 | |
| } | |
| override fun onMoved(fromPosition: Int, toPosition: Int) { | |
| notifyItemMoved(fromPosition, toPosition) | |
| } | |
| override fun onChanged(position: Int, count: Int) { |
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.stockstotrade.ui.watchlist.singlewatchlist | |
| import android.content.Context | |
| import android.content.Intent | |
| import android.content.IntentFilter | |
| import android.os.Handler | |
| import android.os.Looper | |
| import android.os.Parcelable | |
| import android.view.Gravity | |
| import android.view.LayoutInflater |
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
| private fun configTextView(textView: TextView, textValue: String): TextView { | |
| return textView.apply { | |
| text = textValue | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
| setTextAppearance(R.style.AppText_Light) | |
| } else { | |
| setTextAppearance(context, R.style.AppText_Light) | |
| } | |
| setPadding(dpToPx(10), dpToPx(10), dpToPx(10), dpToPx(10)) | |
| } |
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 kz.senim.ui.module.buspayment.history | |
| import android.databinding.ObservableArrayList | |
| import android.databinding.ObservableBoolean | |
| import android.databinding.ObservableList | |
| import kz.senim.common.util.delay | |
| import kz.senim.data.api.response.PaginationPage | |
| import kz.senim.data.api.util.ApiCaller | |
| import kz.senim.data.entity.BusTicket | |
| import kz.senim.data.entity.Role |
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 kz.senim.ui.widget | |
| import android.content.Context | |
| import android.databinding.BindingAdapter | |
| import android.graphics.Canvas | |
| import android.graphics.Paint | |
| import android.graphics.drawable.GradientDrawable | |
| import android.support.annotation.ColorInt | |
| import android.support.annotation.ColorRes | |
| import android.text.TextPaint |
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 kz.senim.ui.module.buspayment.common.widget | |
| import android.content.Context | |
| import android.databinding.BindingAdapter | |
| import android.support.annotation.StringRes | |
| import android.support.v7.widget.AppCompatImageView | |
| import android.support.v7.widget.AppCompatTextView | |
| import android.util.AttributeSet | |
| import android.view.Gravity | |
| import android.view.Gravity.* |
NewerOlder