Skip to content

Instantly share code, notes, and snippets.

View akshay3015's full-sized avatar

akshay shahane akshay3015

View GitHub Profile
@akshay3015
akshay3015 / attrs.xml
Created December 15, 2017 07:16 — forked from iZiMO/attrs.xml
Colour palette theme
<declare-styleable name="CategoryTheme">
<attr name="light_base" format="color" />
<attr name="base" format="color" />
<attr name="light" format="color" />
<attr name="ultra_light" format="color" />
<attr name="medium_dark" format="color" />
<attr name="dark" format="color" />
<attr name="ultra_dark" format="color" />
</declare-styleable>
@akshay3015
akshay3015 / attrs.xml
Created December 15, 2017 07:16 — forked from iZiMO/attrs.xml
Colour palette styleable
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="ColourPalette">
<attr name="light_base" format="color" />
<attr name="base" format="color" />
<attr name="light" format="color" />
<attr name="ultra_light" format="color" />
<attr name="medium_dark" format="color" />
<attr name="dark" format="color" />
@akshay3015
akshay3015 / vector.xml
Created December 15, 2017 07:16 — forked from iZiMO/vector.xml
Vector referencing colour palette
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="360dp"
android:height="230dp"
android:viewportWidth="360"
android:viewportHeight="230">
<path
android:fillColor="?attr/medium_dark"
android:pathData="..." />
@akshay3015
akshay3015 / setTheme.java
Created December 15, 2017 07:16 — forked from iZiMO/setTheme.java
Set activity theme based on card category
public class CardDetailActivity extends AppCompatActivity {
public static final String EXTRA_CARD = "card";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Card card = getIntent().getParcelableExtra(EXTRA_CARD);
setTheme(card.category.getThemeId());
public static void setSnackBar(View coordinatorLayout, String snackTitle) {
Snackbar snackbar = Snackbar.make(coordinatorLayout, snackTitle, Snackbar.LENGTH_SHORT);
snackbar.show();
View view = snackbar.getView();
TextView txtv = (TextView) view.findViewById(android.support.design.R.id.snackbar_text);
txtv.setGravity(Gravity.CENTER_HORIZONTAL);
}
public class ConnectivityReceiver
extends BroadcastReceiver {
public static ConnectivityReceiverListener connectivityReceiverListener;
public ConnectivityReceiver() {
super();
}
@Override
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
package com.example.android.popularmoviesstageone;
import timber.log.Timber;
/**
* Created by akshayshahane on 05/08/17.
*/
public class PopularMoviesApplication extends android.app.Application {
android:clickable="true"
android:background="?attr/selectableItemBackground"
*
Set yourself up:
1) Install SDKMAN - http://sdkman.io/
2) Install Groovy: sdk install groovy
3) Start the groovy console by typing: groovyConsole
*/
// Single line comments start with two forward slashes