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
// 'app' module should have the application plugin. | |
apply plugin: 'com.android.application' | |
android { | |
defaultConfig { | |
... | |
// Specify the version code, only once for each new version of your app, for your App Bundle | |
// No need to have different version codes for different APKs generated. | |
// All split APKs will share the same version code once installed via Google Play. | |
versionCode 1 |
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 bapspatil.pantheon.utils; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import java.io.IOException; | |
import bapspatil.pantheon.network.RetrofitAPI; | |
import okhttp3.Cache; |
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
apply plugin: 'com.android.application' | |
android { | |
... | |
... | |
defaultConfig { | |
... | |
versionCode 2000 | |
... |
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 cacheSize = (5 x 1024 x 1024).toLong() | |
val myCache = Cache(context.cacheDir, cacheSize) | |
val okHttpClient = OkHttpClient.Builder() | |
.cache(myCache) | |
.addInterceptor { chain -> | |
var request = chain.request() | |
request = if (hasNetwork(context)!!) | |
request.newBuilder().header("Cache-Control", "public, max-age=" + 5).build() | |
else |
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.Intent; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.widget.ArrayAdapter; | |
import android.widget.Button; | |
import android.widget.ListView; | |
public class TransitionThemeActivity extends AppCompatActivity implements View.OnClickListener { |
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 okHttpClient = OkHttpClient.Builder() | |
// Specify the cache we created earlier. | |
.cache(myCache) | |
// Add an Interceptor to the OkHttpClient. | |
.addInterceptor { chain -> | |
// Get the request from the chain. | |
var request = chain.request() | |
/* |
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 bapspatil | |
*/ | |
public abstract class EndlessScrollListener extends RecyclerView.OnScrollListener { | |
// The minimum amount of items to have below your current scroll position | |
// before loading more. | |
private int visibleThreshold = 5; | |
// The current offset index of data you have loaded |
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 bapspatil | |
*/ | |
public class ExoPlayerDemoFragment extends Fragment { | |
@BindView(R.id.video_exoplayer_view) SimpleExoPlayerView mPlayerView; | |
private SimpleExoPlayer mPlayer; | |
private Unbinder unbinder; | |
public ExoPlayerDemoFragment() { |
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.mpayme.znap.core.widget; | |
import java.lang.reflect.Field; | |
import android.content.Context; | |
import android.text.SpannableStringBuilder; | |
import android.text.TextUtils; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.TextView; |
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.view.View | |
import android.widget.LinearLayout | |
import kotlinx.android.synthetic.main.inc_dec_view.view.* | |
/** | |
* Created by Bapusaheb Patil. | |
*/ | |
class IncDecView : LinearLayout, View.OnClickListener { |
NewerOlder