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
android { | |
signingConfigs { | |
getByName("debug") { | |
keyAlias = "debug" | |
keyPassword = "my debug key password" | |
storeFile = file("/home/miles/keystore.jks") | |
storePassword = "my keystore password" | |
} | |
create("release") { | |
keyAlias = "release" |
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
inline fun getValueAnimator(forward: Boolean = true, duration: Long, interpolator: TimeInterpolator, | |
crossinline updateListener: (progress: Float) -> Unit | |
): ValueAnimator { | |
val a = | |
if (forward) ValueAnimator.ofFloat(0f, 1f) | |
else ValueAnimator.ofFloat(1f, 0f) | |
a.addUpdateListener { updateListener(it.animatedValue as Float) } | |
a.duration = duration | |
a.interpolator = interpolator | |
return a |
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
class ToolbarBehavior : CoordinatorLayout.Behavior<AppBarLayout>() { | |
/** Consume if vertical scroll because we don't care about other scrolls */ | |
override fun onStartNestedScroll(coordinatorLayout: CoordinatorLayout, child: AppBarLayout, | |
directTargetChild: View, target: View, axes: Int, type: Int): Boolean { | |
getViews(child) | |
return axes == ViewCompat.SCROLL_AXIS_VERTICAL || | |
super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, axes, type) | |
} |
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
tabsRecyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() { | |
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { | |
totalTabsScroll += dx | |
} | |
}) | |
viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { | |
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) { | |
// Scroll tabs as viewpager is scrolled | |
val dx = (position + positionOffset) * tabItemWidth - totalTabsScroll |
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
/* | |
* Copyright 2018 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | |
* except in compliance with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under the | |
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
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
public class MediaPlayerService extends Service implements MediaPlayer.OnCompletionListener, | |
MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnSeekCompleteListener, | |
MediaPlayer.OnInfoListener, MediaPlayer.OnBufferingUpdateListener, | |
AudioManager.OnAudioFocusChangeListener { | |
public static final String ACTION_PLAY = "com.be.homsi.ACTION_PLAY"; | |
public static final String ACTION_PAUSE = "com.be.homsi.ACTION_PAUSE"; | |
public static final String ACTION_PREVIOUS = "com.be.homsi.ACTION_PREVIOUS"; | |
public static final String ACTION_NEXT = "com.be.homsi.ACTION_NEXT"; |
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
public class Inter extends Fragment implements MainView { | |
List<InterpretationModel> passages; | |
List<InterpretationModel> interlists; | |
Menu test; AudioAdapter adapters; | |
public RecyclerView mRecyclerView,recycleraudio; | |
public Recycleradapter mAdapter; | |
boolean serviceBound = false; | |
TextView textView; |
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.be.homsi.adapter; | |
import android.Manifest; | |
import android.content.BroadcastReceiver; | |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.content.ServiceConnection; | |
import android.content.SharedPreferences; |
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
infix fun <T>Boolean.then(action : () -> T): T? { | |
return if (this) | |
action.invoke() | |
else null | |
} | |
infix fun <T>T?.elze(action: () -> T): T { | |
return if (this == null) | |
action.invoke() |
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
/* | |
* Copyright (C) 2017 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder