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 void nextMain() { | |
FragmentManager fm = getSupportFragmentManager(); | |
FragmentTransaction ft = fm.beginTransaction(); | |
ft.setCustomAnimations(R.anim.test_in, 0, 0, R.anim.test_out); | |
ft.add(R.id.fragment, new MainActivityFragment()); | |
ft.addToBackStack(null); | |
ft.commit(); | |
} | |
public void nextSecond() { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shareInterpolator="false"> | |
<scale | |
android:interpolator="@android:anim/accelerate_decelerate_interpolator" | |
android:fromXScale="1" | |
android:toXScale="0" | |
android:fromYScale="1" | |
android:toYScale="0" | |
android:pivotX="90%" |
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 AlphaImageView extends ImageView { | |
private static final int FADE_IN_TIME_MS = 10000; | |
public AlphaImageView(Context context) { | |
super(context); | |
} | |
public AlphaImageView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} |
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
// 存在するRingtoneの名称を取得 | |
RingtoneManager ringtoneManager = new RingtoneManager(getApplicationContext()); | |
Cursor cursor = ringtoneManager.getCursor(); | |
while (cursor.moveToNext()) { | |
Log.d(TAG, "Ringtone Title: " + cursor.getString(RingtoneManager.TITLE_COLUMN_INDEX)); | |
} |
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 | |
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
if (resultCode == RESULT_OK) { | |
if (requestCode == RINGTONE_PICKER) { | |
// RINGTONE_PICKERからの選択されたデータを取得する | |
mUri = (Uri) data.getExtras().get(RingtoneManager.EXTRA_RINGTONE_PICKED_URI); | |
Ringtone ringtone = RingtoneManager.getRingtone(getApplicationContext(), mUri); | |
TextView ringView = (TextView) findViewById(R.id.ringtone); | |
ringView.setText(ringtone.getTitle(getApplicationContext())); | |
ringtone.setStreamType(AudioManager.STREAM_ALARM); |
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
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); | |
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "タイトル"); | |
//intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false); // サイレントは見せない | |
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_ALARM); // アラーム音 | |
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false);// デフォルトは表示しない | |
if (mUri != null) { | |
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, mUri); // 選択済みを選択する | |
} | |
startActivityForResult(intent, RINGTONE_PICKER); |
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
<!-- NFCを使用する為のパーミッションを付与 --> | |
<uses-permission android:name="android.permission.NFC" /> | |
<!-- マーケットで、NFC対応端末にのみ表示させる --> | |
<uses-feature android:name="android.hardware.nfc" android:required="true" /> |
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
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> | |
<tech-list> | |
<tech>android.nfc.tech.IsoDep</tech> | |
</tech-list> | |
<tech-list> | |
<tech>android.nfc.tech.NfcA</tech> | |
</tech-list> | |
<tech-list> | |
<tech>android.nfc.tech.NfcB</tech> | |
</tech-list> |
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
/** | |
* IDmを取得する | |
* @param intent | |
* @return | |
*/ | |
private String getIdm(Intent intent) { | |
String idm = null; | |
StringBuffer idmByte = new StringBuffer(); | |
byte[] rawIdm = intent.getByteArrayExtra(NfcAdapter.EXTRA_ID); | |
if (rawIdm != null) { |
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
<!-- NFC NDEF text --> | |
<intent-filter> | |
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> | |
<category android:name="android.intent.category.DEFAULT"/> | |
<data android:mimeType="text/plain" /> | |
</intent-filter> | |
<!-- NFC NDEF http --> | |
<intent-filter> | |
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> | |
<category android:name="android.intent.category.DEFAULT"/> |
OlderNewer