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
| @Preview | |
| @Composable | |
| private fun DashedDividerPreview() { | |
| DashedDivider( | |
| color = Color.Black, | |
| thickness = 1.dp, | |
| modifier = Modifier | |
| .fillMaxWidth() | |
| .padding(16.dp) | |
| ) |
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.content.res.Resources; | |
| import androidx.annotation.IntDef; | |
| import androidx.annotation.NonNull; | |
| import java.lang.annotation.Retention; | |
| import java.lang.annotation.RetentionPolicy; | |
| public final class CompatUtils { | |
| @Retention(RetentionPolicy.SOURCE) |
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.support.v7.widget.RecyclerView | |
| import android.view.View | |
| interface OnItemClickListener { | |
| fun onItemClicked(position: Int, view: View) | |
| } | |
| fun RecyclerView.addOnItemClickListener(onClickListener: OnItemClickListener) { | |
| this.addOnChildAttachStateChangeListener(object: RecyclerView.OnChildAttachStateChangeListener { | |
| override fun onChildViewDetachedFromWindow(view: View?) { |
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
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| maven { | |
| url 'https://oss.sonatype.org/content/repositories/snapshots/' | |
| } | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:0.9.+' | |
| classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT' |
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.app.Activity; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.pm.ResolveInfo; | |
| import android.content.res.AssetFileDescriptor; | |
| import android.database.Cursor; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.graphics.Matrix; | |
| import android.media.ExifInterface; |
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
| FullScreenDialog dialog = new FullScreenDialog(); | |
| FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | |
| dialog.show(ft, FullScreenDialog.TAG); |
- Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
- Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
- A fairly complete shortcut list can be found here.
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
| package com.example.anothersignintest; | |
| import com.google.android.gms.auth.api.Auth; | |
| import com.google.android.gms.auth.api.signin.GoogleSignInAccount; | |
| import com.google.android.gms.auth.api.signin.GoogleSignInOptions; | |
| import com.google.android.gms.auth.api.signin.GoogleSignInResult; | |
| import com.google.android.gms.common.ConnectionResult; | |
| import com.google.android.gms.common.api.GoogleApiClient; | |
| import com.google.android.gms.common.api.OptionalPendingResult; | |
| import com.google.android.gms.common.api.ResultCallback; |
NewerOlder