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=".TutorialActivity" | |
android:theme="@style/WelcomeScreenTheme"> |
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
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
AlertDialog.Builder(applicationContext) | |
.setTitle("title") | |
.setView(R.layout.view_scrollable_text) | |
.setPositiveButton( | |
"OK" | |
) { _, _ -> |
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
<manifest> | |
<application> | |
: | |
(中略) | |
: | |
<meta-data | |
android:name="com.google.android.gms.ads.APPLICATION_ID" | |
android:value="ADMOB_APP_ID"/> | |
</application> |
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
<application | |
android:icon="@mipmap/ic_launcher" | |
/> |
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 ScaleTransformation( | |
private val scale: Float | |
) : Transformation { | |
override fun transform(source: Bitmap?): Bitmap? { | |
source ?: return null | |
//1倍にするとcreateBitmapしてもsourceを返そうとして死ぬ | |
if (scale == 1f) { | |
return source |
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 MainActivity : Activity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) | |
} | |
} |
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 android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.media.AudioManager | |
class HeadsetEventReceiver :BroadcastReceiver() { | |
override fun onReceive(context: Context?, intent: Intent?) { | |
if (intent == null || intent.action != Intent.ACTION_HEADSET_PLUG) { | |
return |
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
private fun setAppMuted(muteState: Boolean) { | |
val audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager | |
audioManager.setStreamMute(AudioManager.STREAM_MUSIC, muteState) | |
} |
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
alias screenrecord="adb shell screenrecord --bit-rate 10000000 /sdcard/screen.mp4; sleep 3; adb pull /sdcard/screen.mp4 /tmp/screen.mp4; adb shell rm /sdcard/screen.mp4; open /tmp/screen.mp4" |
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
# -*- coding:utf-8 -*- | |
import os | |
from bottle import route, run | |
@route('/hello/') | |
def hello(): | |
return "Hello World" |
NewerOlder