本文整理汇总了Java中com.mikepenz.materialize.MaterializeBuilder类的典型用法代码示例。如果您正苦于以下问题:Java MaterializeBuilder类的具体用法?Java MaterializeBuilder怎么用?Java MaterializeBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterializeBuilder类属于com.mikepenz.materialize包,在下文中一共展示了MaterializeBuilder类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// init
mPager = (DirectionalViewPager) view.findViewById(R.id.pager);
mMaterializeBuilder = new MaterializeBuilder(getActivity());
mPager.setAdapter(mAdapter);
mPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
super.onPageSelected(position);
onSlideChanged(mAdapter.getRegisteredFragment(position));
}
});
mInteractionsListener.onCarouselViewCreated(view, savedInstanceState);
inflateIndicatorContainer(view);
}
开发者ID:meness,项目名称:EasyIntro,代码行数:22,代码来源:EasyIntroCarouselFragment.java
示例2: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setTheme(R.style.AppTheme);
setContentView(R.layout.activity_main);
new MaterializeBuilder().withActivity(this).build();
}
开发者ID:LivotovLabs,项目名称:AndroidApplicationSkeleton,代码行数:9,代码来源:MainActivity.java
示例3: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_by_phone);
new MaterializeBuilder().withActivity(this).build();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.register_by_phone);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
instance = this;
initView();
}
开发者ID:niuzehai,项目名称:Sxumiro_AndroidClient,代码行数:14,代码来源:RegisterActivity.java
示例4: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_binding_student_id);
new MaterializeBuilder().withActivity(this).build();
Toolbar toolbar= (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.binding_sxu_id);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
initView();
}
开发者ID:niuzehai,项目名称:Sxumiro_AndroidClient,代码行数:14,代码来源:BingingStudentIdActivity.java
示例5: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_by_phone);
new MaterializeBuilder().withActivity(this).build();
Toolbar toolbar= (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.login_by_account);
instance = this;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
initView();
}
开发者ID:niuzehai,项目名称:Sxumiro_AndroidClient,代码行数:15,代码来源:LoginActivity.java
示例6: materialize
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
private void materialize() {
new MaterializeBuilder()
.withActivity(this)
.withFullscreen(true)
.withTranslucentStatusBarProgrammatically(false)
.withTintedStatusBar(false).build();
}
开发者ID:AhmadNemati,项目名称:WindView,代码行数:8,代码来源:MainActivity.java
示例7: onPostCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
new MaterializeBuilder()
.withActivity(this)
.build();
}
开发者ID:liamspradlin,项目名称:Phoebe,代码行数:9,代码来源:SuperAppCompatActivity.java
示例8: materialize
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
public static Materialize materialize(Activity activity, int colorRes) {
return new MaterializeBuilder()
.withActivity(activity)
.withTintedStatusBar(true)
.withTranslucentStatusBar(true)
.withStatusBarColorRes(colorRes)
.build();
}
开发者ID:citiususc,项目名称:calendula,代码行数:9,代码来源:ScreenUtils.java
示例9: materializeForColor
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
public static Materialize materializeForColor(Activity activity, int color) {
return new MaterializeBuilder()
.withActivity(activity)
.withTintedStatusBar(true)
.withTranslucentStatusBar(true)
.withStatusBarColor(color)
.build();
}
开发者ID:citiususc,项目名称:calendula,代码行数:9,代码来源:ScreenUtils.java
示例10: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
// Handle Toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.sample_generic_item);
//style our ui
new MaterializeBuilder().withActivity(this).build();
//create our FastAdapter which will manage everything
fastAdapter = new FastAdapter();
fastAdapter.withSelectable(true);
//get our recyclerView and do basic setup
RecyclerView rv = (RecyclerView) findViewById(R.id.rv);
//init our gridLayoutManager and configure RV
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
GenericItemAdapter<IconModel, GenericIconItem> itemAdapter = new GenericItemAdapter<>(new Function<IconModel, GenericIconItem>() {
@Override
public GenericIconItem apply(IconModel iconModel) {
return new GenericIconItem(iconModel);
}
});
final FastScrollIndicatorAdapter<GenericIconItem> fastScrollIndicatorAdapter = new FastScrollIndicatorAdapter<>();
rv.setAdapter(fastScrollIndicatorAdapter.wrap(itemAdapter.wrap(fastAdapter)));
DragScrollBar materialScrollBar = new DragScrollBar(this, rv, true);
materialScrollBar.setHandleColour(ContextCompat.getColor(this, R.color.colorAccent));
materialScrollBar.setHandleOffColour(ContextCompat.getColor(this, R.color.colorAccent));
materialScrollBar.addIndicator(new CustomIndicator(this), true);
rv.setLayoutManager(gridLayoutManager);
rv.setItemAnimator(new SlideDownAlphaAnimator());
//order fonts by their name
List<ITypeface> mFonts = new ArrayList<>(Iconics.getRegisteredFonts(this));
Collections.sort(mFonts, new Comparator<ITypeface>() {
@Override
public int compare(final ITypeface object1, final ITypeface object2) {
return object1.getFontName().compareTo(object2.getFontName());
}
});
//add all icons of all registered Fonts to the list
ArrayList<IconModel> models = new ArrayList<>();
for (ITypeface font : mFonts) {
for (String icon : font.getIcons()) {
models.add(new IconModel(font.getIcon(icon)));
}
}
//fill with some sample data
itemAdapter.addModel(models);
//restore selections (this has to be done after the items were added
fastAdapter.withSavedInstanceState(savedInstanceState);
//set the back arrow in the toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(false);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:71,代码来源:GenericItemActivity.java
示例11: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
// Handle Toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.sample_image_list);
//style our ui
new MaterializeBuilder().withActivity(this).build();
//create our FastAdapter which will manage everything
mFastItemAdapter = new FastItemAdapter<>();
//init the ClickListenerHelper which simplifies custom click listeners on views of the Adapter
mClickListenerHelper = new ClickListenerHelper<>(mFastItemAdapter);
//configure our fastAdapter
mFastItemAdapter.withOnClickListener(new FastAdapter.OnClickListener<ImageItem>() {
@Override
public boolean onClick(View v, IAdapter<ImageItem> adapter, ImageItem item, int position) {
Toast.makeText(v.getContext(), item.mName, Toast.LENGTH_SHORT).show();
return false;
}
});
//get our recyclerView and do basic setup
RecyclerView rv = (RecyclerView) findViewById(R.id.rv);
//find out how many columns we display
int columns = getResources().getInteger(R.integer.wall_splash_columns);
if (columns == 1) {
//linearLayoutManager for one column
rv.setLayoutManager(new LinearLayoutManager(this));
} else {
//gridLayoutManager for more than one column ;)
rv.setLayoutManager(new GridLayoutManager(this, columns));
}
rv.setItemAnimator(new DefaultItemAnimator());
rv.setAdapter(mFastItemAdapter);
//fill with some sample data
mFastItemAdapter.add(ImageDummyData.getImageItems());
//restore selections (this has to be done after the items were added
mFastItemAdapter.withSavedInstanceState(savedInstanceState);
//a custom OnCreateViewHolder listener class which is used to create the viewHolders
//we define the listener for the imageLovedContainer here for better performance
//you can also define the listener within the items bindView method but performance is better if you do it like this
mFastItemAdapter.withItemEvent(new ImageItem.ImageItemHeartClickEvent());
//set the back arrow in the toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(false);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:59,代码来源:ImageListActivity.java
示例12: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Handle Toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.sample_realm_list);
//style our ui
new MaterializeBuilder().withActivity(this).build();
//create our FastAdapter which will manage everything
mFastItemAdapter = new FastItemAdapter<>();
//configure our fastAdapter
mFastItemAdapter.withOnClickListener(new FastAdapter.OnClickListener<RealmSampleUserItem>() {
@Override
public boolean onClick(View v, IAdapter<RealmSampleUserItem> adapter, RealmSampleUserItem item, int position) {
Toast.makeText(v.getContext(), item.getName(), Toast.LENGTH_SHORT).show();
return false;
}
});
//get our recyclerView and do basic setup
RecyclerView rv = (RecyclerView) findViewById(R.id.rv);
rv.setLayoutManager(new LinearLayoutManager(this));
rv.setItemAnimator(new AlphaInAnimator());
rv.setAdapter(mFastItemAdapter);
//Get a realm instance for this activity
mRealm = Realm.getDefaultInstance();
//Add a realm on change listener (don´t forget to close this realm instance before adding this listener again)
mRealm.where(RealmSampleUserItem.class).findAllAsync().addChangeListener(new RealmChangeListener<RealmResults<RealmSampleUserItem>>() {
@Override
public void onChange(RealmResults<RealmSampleUserItem> userItems) {
//This will call twice
//1.) from findAllAsync()
//2.) from createData()
mFastItemAdapter.setNewList(userItems);
}
});
//fill with some sample data
createData();
//set the back arrow in the toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(false);
//restore selections (this has to be done after the items were added
mFastItemAdapter.withSavedInstanceState(savedInstanceState);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:57,代码来源:RealmActivity.java
示例13: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
//as we use an icon from Android-Iconics via xml we add the IconicsLayoutInflater
//https://github.com/mikepenz/Android-Iconics
LayoutInflaterCompat.setFactory(getLayoutInflater(), new IconicsLayoutInflater(getDelegate()));
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
// Handle Toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.sample_collapsible);
//style our ui
new MaterializeBuilder().withActivity(this).build();
//create our FastAdapter
fastItemAdapter = new FastItemAdapter<>();
fastItemAdapter.withSelectable(true);
//get our recyclerView and do basic setup
RecyclerView rv = (RecyclerView) findViewById(R.id.rv);
rv.setLayoutManager(new LinearLayoutManager(this));
rv.setItemAnimator(new SlideDownAlphaAnimator());
rv.setAdapter(fastItemAdapter);
//fill with some sample data
List<IItem> items = new ArrayList<>();
for (int i = 1; i <= 100; i++) {
if (i % 10 == 0) {
SimpleSubExpandableItem expandableItem = new SimpleSubExpandableItem();
expandableItem
.withName("Test " + i)
.withIdentifier(100 + i);
//add subitems so we can showcase the collapsible functionality
List<IItem> subItems = new LinkedList<>();
for (int ii = 1; ii <= 5; ii++) {
SimpleSubItem sampleItem = new SimpleSubItem();
sampleItem
.withName("-- Test " + ii)
.withIdentifier(1000 + ii);
subItems.add(sampleItem);
}
expandableItem.withSubItems(subItems);
items.add(expandableItem);
} else {
items.add(new SimpleSubItem().withName("Test " + i).withIdentifier(100 + i));
}
}
fastItemAdapter.add(items);
//restore selections (this has to be done after the items were added
fastItemAdapter.withSavedInstanceState(savedInstanceState);
//set the back arrow in the toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(false);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:62,代码来源:ExpandableSampleActivity.java
示例14: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
// Handle Toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.sample_sticky_header);
//style our ui
new MaterializeBuilder().withActivity(this).build();
//create our FastAdapter
fastAdapter = new FastAdapter();
fastAdapter.withSelectable(true);
//create our adapters
final StickyHeaderAdapter stickyHeaderAdapter = new StickyHeaderAdapter();
final HeaderAdapter headerAdapter = new HeaderAdapter();
final ItemAdapter itemAdapter = new ItemAdapter();
//configure our fastAdapter
//as we provide id's for the items we want the hasStableIds enabled to speed up things
fastAdapter.setHasStableIds(true);
//get our recyclerView and do basic setup
RecyclerView rv = (RecyclerView) findViewById(R.id.rv);
rv.setLayoutManager(new LinearLayoutManager(this));
rv.setItemAnimator(new DefaultItemAnimator());
rv.setAdapter(stickyHeaderAdapter.wrap(itemAdapter.wrap(headerAdapter.wrap(fastAdapter))));
//this adds the Sticky Headers within our list
final StickyRecyclerHeadersDecoration decoration = new StickyRecyclerHeadersDecoration(stickyHeaderAdapter);
rv.addItemDecoration(decoration);
//fill with some sample data
headerAdapter.add(new SimpleItem().withName("Header").withIdentifier(1));
List<IItem> items = new ArrayList<>();
for (int i = 1; i <= 100; i++) {
items.add(new SimpleItem().withName("Test " + i).withHeader(headers[i / 5]).withIdentifier(100 + i));
}
itemAdapter.add(items);
//so the headers are aware of changes
stickyHeaderAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
@Override
public void onChanged() {
decoration.invalidateHeaders();
}
});
//restore selections (this has to be done after the items were added
fastAdapter.withSavedInstanceState(savedInstanceState);
//set the back arrow in the toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(false);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:61,代码来源:StickyHeaderSampleActivity.java
示例15: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
// Handle Toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(R.string.sample_multi_generic_item);
//style our ui
new MaterializeBuilder().withActivity(this).build();
//create our FastAdapter which will manage everything
fastAdapter = new FastAdapter();
fastAdapter.withSelectable(true);
//get our recyclerView and do basic setup
RecyclerView rv = (RecyclerView) findViewById(R.id.rv);
//init our gridLayoutManager and configure RV
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
//if you need multiple items for different models you can also do this be defining a Function which get's the model object and returns the item (extends IItem)
GenericItemAdapter<IconModel, GenericIconItem> itemAdapter = new GenericItemAdapter<>(new Function<IconModel, GenericIconItem>() {
@Override
public GenericIconItem apply(IconModel o) {
if (o instanceof RightIconModel) {
return new RightGenericIconItem(o);
} else {
return new GenericIconItem(o);
}
}
});
rv.setLayoutManager(gridLayoutManager);
rv.setItemAnimator(new SlideDownAlphaAnimator());
rv.setAdapter(itemAdapter.wrap(fastAdapter));
//order fonts by their name
List<ITypeface> mFonts = new ArrayList<>(Iconics.getRegisteredFonts(this));
Collections.sort(mFonts, new Comparator<ITypeface>() {
@Override
public int compare(final ITypeface object1, final ITypeface object2) {
return object1.getFontName().compareTo(object2.getFontName());
}
});
//add all icons of all registered Fonts to the list
ArrayList<IconModel> models = new ArrayList<>();
int i = 0;
for (ITypeface font : mFonts) {
for (String icon : font.getIcons()) {
if (i % 3 == 0) {
models.add(new IconModel(font.getIcon(icon)));
} else {
models.add(new RightIconModel(font.getIcon(icon)));
}
i++;
}
}
//fill with some sample data
itemAdapter.addModel(models);
//restore selections (this has to be done after the items were added
fastAdapter.withSavedInstanceState(savedInstanceState);
//set the back arrow in the toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(false);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:75,代码来源:MultiTypeGenericItemActivity.java
示例16: onCreate
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content)
.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sort);
ButterKnife.bind(this);
// Handle Toolbar
setSupportActionBar(toolbar);
//style our ui
new MaterializeBuilder().withActivity(this).build();
//create our FastAdapter which will manage everything
fastItemAdapter = new FastItemAdapter<>();
fastItemAdapter.withSelectable(true);
//configure our fastAdapter
fastItemAdapter.withOnClickListener(new FastAdapter.OnClickListener<SimpleItem>() {
@Override
public boolean onClick(View v, IAdapter<SimpleItem> adapter,
SimpleItem item, int position) {
Toast.makeText(v.getContext(), (item).name.getText(v.getContext()),
Toast.LENGTH_LONG).show();
return false;
}
});
//get our recyclerView and do basic setup
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(fastItemAdapter);
if (savedInstanceState != null) {
//Retrieve the previous sorting strategy from the instance state
sortingStrategy = toSortingStrategy(savedInstanceState.getInt("sorting_strategy"));
} else {
//Set the default so
sortingStrategy = SORT_NONE;
}
//we sort the list
fastItemAdapter.getItemAdapter().withComparator(getComparator());
//initial filling of the list
fastItemAdapter.setNewList(generateUnsortedList());
//restore selections (this has to be done after the items were added
fastItemAdapter.withSavedInstanceState(savedInstanceState);
//set the back arrow in the toolbar
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(false);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:58,代码来源:SortActivity.java
示例17: build
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
/**
* Build and add the DrawerBuilder to your activity
*
* @return
*/
public Drawer build() {
if (mUsed) {
throw new RuntimeException("you must not reuse a DrawerBuilder builder");
}
if (mActivity == null) {
throw new RuntimeException("please pass an activity");
}
//set that this builder was used. now you have to create a new one
mUsed = true;
// if the user has not set a drawerLayout use the default one :D
if (mDrawerLayout == null) {
withDrawerLayout(-1);
}
//some new Materialize magic ;)
mMaterialize = new MaterializeBuilder()
.withActivity(mActivity)
.withRootView(mRootView)
.withFullscreen(mFullscreen)
.withSystemUIHidden(mSystemUIHidden)
.withUseScrimInsetsLayout(false)
.withTransparentStatusBar(mTranslucentStatusBar)
.withTranslucentNavigationBarProgrammatically(mTranslucentNavigationBarProgrammatically)
.withContainer(mDrawerLayout)
.build();
//handle the navigation stuff of the ActionBarDrawerToggle and the drawer in general
handleDrawerNavigation(mActivity, false);
//build the view which will be set to the drawer
Drawer result = buildView();
//define id for the sliderLayout
mSliderLayout.setId(R.id.material_drawer_slider_layout);
// add the slider to the drawer
mDrawerLayout.addView(mSliderLayout, 1);
return result;
}
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:47,代码来源:DrawerBuilder.java
示例18: build
import com.mikepenz.materialize.MaterializeBuilder; //导入依赖的package包/类
/**
* Build and add the DrawerBuilder to your activity
*
* @return
*/
public Drawer build() {
if (mUsed) {
throw new RuntimeException("you must not reuse a DrawerBuilder builder");
}
if (mActivity == null) {
throw new RuntimeException("please pass an activity");
}
//set that this builder was used. now you have to create a new one
mUsed = true;
// if the user has not set a drawerLayout use the default one :D
if (mDrawerLayout == null) {
withDrawerLayout(-1);
}
//some new Materialize magic ;)
mMaterialize = new MaterializeBuilder()
.withActivity(mActivity)
.withRootView(mRootView)
.withFullscreen(mFullscreen)
.withSystemUIHidden(mSystemUIHidden)
.withTranslucentStatusBar(mTranslucentStatusBar)
.withTranslucentStatusBarProgrammatically(mTranslucentStatusBarProgrammatically)
.withTranslucentNavigationBar(mTranslucentNavigationBar)
.withTranslucentNavigationBarProgrammatically(mTranslucentNavigationBarProgrammatically)
.withContainer(mDrawerLayout)
.withStatusBarColor(mStatusBarColor)
.withStatusBarColorRes(mStatusBarColorRes)
.build();
//handle the navigation stuff of the ActionBarDrawerToggle and the drawer in general
handleDrawerNavigation(mActivity, false);
//build the view which will be set to the drawer
Drawer result = buildView();
//define id for the sliderLayout
mSliderLayout.setId(R.id.material_drawer_slider_layout);
// add the slider to the drawer
mDrawerLayout.addView(mSliderLayout, 1);
return result;
}
开发者ID:FreedomZZQ,项目名称:YouJoin-Android,代码行数:50,代码来源:DrawerBuilder.java
注:本文中的com.mikepenz.materialize.MaterializeBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论