本文整理匯總了Java中com.chopping.bus.CloseDrawerEvent類的典型用法代碼示例。如果您正苦於以下問題:Java CloseDrawerEvent類的具體用法?Java CloseDrawerEvent怎麽用?Java CloseDrawerEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CloseDrawerEvent類屬於com.chopping.bus包,在下文中一共展示了CloseDrawerEvent類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addNewFilter
import com.chopping.bus.CloseDrawerEvent; //導入依賴的package包/類
/**
* Helper method to add a new {@link com.schautup.data.Filter}.
*
* @param filter
* A {@link com.schautup.data.Filter} to show.
*/
private void addNewFilter(final Filter filter) {
final ViewGroup filterV = (ViewGroup) getActivity().getLayoutInflater().inflate(LAYOUT_FILTER, mFiltersVg,
false);
filterV.setId((int) filter.getId());
TextView nameTv = (TextView) filterV.findViewById(R.id.filter_name_tv);
nameTv.setText(filter.getName());
final AnimImageButton rmvV = (AnimImageButton) filterV.findViewById(R.id.filter_remove_ibtn);
rmvV.setTag(filter);
rmvV.setOnClickListener(new OnAnimImageButtonClickedListener() {
@Override
public void onClick() {
removeFilter(rmvV);
}
});
AnimImageButton editV = (AnimImageButton) filterV.findViewById(R.id.filter_edit_ibtn);
editV.setTag(filter);
editV.setOnClickListener(new OnAnimImageButtonClickedListener() {
@Override
public void onClick() {
EventBus.getDefault().postSticky(new ShowSetFilterEvent(filter));
EventBus.getDefault().post(new ShowFilterDefineDialogEvent());
}
});
AnimImageButton doFilterV = (AnimImageButton) filterV.findViewById(R.id.filter_do_ibtn);
doFilterV.setOnClickListener(new OnAnimImageButtonClickedListener() {
@Override
public void onClick() {
EventBus.getDefault().post(new CloseDrawerEvent());
EventBus.getDefault().post(new FilterEvent(filter, true));
}
});
mFiltersList.put(filter.getId(), filter);
mFiltersVg.addView(filterV);
}
示例2: addNewLabel
import com.chopping.bus.CloseDrawerEvent; //導入依賴的package包/類
/**
* Helper method to add a new {@link com.schautup.data.Filter}.
*
* @param filter
* A {@link com.schautup.data.Filter} to show.
*/
private void addNewLabel(final Filter filter) {
final ViewGroup labelV = (ViewGroup) getActivity().getLayoutInflater().inflate(LAYOUT_LABEL, mLabelsVg, false);
labelV.setId((int) filter.getId());
TextView nameTv = (TextView) labelV.findViewById(R.id.label_name_tv);
nameTv.setText(filter.getName());
final AnimImageButton rmvV = (AnimImageButton) labelV.findViewById(R.id.label_remove_ibtn);
rmvV.setTag(filter);
rmvV.setOnClickListener(new OnAnimImageButtonClickedListener() {
@Override
public void onClick() {
removeLabel(rmvV);
}
});
AnimImageButton editV = (AnimImageButton) labelV.findViewById(R.id.label_edit_ibtn);
editV.setTag(filter);
editV.setOnClickListener(new OnAnimImageButtonClickedListener() {
@Override
public void onClick() {
EventBus.getDefault().postSticky(new ShowSetLabelEvent(filter));
EventBus.getDefault().post(new ShowLabelDefineDialogEvent());
}
});
AnimImageButton doLabelV = (AnimImageButton) labelV.findViewById(R.id.label_do_ibtn);
doLabelV.setOnClickListener(new OnAnimImageButtonClickedListener() {
@Override
public void onClick() {
mLabelsVg.removeView(labelV);
new ParallelTask<Filter, List<ScheduleItem>, List<ScheduleItem>>(false) {
Filter mFilter;
@Override
protected List<ScheduleItem> doInBackground(Filter... params) {
Activity activity = getActivity();
mFilter = params[0];
if (activity != null) {
DB db = DB.getInstance(activity.getApplication());
db.updateLabelToFilter(mFilter);
ScheduleItem newSchedule;
List<Label> labels = db.fetchAllLabels(mFilter);
for (Label label : labels) {
newSchedule = new ScheduleItem(label.getType(), label.getHour(), label.getMinute(),
label.getEventRecurrence(), label.getReserveLeft(), label.getReserveRight());
db.addSchedule(newSchedule);
}
return Utils.getAllSchedules(activity.getApplication());
}
return null;
}
@Override
protected void onPostExecute(List<ScheduleItem> items) {
super.onPostExecute(items);
if(items !=null) {
EventBus.getDefault().post(new UpdateFilterEvent(mFilter, false, true));
EventBus.getDefault().post(new CloseDrawerEvent());
EventBus.getDefault().post(new AllScheduleLoadedEvent(items));
EventBus.getDefault().post(new UpdatedItemGroupEvent(items));
}
}
}.executeParallel(filter);
}
});
mLabelsList.put(filter.getId(), filter);
mLabelsVg.addView(labelV);
}
示例3: onEvent
import com.chopping.bus.CloseDrawerEvent; //導入依賴的package包/類
/**
* Handler for {@link com.chopping.bus.CloseDrawerEvent }.
*
* @param e
* Event {@link com.chopping.bus.CloseDrawerEvent}.
*/
public void onEvent( CloseDrawerEvent e ) {
mDrawerLayout.closeDrawer( Gravity.RIGHT );
}
示例4: onEvent
import com.chopping.bus.CloseDrawerEvent; //導入依賴的package包/類
/**
* Handler for {@link com.chopping.bus.CloseDrawerEvent }.
*
* @param e
* Event {@link com.chopping.bus.CloseDrawerEvent}.
*/
public void onEvent(CloseDrawerEvent e) {
mBinding.drawerLayout.closeDrawer(Gravity.RIGHT);
}
示例5: onEvent
import com.chopping.bus.CloseDrawerEvent; //導入依賴的package包/類
/**
* Handler for {@link CloseDrawerEvent}.
*
* @param e
* Event {@link CloseDrawerEvent}.
*/
public void onEvent(CloseDrawerEvent e) {
mDrawerLayout.closeDrawers();
}