Skip to content

Code Samples

Yury Polshchikov edited this page Jan 17, 2017 · 8 revisions

а как полностью убрать статус бар из сплеш стиля:

<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" или <activity android:theme="@android:style/Theme.NoTitleBar getActionBar().hide(); setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

Как убрать ActionBar:

** < style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> @color/colorPrimary @color/colorPrimaryDark @color/colorAccent </ style>**

Обертка Cursor над list, для правильного доступа к большому объему данных:

public class DbList extends AbstractList {

public interface Factory { T get(Cursor cursor); }

public static List create(Cursor cursor, Factory factory) { return new DbList<>(cursor, factory); }

private final Cursor cursor; private final Factory factory;

private DbList(Cursor cursor, Factory factory) { this.cursor = cursor; this.factory = factory; }

@Override @Nullable public T get(int location) { if (cursor != null && cursor.moveToPosition(location)) { return factory.get(cursor); } return null; }

@Override public int size() { return cursor == null ? 0 : cursor.getCount(); }

}