Skip to content

Instantly share code, notes, and snippets.

View safaorhan's full-sized avatar
👋
Hey.

Safa Orhan safaorhan

👋
Hey.
View GitHub Profile
@safaorhan
safaorhan / uninstall-youtube.txt
Created July 6, 2023 06:28
How to uninstall YouTube app via adb
The first command uninstalls updates and clears data.
The second command uninstalls the system app all together.
Run commands in this order to get rid of YouTube forever.
--
adb uninstall com.google.android.youtube
adb shell pm uninstall --user 0 com.google.android.youtube
@safaorhan
safaorhan / MainActivity.kt
Created April 21, 2022 19:25
Log the fragment back stack status with each change for debugging purposes.
// Adapted from: https://stackoverflow.com/a/67267584/3539594
private fun listenNavigationChanges() {
val navHost = supportFragmentManager.findFragmentById(R.id.container) as NavHostFragment
val navController = navHost.navController
navController.addOnDestinationChangedListener { _, destination, _ ->
val breadcrumb = navController
.backQueue
.map {
@safaorhan
safaorhan / testf
Created March 2, 2022 09:26
Creates a test function
@Test
fun `$FUNCTION_NAME$`() {
$END$
}
@safaorhan
safaorhan / AndroidManifest.xml
Created August 6, 2021 09:12
Adding internet permission
<manifest ...
<uses-permission android:name="android.permission.INTERNET" /> <!-- ADD THIS LINE -->
<application
...
@safaorhan
safaorhan / build.gradle
Created August 6, 2021 09:08
Retrofit Dependencies
implementation 'com.squareup.retrofit2:retrofit:2.9.0' // 1
implementation 'com.squareup.retrofit2:converter-gson:2.9.0' // 2
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' // 3
// 1: Core Retrofit library
// 2: Converter to serialize / deserialize json
// 3: An optional interceptor to let you see request and response in your Logcat
// Don't forget to use the latest versions of the libraries above.
Job brief
We are looking for an Android Developer who possesses a passion for pushing mobile technologies to the limits. This Android app developer will work with our team of talented engineers to design and build the next generation of our mobile applications. Android programming works closely with other app development and technical teams.
Responsibilities
Design and build advanced applications for the Android platform
Collaborate with cross-functional teams to define, design, and ship new features
Work with outside data sources and APIs
Unit-test code for robustness, including edge cases, usability, and general reliability
Work on bug fixing and improving application performance
Continuously discover, evaluate, and implement new technologies to maximize development efficiency
@safaorhan
safaorhan / ViewPager2Hack.kt
Created February 11, 2020 13:45
Disables the child attach listener so that inflated children with wrap_content heights can pass.
/**
* Disables the child attach listener so that inflated children with wrap_content heights can pass.
*
* This is very fragile and depends on the implementation details of [ViewPager2].
*
* @see ViewPager2.enforceChildFillListener (the removed listener)
*/
private fun ViewPager2.hackMatchParentCheckInViewPager() {
(getChildAt(0) as RecyclerView).clearOnChildAttachStateChangeListeners()
}
@safaorhan
safaorhan / viewPagerHack.kt
Last active October 18, 2019 13:10
Disables the child attach listener so that inflated children with wrap_content heights can pass.
/**
* Disables the child attach listener so that inflated children with wrap_content heights can pass.
*
* This is very fragile and depends on the implementation details of [ViewPager2].
*
* @see ViewPager2.enforceChildFillListener (the removed listener)
*/
private fun ViewPager2.removeMatchParentCheckForChildren() {
(getChildAt(0) as RecyclerView).clearOnChildAttachStateChangeListeners()
}
@safaorhan
safaorhan / mail-settings.md
Created June 21, 2018 21:47
Yandex pop3 and smtp settings for custom domains

Incoming mail

user name — name@example.com
mail server address — pop.yandex.com
connection security — SSL
port — 995

Outgoing mail

@safaorhan
safaorhan / dict-tr-TR.txt
Created June 14, 2018 11:13
Turkish word list, with circumflexes removed. This dictionary is extracted from aspell.
This file has been truncated, but you can view the full file.
o
aba
abu
ebe
oba
obua
ibibiği
ibibik
ebabil
ebebulguru