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
<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
public class UpdateChecker { | |
private static final String KEY_LATEST_VERSION_CODE = "latestVersionCode"; | |
private static final String KEY_SHOW_NOTIFICATION_FLAG = "showNotificationFlag"; | |
private static final String KEY_NOTIFICATION_TICKER = "notificationTicker"; | |
private static final String KEY_NOTIFICATION_TITLE = "notificationTitle"; | |
private static final String KEY_NOTIFICATION_CONTENT = "notificationContent"; | |
private int mConfigId; | |
public UpdateChecker(int configId) { |
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=".MainActivity" | |
android:label="${label}" | |
android:theme="@style/AppTheme.NoActionBar"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN"/> | |
<category android:name="android.intent.category.LAUNCHER"/> | |
</intent-filter> | |
</activity> |
NewerOlder