こんな感じのをzshrcに書く。この場合、@キーで画像が変わる。
image_list=("画像1" "画像2") # 絶対パス
image_index=1
bg() {
if [ -z "$BUFFER" ]; then
if test $image_index -eq 2; then
#!/usr/bin/env ruby | |
require 'xcodeproj' | |
require 'fileutils' | |
PROJECT = 'Unity-iPhone' | |
TARGET = 'Unity-iPhone' | |
LIBRARY = 'Libraries' | |
# システムFramework追加 |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Matrix; | |
/** | |
* 画像変換クラス | |
* | |
*/ | |
public class BitmapUtil { |
public class SampleFragment extends Fragment implements LoaderCallbacks<String> { | |
private static final int LOADER_ID = 0; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
return inflater.inflate(R.layout.fragment_main, container, false); | |
} | |
@Override |
class MainActivity : AppCompatActivity() { | |
private val viewModel: MainViewModel by viewModels() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val splashScreen = installSplashScreen() // ★ SplashScreenを適用 | |
setContentView(R.layout.activity_main) | |
splashScreen.setKeepVisibleCondition { // ★ ここでtrueを返してる間はSplashScreenが表示されたまま |
fun ConcatAdapter.findAdapter(position: Int): RecyclerView.Adapter<*>? { | |
var totalCount = 0 | |
adapters.forEach { adapter -> | |
totalCount += adapter.itemCount | |
if (position < totalCount) { | |
return adapter | |
} | |
} | |
return null | |
} |
try { | |
var xxhdpiImage = File.openDialog("Select xxxhdpi file.", "*.png", false); | |
if (xxhdpiImage == null) { | |
throw ""; | |
} | |
var doc = open(xxhdpiImage, OpenDocumentType.PNG); | |
if (doc == null) { |
#!/usr/bin/env ruby | |
require 'xcodeproj' | |
require 'fileutils' | |
PROJECT = 'Unity-iPhone' | |
TARGET = 'Unity-iPhone' | |
LIBRARY = 'Libraries' | |
LOCALIZE = 'Localize' |
// compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.16" | |
// compile "android.arch.lifecycle:runtime:1.0.0-alpha3" | |
// compile "android.arch.lifecycle:extensions:1.0.0-alpha3" | |
// kapt "android.arch.lifecycle:compiler:1.0.0-alpha3" | |
class AsyncLiveData<T> private constructor(private val exec: suspend () -> T) : LiveData<T>() { | |
private var observer: Observer<T>? = null | |
private var job: Job? = null |