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 io.navendra.player | |
class MediaSourceBuilder { | |
//Build various MediaSource depending upon the type of Media for a given video/audio uri | |
fun build(uri: Uri): MediaSource { | |
val userAgent = PlayerConstants.USER_AGENT | |
val lastPath = uri.lastPathSegment?:"" | |
val defaultHttpDataSourceFactory = DefaultHttpDataSourceFactory(userAgent) |
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
Stream.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | |
.filter(input -> { | |
Log.d("Lazy test", "Filtering: " + input); | |
return input > 5; | |
}) |
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.volokh.danylo.video_player_manager; | |
import com.volokh.danylo.video_player_manager.player_messages.Message; | |
import com.volokh.danylo.video_player_manager.utils.Logger; | |
import java.util.List; | |
import java.util.Queue; | |
import java.util.concurrent.ConcurrentLinkedQueue; | |
import java.util.concurrent.Executor; | |
import java.util.concurrent.Executors; |
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
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView); |
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
import java.text.SimpleDateFormat | |
import java.util.* | |
/** | |
* Pattern: yyyy-MM-dd HH:mm:ss | |
*/ | |
fun Date.formatToServerDateTimeDefaults(): String{ | |
val sdf= SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()) | |
return sdf.format(this) | |
} |
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
<RelativeLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="16dp"> | |
<TextView | |
android:text="I’m in this corner" | |
android:layout_height="wrap_content" | |
android:layout_width="wrap_content" |
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
import android.os.Bundle | |
import android.support.annotation.LayoutRes | |
import android.support.v4.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import com.arellomobile.mvp.MvpDelegate | |
import com.google.android.gms.maps.GoogleMap | |
import com.google.android.gms.maps.MapView | |
import com.google.android.gms.maps.OnMapReadyCallback |
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
private void mixSound() throws IOException { | |
AudioTrack audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_16BIT, 44100, AudioTrack.MODE_STREAM); | |
InputStream in1=getResources().openRawResource(R.raw.track1); | |
InputStream in2=getResources().openRawResource(R.raw.track2); | |
byte[] music1 = null; | |
music1= new byte[in1.available()]; | |
music1=convertStreamToByteArray(in1); | |
in1.close(); |
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
activity_main.xml: | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center" | |
android:orientation="vertical"> | |
<Button |
NewerOlder