Commit 781669e0 by onuma

カテゴリ選択機能(タブレット)実装

parent c976e02c
...@@ -30,6 +30,16 @@ ...@@ -30,6 +30,16 @@
android:layout_toRightOf="@+id/btn_view_mode" android:layout_toRightOf="@+id/btn_view_mode"
android:onClick="onClickOperationFilterList" android:onClick="onClickOperationFilterList"
android:src="@drawable/ic_filter" /> android:src="@drawable/ic_filter" />
<!-- カテゴリ選択機能追加 -->
<ImageButton
android:id="@+id/btn_category_location"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/icon_filter"
android:onClick="onClickGroupLocationByTablet"
android:src="@drawable/ic_category_off" />
<!-- ここまで -->
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
......
...@@ -12,6 +12,7 @@ import android.net.Uri; ...@@ -12,6 +12,7 @@ import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.util.SparseBooleanArray; import android.util.SparseBooleanArray;
import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -2269,4 +2270,36 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -2269,4 +2270,36 @@ public class OperationListActivity extends ABVUIActivity {
private boolean isSearched() { private boolean isSearched() {
return !(StringUtil.isNullOrEmpty(mSearchWord) && StringUtil.isNullOrEmpty(mStartDateStr) && StringUtil.isNullOrEmpty(mEndDateStr)); return !(StringUtil.isNullOrEmpty(mSearchWord) && StringUtil.isNullOrEmpty(mStartDateStr) && StringUtil.isNullOrEmpty(mEndDateStr));
} }
/**
* 全て・カテゴリ選択画面(タブレット)
*
* @param anchor
*/
public void onClickGroupLocationByTablet(final View anchor) {
Logger.d(TAG, "onClickGroupLocationByTablet start");
final ABVPopupListWindow popup = new ABVPopupListWindow(this, R.layout.popup_simple_list);
popup.setTitle(getRString(R.string.category_list));
popup.setWidth(getRDimensionSize(R.dimen.popup_size_large));
// 表示するコンテンツタイプのリストを作成
ListView listView = popup.getListView();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.item_dialog_list, Arrays.asList(getRStringArray(R.array.category_types)));
popup.setListViewAdapter(adapter);
popup.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
popup.dismiss();
setOperationLocation(id);
}
});
if (anchor == null) {
// 呼び出したViewが存在しない場合、真ん中に表示する
popup.showAtLocation(getWindow().getDecorView().findViewById(android.R.id.content), Gravity.CENTER, 0,0);
} else {
popup.showAsDropDown(anchor);
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment