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
fun main() { | |
val state = State.DataLoaded | |
val newState = state + UserInputs.OnRetryClick | |
println(newState) | |
} | |
sealed class State{ | |
abstract operator fun plus(userInputs: UserInputs): State | |
object DataLoaded : State() { |
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
<item name="android:windowTranslucentStatus">true</item> | |
<item name="android:windowTranslucentNavigation">true</item> |
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
mTopPanel.animate().translationY(0); | |
mTopPanel.animate().translationY(500); |
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
// Sample code to measure code execution time. | |
void onBindViewHolder(){ | |
long startTime = System.currentTimeMillis(); | |
// Your code | |
long endTime = System.currentTimeMillis(); | |
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
# | |
# Sample CircleCI 2.0 configuration for Android | |
# | |
version: 2 | |
jobs: | |
build: | |
working_directory: ~/code | |
docker: | |
- image: circleci/android:api-28 | |
environment: |
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 org.webrtc.EglBase; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
/* | |
* Uses reflection to interact with non public class EglBaseProvider. | |
*/ | |
public class EglBaseProviderReflectionUtils { |
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
Date d=new Date(); | |
SimpleDateFormat sdf=new SimpleDateFormat("dd:MM:yyyy hh:mm:ss"); | |
String date=sdf.fomat(date); |
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
Scanner sn=null; | |
try{ | |
sn=new Scanner(new File("c://file.txt")); | |
} | |
catch(Exception e){ | |
} | |
while(sn.hasNextLine()){ | |
String line=sn.nextLine(); | |
String datas[]=line.split(";");// If data in split | |
System.out.println("Name"+data[0]+"Number"+data[1]); |
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
File f=new File("C://new.txt"); | |
FileWriter fw=null; | |
BufferedWriter bw=null; | |
String data="Data to be stored in new.txt"; | |
if(!f.exists()){ | |
try{ | |
f.createNewFile(); | |
} | |
catch(Exception e){ | |
System.out.println(e.getMessage()); |
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
std::cout << std::setfill ('*') << std::setw (10); | |
std::cout << 5 <<std::endl; | |
NewerOlder