フロントエンドを楽にするために
Qiitaを支えたい技術 at 時雨祭
- HN: mizchi
- Qiitaの方からきました(入社半年たったらしい)
- Reactオジサンはそろそろ飽きてきた
- Angularに興味が無いのでこっちにきた
| Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar); | |
| //Title and subtitle | |
| toolbar.setTitle("MY toolbar"); | |
| toolbar.setSubtitle("Subtitle"); | |
| //Menu | |
| toolbar.inflateMenu(R.menu.toolbar_menu); | |
| toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { |
| import com.google.auto.value.AutoValue; | |
| import java.lang.annotation.Retention; | |
| import java.lang.annotation.Target; | |
| import static java.lang.annotation.ElementType.TYPE; | |
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| /** | |
| * Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization. | |
| * <p> |
| /* | |
| * Copyright (C) 2014 The Android Open Source Project | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| import android.graphics.*; | |
| import com.squareup.picasso.Transformation; | |
| /** | |
| * Transforms an image into a circle representation. Such as a avatar. | |
| */ | |
| public class CircularTransformation implements Transformation | |
| { | |
| int radius = 10; |
| public class ColoredSnackBar { | |
| private static final int red = 0xfff44336; | |
| private static final int green = 0xff4caf50; | |
| private static final int blue = 0xff2195f3; | |
| private static final int orange = 0xffffc107; | |
| private static View getSnackBarLayout(Snackbar snackbar) { | |
| if (snackbar != null) { |
| Permissionのファイルは | |
| /data/system/users/{userId}/runtime-permissions.xml | |
| ここにこういうのが入ってる | |
| ```runtime-permissions.xml | |
| <?xml version='1.0' encoding='utf-8' standalone='yes' ?> | |
| <runtime-permissions> | |
| <pkg name="com.android.launcher"> |
| // You can place it in the root build.gradle | |
| allprojects { | |
| tasks.withType(JavaForkOptions) { | |
| // Forked processes like GradleWorkerMain for tests won't steal focus! | |
| jvmArgs '-Djava.awt.headless=true' | |
| } | |
| } |
| history = [] | |
| while history != [0, 0, 0, 0, 1] do | |
| n = rand(2) | |
| history.push(n) | |
| history.shift if history.size > 5 | |
| puts n == 0 ? 'ズン' : 'ドコ' | |
| end | |
| puts 'キ・ヨ・シ!' |
Author: Michael Zeng