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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center_horizontal" | |
android:orientation="vertical"> | |
<android.support.design.widget.AppBarLayout | |
android:id="@+id/app_bar_layout" |
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
MyApi.Builder builder = new MyApi.Builder(new NetHttpTransport(), new AndroidJsonFactory(), null) | |
.setApplicationName("<my package name>") | |
.setRootUrl(<my root URL>) | |
.setGoogleClientRequestInitializer(new MyApiRequestInitializer(<my API key>)); |
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
extension UIColor { | |
func toHex() -> String { | |
var r:CGFloat = 0 | |
var g:CGFloat = 0 | |
var b:CGFloat = 0 | |
var a:CGFloat = 0 | |
getRed(&r, green: &g, blue: &b, alpha: &a) | |
let rgb:Int = (Int)(r*255)<<16 | (Int)(g*255)<<8 | (Int)(b*255)<<0 |
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
... | |
<activity | |
android:name=".FullscreenVideoActivity" | |
android:configChanges="orientation|keyboardHidden|screenSize" | |
android:label="@string/app_name" | |
android:theme="@style/FullscreenTheme" /> | |
... |
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
import Foundation | |
extension Data { | |
func toString() -> String { | |
if let string = String(data: self, encoding: .utf8) { | |
return string | |
} else { | |
return map { String(format: "%02X", $0) }.joined() | |
} | |
} |