Skip to content

Instantly share code, notes, and snippets.

View rakshakhegde's full-sized avatar

Rakshak R.Hegde rakshakhegde

View GitHub Profile
import kotlin.reflect.KFunction1
import kotlin.test.assertEquals
fun main() {
assertSums(::makeSum)
assertSums(::makeSum2)
assertSums(::makeSum3)
}
fun assertSums(kFunction1: KFunction1<List<Int>, List<Int>>) {
@rakshakhegde
rakshakhegde / my-layout.xml
Last active May 19, 2018 11:03
Setting hint color of `TextInputLayout`
<android.support.design.widget.TextInputLayout
android:theme="@style/PickupEditTextHint"
>
<android.support.design.widget.TextInputEditText />
</android.support.design.widget.TextInputLayout>
@ColorListVariableMethod(limitedToValues = {0xFF00b47c, 0xFF3f51b5, 0xFFf44336})
public void setIndicatorColor(Integer indicatorColor) {
indicator.setIndicatorColor(indicatorColor);
}
@BooleanVariableMethod(initialValue = true)
public void showLabels(Boolean showLabels) {
indicator.showLabels(showLabels);
}
@RangeVariableMethod(minValue = 6, maxValue = 70, initialValue = 20)
public void setLabelSize(Float fontSize) { // Float? in Kotlin
indicator.setLabelSize(fontSize);
}
// These 2 lines can be done in Application class
RemixerInitialization.initRemixer(getApplication());
Remixer.getInstance().setSynchronizationMechanism(new LocalStorage(getApplicationContext()));
RemixerBinder.bind(this); // pass an Activity instance
final FloatingActionButton remixerButton = findViewById(R.id.remixerButton);
RemixerFragment.newInstance().attachToFab(this, remixerButton);
// or attach to button, swipe up gesture or even a phone shake
// https://github.com/material-foundation/material-remixer-android/blob/develop/docs/CONFIGURE_UI.md
@rakshakhegde
rakshakhegde / remixer build.gradle
Last active September 10, 2017 13:01
Remixer snippets
compile 'com.github.material-foundation.material-remixer-android:remixer:1.0'
annotationProcessor 'com.github.material-foundation.material-remixer-android:remixer_annotation:1.0'
package com.example.android_transition_samples.app;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
@rakshakhegde
rakshakhegde / FusedLocationEnabler.kt
Last active May 30, 2017 07:23
If GPS disabled, show dialog to enable GPS and provide location updates: FusedLocationEnabler using Lifecycle from Arch Components
package me.rakshakhegde.locationapp
import android.app.Activity
import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver
import android.arch.lifecycle.OnLifecycleEvent
import android.content.IntentSender
import android.location.Location
import android.os.Bundle
import android.util.Log
import time
from selenium import webdriver
import csv
import urllib.request
driver = webdriver.Chrome()
driver.implicitly_wait(5)
base_url = "https://baseurl/login/"
verificationErrors = []
accept_next_alert = True