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
let button = document.createElement('button'); | |
button.textContent = "Start"; | |
button.onclick = function () { | |
doSomeWork().then(value => { | |
alert(value); | |
}).catch(err => { | |
alert(err); | |
}) | |
} |
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
for view in (self.navigationController?.navigationBar.subviews)! { | |
if let findClass = NSClassFromString("_UINavigationBarContentView") { | |
if view.isKind(of: findClass) { | |
if let barView = self.navigationItem.leftBarButtonItem?.value(forKey: "view") as? UIView { | |
let highlightController = MDCFeatureHighlightViewController(highlightedView: barView, completion: completion) | |
highlightController.titleText = "Current location" | |
highlightController.bodyText = "Tap here to change pickup location to your current location" | |
highlightController.titleColor = UIColor.white | |
highlightController.bodyColor = UIColor.white | |
highlightController.outerHighlightColor = UIColor.darkGray.withAlphaComponent(kMDCFeatureHighlightOuterHighlightAlpha) |
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
//Send a broadcast | |
String TAG = "your_custom_tag"; | |
Intent intent = new Intent(TAG); | |
intent.putExtra("data_key","data_value"); | |
getActivity().sendBroadcast(intent); | |
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
package com.project.rise; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import android.graphics.Typeface; | |
import android.os.Bundle; | |
import android.support.design.widget.CoordinatorLayout; | |
import android.support.design.widget.TabLayout; | |
import android.support.v4.view.ViewPager; |
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
package adapters; | |
import android.content.Context; | |
import android.graphics.Typeface; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
import android.widget.TextView; |