Skip to content

Instantly share code, notes, and snippets.

View SergeyBurlaka's full-sized avatar
🤠

Serg Burlaka SergeyBurlaka

🤠
View GitHub Profile
@SergeyBurlaka
SergeyBurlaka / dimens.xml
Created March 1, 2018 06:30 — forked from bopbi/dimens.xml
android dimens bootstrap
<resources>
<dimen name="text_xsmall">8sp</dimen>
<dimen name="text_smaller">10sp</dimen>
<dimen name="text_small">12sp</dimen>
<dimen name="text_medium">14sp</dimen>
<dimen name="text_large">16sp</dimen>
<dimen name="text_larger">18sp</dimen>
<dimen name="text_xlarge">20sp</dimen>
<dimen name="text_xxlarge">22sp</dimen>
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;
@Override
public void loadData(final IDataWorkerCallback dataWorkerCallback) {
String remoteListId = PrefProvider.getInstance().getGroupIdListFirebase();
Query lotsIdQuery = refDb.child(BATTLERS_GROUP_ITEM).child(remoteListId);
lotsIdQuery.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
List<FighterGroupFB> fighterGroupFBs = new ArrayList<>();
for (DataSnapshot singleSnapshot : dataSnapshot.getChildren())//get node with Product_ID
@SergeyBurlaka
SergeyBurlaka / ServiceConnection.java
Last active April 1, 2018 11:18
ServiceConnection.java
/*INIT TCP and UDP SERVERS*/
@Override
public void startReceiving() {
if (mServerState != SERVER_STARTED) {
mServerState = SERVER_STARTED;
//TCP Service
Intent tcpServiceIntent = new Intent(mContext.getApplicationContext(), TcpServerService.class);
mContext.startService(tcpServiceIntent);
mContext.bindService(tcpServiceIntent, mStartTcpServerConnection, Context.BIND_AUTO_CREATE);
public class FighterGroupFB {
/**
* Firebase fields
*/
@PropertyName("id")
Long id;
@PropertyName("irebaseId")
String firebaseId;
@PropertyName("mixId")
Long mixId;
private inner class MuAudioWorkerThread internal constructor(name: String) : HandlerThread(name) {
private var mHandler = Handler()
fun prepareHandler() {
mHandler = Handler(looper)
}
fun postTask(task: Runnable) {
mHandler.post(task)
SimpleDateFormat("dd MMM yyyy", Locale.getDefault())
public void write(){
fos = new FileOutputStream(file);
int length;
byte[] buf = new byte[8192];
while ((length = dis.read(buf, 0, buf.length)) != -1) {
fos.write(buf, 0, length);
sumProgress = sumProgress + length;
}
}
@Expose
@SerializedName("senderId")
var id: String? = PrefProvider.userId
@Expose
@SerializedName("senderName")
var name: String? = PrefProvider.userName
@Expose
@SerializedName("senderType")
open class TourInfoRequest : SystemContent() {
@Expose
@SerializedName("id")
var id: String? = ""
@Expose
@SerializedName("name")
var name: String? = ""