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
val dataJSONStr = """ | |
{ | |
"name": "Pavneet", | |
"occupation": "Software Engineer" | |
} | |
""".trimIndent() | |
val mapper = ObjectMapper() | |
println(mapper.readValue(dataJSONStr, Person::class.java)) |
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 android.content.Context | |
import android.util.AttributeSet | |
import android.widget.FrameLayout | |
import kotlin.math.max | |
/** | |
* Created by Pavneet_Singh on 2020-02-19. | |
*/ | |
class MaxChildHeightFrameLayout @JvmOverloads constructor( |
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 test.myapplication; | |
import static org.junit.Assert.*; | |
/** | |
* Created by Pavneet Singh on 11/14/2017. | |
* Email : Pavneet.edu@gmail.com | |
*/ | |
public class 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
public class AppNavigationTest { | |
@Rule | |
public ActivityTestRule<NewsActivity> activityTestRule = | |
new ActivityTestRule<>(NewsActivity.class); | |
@Before | |
public void registerIdlingResource() { | |
// let espresso know to synchronize with background tasks | |
IdlingRegistry.getInstance().register(EspressoTestingIdlingResource.getIdlingResource()); |
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
public class EspressoTestingIdlingResource { | |
private static final String RESOURCE = "GLOBAL"; | |
private static CountingIdlingResource mCountingIdlingResource = | |
new CountingIdlingResource(RESOURCE); | |
public static void increment() { | |
mCountingIdlingResource.increment(); | |
} |
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
Retrofit retrofit = new Retrofit.Builder().baseUrl(Navigation_Url).addConverterFactory(GsonConverterFactory.create()).build(); | |
CountryArrayAPI api = retrofit.create(CountryArrayAPI.class); | |
Call<List> call = api.getCountries(); | |
call.enqueue(new Callback<List>() { | |
@Override | |
public void onResponse(Call<List> call, Response<List> response) { | |
Gson gson = new Gson(); | |
try { |
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
public interface CountryArrayAPI { | |
@GET("/api/popular_destinations") | |
public Call<List> getCountries(); | |
} |
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 com.example.miccy.myapplication; | |
import android.os.AsyncTask; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.widget.TextView; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; |
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 com.pavneet.myapplication; | |
import android.animation.AnimatorSet; | |
import android.animation.ObjectAnimator; | |
import android.graphics.Point; | |
import android.os.Handler; | |
import android.os.Message; | |
import android.support.annotation.Nullable; | |
import android.support.v7.app.AppCompatActivity; | |
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 com.pavneet.myapplication; | |
import android.animation.AnimatorSet; | |
import android.animation.ObjectAnimator; | |
import android.graphics.Point; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.support.v7.widget.Toolbar; | |
import android.view.Display; | |
import android.view.View; |