• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ListView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.holoeverywhere.widget.ListView的典型用法代码示例。如果您正苦于以下问题:Java ListView类的具体用法?Java ListView怎么用?Java ListView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ListView类属于org.holoeverywhere.widget包,在下文中一共展示了ListView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onPrepareListView

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
public void onPrepareListView(ListView listView) {
    if (hasDefaultItem) {
        defaultRingtonePos = addDefaultRingtoneItem(listView);
        if (RingtoneManager.isDefault(existingUri)) {
            clickedPos = defaultRingtonePos;
        }
    }
    if (hasSilentItem) {
        silentPos = addSilentItem(listView);
        if (existingUri == null) {
            clickedPos = silentPos;
        }
    }
    if (clickedPos == -1) {
        clickedPos = getListPosition(ringtoneManager
                .getRingtonePosition(existingUri));
    }
    builder.setCheckedItem(clickedPos);
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:21,代码来源:_RingtonePickerDialog.java


示例2: onSupportContentChanged

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
public void onSupportContentChanged() {
    super.onSupportContentChanged();
    View emptyView = findViewById(android.R.id.empty);
    mList = (ListView) findViewById(android.R.id.list);
    if (mList == null) {
        throw new RuntimeException(
                "Your content must have a ListView whose id attribute is "
                        + "'android.R.id.list'");
    }
    if (emptyView != null) {
        mList.setEmptyView(emptyView);
    }
    mList.setOnItemClickListener(mOnClickListener);
    if (mFinishedStart) {
        setListAdapter(mAdapter);
    }
    mHandler.post(mRequestFocus);
    mFinishedStart = true;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:21,代码来源:ListActivity.java


示例3: createTabView

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
private TabView createTabView(ActionBar.Tab tab, boolean forAdapter) {
    final TabView tabView = (TabView) mInflater.inflate(R.layout.abc_action_bar_tab, mTabLayout,
            false);
    tabView.attach(this, tab, forAdapter);

    if (forAdapter) {
        tabView.setBackgroundDrawable(null);
        tabView.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.FILL_PARENT,
                mContentHeight));
    } else {
        tabView.setFocusable(true);

        if (mTabClickListener == null) {
            mTabClickListener = new TabClickListener();
        }
        tabView.setOnClickListener(mTabClickListener);
    }
    return tabView;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:20,代码来源:ScrollingTabContainerView.java


示例4: onContentChanged

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
public void onContentChanged() {
    super.onContentChanged();
    View emptyView = findViewById(android.R.id.empty);
    mList = (ListView) findViewById(android.R.id.list);
    if (mList == null) {
        throw new RuntimeException(
                "Your content must have a ListView whose id attribute is "
                        + "'android.R.id.list'");
    }
    if (emptyView != null) {
        mList.setEmptyView(emptyView);
    }
    mList.setOnItemClickListener(mOnClickListener);
    if (mFinishedStart) {
        setListAdapter(mAdapter);
    }
    mHandler.post(mRequestFocus);
    mFinishedStart = true;
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:21,代码来源:ListActivity.java


示例5: onCreateView

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    mDrawerListView = (ListView) inflater.inflate(
            R.layout.fragment_navigation_drawer, container, false);
    mDrawerListView.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(android.widget.AdapterView<?> parent, View view, int position, long id) {
            selectItem(position);
        }
    });
    mDrawerListView.setAdapter(new ArrayAdapter<String>(
            getSupportActionBar().getThemedContext(),
            android.R.layout.simple_list_item_1,
            android.R.id.text1,
            new String[]{
                    getString(R.string.title_section1),
                    getString(R.string.title_section2),
                    getString(R.string.title_section3),
            }));
    mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
    return mDrawerListView;
}
 
开发者ID:wuyingren,项目名称:WhatsAnnoyProject,代码行数:24,代码来源:NavigationDrawerFragment.java


示例6: onCreateView

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {       
View view = inflater.inflate(R.layout.fragment_vertretung, container, false);

appContext = getActivity().getApplicationContext();
startActivity = (StartActivity) getActivity();

// Restore preferences
      settings = PreferenceManager.getDefaultSharedPreferences(appContext);
      list = (ListView) view.findViewById(R.id.listView1);
      klassen = (Spinner) view.findViewById(R.id.spinner1);
      txtStand = (TextView) view.findViewById(R.id.txtStand);
      pBar = (ProgressBar) view.findViewById(R.id.progressBar1);
      
      listadapter = new VertretungAdapter(startActivity);
list.setAdapter(listadapter);

new LoadClassesTask().execute();

// Inflate the layout for this fragment
      return view;
  }
 
