View WhiteNotificationBar_BlackIcons
This file contains 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
Window window = this.getWindow(); | |
// clear FLAG_TRANSLUCENT_STATUS flag: | |
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); | |
// add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window | |
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); | |
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); | |
// finally change the color |
View SectionWithHeader.txt
This file contains 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
This is how you set up a custom layout in kotlin, with a linearlayout and 3 textviews but these are embedded so a little | |
trick here to get the properties setters and getters needs to be done. May not be the most efficient way but it works | |
attrs.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<declare-styleable name="DetailSectionHeaderText"> | |
<attr name="title" format="string" /> |
View gist:8ab2fdea6e269726a253761571986665
This file contains 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
1. Create a new package in your app with name android.support.v4.app This is a workaround to override package-private methods. | |
2. Create or Edit your Own ServiceClass to Override dequeueWork() method and surround super.dequeueWork() call with try/catch block like the coming snippet. | |
Any code that uses JobIntent Service override with this class | |
(Important Note: This fix should be tracked from time to time as any change in the support libraries might break it.) | |
public abstract class MyServiceImpl extends JobIntentService { | |
// This method is the main reason for the bug and crash | |
// the dequeueWork method is called only when the worker service is done |
View gist:57150b22f724006bb9303e25a161cc53
This file contains 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
Most code I saw for this was to create custom layout. Project I did not want to do this but do it for only a specific activity. Here is how to do it in the activity in onStart() | |
override fun onStart() { | |
super.onStart() | |
val toolbarViewGroup = findViewById<ViewGroup>(R.id.action_bar) // standard action layout from theme | |
toolbarViewGroup?.let{ viewGroup -> | |
// find the textview title since its in combined layout | |
val textView = viewGroup.children.find { (it is TextView) } as TextView |
View RecordVideoInAppium.txt
This file contains 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
// So I found out that its not easy to do this without the right code. | |
// Funny thing is that it puts a recording on the phone with some random name.mp4 | |
// The hard thing was actually saving it locally. | |
// When you stop the recording its in a string 64 base you have to decode and then write that byte array to a file. | |
protected void screenRecordVideo() throws InterruptedException, IOException { | |
if (platform == OperatingSystem.ANDROID) { | |
((CanRecordScreen)driver).startRecordingScreen( | |
new AndroidStartScreenRecordingOptions() | |
.withVideoSize("1280x720") |