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
| /** | |
| To solve the memory leak and crash problem caused by View.getViewTreeObserver returning different object instances | |
| */ | |
| fun View.safeViewTreeObserver(): SafeViewTreeObserver { | |
| return ViewTreeObserverRepository.get(this) | |
| } | |
| object ViewTreeObserverRepository { | |
| private val map = HashMap<View, SafeViewTreeObserver>() |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 UserPanelDialogFragment extends DialogFragment implements View.OnClickListener { | |
| private boolean isLogin = false; | |
| private TextView mRegister; | |
| private TextView mLogin; | |
| private TextView mFeedback; | |
| private TextView mUserId; | |
| private TextView mLogout; |
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
| <!-- Application theme. --> | |
| <style name="MyTheme" parent="@android:style/Theme.Holo"> | |
| <item name="android:windowActionBarOverlay">true</item> | |
| <item name="android:actionBarStyle">@style/MyTheme.ActionBar</item> | |
| <item name="android:windowContentOverlay">@null</item> | |
| <item name="android:windowBackground">@color/red_background</item> | |
| </style> | |
| <style name="MyTheme.ActionBar" parent="android:Widget.Holo.ActionBar"> | |
| <item name="android:background">@android:color/transparent</item> | |
| <item name="android:backgroundStacked">@android:color/transparent</item> |
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"?> | |
| <resources> | |
| <style name="Theme.Transparent" parent="android:Theme"> | |
| <item name="android:windowIsTranslucent">true</item> | |
| <item name="android:windowBackground">@android:color/transparent</item> | |
| <item name="android:windowContentOverlay">@null</item> | |
| <item name="android:windowNoTitle">true</item> | |
| <item name="android:windowIsFloating">true</item> | |
| <item name="android:backgroundDimEnabled">false</item> | |
| </style> |
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
| delete require.cache[require.resolve('./b.js')] | |
| var l = require('./b'); |
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
| var sha1 = crypto.createHash('sha1'); | |
| sha1.update('foo'); | |
| sha1.digest('hex'); |