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
/** | |
* Creates a linear gradient with the provided colors | |
* and angle. | |
* | |
* @param colors Colors of gradient | |
* @param stops Offsets to determine how the colors are dispersed throughout | |
* the vertical gradient | |
* @param tileMode Determines the behavior for how the shader is to fill a region outside | |
* its bounds. Defaults to [TileMode.Clamp] to repeat the edge pixels | |
* @param angleInDegrees Angle of a gradient in degrees |
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
... | |
import androidx.fragment.app.DialogFragment | |
... | |
class MyDialogFragmentDialog : DialogFragment() { | |
... | |
private val statusBarColorRes = R.color.colorPrimaryDark | |
private var previousSystemUiVisibility: Int? = null | |
... | |
override fun getTheme(): Int = R.style.FullscreenDialog | |
... |
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
InputStream is; | |
try { | |
is = openFileInput(fileName); | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
byte[] buffer = new byte[10240]; | |
int count; | |
while(-1 != (count = is.read(buffer, 0, buffer.length))) { | |
baos.write(buffer, 0, count); | |
} |