本文整理汇总了Java中android.widget.ListView.setDivider方法的典型用法代码示例。如果您正苦于以下问题:Java ListView.setDivider方法的具体用法?Java ListView.setDivider怎么用?Java ListView.setDivider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ListView
的用法示例。
在下文中一共展示了ListView.setDivider方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import android.widget.ListView; //导入方法依赖的package包/类
private void initView(View view)
{
lv_chatting= (ListView) view.findViewById(R.id.lv_chatting);
btn_chatting_send= (Button) view.findViewById(R.id.btn_chatting_send);
et_chatting_text= (EditText) view.findViewById(R.id.et_chatting_text);
//适配器初始化以及与ListView的绑定
adapter=new ChattingAdapter(mList);
lv_chatting.setAdapter(adapter);
//取消ListView的分割线
lv_chatting.setDivider(null);
//机器人欢迎话语
showButlerResponse("你好,人家是向玮鑫的小管家啦~");
btn_chatting_send.setOnClickListener(this);
et_chatting_text.setOnClickListener(this);
}
示例2: onCreateView
import android.widget.ListView; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, @Nullable Bundle savedInstanceState) {
listView = (ListView) container.findViewById(R.id.list_view);
// Create the animator after the list view has finished laying out
listView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
initSpruce();
}
});
// Mock data objects
List<ExampleData> placeHolderList = new ArrayList<>();
for (int i = 0; i < 10; i++) {
placeHolderList.add(new ExampleData());
}
// Remove default dividers and set adapter
listView.setDivider(null);
listView.setDividerHeight(0);
listView.setAdapter(new ListViewAdapter(placeHolderList));
return inflater.inflate(R.layout.list_view_fragment, container, false);
}
示例3: onCreateView
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final Context context = inflater.getContext();
final Resources res = context.getResources();
final View view = inflater.inflate(R.layout.fragment_directory, container, false);
mProgressBar = (MaterialProgressBar) view.findViewById(R.id.progressBar);
mEmptyView = (CompatTextView)view.findViewById(android.R.id.empty);
mListView = (ListView) view.findViewById(R.id.list);
mListView.setOnItemClickListener(mItemListener);
mListView.setMultiChoiceModeListener(mMultiListener);
mListView.setRecyclerListener(mRecycleListener);
// Indent our list divider to align with text
final Drawable divider = mListView.getDivider();
final boolean insetLeft = res.getBoolean(R.bool.list_divider_inset_left);
final int insetSize = res.getDimensionPixelSize(R.dimen.list_divider_inset);
if (insetLeft) {
mListView.setDivider(new InsetDrawable(divider, insetSize, 0, 0, 0));
} else {
mListView.setDivider(new InsetDrawable(divider, 0, 0, insetSize, 0));
}
mGridView = (GridView) view.findViewById(R.id.grid);
mGridView.setOnItemClickListener(mItemListener);
mGridView.setMultiChoiceModeListener(mMultiListener);
mGridView.setRecyclerListener(mRecycleListener);
return view;
}
示例4: onActivityCreated
import android.widget.ListView; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onActivityCreated(Bundle savedInstanceState) {
addPreferencesFromResource(R.xml.usb_device_preferences);
ListView listView = (ListView) getView().findViewById(android.R.id.list);
listView.setDivider(null);
int contentSettingsType = getArguments().getInt(EXTRA_CATEGORY);
mCategory = SiteSettingsCategory.fromContentSettingsType(contentSettingsType);
mUsbInfos = (ArrayList<UsbInfo>) getArguments().getSerializable(EXTRA_USB_INFOS);
mUsbInfo = mUsbInfos.get(0);
mSites = (ArrayList<Website>) getArguments().getSerializable(EXTRA_SITES);
String title = getArguments().getString(SingleCategoryPreferences.EXTRA_TITLE);
if (title != null) getActivity().setTitle(title);
setHasOptionsMenu(true);
super.onActivityCreated(savedInstanceState);
}
示例5: initv
import android.widget.ListView; //导入方法依赖的package包/类
private void initv() {
List<Data> count=DataSupport.select().find(Data.class);
int counts=count.size();
if (counts>0){
Data lastData= DataSupport.findLast(Data.class);
int last=lastData.getId();
if (last>5){
recent=DataSupport.limit(5).offset(last-5).find(Data.class);
}
else {
recent=DataSupport.findAll(Data.class);
}
}
final SearchRecentAdapter adapter=new SearchRecentAdapter(getActivity(),R.layout.hot_item,recent);
ListView listView= (ListView) rootView.findViewById(R.id.recent_view);
listView.setDivider(null);
listView.setAdapter(adapter);
}
示例6: onCreate
import android.widget.ListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mListView = (ListView) findViewById(R.id.id_listview_list);
mListView.setDivider(null);
mListView.setAdapter(new ChatAdapter(this, ChatMessage.MOCK_DATAS));
}
示例7: setItems
import android.widget.ListView; //导入方法依赖的package包/类
public void setItems(CharSequence[] items, int index,
AdapterView.OnItemClickListener onItemClickListener) {
ListView listview = new ListView(content.getContext());
listview.setCacheColorHint(0);
listview.setDivider(null);
listview.setLayoutParams(new FrameLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
listview.setAdapter(new DialogAdapter(items, index));
listview.setOnItemClickListener(onItemClickListener);
setContent(listview, 0);
}
示例8: QDQQFaceBasePagerView
import android.widget.ListView; //导入方法依赖的package包/类
public QDQQFaceBasePagerView(Context context) {
super(context);
mTestData = new QDQQFaceTestData();
setOrientation(VERTICAL);
ListView listView = new ListView(context);
LinearLayout.LayoutParams listLp = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);
listLp.weight = 1;
listView.setLayoutParams(listLp);
listView.setDivider(null);
listView.setDividerHeight(0);
listView.setAdapter(new MyAdapter());
addView(listView);
mLogTv = new TextView(context);
LinearLayout.LayoutParams logLp = new LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, QMUIDisplayHelper.dp2px(context, 60));
mLogTv.setLayoutParams(logLp);
mLogTv.setTextSize(12);
mLogTv.setBackgroundResource(R.drawable.qmui_divider_top_bitmap);
int paddingHor = QMUIDisplayHelper.dp2px(context, 16);
mLogTv.setPadding(paddingHor, 0, paddingHor, 0);
mLogTv.setTextColor(ContextCompat.getColor(context, R.color.qmui_config_color_black));
mLogTv.setMovementMethod(QMUIScrollingMovementMethod.getInstance());
addView(mLogTv);
}
示例9: updateDivider
import android.widget.ListView; //导入方法依赖的package包/类
private void updateDivider() {
boolean shouldUpdate = true;
if (Build.VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
shouldUpdate = isLayoutDirectionResolved();
}
if (shouldUpdate) {
final ListView listView = getListView();
if (mDefaultDivider == null) {
mDefaultDivider = listView.getDivider();
}
mDivider = DrawableLayoutDirectionHelper.createRelativeInsetDrawable(mDefaultDivider,
mDividerInset /* start */, 0 /* top */, 0 /* end */, 0 /* bottom */, this);
listView.setDivider(mDivider);
}
}
示例10: onCreateView
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
activity = getActivity();
context = activity.getApplicationContext();
receiver = new DownloadedReceiver();
activity.registerReceiver(receiver, new IntentFilter(ConfigUtil.ACTION_DOWNLOADING));
RelativeLayout downloadRelativeLayout = new RelativeLayout(context);
downloadRelativeLayout.setBackgroundColor(Color.WHITE);
downloadRelativeLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
downloadListView = new ListView(context);
downloadListView.setPadding(10, 10, 10, 10);
downloadListView.setDivider(getResources().getDrawable(R.drawable.line));
LayoutParams listViewLayout = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
downloadRelativeLayout.addView(downloadListView, listViewLayout);
// 生成动态数组,加入数据
pairs = new ArrayList<Pair<String,Integer>>();
for (int i = 0; i < downloadVideoIds.length; i++) {
Pair<String, Integer> pair = new Pair<String, Integer>(downloadVideoIds[i], R.drawable.download);
pairs.add(pair);
}
downloadListViewAdapter = new DownloadListViewAdapter(context, pairs);
downloadListView.setAdapter(downloadListViewAdapter);
downloadListView.setOnItemClickListener(onItemClickListener);
service = new Intent(context, DownloadService.class);
activity.bindService(service, serviceConnection, Context.BIND_AUTO_CREATE);
initDownloaderHashMap();
return downloadRelativeLayout;
}
示例11: onCreate
import android.widget.ListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mListView = (ListView) findViewById(R.id.id_listview_list);
mListView.setDivider(null);
mListView.setAdapter(new ChatAdapter(this, ChatMessage.MOCK_DATAS));
}
示例12: setItemsWithoutChk
import android.widget.ListView; //导入方法依赖的package包/类
public void setItemsWithoutChk(CharSequence[] items,
AdapterView.OnItemClickListener onItemClickListener) {
ListView listview = new ListView(content.getContext());
listview.setLayoutParams(new FrameLayout.LayoutParams(-1, -2));
DialogAdapter adapter = new DialogAdapter(items);
adapter.setShowChk(false);
listview.setDivider(null);
listview.setAdapter(adapter);
listview.setOnItemClickListener(onItemClickListener);
setContent(listview, 0);
}
示例13: create
import android.widget.ListView; //导入方法依赖的package包/类
public void create(int width, int maxHeight, AdapterView.OnItemClickListener onItemClickListener) {
ListView listView = new QMUIWrapContentListView(mContext, maxHeight);
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(width, maxHeight);
listView.setLayoutParams(lp);
listView.setAdapter(mAdapter);
listView.setVerticalScrollBarEnabled(false);
listView.setOnItemClickListener(onItemClickListener);
listView.setDivider(null);
setContentView(listView);
}
示例14: onCreateView
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Bundle args = this.getArguments();
mColCount = args.getInt(GalleryActivity.EXT_COL_COUNT, 2);
int playCount = args.getInt(GalleryActivity.EXT_PLAY_COUNT, 1);
mTapAction = args.getInt(GalleryActivity.EXT_TAP_ACTION, MainActivity.TAP_ACTION_FLOAT);
Context context = getActivity().getApplicationContext();
mWindowSize = new int[2];
DisplayMetrics display = context.getResources().getDisplayMetrics();
mWindowSize[0] = display.widthPixels;
mWindowSize[1] = display.heightPixels;
mRootView = new RelativeLayout(context);
RelativeLayout.LayoutParams listLayoutParams = new RelativeLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mVideoList = new ListView(context);
mVideoList.setDivider(null);
mRootView.addView(mVideoList, listLayoutParams);
mVideoUriList = new ArrayList<>();
mThumbnailCache = new ThumbnailCache(context);
mSurfaceArray = new SparseArray<>();
mQueueManager.setMaxRunCount(playCount);
return mRootView;
}
示例15: onCreateView
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.search_engine_layout, container, false);
mListView = (ListView) view.findViewById(android.R.id.list);
mListView.setAdapter(mSearchEngineAdapter);
mListView.setDivider(null);
mListView.addOnLayoutChangeListener(this);
mCancelButton = view.findViewById(R.id.cancel_button);
mCancelButton.setOnClickListener(this);
mSaveButton = view.findViewById(R.id.save_button);
mSaveButton.setOnClickListener(this);
mDivider = view.findViewById(R.id.bottom_shadow);
return view;
}