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
// DrwableMaker.kt | |
class DrawableMaker { | |
var shape: DrawableShape = DrawableShape.RECTANGLE | |
@ColorInt | |
var color: Int = 0 | |
var cornerRadius: Int = 0 | |
var cornerRadii: CornerRadii? = null | |
var gradientOrientation: GradientDrawable.Orientation = GradientDrawable.Orientation.TOP_BOTTOM | |
var gradientColors: IntArray? = null |
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
val audioPauseJavascipt = "function pauseAudioAndVideo(windowA){" + | |
" for(var i = 0; i < windowA.document.getElementsByTagName('video').length; i++){" + | |
" var media = windowA.document.getElementsByTagName('video')[i];" + | |
" media.pause(); " + | |
" media.currentTime = -1; " + | |
" media.volume = 0; " + | |
" }" + | |
" for(var i = 0; i < windowA.document.getElementsByTagName('audio').length; i++){" + | |
" var media = windowA.document.getElementsByTagName('audio')[i];" + | |
" media.pause(); " + |
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
override fun show(manager: FragmentManager, tag: String?) { | |
try { | |
val superClass = this::class.java.superclass | |
val dismissedField = superClass?.getDeclaredField("mDismissed") | |
val isShownByMeField = superClass?.getDeclaredField("mShownByMe") | |
dismissedField?.isAccessible = true | |
isShownByMeField?.isAccessible = true | |
dismissedField?.setBoolean(this, false) | |
isShownByMeField?.setBoolean(this, true) | |
dismissedField?.isAccessible = false |
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
getWindow().getDecorView().findViewById(android.R.id.content).addView(View(context)) |
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
((ViewGroup) overlayLayout.getParent()).removeView(overlayLayout); |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.simple_layout); | |
OverlayLayout overlayLayout = new OverlayLayout(this); // our overlay view | |
addContentView(overlayLayout, new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,RelativeLayout.LayoutParams.MATCH_PARENT)); | |
} |
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
@Override | |
public void addContentView(View view, ViewGroup.LayoutParams params) { | |
if (mContentParent == null) { | |
installDecor(); | |
} | |
mContentParent.addView(view, params); | |
final Callback cb = getCallback(); | |
if (cb != null && !isDestroyed()) { | |
cb.onContentChanged(); | |
} |
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
private void installDecor() { | |
if (mDecor == null) { | |
mDecor = generateDecor(); | |
mDecor.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS); | |
mDecor.setIsRootNamespace(true); | |
} | |
if (mContentParent == null) { | |
mContentParent = generateLayout(mDecor); | |
... |
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
@Override | |
public void setContentView(int layoutResID) { | |
if (mContentParent == null) { | |
installDecor(); | |
} else { | |
mContentParent.removeAllViews(); | |
} | |
mLayoutInflater.inflate(layoutResID, mContentParent); | |
final Callback cb = getCallback(); | |
if (cb != null && !isDestroyed()) { |
NewerOlder