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
fun <Model, VH : RecyclerView.ViewHolder> ListAdapter<Model, VH>.getVisibleItemsInUi( | |
layoutManager: RecyclerView.LayoutManager | |
): List<Model>? { | |
if (layoutManager is LinearLayoutManager) { | |
val firstViewPosition = layoutManager.findFirstVisibleItemPosition() | |
val lastViewPosition = layoutManager.findLastVisibleItemPosition() | |
return currentList.slice(firstViewPosition..lastViewPosition) | |
} | |
return null | |
} |
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 EmptyInterceptor @Inject constructor() : Interceptor { | |
override fun intercept(chain: Interceptor.Chain): Response { | |
val request: Request = chain.request() | |
val builder = request.newBuilder() | |
return chain.proceed(builder.build()) | |
} | |
} |
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
import os | |
import subprocess | |
import time | |
from pydub import AudioSegment | |
DIRECTORY_PATH = "D:/asr-ı saadet radyo tiyatrosu" | |
ONE_SECOND = 1000 | |
AUDIO_PREFIX_TO_TRIM = 40 * ONE_SECOND |
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
if (isCurrentLanguageRTL) { | |
etEmail.doOnTextChanged { text, start, before, count -> | |
etEmail.setSelection(0) | |
} | |
} |
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
if(isCurrentLanguageRTL) { | |
textView.gravity = Gravity.END | |
} |
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
override fun onRtlPropertiesChanged(layoutDirection: kotlin.Int) { | |
super.onRtlPropertiesChanged(layoutDirection) | |
//do magic | |
} |
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
val layoutDirection = context.resources.configuration.layoutDirection | |
val viewLayoutDirection = view.layoutDirection | |
if (layoutDirection == View.LAYOUT_DIRECTION_RTL){ | |
//do stuff | |
} |
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
willLoadHtmlData = if(isCurrentLanguageRTL) <html dir=\"rtl\"><body> $mainHtmlData </body></html> else $mainHtmlData |
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
TabLayoutMediator(mTabLayout, mViewPager) { tab, position -> | |
tab.text = it[position].title | |
}.attach() |
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
lateinit var user: User | |
val args: HomeFragmentArgs by navArgs() | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
user = args.user | |
} | |
override fun onCreateView( | |
inflater: LayoutInflater, container: ViewGroup?, |
NewerOlder