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
/** | |
* created by Mohammad Reza Eram | |
*/ | |
class VideoPlayerWebChromeClient(private val activity: Activity) : WebChromeClient() { | |
private var mCustomView: View? = null | |
private var mCustomViewCallback: CustomViewCallback? = null | |
@Suppress("MagicNumber") | |
override fun getDefaultVideoPoster(): Bitmap? { |
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 ir.eram.printexample; | |
import android.app.ProgressDialog; | |
import android.bluetooth.BluetoothAdapter; | |
import android.bluetooth.BluetoothClass; | |
import android.bluetooth.BluetoothDevice; | |
import android.graphics.Color; | |
import android.graphics.drawable.ColorDrawable; | |
import android.os.AsyncTask; | |
import android.os.Bundle; |
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 eram.ir.camerapager | |
import android.animation.ValueAnimator | |
import android.app.Activity | |
import android.content.Context | |
import android.support.v4.app.FragmentActivity | |
import android.support.v4.view.ViewPager | |
import android.util.AttributeSet | |
import android.util.Log | |
import android.view.MotionEvent |
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
DEV=enp4s0 | |
GW=$(ip route list | sed "s/.* via \([0-9.]*\) dev $DEV.*/\1/;t;d"|head -1) | |
route add -host git.mycompany.com gw $GW $DEV |
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
Remap Super(left) to ctrl left: | |
remove mod4 = Super_L | |
add control = Super_L |
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 kotlinx.coroutines.* | |
import kotlinx.coroutines.channels.consumeEach | |
import kotlinx.coroutines.flow.MutableStateFlow | |
import kotlinx.coroutines.flow.broadcastIn | |
import kotlinx.coroutines.test.runBlockingTest | |
import org.junit.Test | |
class StateFlowBroadcastTest { |
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 kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.FlowPreview | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.flow.MutableStateFlow | |
import kotlinx.coroutines.flow.collect | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.test.runBlockingTest | |
import org.junit.Test | |
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 kotlinx.coroutines.* | |
import kotlinx.coroutines.channels.BroadcastChannel | |
import kotlinx.coroutines.channels.consume | |
import kotlinx.coroutines.test.runBlockingTest | |
import org.junit.Test | |
class BroadcastChannelTest { | |
@ExperimentalCoroutinesApi | |
companion object { |
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 eram.ir.camerapager | |
import android.os.Bundle | |
import android.support.v4.app.Fragment | |
import kotlinx.android.synthetic.main.camera_fragment.* | |
import android.view.* | |
import android.widget.FrameLayout | |
import android.animation.ValueAnimator | |
import android.content.res.Resources | |
import android.view.animation.DecelerateInterpolator |