Skip to content

Commit

Permalink
Guy that manages the focus of application startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aska committed Jan 22, 2014
1 parent 50f4133 commit 4f0af20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
android:visibility="gone"
android:background="@color/menu_background">

<View
android:layout_width="0dip"
android:layout_height="0dip"
android:focusable="true"
android:focusableInTouchMode="true"><requestFocus /></View>

<info.justaway.widget.ClearEditText
android:id="@+id/quick_tweet_edit"
android:layout_width="1dip"
Expand Down Expand Up @@ -74,9 +80,7 @@
android:layout_height="wrap_content"
android:background="@color/menu_active_background"
android:text="@string/fontello_home"
android:textSize="22sp"
android:focusable="true"
android:focusableInTouchMode="true"><requestFocus /></Button>
android:textSize="22sp" />

<Button
android:id="@+id/action_interactions"
Expand Down
5 changes: 5 additions & 0 deletions src/info/justaway/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public class MainActivity extends BaseActivity implements LoaderManager.LoaderCa
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// クイックモード時に起動と同時にキーボードが出現するのを抑止
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

setContentView(R.layout.activity_main);

sDefaultListName = getString(R.string.title_default_list);
Expand Down Expand Up @@ -175,6 +179,7 @@ public void showQuickPanel() {
editStatus.setFocusable(true);
editStatus.setFocusableInTouchMode(true);
editStatus.setEnabled(true);
editStatus.clearFocus();
mApplication.setQuickMod(true);
}

Expand Down

0 comments on commit 4f0af20

Please sign in to comment.