com.qmuiteam.qmui.widget.grouplist.QMUIGroupListView Java Examples
The following examples show how to use
com.qmuiteam.qmui.widget.grouplist.QMUIGroupListView.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AboutActivity.java From PoetryWeather with Apache License 2.0 | 5 votes |
private void initAboutList() { //初始化LOGO下面的名称和版本号 mVersionTextView.setText("诗语天气 V1.0.2"); //作者 QMUICommonListItemView itemAuthor = mAboutGroupListView.createItemView("作者"); itemAuthor.setDetailText("黄振敏"); //微信 QMUICommonListItemView itemWechat = mAboutGroupListView.createItemView("微信"); itemWechat.setAccessoryType(QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); itemWechat.setDetailText("hzm1998hzm"); itemWechat.setTag(R.id.listitem_tag_1); //QQ QMUICommonListItemView itemQQ = mAboutGroupListView.createItemView("QQ"); itemQQ.setAccessoryType(QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); itemQQ.setDetailText("934585316"); itemQQ.setTag(R.id.listitem_tag_2); //GitHub主页 QMUICommonListItemView itemGitHub = mAboutGroupListView.createItemView("作者GitHub主页"); itemGitHub.setOrientation(QMUICommonListItemView.VERTICAL); itemGitHub.setDetailText("https://github.com/hzm0321"); itemGitHub.setAccessoryType(QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); itemGitHub.setTag(R.id.listitem_tag_3); QMUIGroupListView.newSection(this) .setDescription(getString(R.string.about_description)) .addItemView(itemAuthor, null) .addItemView(itemWechat, mOnClickListenerListItem) .addItemView(itemQQ, mOnClickListenerListItem) .addItemView(itemGitHub, mOnClickListenerListItem) .addTo(mAboutGroupListView); //初始化页面底部的版权 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy", Locale.CHINA); String currentYear = dateFormat.format(new java.util.Date()); mCopyrightTextView.setText(String.format(getResources().getString(R.string.about_copyright), currentYear)); }
Example #2
Source File: AddAndEditPoetryActivity.java From PoetryWeather with Apache License 2.0 | 4 votes |
/** * 初始化列表 */ @SuppressLint("LongLogTag") private void initGroupListView() { idPoetryListView = mGroupListView.createItemView( ContextCompat.getDrawable(AddAndEditPoetryActivity.this,R.drawable.item_icon00), "id", String.valueOf(id), QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_NONE); idPoetryListView.setTag(R.id.listitem_tag_1); firstPoetryListView = mGroupListView.createItemView( ContextCompat.getDrawable(AddAndEditPoetryActivity.this,R.drawable.item_icon01), "诗词上句", sFirstPoetry, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); firstPoetryListView.setTag(R.id.listitem_tag_2); secondPoetryListView = mGroupListView.createItemView( ContextCompat.getDrawable(AddAndEditPoetryActivity.this,R.drawable.item_icon02), "诗词下句", sSecondPotry, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); secondPoetryListView.setTag(R.id.listitem_tag_3); weatherPoetryListView = mGroupListView.createItemView( ContextCompat.getDrawable(AddAndEditPoetryActivity.this,R.drawable.item_icon03), "匹配天气", sWeatherPoetry, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); weatherPoetryListView.setTag(R.id.listitem_tag_4); isqwxlPoetryListView = mGroupListView.createItemView( ContextCompat.getDrawable(AddAndEditPoetryActivity.this,R.drawable.item_icon04), "清婉秀丽", qwxl==-1?null:(qwxl==0?"否":"是"), QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); Log.d(TAG, "initGroupListView: 清婉秀丽"+qwxl); isqwxlPoetryListView.setTag(R.id.listitem_tag_5); isjygkPoetryListView = mGroupListView.createItemView( ContextCompat.getDrawable(AddAndEditPoetryActivity.this,R.drawable.item_icon05), "激越高亢", jygk==-1?null:(jygk==0?"否":"是"), QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); isjygkPoetryListView.setTag(R.id.listitem_tag_6); isyyqlPoetryListView = mGroupListView.createItemView( ContextCompat.getDrawable(AddAndEditPoetryActivity.this,R.drawable.item_icon06), "语言绮丽", yyql==-1?null:(yyql==0?"否":"是"), QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); isyyqlPoetryListView.setTag(R.id.listitem_tag_7); QMUIGroupListView.newSection(this) .addItemView(idPoetryListView,null) .addItemView(firstPoetryListView,onClickListener) .addItemView(secondPoetryListView,onClickListener) .addItemView(weatherPoetryListView,onClickListener) // .addItemView(isqwxlPoetryListView,onClickListener) // .addItemView(isjygkPoetryListView,onClickListener) // .addItemView(isyyqlPoetryListView,onClickListener) .addTo(mGroupListView); }
Example #3
Source File: PersonActivity.java From PoetryWeather with Apache License 2.0 | 4 votes |
/** * 初始化GroupListView */ private void initGroupListView() { nameListView = mGroupListView.createItemView( ContextCompat.getDrawable(PersonActivity.this,R.drawable.item_icon00), "姓名", null, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); nameListView.setTag(R.id.listitem_tag_1); nameListView.setDetailText(name); sexListView = mGroupListView.createItemView( ContextCompat.getDrawable(PersonActivity.this, R.drawable.item_icon01), "性别", null, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); sexListView.setTag(R.id.listitem_tag_2); sexListView.setDetailText(sex); signatureListView = mGroupListView.createItemView( ContextCompat.getDrawable(PersonActivity.this, R.drawable.item_icon02), "个性签名", null, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); signatureListView.setTag(R.id.listitem_tag_3); signatureListView.setDetailText(signature); preferenceListView = mGroupListView.createItemView( ContextCompat.getDrawable(PersonActivity.this, R.drawable.item_icon03), "诗词偏爱", null, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); preferenceListView.setTag(R.id.listitem_tag_4); preferenceListView.setDetailText(preference); refreshForWeatherListView = mGroupListView.createItemView( ContextCompat.getDrawable(PersonActivity.this,R.drawable.item_icon04), "自动刷新间隔", null, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); refreshForWeatherListView.setTag(R.id.listitem_tag_5); refreshForWeatherListView.setDetailText(refreshForWeather); QMUIGroupListView.newSection(this) .setTitle("个人信息") .addItemView(nameListView,onClickListener) .addItemView(sexListView,onClickListener) .addItemView(signatureListView,onClickListener) .addTo(mGroupListView); QMUIGroupListView.newSection(this) .setTitle("偏好设置") .addItemView(refreshForWeatherListView, onClickListener) .addTo(mGroupListView); }
Example #4
Source File: PoetryActivity.java From PoetryWeather with Apache License 2.0 | 4 votes |
/** * 初始化GroupList */ private void initGroupListView() { //检查优先级 int prior = PrefUtils.getInt("priorPoetry", PoetryActivity.this); String sPrior; if (prior == 1) { sPrior = "低"; } else if (prior == 2) { sPrior = "标准"; } else { sPrior = "高"; } int ownNumbers = LitePal.findAll(PoetryDb.class).size(); officialPoetryNumber = mGroupListView.createItemView( ContextCompat.getDrawable(PoetryActivity.this,R.drawable.item_icon05), "官方诗词数", String.valueOf("1w+"), QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_NONE); officialPoetryNumber.setTag(R.id.listitem_tag_1); ownPoetryNumber = mGroupListView.createItemView( ContextCompat.getDrawable(PoetryActivity.this,R.drawable.item_icon06), "自定义诗词数", String.valueOf(ownNumbers), QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_NONE); ownPoetryNumber.setTag(R.id.listitem_tag_2); addOwnPoetry = mGroupListView.createItemView( ContextCompat.getDrawable(PoetryActivity.this,R.drawable.item_icon07), "添加自定义诗词", null, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); addOwnPoetry.setTag(R.id.listitem_tag_3); buyOwnPoetry = mGroupListView.createItemView( ContextCompat.getDrawable(PoetryActivity.this,R.drawable.item_icon00), "购买自定义诗词包", null, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); buyOwnPoetry.setTag(R.id.listitem_tag_4); priorOwnPoetry = mGroupListView.createItemView( ContextCompat.getDrawable(PoetryActivity.this,R.drawable.item_icon01), "自定义诗词匹配优先级", sPrior, QMUICommonListItemView.HORIZONTAL, QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); priorOwnPoetry.setTag(R.id.listitem_tag_5); QMUIGroupListView.newSection(this) .setTitle("本地诗词数据库") .addItemView(officialPoetryNumber,null) .addItemView(ownPoetryNumber,null) .addTo(mGroupListView); QMUIGroupListView.newSection(this) .setTitle("自定义诗词数据库") .addItemView(addOwnPoetry,onClickListener) .addItemView(buyOwnPoetry,onClickListener) .addItemView(priorOwnPoetry,onClickListener) .addTo(mGroupListView); }
Example #5
Source File: QMUIGroupListViewActivity.java From BaseUIFrame with MIT License | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ButterKnife.bind(mActivity); title = getIntent().getStringExtra(MyApp.INTENT_VALUE_TITLE_STR); if (title != null) { topBar.setTitle(title); } //标准样式 QMUICommonListItemView normalItem = mGroupListView.createItemView("Item 1"); normalItem.setOrientation(QMUICommonListItemView.VERTICAL); //右边描述信息 QMUICommonListItemView itemWithDetail = mGroupListView.createItemView("Item 2"); itemWithDetail.setDetailText("右边Detail描述信息"); //下方描述信息 QMUICommonListItemView itemWithDetailBelow = mGroupListView.createItemView("Item 3"); itemWithDetailBelow.setOrientation(QMUICommonListItemView.VERTICAL); itemWithDetailBelow.setDetailText("下方Detail描述信息"); //带向右箭头的ITEM QMUICommonListItemView itemWithChevron = mGroupListView.createItemView("Item 4"); itemWithChevron.setAccessoryType(QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON); //带Boolean SWITCH选择器的ITEM QMUICommonListItemView itemWithSwitch = mGroupListView.createItemView("Item 5"); itemWithSwitch.setAccessoryType(QMUICommonListItemView.ACCESSORY_TYPE_SWITCH); itemWithSwitch.getSwitch().setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { ToastUtil.showToast("checked = " + isChecked); } }); mGroupListView.newSection(mActivity) .setTitle("Section 1: 默认提供的样式(HEAD)") // .setDescription("Section 1 的描述(FOOT)") .addItemView(normalItem, onClickListener) .addItemView(itemWithDetail, onClickListener) .addItemView(itemWithDetailBelow, onClickListener) .addItemView(itemWithChevron, onClickListener) .addItemView(itemWithSwitch, onClickListener) .addTo(mGroupListView); QMUICommonListItemView itemWithCustom = mGroupListView.createItemView("Item 6"); itemWithCustom.setAccessoryType(QMUICommonListItemView.ACCESSORY_TYPE_CUSTOM); QMUILoadingView loadingView = new QMUILoadingView(mActivity); itemWithCustom.addAccessoryCustomView(loadingView); QMUIGroupListView.newSection(mActivity) .setTitle("Section 2: 自定义右侧 View") .addItemView(itemWithCustom, onClickListener) .addTo(mGroupListView); }