For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
This file contains hidden or 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
| # Set up adb to use tcpip port | |
| adb tcpip 5555 | |
| # Default device ip when it's used as a portable hotspot | |
| adb connect 192.168.43.1 | |
| # List connected devices | |
| adb devices |
This file contains hidden or 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.EditText; | |
| /** | |
| * Original: | |
| * An EditText, which notifies when something was cut/copied/pasted inside it. | |
| * @author Lukas Knuth | |
| * @version 1.0 | |
| * |
This file contains hidden or 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
| class Geo(private val lat: Double, private val lon: Double) { | |
| companion object { | |
| const val earthRadiusKm: Double = 6372.8 | |
| } | |
| /** | |
| * Haversine formula. Giving great-circle distances between two points on a sphere from their longitudes and latitudes. | |
| * It is a special case of a more general formula in spherical trigonometry, the law of haversines, relating the | |
| * sides and angles of spherical "triangles". |
This file contains hidden or 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
| webView.setWebViewClient(new WebViewClient() { | |
| @Override | |
| public boolean shouldOverrideUrlLoading(WebView view, String url) { | |
| String cookieStr = CookieManager.getInstance().getCookie(url); // android.webkit.CookieManager | |
| storeCookies(url, cookieStr); | |
| return super.shouldOverrideUrlLoading(view, url); | |
| } | |
| // Convert cookie string into a list of cookies. Persist cookies in a java.net.CookieStore |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <item | |
| android:top="-6dp" | |
| android:left="-6dp" | |
| android:right="-6dp" | |
| android:bottom="0dp"> | |
| <shape android:shape="rectangle"> | |
| <solid android:color="#88FFFF00"/> |
This file contains hidden or 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.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.graphics.Canvas; | |
| import android.graphics.Matrix; | |
| import android.graphics.Paint; | |
| import android.media.ExifInterface; | |
| import android.os.AsyncTask; | |
| import android.os.Environment; |
This file contains hidden or 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
| /* | |
| * Copyright (c) 2017 Emil Davtyan | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files (the | |
| * "Software"), to deal in the Software without restriction, including | |
| * without limitation the rights to use, copy, modify, merge, publish, | |
| * distribute, sublicense, and/or sell copies of the Software, and to | |
| * permit persons to whom the Software is furnished to do so, subject to | |
| * the following conditions: |
This file contains hidden or 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 static class ExampleViewHolder extends RecyclerView.ViewHolder | |
| implements View.OnClickListener { | |
| private int originalHeight = 0; | |
| private boolean isViewExpanded = false; | |
| private YourCustomView yourCustomView | |
| public ExampleViewHolder(View v) { | |
| super(v); | |
| v.setOnClickListener(this); |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
| <!-- Drop Shadow Stack --> | |
| <item> | |
| <shape> | |
| <padding | |
| android:bottom="1dp" | |
| android:left="1dp" | |
| android:right="1dp" |
NewerOlder