紙面だとコマンド入力が辛い部分も多いかと思いますので、コピー&ペーストを行うためのコマンド群を用意しました。
参考に紙面を読み進めてもらえればと思います。
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 'package:flutter/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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
#!/bin/bash | |
for branch in `git branch -r` | |
do | |
if [[ $branch != *"->"* ]] | |
then | |
echo $branch | |
git ls-tree -r $branch | grep --color -ns $1 | |
fi | |
done |
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
final ApiService service = retrofit.create(ApiService.class); | |
service.login() | |
.subscribeOn(Schedulers.newThread()) | |
.observeOn(Schedulers.newThread()) | |
.flatMap(response -> { | |
if (response.getErrCode != 0) { | |
return null; | |
} | |
return service.getDataFromWeb(); | |
}) |
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
new Runnable() { | |
@Override | |
public void run() { | |
OkHttpClient.Builder builder = new OkHttpClient.Builder(); | |
final Map<String, CachingAuthenticator> authCache = new ConcurrentHashMap<>(); | |
final DigestAuthenticator authenticator = new DigestAuthenticator(new Credentials("hoge", "fuga")); | |
OkHttpClient client = builder.authenticator(authenticator) | |
.addInterceptor(new AuthenticationCacheInterceptor(authCache)) | |
.build(); | |
Retrofit retrofit = new Retrofit.Builder() |
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
TOP_LOCAL_PATH:= $(call my-dir) | |
LOCAL_PATH:= $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE_TAGS := optional | |
LOCAL_JAVACFLAGS := -processor butterknife.internal.ButterKnifeProcessor | |
LOCAL_STATIC_JAVA_LIBRARIES := \ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:paddingBottom="@dimen/activity_vertical_margin" |
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
package uselibrary.sample.kobashin.com.uselibrary_sample; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.widget.Button; | |
import butterknife.Bind; | |
import butterknife.ButterKnife; | |
import butterknife.OnClick; |
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
class Sample(){ | |
private val writer: PrintWriter by lazy { | |
val name = SimpleDateFormat("yyyyMMdd_HHmmss'.log'").format(Date(System.currentTimeMillis())) | |
PrintWriter(BufferedWriter(FileWriter(File("${Environment.getExternalStorageDirectory()}/$name")))) | |
} | |
} |
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
class CustomDialogFragment : DialogFragment() { | |
interface OnDialogActionListerner { | |
fun onPositiveButtonClicked() | |
fun onNegativeButtonClicked() | |
} | |
class Builder { |
NewerOlder