开发者ID:johan12345,项目名称:ls-vertretungsplan,代码行数:23,代码来源:VertretungFragment.java


示例7: onCreate

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	this.requestWindowFeature(Window.FEATURE_NO_TITLE);
	this.setContentView(R.layout.snap_dialog);
	
	WindowManager.LayoutParams params = this.getWindow().getAttributes();
	params.gravity = Gravity.CENTER;
	this.getWindow().setAttributes(params);
	
	ListView listView = (ListView)this.findViewById(R.id.listView1);
	listView.setAdapter(new DialogListAdapter());
	
	int snapno = this.getIntent().getIntExtra(SNAP_NO, -1);
	if (snapno == -1) {
		StatMethods.hotBread(this, "Error: missing mSnap number in intent", Toast.LENGTH_SHORT);
		this.finish();
	}
	
	mSnap = LocalSnaps.getInstanceUnsafe().getSnapAt(snapno);
	
	mSnapTime = mSnap.getDisplayTime();
	mIsPhoto = mSnap.isPhoto();
	if (!mIsPhoto) {
		mCaption = mSnap.getCaption();
		mCaptionOri = mSnap.getCaptionOrientation();
		mCaptionPos = mSnap.getCaptionLocation();
	}
	
	mAllowSaves = SettingsAccessor.getAllowSaves(this);
	try {
		mFilePath = mSnap.getSnapPath(this);
	} catch (IOException e) {
		Twig.debug("SnapDialogActivity", "Error getting path");
	}
}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:38,代码来源:SnapDialogActivity.java


示例8: onCreateView

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup root, Bundle savedInstanceState) {
	setFocused(true);
	
	ListView v = (ListView)inflater.inflate(R.layout.contact_list, root, false);

       LocalSnaps.getInstanceSafe(this);
	
	switch (mTheme = SettingsAccessor.getThemePref(this.getActivity())) {
	case ori:
	case snapchat:
		break;
	case black:
	case def:
	default:
		BitmapDrawable draw;
		if (mBackgroundDrawable == null || (draw = mBackgroundDrawable.get()) == null) {
			draw = (BitmapDrawable) this.getActivity().getResources().getDrawable(R.drawable.main_menu_default_background);
			draw.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
			mBackgroundDrawable = new SoftReference<BitmapDrawable>(draw);
		}
		if (Build.VERSION.SDK_INT < 16) {
			v.setBackgroundDrawable(draw);
		} else {
			v.setBackground(draw);
		}
		v.setCacheColorHint(0x0);
		break;
}
	
	return v;
}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:34,代码来源:SnapThreadListFrag.java


示例9: onCreateView

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	setFocused(true);
	
	ListView v = (ListView)inflater.inflate(R.layout.contact_list);
	
	switch (theme = SettingsAccessor.getThemePref(this.getActivity())) {
		case ori:
		case snapchat:
			break;
		case black:
		case def:
		default:
			BitmapDrawable draw;
			if (drawable == null || (draw = drawable.get()) == null) {
				draw = (BitmapDrawable) this.getActivity().getResources().getDrawable(R.drawable.main_menu_default_background);
				draw.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
				drawable = new SoftReference<BitmapDrawable>(draw);
			}
			if (Build.VERSION.SDK_INT < 16) {
				v.setBackgroundDrawable(draw);
			} else {
				v.setBackground(draw);
			}
			v.setCacheColorHint(0x0);
			break;
	}
	
	Contacts.getInstanceSafe(this);
	
	return v;
}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:34,代码来源:ContactViewerListFrag.java


