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
package x5.ru.domain.interactor.report | |
import io.reactivex.Observable | |
import io.reactivex.Single | |
import io.reactivex.rxkotlin.Singles | |
import ru.x5.core.domain.Resource | |
import ru.x5.core.domain.ioResourceFlow | |
import x5.ru.domain.interactor.user.SubordinatesUseCase | |
import x5.ru.domain.model.entity.mvi.Report | |
import x5.ru.domain.roles.RoleAttributes |
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
package io.github.vladimirmi.internetradioplayer.ui | |
import android.content.Context | |
import android.util.AttributeSet | |
import androidx.viewpager.widget.ViewPager | |
import com.google.android.material.tabs.TabLayout | |
import io.github.vladimirmi.internetradioplayer.extensions.getScreenSize | |
import java.lang.reflect.Field | |
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
private void setupScrolling() { | |
NestedScrollView scroll = findViewById(R.id.movie_details_scroll); | |
CollapsingToolbarLayout collapsing = findViewById(R.id.toolbar_layout); | |
boolean canScroll = Utils.canScroll(scroll); | |
int scrollFlags = 0; | |
if (canScroll) { | |
scrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | | |
AppBarLayout.LayoutParams.SCROLL_FLAG_EXIT_UNTIL_COLLAPSED; | |
} |
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
def secretsProperties = new Properties() | |
secretsProperties.load(new FileInputStream("secrets.properties")) | |
android { | |
defaultConfig { | |
buildConfigField("String", "API_KEY", "\"${secretsProperties['apiKey']}\"") | |
} | |
} |
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 for maintaining global application state. | |
*/ | |
public class App extends Application { | |
private static DataManager sDataManager; | |
@Override | |
public void onCreate() { |
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 <T> bind(lifecycle: Observable<Lifecycle>, | |
mainThreadScheduler: Scheduler, | |
state: Observable<T>, | |
viewAction: (T) -> Unit) { | |
lifecycle | |
.filter { CREATE } | |
.switchMap { state } | |
.observeOn(mainThreadScheduler) | |
.takeUntil(lifecycle.filter { DESTROY }) | |
.subscribe(viewAction) |
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
public String getDeviceId() { | |
String m_szDevIDShort = "35" | |
+ // we make this look like a valid IMEI | |
Build.BOARD.length() % 10 + Build.BRAND.length() % 10 | |
+ Build.CPU_ABI.length() % 10 + Build.DEVICE.length() % 10 | |
+ Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 | |
+ Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 | |
+ Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 | |
+ Build.TAGS.length() % 10 + Build.TYPE.length() % 10 | |
+ Build.USER.length() % 10; // 13 digits |