- Open Android Studio
- Go to: Tools > Create Command-line Launcher
- Leave as default, Press OK
- Add the following lines to your
.gitconfig
| /* | |
| * Copyright 2018 Google LLC | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| import android.arch.lifecycle.GenericLifecycleObserver | |
| import android.arch.lifecycle.Lifecycle | |
| import android.arch.lifecycle.Lifecycle.Event.ON_DESTROY | |
| import android.arch.lifecycle.LifecycleOwner | |
| import kotlinx.coroutines.experimental.CoroutineScope | |
| import kotlinx.coroutines.experimental.Dispatchers | |
| import kotlinx.coroutines.experimental.Job | |
| import kotlinx.coroutines.experimental.android.Main | |
| fun Lifecycle.createJob(cancelEvent: Lifecycle.Event = ON_DESTROY): Job { |
| override fun onViewCreated(view: View?, savedInstanceState: Bundle?) { | |
| viewPagerAdapter = MLPagedScrollAdapter(childFragmentManager, fragments) | |
| fragmentViewPager = viewPager!! | |
| fragmentViewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { | |
| override fun onPageScrollStateChanged(state: Int) { | |
| viewPager.scrollState = state | |
| } |
| ## Android architecture components: Lifecycle | |
| # LifecycleObserver's empty constructor is considered to be unused by proguard | |
| -keepclassmembers class * implements android.arch.lifecycle.LifecycleObserver { | |
| <init>(...); | |
| } | |
| # ViewModel's empty constructor is considered to be unused by proguard | |
| -keepclassmembers class * extends android.arch.lifecycle.ViewModel { | |
| <init>(...); | |
| } | |
| # keep Lifecycle State and Event enums values |
| 1.Install the BEEKs app from the Play store (this is not a Google product) | |
| 2.Hold the beacon to the back of the phone (most helpful when there are >1 beacons in the room) | |
| 3.The beacon marked (NEAR) will be at the top, select that | |
| 4.When connected, a LED will glow inside the beacon | |
| 5.Scroll down to the Eddystone area | |
| 6.Two buttons, one to set the URL another to set the power/frequency | |
| 7.Suggested transmit power is -20dbm at 2 times a second |
| import java.io.IOException; | |
| import java.net.MalformedURLException; | |
| import java.net.URL; | |
| import java.security.KeyManagementException; | |
| import java.security.KeyStore; | |
| import java.security.KeyStoreException; | |
| import java.security.NoSuchAlgorithmException; | |
| import javax.net.ssl.HttpsURLConnection; | |
| import javax.net.ssl.SSLContext; |
| #!/bin/bash | |
| # $> bash icon-gen.sh <version label> <project dir> <script sub-dir> | |
| # | |
| # | |
| # process_icon version_num res_sub_dir current_work_dir target_dir | |
| process_icon(){ | |
| image_width=`identify -format %[fx:w] $3/app/src/main/res/drawable-$2/com_garena_shopee_logo_shopee_launcher.png` && let "image_width-=4" | |
| image_height=`identify -format %[fx:h] $3/app/src/main/res/drawable-$2/com_garena_shopee_logo_shopee_launcher.png` && let "image_height-=4" | |
| convert $3$4/marker.png -background '#0000' -fill white -gravity south -size 137x16 caption:$1 -composite -resize $image_widthx$image_height $3$4/intermediate.png | |
| convert -composite -gravity center $3/app/src/main/res/drawable-$2/com_garena_shopee_logo_shopee_launcher.png $3$4/intermediate.png $3$4/com_garena_shopee_logo_shopee_launcher.png |
| /** | |
| * ABOUT | |
| * Google Apps Script to post a message to Slack when someone responds to a Google Form. | |
| * | |
| * Uses Slack incoming webhooks - https://api.slack.com/incoming-webhooks | |
| * and FormsResponse - https://developers.google.com/apps-script/reference/forms/form-response | |
| * | |
| * | |
| * AUTHOR | |
| * Akash A <github.com/akash1810> |
| public class ClickToSelectEditText<T extends Listable> extends AppCompactEditText { | |
| List<T> mItems; | |
| String[] mListableItems; | |
| CharSequence mHint; | |
| OnItemSelectedListener<T> onItemSelectedListener; | |
| public ClickToSelectEditText(Context context) { | |
| super(context); |