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
// scala.xmlのインポート | |
scala> import scala.xml._ | |
import scala.xml._ | |
// scala.xml.transformのインポート | |
scala> import transform._ | |
import transform._ | |
// scala.collection.mutableパッケージのHashMapをインポート | |
scala> import scala.collection.mutable.HashMap |
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.os.Bundle; | |
import android.support.annotation.Nullable; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.view.MenuItemCompat; | |
import android.support.v7.app.ActionBar; | |
import android.support.v7.app.ActionBarActivity; | |
import android.support.v7.widget.SearchView; | |
import android.view.LayoutInflater; | |
import android.view.MenuInflater; | |
import android.view.Menu; |
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
EditText editText = (EditText)this.findViewById(R.id.edit_text); | |
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { | |
@Override | |
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { | |
if (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER) { | |
// ここに処理 | |
} | |
} | |
}); |
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
<!-- res/menu/search.xml --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<menu xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
> | |
<item | |
android:id="@+id/search_menu_search_view" | |
android:orderInCategory="100" | |
android:title="@string/search_menu_search_text" |
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
<!-- res/values/color.xml --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- 緑っぽい色 --> | |
<color name="action_bar_tab_selected_color">#0ACE00</color> | |
<!-- 白 --> | |
<color name="action_bar_tab_un_selected_color">#000000</color> | |
</resources> |
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
<!-- res/color/action_bar_tab_text.xml --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- 現在選択されている --> | |
<item android:color="@color/action_bar_tab_selected_color" android:state_selected="true" /> | |
<item android:color="@color/action_bar_tab_selected_color" android:state_focused="true" /> | |
<item android:color="@color/action_bar_tab_selected_color" android:state_active="true" /> | |
<item android:color="@color/action_bar_tab_selected_color" android:state_pressed="true" /> | |
<!-- 選択されていない --> | |
<item android:color="@color/action_bar_tab_un_selected_color" android:state_selected="false" /> |
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
<!-- res/values/styles.xml --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- 省略 --> | |
<style name="ActionBar.TabText.Sample" parent="@style/Widget.AppCompat.Light.ActionBar.TabText"> | |
<item name="android:textColor">@color/action_bar_tab_text</item> | |
</style> | |
<style name="ActionBar.Solid.Sample" parent="@style/Widget.AppCompat.Light.ActionBar.Solid"> | |
<item name="actionBarTabTextStyle">@style/ActionBar.TabText.Qittaro</item> | |
</style> |
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 MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
this.setContentView(R.layout.main); | |
// SharedPreferencesの生成 | |
SharedPreferences sp = this.getSharedPreferences("MainActivity", Context.MODE_PRIVATE); | |
// Editorの生成 | |
Editor editor = sp.edit(); | |
// 文字列の保存 |
OlderNewer