Skip to content

Instantly share code, notes, and snippets.

Avatar

Hikaru Wada sugoi-wada

View GitHub Profile
View speech_transcribe_async.py
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
View ProgressRecyclerAdapter
import android.support.v7.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import android.widget.ProgressBar
import android.widget.RelativeLayout
abstract class ProgressRecyclerAdapter<T : RecyclerView.ViewHolder> : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object {
private val VIEW_PROGRESS = 11
}
View SmoothScrollableLinearLayoutManager.kt
import android.content.Context
import android.graphics.PointF
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.LinearSmoothScroller
import android.support.v7.widget.RecyclerView
class SmoothScrollableLinearLayoutManager @JvmOverloads constructor(context: Context, orientation: Int = LinearLayoutManager.VERTICAL, reverseLayout: Boolean = false) : LinearLayoutManager(context, orientation, reverseLayout) {
View ass.sh
FILENAME="screenshot_`date \"+%Y%m%d%H%M%S\"`.png"
while getopts n: opt
do
if test $opt = "n"
then
FILENAME=${OPTARG}
fi
done
adb shell screencap -p /sdcard/$FILENAME
adb pull /sdcard/$FILENAME
You can’t perform that action at this time.