本文整理汇总了Java中de.mrapp.android.util.logging.LogLevel类的典型用法代码示例。如果您正苦于以下问题:Java LogLevel类的具体用法?Java LogLevel怎么用?Java LogLevel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LogLevel类属于de.mrapp.android.util.logging包,在下文中一共展示了LogLevel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreInstanceState
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
@Override
public final void restoreInstanceState(@Nullable final Bundle savedInstanceState) {
if (savedInstanceState != null) {
firstVisibleTabIndex = savedInstanceState.getInt(FIRST_VISIBLE_TAB_INDEX_EXTRA, -1);
firstVisibleTabPosition =
savedInstanceState.getFloat(FIRST_VISIBLE_TAB_POSITION_EXTRA, -1);
logLevel = (LogLevel) savedInstanceState.getSerializable(LOG_LEVEL_EXTRA);
tabs = savedInstanceState.getParcelableArrayList(TABS_EXTRA);
switcherShown = savedInstanceState.getBoolean(SWITCHER_SHOWN_EXTRA);
selectedTab = savedInstanceState.getParcelable(SELECTED_TAB_EXTRA);
padding = savedInstanceState.getIntArray(PADDING_EXTRA);
tabIconId = savedInstanceState.getInt(TAB_ICON_ID_EXTRA);
tabIconBitmap = savedInstanceState.getParcelable(TAB_ICON_BITMAP_EXTRA);
tabBackgroundColor = savedInstanceState.getParcelable(TAB_BACKGROUND_COLOR_EXTRA);
tabTitleTextColor = savedInstanceState.getParcelable(TAB_TITLE_TEXT_COLOR_EXTRA);
tabCloseButtonIconId = savedInstanceState.getInt(TAB_CLOSE_BUTTON_ICON_ID_EXTRA);
tabCloseButtonIconBitmap =
savedInstanceState.getParcelable(TAB_CLOSE_BUTTON_ICON_BITMAP_EXTRA);
showToolbars = savedInstanceState.getBoolean(SHOW_TOOLBARS_EXTRA);
toolbarTitle = savedInstanceState.getCharSequence(TOOLBAR_TITLE_EXTRA);
childRecyclerAdapter.restoreInstanceState(savedInstanceState);
}
}
示例2: testGetFirstDisabledIndex
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to retrieve the index of the first
* disabled item.
*/
public final void testGetFirstDisabledIndex() {
AbstractEnableStateListAdapterImplementation abstractEnableStateListAdapter =
new AbstractEnableStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>());
abstractEnableStateListAdapter.addItem(new Object());
abstractEnableStateListAdapter.addItem(new Object());
abstractEnableStateListAdapter.setEnabled(0, false);
abstractEnableStateListAdapter.setEnabled(1, false);
assertEquals(0, abstractEnableStateListAdapter.getFirstDisabledIndex());
}
示例3: testSetAllItemStatesThrowsExceptionWhenStateIsGreaterThanMaxState
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Ensures, that an {@link IllegalArgumentException} is thrown by the method, which allows to
* set the states of all items to a specific state, if the state is greater than the maximum
* state.
*/
public final void testSetAllItemStatesThrowsExceptionWhenStateIsGreaterThanMaxState() {
try {
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.setAllItemStates(2);
Assert.fail();
} catch (IllegalArgumentException e) {
}
}
示例4: testIsEnabledThrowsExceptionWhenItemIsNull
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Ensures, that a {@link NullPointerException} is thrown, if it should be retrieved, whether a
* specific item, which is null, is enabled or not.
*/
public final void testIsEnabledThrowsExceptionWhenItemIsNull() {
try {
AbstractEnableStateListAdapterImplementation abstractEnableStateListAdapter =
new AbstractEnableStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>());
abstractEnableStateListAdapter.isEnabled(null);
Assert.fail();
} catch (NullPointerException e) {
}
}
示例5: testGetIndicesWithSpecificStateWhenNoItemHasState
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to retrieve a collection, which contains
* the indices of all items, which have a specific state, if no item has the state.
*/
public final void testGetIndicesWithSpecificStateWhenNoItemHasState() {
Object item = new Object();
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.addItem(item);
Collection<Integer> indices = abstractItemStateListAdapter.getIndicesWithSpecificState(1);
assertTrue(indices.isEmpty());
}
示例6: testGetLastIndexWithSpecificStateWhenNoItemHasState
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to retrieve the index of the last item,
* which has a specific state, if no item has the state.
*/
public final void testGetLastIndexWithSpecificStateWhenNoItemHasState() {
Object item1 = new Object();
Object item2 = new Object();
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.addItem(item1);
abstractItemStateListAdapter.addItem(item2);
assertEquals(-1, abstractItemStateListAdapter.getLastIndexWithSpecificState(1));
}
示例7: testSetEnabledByIndexWhenItemIsAlreadyEnabled
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to set the enable state of the item,
* which belongs to a specific index, if the item is already enabled.
*/
@SuppressWarnings("unchecked")
public final void testSetEnabledByIndexWhenItemIsAlreadyEnabled() {
Object item = new Object();
DataSetObserver dataSetObserver = new DataSetObserver();
ListEnableStateListener<Object> listEnableStateListener =
mock(ListEnableStateListener.class);
AbstractEnableStateListAdapterImplementation abstractEnableStateListAdapter =
new AbstractEnableStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>());
abstractEnableStateListAdapter.registerDataSetObserver(dataSetObserver);
abstractEnableStateListAdapter.addEnableStateListener(listEnableStateListener);
abstractEnableStateListAdapter.addItem(item);
dataSetObserver.reset();
abstractEnableStateListAdapter.setEnabled(0, true);
assertTrue(abstractEnableStateListAdapter.isEnabled(0));
verify(listEnableStateListener, times(0))
.onItemDisabled(abstractEnableStateListAdapter, item, 0);
assertFalse(dataSetObserver.hasOnChangedBeenCalled());
}
示例8: testGetItemState
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to retrieve the state of a specific
* item.
*/
public final void testGetItemState() {
Object item1 = new Object();
Object item2 = new Object();
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.addItem(item1);
abstractItemStateListAdapter.addItem(item2);
abstractItemStateListAdapter.setItemState(item2, 1);
assertEquals(0, abstractItemStateListAdapter.getItemState(item1));
assertEquals(1, abstractItemStateListAdapter.getItemState(item2));
}
示例9: testTriggerItemStateWhenStateIsNotMaxState
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to trigger the state of a specific item,
* if the item's state is not already the maximum state.
*/
@SuppressWarnings("unchecked")
public final void testTriggerItemStateWhenStateIsNotMaxState() {
Object item = new Object();
DataSetObserver dataSetObserver = new DataSetObserver();
ListItemStateListener<Object> listItemStateListener = mock(ListItemStateListener.class);
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.registerDataSetObserver(dataSetObserver);
abstractItemStateListAdapter.addItemStateListener(listItemStateListener);
abstractItemStateListAdapter.addItem(item);
dataSetObserver.reset();
int previousState = abstractItemStateListAdapter.triggerItemState(item);
assertEquals(0, previousState);
assertEquals(1, abstractItemStateListAdapter.getItemState(item));
verify(listItemStateListener, times(1))
.onItemStateChanged(abstractItemStateListAdapter, item, 0, 1);
assertTrue(dataSetObserver.hasOnChangedBeenCalled());
}
示例10: testGetIndicesWithSpecificState
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to retrieve a collection, which contains
* the indices of all items, which have a specific state.
*/
public final void testGetIndicesWithSpecificState() {
Object item1 = new Object();
Object item2 = new Object();
Object item3 = new Object();
AbstractItemStateListAdapterImplementation abstractItemStateListAdapter =
new AbstractItemStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>(), 2, false,
new LinkedHashSet<ListItemStateListener<Object>>());
abstractItemStateListAdapter.addItem(item1);
abstractItemStateListAdapter.addItem(item2);
abstractItemStateListAdapter.addItem(item3);
abstractItemStateListAdapter.setItemState(item2, 1);
Collection<Integer> indices = abstractItemStateListAdapter.getIndicesWithSpecificState(0);
assertEquals(2, indices.size());
Iterator<Integer> iterator = indices.iterator();
assertEquals(0, iterator.next().intValue());
assertEquals(2, iterator.next().intValue());
}
示例11: testGetDisabledIndices
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to retrieve a collection, which contains
* the indices of all disabled items.
*/
public final void testGetDisabledIndices() {
AbstractEnableStateListAdapterImplementation abstractEnableStateListAdapter =
new AbstractEnableStateListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<Object>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<Object>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<Object>>(),
new LinkedHashSet<ListAdapterListener<Object>>(),
new LinkedHashSet<ListEnableStateListener<Object>>());
abstractEnableStateListAdapter.addItem(new Object());
abstractEnableStateListAdapter.addItem(new Object());
abstractEnableStateListAdapter.setEnabled(0, false);
abstractEnableStateListAdapter.setEnabled(1, false);
Collection<Integer> disabledIndices = abstractEnableStateListAdapter.getDisabledIndices();
Iterator<Integer> iterator = disabledIndices.iterator();
assertEquals(0, iterator.next().intValue());
assertEquals(1, iterator.next().intValue());
}
示例12: testConstructor
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests, if all properties are set correctly by the constructor.
*/
public final void testConstructor() {
Set<ListFilterListener<FilterableImplementation>> filterListeners = new LinkedHashSet<>();
LinkedHashSet<AppliedFilter<FilterableImplementation>> appliedFilters =
new LinkedHashSet<>();
AbstractFilterableListAdapterImplementation abstractFilterableListAdapter =
new AbstractFilterableListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<FilterableImplementation>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<FilterableImplementation>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<FilterableImplementation>>(),
new LinkedHashSet<ListAdapterListener<FilterableImplementation>>(),
new LinkedHashSet<ListEnableStateListener<FilterableImplementation>>(), 1,
false, new LinkedHashSet<ListItemStateListener<FilterableImplementation>>(),
new LinkedHashSet<ListSortingListener<FilterableImplementation>>(),
filterListeners, appliedFilters);
assertEquals(filterListeners, abstractFilterableListAdapter.getFilterListeners());
assertEquals(appliedFilters, abstractFilterableListAdapter.getAppliedFilters());
}
示例13: testConstructorThrowsExceptionWhenContextIsNull
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Ensures, that a {@link NullPointerException} is thrown, if the context, which is passed to
* the constructor, is null.
*/
public final void testConstructorThrowsExceptionWhenContextIsNull() {
try {
MultipleChoiceListAdapter<Group<Object, Object>> groupAdapter =
new MultipleChoiceListAdapterImplementation<>(getContext(),
new NullObjectDecorator<Group<Object, Object>>());
new AbstractExpandableListAdapterImplementation(null,
new ExpandableListDecoratorImplementation(), LogLevel.ALL, groupAdapter, false,
true, true,
new LinkedHashSet<ExpandableListAdapterItemClickListener<Object, Object>>(),
new LinkedHashSet<ExpandableListAdapterItemLongClickListener<Object, Object>>(),
new LinkedHashSet<ExpandableListAdapterListener<Object, Object>>(),
new LinkedHashSet<ExpansionListener<Object, Object>>());
Assert.fail();
} catch (NullPointerException e) {
}
}
示例14: testRemoveFilterListener
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to add a listener, which should be
* notified, when the adapter's underlying data has been filtered.
*/
@SuppressWarnings("unchecked")
public final void testRemoveFilterListener() {
AbstractFilterableListAdapterImplementation abstractFilterableListAdapter =
new AbstractFilterableListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<FilterableImplementation>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<FilterableImplementation>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<FilterableImplementation>>(),
new LinkedHashSet<ListAdapterListener<FilterableImplementation>>(),
new LinkedHashSet<ListEnableStateListener<FilterableImplementation>>(), 1,
false, new LinkedHashSet<ListItemStateListener<FilterableImplementation>>(),
new LinkedHashSet<ListSortingListener<FilterableImplementation>>(),
new LinkedHashSet<ListFilterListener<FilterableImplementation>>(),
new LinkedHashSet<AppliedFilter<FilterableImplementation>>());
ListFilterListener<FilterableImplementation> filterListener =
mock(ListFilterListener.class);
abstractFilterableListAdapter.removeFilterListener(filterListener);
abstractFilterableListAdapter.addFilterListener(filterListener);
assertFalse(abstractFilterableListAdapter.getFilterListeners().isEmpty());
abstractFilterableListAdapter.removeFilterListener(filterListener);
assertTrue(abstractFilterableListAdapter.getFilterListeners().isEmpty());
}
示例15: testIsFiltered
import de.mrapp.android.util.logging.LogLevel; //导入依赖的package包/类
/**
* Tests the functionality of the method, which allows to retrieve, whether at least one filter
* is applied on the adapter, or not.
*/
public final void testIsFiltered() {
AbstractFilterableListAdapterImplementation abstractFilterableListAdapter =
new AbstractFilterableListAdapterImplementation(getContext(),
new ListDecoratorImplementation(), LogLevel.ALL,
new ArrayList<Item<FilterableImplementation>>(), false, true,
new LinkedHashSet<ListAdapterItemClickListener<FilterableImplementation>>(),
new LinkedHashSet<ListAdapterItemLongClickListener<FilterableImplementation>>(),
new LinkedHashSet<ListAdapterListener<FilterableImplementation>>(),
new LinkedHashSet<ListEnableStateListener<FilterableImplementation>>(), 1,
false, new LinkedHashSet<ListItemStateListener<FilterableImplementation>>(),
new LinkedHashSet<ListSortingListener<FilterableImplementation>>(),
new LinkedHashSet<ListFilterListener<FilterableImplementation>>(),
new LinkedHashSet<AppliedFilter<FilterableImplementation>>());
assertFalse(abstractFilterableListAdapter.isFiltered());
abstractFilterableListAdapter.applyFilter("", 0);
assertTrue(abstractFilterableListAdapter.isFiltered());
}