示例10: onItemClick

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
                        long id) {
    if (parent instanceof ListView) {
        position -= ((ListView) parent).getHeaderViewsCount();
    }
    Object item = getRootAdapter().getItem(position);
    if (!(item instanceof Preference)) {
        return;
    }

    final Preference preference = (Preference) item;
    preference.performClick(this);
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:15,代码来源:PreferenceScreen.java


示例11: addStaticItem

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
private int addStaticItem(ListView listView, int textResId) {
    TextView textView = (TextView) LayoutInflater.inflate(context,
            R.layout.select_dialog_singlechoice_holo, listView, false);
    textView.setText(textResId);
    listView.addHeaderView(textView);
    staticItemCount++;
    return listView.getHeaderViewsCount() - 1;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:9,代码来源:_RingtonePickerDialog.java


示例12: onListItemClick

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    if (mAdapter != null) {
        Object item = mAdapter.getItem(position);
        if (item instanceof Header) {
            onHeaderClick((Header) item, position);
        }
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:11,代码来源:PreferenceActivity.java


示例13: onItemClick

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    ActivityChooserViewAdapter adapter = (ActivityChooserViewAdapter) ((ListView) parent).getAdapterSource();
    final int itemViewType = adapter.getItemViewType(position);
    switch (itemViewType) {
        case ActivityChooserViewAdapter.ITEM_VIEW_TYPE_FOOTER: {
            showPopupUnchecked(ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED);
        } break;
        case ActivityChooserViewAdapter.ITEM_VIEW_TYPE_ACTIVITY: {
            dismissPopup();
            if (mIsSelectingDefaultActivity) {
                // The item at position zero is the default already.
                if (position > 0) {
                    mAdapter.getDataModel().setDefaultActivity(position);
                }
            } else {
                // If the default target is not shown in the list, the first
                // item in the model is default action => adjust index
                position = mAdapter.getShowDefaultActivity() ? position : position + 1;
                Intent launchIntent = mAdapter.getDataModel().chooseActivity(position);
                if (launchIntent != null) {
                    launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                    getContext().startActivity(launchIntent);
                }
            }
        } break;
        default:
            throw new IllegalArgumentException();
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:30,代码来源:ActivityChooserView.java


示例14: onKey

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
public boolean onKey(View v, int keyCode, KeyEvent event) {
    // guard against possible race conditions
    if (mSearchable == null) {
        return false;
    }

    if (DBG) {
        Log.d(LOG_TAG, "mTextListener.onKey(" + keyCode + "," + event + "), selection: "
                + mQueryTextView.getListSelection());
    }

    // If a suggestion is selected, handle enter, search key, and action keys
    // as presses on the selected suggestion
    if (mQueryTextView.isPopupShowing()
            && mQueryTextView.getListSelection() != ListView.INVALID_POSITION) {
        return onSuggestionsKey(v, keyCode, event);
    }

    // If there is text in the query box, handle enter, and action keys
    // The search key is handled by the dialog's onKeyDown().
    if (!mQueryTextView.isEmpty() && KeyEventCompat.hasNoModifiers(event)) {
        if (event.getAction() == KeyEvent.ACTION_UP) {
            if (keyCode == KeyEvent.KEYCODE_ENTER) {
                v.cancelLongPress();

                // Launch as a regular search.
                launchQuerySearch(KeyEvent.KEYCODE_UNKNOWN, null, mQueryTextView.getText()
                        .toString());
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:35,代码来源:SearchView.java


示例15: onItemClick

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
        long id) {
    if (parent instanceof ListView) {
        position -= ((ListView) parent).getHeaderViewsCount();
    }
    Object item = getRootAdapter().getItem(position);
    if (!(item instanceof Preference)) {
        return;
    }

    final Preference preference = (Preference) item;
    preference.performClick(this);
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:15,代码来源:PreferenceScreen.java


示例16: onCreateView

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {       
View view = inflater.inflate(R.layout.fragment_nachrichten, container, false);

      pBar = (ProgressBar) view.findViewById(R.id.progressBar2);
      list = (ListView) view.findViewById(R.id.listView2);
      progress(true);
      
      listadapter = new NachrichtenAdapter(activity);
list.setAdapter(listadapter);

// Inflate the layout for this fragment
      return view;
  }
 
开发者ID:johan12345,项目名称:ls-vertretungsplan,代码行数:15,代码来源:NachrichtenFragment.java


示例17: bind

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
public void bind(ListView listView) {
    listView.setOnItemClickListener(this);
    listView.setAdapter(getRootAdapter());
    onAttachedToActivity();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:6,代码来源:PreferenceScreen.java


示例18: getListView

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
public ListView getListView() {
    ensureList();
    return mList;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:5,代码来源:PreferenceFragment.java


示例19: addDefaultRingtoneItem

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
private int addDefaultRingtoneItem(ListView listView) {
    return addStaticItem(listView, R.string.ringtone_default);
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:4,代码来源:_RingtonePickerDialog.java


示例20: addSilentItem

import org.holoeverywhere.widget.ListView; //导入依赖的package包/类
private int addSilentItem(ListView listView) {
    return addStaticItem(listView, R.string.ringtone_silent);
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:4,代码来源:_RingtonePickerDialog.java



注:本文中的org.holoeverywhere.widget.ListView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JSON类代码示例发布时间:2022-05-23
下一篇:
Java IMetadataSerializer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap