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
| void main() { | |
| List<String> hello = ['1','2','3']; | |
| print(hello); | |
| } |
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
| fun <T> LiveData<T>.observeOnce(lifecycleOwner: LifecycleOwner, observer: Observer<T>) { | |
| observe(lifecycleOwner, object : Observer<T> { | |
| override fun onChanged(t: T?) { | |
| observer.onChanged(t) | |
| removeObserver(this) | |
| } | |
| }) | |
| } | |
| //Using | |
| liveData.observeOnce(this, Observer<Password> { |
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 github.kaierwen.android.dateutildemo | |
| import java.util.* | |
| /** | |
| * 日期时间工具类 | |
| * | |
| * @since 2021/8/7 | |
| */ | |
| class MyDateTimeUtil { |
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 class SoftInputAssist { | |
| private View rootView; | |
| private ViewGroup contentContainer; | |
| private ViewTreeObserver viewTreeObserver; | |
| private ViewTreeObserver.OnGlobalLayoutListener listener = () -> possiblyResizeChildOfContent(); | |
| private Rect contentAreaOfWindowBounds = new Rect(); | |
| private FrameLayout.LayoutParams rootViewLayout; | |
| private int usableHeightPrevious = 0; | |
| public SoftInputAssist(Activity activity) { |
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.voxelbusters.nativeplugins.helpers; | |
| import android.app.Activity; | |
| import android.graphics.Rect; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import android.view.ViewTreeObserver; | |
| import android.view.WindowManager; | |
| import com.voxelbusters.nativeplugins.helpers.interfaces.IKeyboardListener; |
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.setOnTouchListener(new View.OnTouchListener() | |
| { | |
| @Override | |
| public boolean onTouch(View v, MotionEvent event) | |
| { | |
| int actionEvent = event.getAction(); | |
| switch (actionEvent) | |
| { | |
| case MotionEvent.ACTION_DOWN: | |
| case MotionEvent.ACTION_UP: |
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
| android.support.v7.widget.util.SortedListAdapterCallback | androidx.recyclerview.widget.SortedListAdapterCallback | |
|---|---|---|
| android.support.v7.widget.helper.ItemTouchUIUtilImpl | androidx.recyclerview.widget.ItemTouchUIUtilImpl | |
| android.support.v7.widget.helper.ItemTouchUIUtil | androidx.recyclerview.widget.ItemTouchUIUtil | |
| android.support.v7.widget.helper.ItemTouchHelper | androidx.recyclerview.widget.ItemTouchHelper | |
| android.support.v7.widget.WithHint | androidx.appcompat.widget.WithHint | |
| android.support.v7.widget.ViewUtils | androidx.appcompat.widget.ViewUtils | |
| android.support.v7.widget.ViewStubCompat | androidx.appcompat.widget.ViewStubCompat | |
| android.support.v7.widget.ViewInfoStore | androidx.recyclerview.widget.ViewInfoStore | |
| android.support.v7.widget.ViewBoundsCheck | androidx.recyclerview.widget.ViewBoundsCheck | |
| android.support.v7.widget.VectorEnabledTintResources | androidx.appcompat.widget.VectorEnabledTintResources |