Skip to content

Instantly share code, notes, and snippets.

View mikehibm's full-sized avatar
🏠
Working from home

Mike I mikehibm

🏠
Working from home
View GitHub Profile
package com.example.mireversi;
import android.app.Activity;
import android.os.Bundle;
public class GameActivity extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@mikehibm
mikehibm / main.xml
Created August 16, 2011 06:59
GameActivityのXMLファイル
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<FrameLayout
android:id="@+id/frame"
android:layout_width="fill_parent"
@mikehibm
mikehibm / winner.xml
Created August 16, 2011 07:05
ゲーム終了時の結果表示の為のアニメーション定義
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillEnabled="true"
android:fillAfter="true"
>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="2000"
@mikehibm
mikehibm / GameActivity.java
Created August 16, 2011 07:19
TextViewにAnimationを適用
Animation mAnimWinner = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAnimWinner = AnimationUtils.loadAnimation(this, R.anim.winner);
setContentView(R.layout.main);
/* 省略 */
@mikehibm
mikehibm / gist:1386019
Created November 22, 2011 16:08
Android: Theme.Dialogを適用したアクティビティを最大化して表示したい時は
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
//これを入れるとダイアログが最大化される。
getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
@mikehibm
mikehibm / styles.xml
Created November 22, 2011 16:20
ダイアログのタイトルを非表示にする
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MyDialog" parent="android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
</style>
</resources>
@mikehibm
mikehibm / README_JP.txt
Created December 23, 2011 08:02
Ec2EbsSnap - EBS Snapshot Utility
===========================================
EBS Snapshot Utility
===========================================
Amazon EC2上のEBSスナップショットの作成・削除を自動化する為のツールです。
Winsowsのタスクスケジューラー等に登録して定期実行される様に設定して下さい。
使い方:
Ec2EbsSnap.exe /L volume_id
@mikehibm
mikehibm / LunarView.java
Created January 16, 2012 23:40
Fixed LunarView class in Android SDK Sample LunarLander.
/*
* Copyright (C) 2007 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
@mikehibm
mikehibm / LunarView.java
Created January 17, 2012 01:28
Fixed LunarView class in Android sample LunarLander, using object.wait() method.
/*
* Copyright (C) 2007 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
@mikehibm
mikehibm / button_stateful.xml
Created June 21, 2012 23:11
Android: 押されるとカクッと画像の角度が変わるボタン
<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<rotate
android:fromDegrees="10"
android:toDegrees="10"
android:pivotX="50%"
android:pivotY="50%"
android:drawable="@drawable/ic_launcher" />
</item>