use of io.karim.MaterialTabs in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
pager = (ViewPager) findViewById(R.id.pager);
adapter = new SampleAdapter(this, getFragmentManager());
pager.setAdapter(adapter);
MaterialTabs tabs = (MaterialTabs) findViewById(R.id.tabs);
tabs.setViewPager(pager);
}
use of io.karim.MaterialTabs in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
pager = (ViewPager) findViewById(R.id.pager);
adapter = new SampleAdapter(this, getFragmentManager());
pager.setAdapter(adapter);
MaterialTabs tabs = (MaterialTabs) findViewById(R.id.tabs);
tabs.setViewPager(pager);
}
use of io.karim.MaterialTabs in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
pager = (ViewPager) findViewById(R.id.pager);
adapter = new SampleAdapter(this, getFragmentManager());
pager.setAdapter(adapter);
MaterialTabs tabs = (MaterialTabs) findViewById(R.id.tabs);
tabs.setViewPager(pager);
}
use of io.karim.MaterialTabs in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ViewPager pager = (ViewPager) findViewById(R.id.pager);
final MaterialTabs tabs = (MaterialTabs) findViewById(R.id.tabs);
observable = (Observable<PermissionRoster>) getLastNonConfigurationInstance();
if (observable == null) {
observable = Observable.create(new PermissionSource(this)).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).cache();
}
sub = observable.subscribe(new Consumer<PermissionRoster>() {
@Override
public void accept(PermissionRoster roster) throws Exception {
pager.setAdapter(new PermissionTabAdapter(MainActivity.this, getFragmentManager(), roster));
tabs.setViewPager(pager);
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable error) throws Exception {
Toast.makeText(MainActivity.this, error.getMessage(), Toast.LENGTH_LONG).show();
Log.e(getClass().getSimpleName(), "Exception processing request", error);
}
});
}
use of io.karim.MaterialTabs in project cw-omnibus by commonsguy.
the class EmPubLiteActivity method setupPager.
private void setupPager(BookContents contents) {
adapter = new ContentsAdapter(this, contents);
pager.setAdapter(adapter);
MaterialTabs tabs = (MaterialTabs) findViewById(R.id.tabs);
tabs.setViewPager(pager);
SharedPreferences prefs = mfrag.getPrefs();
if (prefs != null) {
if (prefs.getBoolean(PREF_SAVE_LAST_POSITION, false)) {
pager.setCurrentItem(prefs.getInt(PREF_LAST_POSITION, 0));
}
pager.setKeepScreenOn(prefs.getBoolean(PREF_KEEP_SCREEN_ON, false));
}
}
Aggregations