當前位置: 首頁>>代碼示例>>Java>>正文


Java ListView.setDivider方法代碼示例

本文整理匯總了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);
}
 
開發者ID:WindFromFarEast,項目名稱:SmartButler,代碼行數:18,代碼來源:ButlerFragment.java

示例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);
}
 
開發者ID:willowtreeapps,項目名稱:spruce-android,代碼行數:27,代碼來源:ListViewFragment.java

示例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;
}
 
開發者ID:medalionk,項目名稱:simple-share-android,代碼行數:33,代碼來源:DirectoryFragment.java

示例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);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:20,代碼來源:UsbDevicePreferences.java

示例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);

    }
 
開發者ID:Shmilyz,項目名稱:Swap,代碼行數:22,代碼來源:SearchFragment.java

示例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));

}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:MultiItemListViewActivity.java

示例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);
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:12,代碼來源:CommonDialog.java

示例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);
}
 
開發者ID:QMUI,項目名稱:QMUI_Android,代碼行數:28,代碼來源:QDQQFaceBasePagerView.java

示例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);
    }
}
 
開發者ID:Trumeet,項目名稱:SetupWizardLibCompat,代碼行數:16,代碼來源:SetupWizardListLayout.java

示例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;
}
 
開發者ID:lbbniu,項目名稱:CCDownload,代碼行數:36,代碼來源:DownloadFragment.java

示例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));
}
 
開發者ID:pao11,項目名稱:BaseAdapterRel,代碼行數:11,代碼來源:MultiItemListViewActivity.java

示例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);
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:12,代碼來源:CommonDialog.java

示例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);
}
 
開發者ID:QMUI,項目名稱:QMUI_Android,代碼行數:11,代碼來源:QMUIListPopup.java

示例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;
}
 
開發者ID:ficklerobot,項目名稱:grid-video-viewer,代碼行數:34,代碼來源:VideoGridFragment.java

示例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;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:16,代碼來源:SearchEnginePreference.java


注:本文中的android.widget.ListView.setDivider方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。