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 onBackPressed() { | |
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); | |
if (drawer.isDrawerOpen(GravityCompat.START)) { | |
// If the drawer is open close the drawer | |
drawer.closeDrawer(GravityCompat.START); | |
} else { | |
// Otherwise do the back pressed operation | |
super.onBackPressed(); | |
} |
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 textToReplace = "Original"; | |
var replacementText = "Replaced"; | |
document.body.innerHTML = document.body.innerHTML.replace(new RegExp(textToReplace, "gi"), replacementText); | |
// "gi" in the RegExp is to make the replacement global and case insensitive |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 21 | |
buildToolsVersion "21.1.1" | |
defaultConfig { | |
applicationId "com.example.app" | |
minSdkVersion 16 | |
targetSdkVersion 21 |
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="AppTheme" parent="android:Theme.Material"> | |
<!--Cannot be transparent--> | |
<item name="android:colorPrimary">@color/colorPrimary</item> | |
<!--Can be transparent--> | |
<item name="android:colorPrimaryDark">@color/colorPrimaryDark</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> | |
<color name="red_50">#fde0dc</color> | |
<color name="red_100">#f9bdbb</color> | |
<color name="red_200">#f69988</color> | |
<color name="red_300">#f36c60</color> | |
<color name="red_400">#e84e40</color> | |
<color name="red_500">#e51c23</color> | |
<color name="red_600">#dd191d</color> | |
<color name="red_700">#d01716</color> |
NewerOlder