Skip to content

Instantly share code, notes, and snippets.

Avatar

Muhammad Bilal BilalSiddiqui

View GitHub Profile
@BilalSiddiqui
BilalSiddiqui / gist:f8b8fa8bcd97f323a86891e89c1e071b
Created Oct 23, 2020
Searching and sorting in ArrayList of Kotlin
View gist:f8b8fa8bcd97f323a86891e89c1e071b
inMemoryCache.filter {
it.name.contains(query, true) ||
(it.description != null && it.description.contains(query, true))
}.sortedWith(compareByDescending<Repo> { it.stars }.thenBy { it.name })
View gist:adc9777f1037af36c0294c339ee1e482
ViewGroup slidingTabStrip = (ViewGroup) mTabSocial.getChildAt(0);
View tab1 = slidingTabStrip.getChildAt(1);
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) tab1.getLayoutParams();
layoutParams.weight = 1.2f;
layoutParams.width = 0;
tab1.setLayoutParams(layoutParams);