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

Java TwoLineListItem类代码示例

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

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



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

示例1: getView

import android.widget.TwoLineListItem; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
  TwoLineListItem view =
      (convertView != null) ? (TwoLineListItem) convertView : createView(parent);
  mCursor.moveToPosition(position);
  bindView(view, mCursor);
  return view;
}
 
开发者ID:De7vID,项目名称:klingon-assistant,代码行数:9,代码来源:KlingonAssistant.java


示例2: createView

import android.widget.TwoLineListItem; //导入依赖的package包/类
private TwoLineListItem createView(ViewGroup parent) {
  TwoLineListItem item =
      (TwoLineListItem) mInflater.inflate(android.R.layout.simple_list_item_2, parent, false);

  // Set single line to true if you want shorter definitions.
  item.getText2().setSingleLine(false);
  item.getText2().setEllipsize(TextUtils.TruncateAt.END);

  return item;
}
 
开发者ID:De7vID,项目名称:klingon-assistant,代码行数:11,代码来源:KlingonAssistant.java


示例3: bindView

import android.widget.TwoLineListItem; //导入依赖的package包/类
private void bindView(TwoLineListItem view, Cursor cursor) {
  KlingonContentProvider.Entry entry =
      new KlingonContentProvider.Entry(cursor, getBaseContext());

  // Note that we override the typeface and text size here, instead of in
  // the xml, because putting it there would also change the appearance of
  // the Preferences page. We fully indent suffixes, but only half-indent verbs.
  String indent1 =
      entry.isIndented() ? (entry.isVerb() ? "  " : "    ") : "";
  String indent2 =
      entry.isIndented()
          ? (entry.isVerb()
              ? "    "
              : "       ")
          : "";

  SharedPreferences sharedPrefs =
      PreferenceManager.getDefaultSharedPreferences(getBaseContext());
  if (Preferences.useKlingonFont(getBaseContext())) {
    // Preference is set to display this in {pIqaD}!
    view.getText1().setTypeface(KlingonAssistant.getKlingonFontTypeface(getBaseContext()));
    view.getText1().setText(Html.fromHtml(indent1 + entry.getEntryNameInKlingonFont()));
  } else {
    // Use serif for the entry, so capital-I and lowercase-l are distinguishable.
    view.getText1().setTypeface(Typeface.SERIF);
    view.getText1()
        .setText(Html.fromHtml(indent1 + entry.getFormattedEntryName(/* isHtml */ true)));
  }
  view.getText1().setTextSize(22);

  // TODO: Colour attached affixes differently from verb.
  view.getText1().setTextColor(entry.getTextColor());

  // Use sans serif for the definition.
  view.getText2().setTypeface(Typeface.SANS_SERIF);
  view.getText2()
      .setText(Html.fromHtml(indent2 + entry.getFormattedDefinition(/* isHtml */ true)));
  view.getText2().setTextSize(14);
  view.getText2().setTextColor(0xFFC0C0C0);
}
 
开发者ID:De7vID,项目名称:klingon-assistant,代码行数:41,代码来源:KlingonAssistant.java


示例4: getView

import android.widget.TwoLineListItem; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.action_bar_two_line_text,
                parent, false);
    }
    TwoLineListItem view = (TwoLineListItem) convertView;
    view.getText1().setText(mActionBar.getTitle());
    view.getText2().setText((CharSequence) getItem(position));
    return convertView;
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:12,代码来源:GalleryActionBar.java


示例5: bindGroupView

import android.widget.TwoLineListItem; //导入依赖的package包/类
@Override
protected void bindGroupView(View view, Context context, Cursor cursor,
		boolean isExpanded) {
	// TODO Auto-generated method stub	
	TwoLineListItem mTwoLineList = (TwoLineListItem)view;
	TextView mInfoView = mTwoLineList.getText1();
	TextView mInfoView2 = mTwoLineList.getText2();
	
	mInfoView.setTextSize(15);
	mInfoView.setTextColor(Color.GREEN);
	mInfoView2.setTextSize(15);
	mInfoView2.setTextColor(Color.BLUE);
	mInfoView.setText(cursor.getString(_ID)+" Power: "+cursor.getString(POWER)+"mW");
	mInfoView2.setText(" Range:\t"+cursor.getString(STARTPOINT)+"% ~ "+cursor.getString(ENDPOINT)+"%");
}
 
