tag 标签: adapter

相关博文
  • 热度 30
    2016-1-19 21:55
    2823 次阅读|
    0 个评论
    安卓listview的view重用,Adapter适配器类,setTag,getTag的理解 listview用的“适配器类”中一般有这个写法:     public View getView(int position, View convertView, final ViewGroup parent) {         mInflater = (LayoutInflater) contxet.getSystemService(Context.LAYOUT_INFLATER_SERVICE);         ViewHolder holder;         if (convertView == null) {             convertView = mInflater.inflate(R.layout.block_list_item, null);             holder = new ViewHolder();             holder.mAd_tv_show = (TextView) convertView.findViewById(R.id.ad_tv_show);             holder.mAd_btn_one = (Button) convertView.findViewById(R.id.ad_btn_one);             holder.mAd_btn_two = (Button) convertView.findViewById(R.id.ad_btn_two);             convertView.setTag(holder);         } else {             holder = (ViewHolder) convertView.getTag();         }         。。。其它语句 是什么意思呢? 经研究,系统要显示listview中的其中一项listitem时,就会调用“适配器类”中的getView(int position, View convertView, final ViewGroup parent)。 这个函数方法是我们自己重写的,是由系统调用的,当要在屏上显示其中一个listitem项时,系统就会调用这个函数方法。 返回值view:我们返回这个listitem的view给系统,系统就把这个view显示出来。 position:系统会给出position值,表示要显示哪一个listitem。 convertView:系统会给出一个view,也可能是null。 因为每个listitem就是一个view! 比如listview中有100个listitem,当我们划动手指时,其它的listitem要显示出来,当每个listitem要显示出来时,系统都会调用getView()来得到这个listitem的view。不管你是上划,还是下划,即查看已显示过的listitem,也会调用getView()。 如果我们在getView()程序中每次都创建一个view出来,那我们下划到最后,就会有100个view被创建出来,我们再上划到最前面,又有100个view被创建出来,反复上下划,view就越来越多,系统就崩溃了。 所以,view是设定成可以重用的,只需要当前显示的view就够用了,,比如手机屏幕中只显示了3个listitem,其它listitem现在不用显示,则只需要3个view就可以了。我们只需要创建出3个view出来。当有一个listitem不再显示,它的view就可以被重用给要显示的新的listitem,就可以了。 系统自己会管理要重用的view,所以它调用getView()时,如果一个不再使用的view可以重用,它就把这个view作为convertView传递过来,让我们使用。如果没有可重用的view,它就传递null。这样我们在程序中就可以判断是否新建一个view了。 setTag()是把我们自己的数据依附到这个view中。当下次我们用这个view时,可以用getTag()取出自己的数据。 这个view中会有textview、button等,我们把它们存到自定义的ViewHolder中,再把ViewHolder依附setTag()到这个view中,供自己下次getTag()出来使用。。  
  • 热度 13
    2012-10-12 21:22
    1732 次阅读|
    0 个评论
    I recently learned about a new type of plug socket. This rather cunning idea is brought to us from the folks at Newer Technology. Basically, it's a replacement for a wall-mounted power socket. In addition to the regular dual power connectors, this little beauty also boasts two USB connectors, each capable of charging anything up to an iPad. When I first heard about this little scamp, I thought to myself "I know just where I could use one of those!" For reasons I've never been able to fathom, out of the countless power sockets scattered throughout our home, my wife (Gina the Gorgeous) and my 17-year-old son (Joseph) both insist on charging their iPhones and iPads using the socket on the end of one of our kitchen cabinets as shown below:     I find this a tad wearing on the nerves for a couple of reasons. First, because this means the main pathway into the kitchen is littered with cables. Second, because Joseph insists on dragging the ironing board out of the laundry room each evening to prepare his clothes for the following day, which means he plugs the iron into one of these sockets. Almost invariably, Joseph unplugs his mother's iPhone, but he neglects to plug it back in again when he's finished, which means I end up being called the following day to hear the dreadful saga of the uncharged iPhone and what am I going to do about it and why can't I have a word with Joseph and ... the minutes of my life pass before my eyes. So you can only imagine my excitement when the nice folks at Newer Technology sent a Power2U to me to play with. Of course, nothing is as easy as you think it's going to be. When the Power2U arrived in my office, I was just heading out of the door to meet the heating, ventilation, and air conditioning (HVAC) guys, who were scheduled to perform some regular maintenance at the house, so I decided to take the Power2U with me and install it as a surprise for Gina and Joseph. Thus it was that, while I was waiting for the HVAC guys to arrive, I popped the existing socket out of the side of the cabinet and disconnected all of the wires. Of course I should have turned off the power first, but "I R an Engineer" and I know what I'm doing (he said with a hollow laugh). Suffice it to say that when the doorbell rang and Henri the dog barked right behind me, the result was to give me an invigorating time. Just to add to the fun and frivolity, I then found that the Power2U would not fit into the existing shallow box that was mounted in the cabinet. "Oh dear," I thought (or words to that effect). So I reconnected the wires and replaced the original socket, only to find that there was no longer any power coming out of it. This was not the surprise I was planning for Gina and Joseph... I'm not as stupid as I look! (Who could be?) Yes, of course I checked the main fuse box. I'm not a complete idiot (as I've mentioned before, my mother had me tested, and I'm happy to report that the word "complete" is unwarranted). All of the fuses were as they should be. And yes, of course I also checked the automatic circuit breaker thingy in the kitchen. No problems there... By some strange quirk of fate, I happened to have two electrical-certified HVAC guys wandering around in my loft, so I explained when had happened and asked them to take a look. First they checked the socket itself—all wired correctly. Then they checked nearby sockets – no power there either. Then they checked the automatic circuit breaker thingy in the kitchen (they thought of that quicker than I had) – no problems there. Next they checked the fuse panel in the garage – all was as it should be. Then we all stood around for a while stroking our chins and trying to come up with a new move. After a while, the HVAC guys wandered off back into the loft to check the wiring up there. Sometime later they returned with a purposeful air and walked around the kitchen looking at the sockets a little more closely. Ah Ha! There was a SECOND automatic circuit breaker thingy in the power socket located behind the flat-screen television. I don't know about the HVAC guys, but I certainly felt a tad foolish. But that's not what I wanted to tell you about... On the way into work the next day, I popped into the local home improvement store to pick up a deeper box. That evening, while Gina and Joseph were in the family room, I whipped out the old socket and box and replaced it with my new, deeper box and Power2U. Now, all we see are two USB cables as shown below:     This really is much more convenient. We no longer have the two white chargers lying around, plus we still have two power sockets to play with. Gina's phone actually ends up being charged, and I am the hero of the hour. The Power2U is one of those things that, when you first see it, you say to yourself "Well, that's an obvious idea – anyone could have thought of that." The thing is, of course, that it's only an obvious idea once you've seen it. All I can say is that I wish I'd thought of it first. Anyway, the bottom line is that I think the Power2U is a great idea and mine is here to stay!
  • 热度 16
    2012-9-26 17:22
    1683 次阅读|
    1 个评论
    Here's a picture of our household. I have an iPhone and an iPad. My wife has an iPhone and an iPad. And our 17-year old son has an iPhone and an iPad. The incredible amount of use we get out of these devices means that they all need to be recharged on a daily basis. I keep my chargers in my backpack and I tend to recharge my iPhone/iPad here in my office (plugging them in plays a small part of my "getting going morning rituals" while my computers are powering up and the coffee is brewing). By comparison, every evening my wife and my son play an endlessly complicated game of "hide and seek with chargers," with accusations flying as to who moves whose charger and cries of "Well, this one is certainly mine!" Quickly followed by "No, it certainly is NOT!" But wait, there's more... We have an open-plan family room that merges with a breakfast area and leads into the kitchen. All told, we must have close to 25 to 30 power outlets in this combined area. This makes it all the more surprising that it's the dual power outlet on the side of the kitchen counter forming the entrance to the kitchen into which they always plug their iPad/iPhone power adapters. When they aren't using them, the cables and adapters are often left hanging out of the power socket trailing on the floor, just inviting people to step on them and crunch them up. And it gets even worse, because every evening before he goes to bed, my son drags out the ironing board to iron his clothes for the following day. Of course he doesn't do this in the laundry room (that would be too easy). Oh no, for reasons known only to himself, he has to place the ironing board on the side of the kitchen counter forming the entrance to the kitchen. Do you see where this is leading... The solution...at last So he pulls out one of the iPad/iPhone power cords and plugs in the iron. When he's finished (if we are lucky), he unplugs the iron and puts it and the ironing board away. But he never remembers to plug the iPad/iPhone connector back in. This explains why my wife keeps on calling me from her office telling me that although her iPhone was plugged in all night it's strangely run out of charge (Duh!). The reason I'm waffling on about this here is that I just heard about the solution to many of these problems – the Power2U AC/USB in-wall power adapter from the guys and gals as Newer Technology. In addition to the two regular power sockets, this little beauty also has two USB ports capable of charging iPhones and iPads. In addition to not having the iPad/iPhone chargers laying on the floor, this means my son could do his ironing without disconnecting his mother's iPhone (strangely, he never unplugs anything that he is charging). I don't know about you, but I think this is a brilliant idea – clean/good looking, simple, and incredibly effective (much like myself :-)  
  • 热度 18
    2011-12-7 11:27
    1706 次阅读|
    1 个评论
    In our line of work, we use many different kinds of connectors. There's no doubt about that. Sometimes the variety is due to the technical demands of the application—DC, AC power, audio, data, RF, microwave, and so on—and sometimes it is because a vendor prefers a proprietary connector to lock you in to their cables and accessories. Other connectors have physical form-factor differences, depending on the way the cable exits or the strain-relief options. Regardless of the reason, one of the most frustrating situations for engineers, especially when in prototype or debug phase, is when you don't have the right connector to mate cable and unit. One way to deal with this is to make up a special cable, using the appropriate matching connectors at each end. But that brings new problems, assuming you have the correct mates and you don't need special tooling to attach the connector to the cable: many high-performance cables are complex assembles, and at higher frequencies, they are transmission lines with impedance-matching and discontinuity issues. The more elegant solution, of course, is an adapter connector designed for the specific pairing you are trying to resolve, or the physical constraints you face. I suspect that many of you have a drawer or box with a collection of these odd pairings. For example, I have an RP-SMA to RP-TNC adapter which came with my D-Link ANT24-0700 external 802.11 antenna (an accessory which "saved the day" for me, see here ). Turns out I didn't need the adapter, but someday it may solve an RF-connector mating problem I can't anticipate—yet. I also have some adapters which I picked up at flea markets, and which are so elegant and nicely machined in their own special ways, that I couldn't resist them.Go to the web site—or even better, the print catalog—of almost any RF cable/connector vendor, and you'll see many of these works of "art" that were developed and tooled to meet someone's need. Even the ubiquitous and fairly limited slate of connectors in the USB family has adapters. For example, if you are using the very common mini-USB connector for your phone, camera, or GPS, and you get a newer device which sports the micro-USB, you can get a mini-to-micro transition adapter (so you can use all your USB-charging cables and wall-warts) for about $3. Or if your installation is physically cramped, you can get a right-angle USB connector adapter:     For basic AC-line power, if you want to use the standard Edison-socket-based LED or CFL bulb in a candelabra socket, you'll need this fairly obscure adapter:   What's the most interesting or strangest adapter pairing you've seen? Is there one you'd like to have—but haven't been able to find yet?  
  • 热度 18
    2011-12-7 11:27
    1625 次阅读|
    0 个评论
    We use a lot of connectors in our line of work, no doubt about that. Sometimes the variety is due to the technical demands of the application—DC, AC power, audio, data, RF, microwave, and so on—and sometimes it is because a vendor prefers a proprietary connector to lock you in to their cables and accessories. Other connectors have physical form-factor differences, depending on the way the cable exits or the strain-relief options. Regardless of the reason, one of the most frustrating situations for engineers, especially when in prototype or debug phase, is when you don't have the right connector to mate cable and unit. One way to deal with this is to make up a special cable, using the appropriate matching connectors at each end. But that brings new problems, assuming you have the correct mates and you don't need special tooling to attach the connector to the cable: many high-performance cables are complex assembles, and at higher frequencies, they are transmission lines with impedance-matching and discontinuity issues. The more elegant solution, of course, is an adapter connector designed for the specific pairing you are trying to resolve, or the physical constraints you face. I suspect that many of you have a drawer or box with a collection of these odd pairings. For example, I have an RP-SMA to RP-TNC adapter which came with my D-Link ANT24-0700 external 802.11 antenna (an accessory which "saved the day" for me, see here ). Turns out I didn't need the adapter, but someday it may solve an RF-connector mating problem I can't anticipate—yet. I also have some adapters which I picked up at flea markets, and which are so elegant and nicely machined in their own special ways, that I couldn't resist them.Go to the web site—or even better, the print catalog—of almost any RF cable/connector vendor, and you'll see many of these works of "art" that were developed and tooled to meet someone's need. Even the ubiquitous and fairly limited slate of connectors in the USB family has adapters. For example, if you are using the very common mini-USB connector for your phone, camera, or GPS, and you get a newer device which sports the micro-USB, you can get a mini-to-micro transition adapter (so you can use all your USB-charging cables and wall-warts) for about $3. Or if your installation is physically cramped, you can get a right-angle USB connector adapter:     For basic AC-line power, if you want to use the standard Edison-socket-based LED or CFL bulb in a candelabra socket, you'll need this fairly obscure adapter:   What's the most interesting or strangest adapter pairing you've seen? Is there one you'd like to have—but haven't been able to find yet?  
相关资源
  • 所需E币: 1
    时间: 2022-7-23 16:10
    大小: 90.26KB
    上传者: Argent
    20-COMM-EAdapterDiagnostics
  • 所需E币: 3
    时间: 2019-12-27 21:01
    大小: 780.8KB
    上传者: givh79_163.com
    本手册提供的使用TEA1733(L)T的65瓦GreenChip演示板规格,性能,原理图及印刷电路板布局。UM10385GreenChip65WTEA1733(L)TdemoboardRev.02―2June2010UsermanualDocumentinformationInfoContentKeywordsNotebookadapter,TEA1733(L)T,Lowstandbypower,Highefficiency,fixedfrequencyflyback,jitterAbstractThismanualprovidesthespecification,schematics,andPrinted-CircuitBoard(PCB)layoutofthe65WTEA1733(L)Tdemoboard.FordetailsontheTEA1733(L)TICpleaserefertotheapplicationnote.NXPSemiconductorsUM10385……
  • 所需E币: 3
    时间: 2019-12-27 21:01
    大小: 961.06KB
    上传者: quw431979_163.com
    TEA1733LT/T的65WGreenChipPCB设计UM10421GreenChip65WTEA1733LT/TprinterreferenceboardRev.1―17December2010UsermanualDocumentinformationInfoContentKeywordsPrinteradapter,TEA1733LT/T,lowstandbypower,high-efficiency,fixedfrequencyflyback,jitterAbstractThismanualprovidesthespecification,schematicsandPrinted-CircuitBoard(PCB)layoutofthe65WTEA1733LT/Tprinterreferenceboard.RefertoapplicationnoteAN10868fordetailsontheTEA1733LT/TIC.NXPSemiconductorsUM10421……
  • 所需E币: 5
    时间: 2019-12-27 21:01
    大小: 2.35MB
    上传者: wsu_w_hotmail.com
    本手册提供65瓦TEA1738LT/T和TEA1703的规范,原理图和PCB布局演示板。UM10437GreenChip65WTEA1738LT/TandTEA1703demoboardRev.1―28February2011UsermanualDocumentinformationInfoContentKeywordsNotebookadapter,TEA1738LT/T,TEA1703,fixedfrequency,ultra-lowstandbypower,high-efficiency,slimlineAbstractThismanualprovidesthespecification,schematicsandPCBlayoutofthe65WTEA1738LT/TandTEA1703demoboard.FordetailsontheTEA1738LT/TorTEA1703ICpleaserefertotheapplicationnote.NXPSemiconductorsUM10437……
  • 所需E币: 3
    时间: 2019-12-27 21:02
    大小: 2.39MB
    上传者: 16245458_qq.com
    本用户手册描述了一个典型的基于EA1713T90W笔记本电脑适配器谐振开关模式电源的设计。UM10450TEA1713demoboardfor90WnotebookadapterRev.1―11April2011UsermanualDocumentinformationInfoContentKeywordsTEA1713T,90W,notebookadapter,LLC,resonant,half-bridge,PFC,controller,converter,burstmode,powersupply,demoboard.AbstractTheTEA1713TincludesaPowerFactorCorrection(PFC)controlleraswellasacontrollerforaHalf-BridgeresonantConverter(HBC).Thisusermanualdescribesa90WresonantswitchingmodepowersupplyforatypicalnotebookadapterdesignbasedontheTEA1713T.Theboardprovidesanoutputof19.5V/4.……
  • 所需E币: 3
    时间: 2019-12-27 21:02
    大小: 763.2KB
    上传者: 2iot
    本用户手册中介绍了源基于TEA1713T和TEA1795T的一个典型的所有功能于一身的PC适配器设计的150W的谐振开关模式(SMPS)电源。UM10465TEA1713andTEA1795demoboardfor150Wall-in-onePCadapterRev.1―28September2011UsermanualDocumentinformationInfoContentKeywordsTEA1713T,TEA1795T,150W,all-in-onePCadapter,GreenChip-SR,synchronousrectification,LLC,resonant,half-bridge,PFC,controller,converter,burstmode,powersupply,demoboardAbstractTheTEA1713TincludesaPowerFactorCorrection(PFC)controllerandacontrollerforaHalf-BridgeresonantConverter(HBC).Thisusermanualdescribesa150WresonantSwitchingModePowerSupply(SMPS)foratypicalall-in-one……
  • 所需E币: 5
    时间: 2019-12-24 22:53
    大小: 710.81KB
    上传者: 二不过三
    摘要:本文深入介绍OneWireViewer软件的操作、故障显示方式,以及特定功能Viewer。文中还给出了关于如何测试iButton电池及如何验证任务是否成功启动的建议。文章第二部分介绍软件安装、端口配置、适配器检测以及更改适配器类型和端口。本文和应用笔记4373:“OneWireViewer和iButton®快速使用指南”、应用笔记3358:“OneWireViewer用户指南”一起,整合了1-Wire和iButton器件用户可能遇到的所有典型应用。OneWireViewer使用技巧BernhardLinke,首席技术专家BrianHindman,高级软件开发工程师Mar01,2012摘要:本文深入介绍OneWireViewer软件的操作、故障显示方式,以及特定功能Viewer。文中还给出了关于如何测试iButton电池及如何验证任务是否成功启动的建议。文章第二部分介绍软件安装、端口配置、适配器检测以及更改适配器类型和端口。本文和应用笔记4373:“OneWireViewer和iButton快速使用指南”、应用笔记3358:“OneWireViewer用户指南”一起,整合了1-Wire和iButton器件用户可能遇到的所有典型应用。引言最初编写OneWireViewer软件的目的是演示1-Wire应用程序接口(API)(适用于Java)的作用和有效性。该软件可通过USB和串口(COM)演示大多数iButton和1-Wire器件。软件可用于32位和64位Windows7、WindowsServer2008、WindowsVista和WindowsXP(SP2及更新)。得益于记录器iButton,OneWireViewer不断受到研究者的青睐。演示各种iButton和1-Wire器件的用户界面对于专注于设置记录器并在数周或数月后取回数据的用户不是太直观。当OneWireViewer遇到异常情况时,例如记录器生命周期结束,找到并解释故障消息很具有挑战性。本文介绍如何分析并理解这些故障消息,以及如何区分设备故障(例如电池耗尽引起的故障)和操作错误(例如,未设置软件密码)。文章还介绍了如何在启动任务之前测试坏电池,以及验证任务是否成功启动,并跟踪记录器的电量。本文第二部分着重于软件方面,包括确定OneWireVi……
  • 所需E币: 4
    时间: 2019-12-24 18:24
    大小: 41.32KB
    上传者: wsu_w_hotmail.com
    摘要:一个适配器电路组成一个RS-485收发器(MAX3076或MAX13086)和电压监视器用作定时器(MAX641X)允许在一个更复杂的现有点,以点全双工电路功能点,点对多点半双工系统。Maxim>AppNotes>AmplifierandComparatorCircuitsCommunicationsCircuitsInterfaceCircuitsKeywords:RS-485adapter,fullduplex,point-to-multipointhalfduplex,voltagemonitorsJan06,2011APPLICATIONNOTE4554RS-485AdapterConvertsDataLinesfromFull-toHalf-DuplexBy:MassimoCaprioliAbstract:AnadaptercircuitconsistingofanRS-485transceiver(MAX3076orMAX13086)andavoltagemonitorusedasatimer(MAX641X)allowsanexistingpoint-to-pointfullduplexcircuittofunctioninamore-complexpoint-to-multipointhalf-duplexsystem.AsimilarversionofthisarticleappearedintheJune21,2007issueofElectronicDesignmagazine.MultiprotocolinterfaceICs(suchastheMAX3162fromMaxim)canbeusedtoconnectaU……