开发者ID:PowerLab,项目名称:PowerDoctor,代码行数:16,代码来源:SaveInformationActivity.java


示例6: onCreate

import android.widget.TwoLineListItem; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
    mListView = (ListView) findViewById(R.id.deviceList);
    mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
    mProgressBarTitle = (TextView) findViewById(R.id.progressBarTitle);

    mAdapter = new ArrayAdapter<UsbSerialPort>(this,
            android.R.layout.simple_expandable_list_item_2, mEntries) {
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            final TwoLineListItem row;
            if (convertView == null){
                final LayoutInflater inflater =
                        (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                row = (TwoLineListItem) inflater.inflate(android.R.layout.simple_list_item_2, null);
            } else {
                row = (TwoLineListItem) convertView;
            }

            final UsbSerialPort port = mEntries.get(position);
            final UsbSerialDriver driver = port.getDriver();
            final UsbDevice device = driver.getDevice();

            final String title = String.format("Vendor %s Product %s",
                    HexDump.toHexString((short) device.getVendorId()),
                    HexDump.toHexString((short) device.getProductId()));
            row.getText1().setText(title);

            final String subtitle = driver.getClass().getSimpleName();
            row.getText2().setText(subtitle);

            return row;
        }

    };
    mListView.setAdapter(mAdapter);

    mListView.setOnItemClickListener(new ListView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Log.d(TAG, "Pressed item " + position);
            if (position >= mEntries.size()) {
                Log.w(TAG, "Illegal position.");
                return;
            }

            final UsbSerialPort port = mEntries.get(position);
            showConsoleActivity(port);
        }
    });
}
 
开发者ID:kost,项目名称:DroidMeter,代码行数:56,代码来源:MainActivity.java


示例7: assertTopViewIsCorrectType

import android.widget.TwoLineListItem; //导入依赖的package包/类
private void assertTopViewIsCorrectType() {
    assertTrue(container.getChildAt(1) instanceof TwoLineListItem);
}
 
开发者ID:mattlogan,项目名称:Pancakes,代码行数:4,代码来源:ViewStackTest.java


示例8: onCreate

import android.widget.TwoLineListItem; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
    mListView = (ListView) findViewById(R.id.deviceList);
    mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
    mProgressBarTitle = (TextView) findViewById(R.id.progressBarTitle);

    mAdapter = new ArrayAdapter<UsbSerialPort>(this,
            android.R.layout.simple_expandable_list_item_2, mEntries) {
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            final TwoLineListItem row;
            if (convertView == null){
                final LayoutInflater inflater =
                        (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                row = (TwoLineListItem) inflater.inflate(android.R.layout.simple_list_item_2, null);
            } else {
                row = (TwoLineListItem) convertView;
            }

            final UsbSerialPort port = mEntries.get(position);
            final UsbSerialDriver driver = port.getDriver();
            final UsbDevice device = driver.getDevice();

            final String title = String.format("Vendor %s Product %s",
                    HexDump.toHexString((short) device.getVendorId()),
                    HexDump.toHexString((short) device.getProductId()));
            row.getText1().setText(title);

            final String subtitle = driver.getClass().getSimpleName();
            row.getText2().setText(subtitle);

            return row;
        }

    };
    mListView.setAdapter(mAdapter);

    mListView.setOnItemClickListener(new ListView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Log.d(TAG, "Pressed item " + position);
            if (position >= mEntries.size()) {
                Log.w(TAG, "Illegal position.");
                return;
            }

            final UsbSerialPort port = mEntries.get(position);
            showConsoleActivity(port);
        }
    });
}
 
开发者ID:rodolfo3,项目名称:android-vusb-arduino,代码行数:56,代码来源:DeviceListActivity.java


示例9: peek

import android.widget.TwoLineListItem; //导入依赖的package包/类
@Test
public void peek() {
    viewStack.push(BOTTOM_LAYOUT_RES);

    viewStack.push(TOP_LAYOUT_RES);

    View view = viewStack.peek();

    assertTrue(view instanceof TwoLineListItem);
}
 
开发者ID:mattlogan,项目名称:Pancakes,代码行数:11,代码来源:ViewStackTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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