User Interfaces-Basics of UI Design



All user interface elements in an Android app are built using View and ViewGroup objects.

View

An object that draws something on the screen that the user can interact with.

ViewGroup

An object that holds other View(and ViewGroup) 

  • You can use two ways to creating Views
  1. Dynamically Add By Coding

              LinearLayout ll = new LinearLayout(getApplicationContext());

  1. Statically Define in XMLs

     
              <android:layout_width=”fill_parent”
              android:layout_height=”fill_parent”
              android:orientation=”vertical” >
     

If you define it in XML you should call setContentView() method to load that XML in Activity.

    public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main_layout);
   }

  • Every View and View Group object supports their own variety of XML attributes. Some attributes are specific to a View object (for example, Text View supports the text Size attribute)
  • Some are common to all View objects, Like id , layout parameters and etc.

  ID Attribute

  • Any View object may have an integer ID associated with it, to uniquely identify the View within the tree. 

      android:id=”@+id/my_button”


  Define & Retrieve

 Define in XML

      <android:layout_width=”wrap_content”
        android:layout_height=”wrap_content”
        android:text=”@string/btn_login_text”/>

   Retrieve By Activity

   Button btnLogin= (Button) findViewById(R.id.btn_login);

 

    Layout Parameters

  • XML layout attributes named layout_something define layout parameters for the View that are appropriate for the View Group in which it reside

    Eg:

  • layout_widthand layout_height
  • wrap_contenttells your view to size itself to the dimensions required by its content
  • fill_parent(renamed match_parentin API Level 8) tells your view to become as big as its parent view group will allow.

       Layout Positioning

  • The geometry of a view is that of a rectangle. 
  • A view has a location, expressed as a pair of  left and top coordinates, and two dimensions, expressed as a width and a height

  Paddings

  • setPadding(int left, int top, int right, int bottom)

Related XML Attributes

android:padding
android:paddingBottom
android:paddingLeft
android:paddingRight
android:paddingTop

 

Margins

  • setMargins(int left, int top, int right, int bottom)
  • Related XML Attributes

android:layout_marginLeft
android:layout_marginTop
android:layout_marginRight
android:layout_marginBottom

145 Comments

  1. Helpful information. Lucky me I found your
    website by accident, and I am stunned why this coincidence didn’t took
    place earlier! I bookmarked it.

  2. Helpful information. Lucky me I found your website by accident, and I am stunned why this coincidence didn’t took
    place earlier!

  3. You really make it appear really easy with your presentation however I to find this topic to be actually something
    which I think I might by no means understand. It sort
    of feels too complicated and very vast for me.
    I am having a look forward on your next submit, I’ll attempt to get the hold of it!

  4. You really make it appear really easy with your presentation however I to find
    this topic to be actually something which I think I might by no means understand.

    It sort of feels too complicated and very vast for me.
    I am having a look forward on your next submit, I’ll attempt to get the hold of it!

  5. Τhanksѕ for another informatіve web site. Thee place else ϲ᧐uld I get that kihd of іnformation wwritten in ѕucһ a perfect means?
    I haѵe a undertaking that I’m just now running on, and I’vе been at thе glance out for
    suсh infօrmation.

  6. Thanks for anotheг informative web site. The place else could I get thst kind
    of information written in such a perfect means? I haѵe a undertaking
    that I’m just now running on, and I’ve bеen at the glance outt for ѕuch information.

  7. This design is wicked! You most certainly know how to
    keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really loved what you had to say, and more than that, how you presented it.
    Too cool!

  8. This design is wicked! You most certainly know how to keep a
    reader entertained. Between your wit and your
    videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really loved what you had to say, and more than that, how
    you presented it. Too cool!

  9. Howdy just wanted to give you a quick heads up
    and let you know a few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers
    and both show the same outcome.

  10. Howdy just wanted to give you a quick heads up and let
    you know a few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers and both show the
    same outcome.

  11. Hello there, just became aware of your blog through Google,
    and found that it’s really informative. I’m going to watch out for brussels.
    I will be grateful if you continue this in future. Many people will be benefited from your writing.
    Cheers!

  12. Hello there, just became aware of your blog through Google, and
    found that it’s really informative. I’m going to watch out for brussels.
    I will be grateful if you continue this in future.
    Many people will be benefited from your writing.

    Cheers!

  13. Howdy are using WordPress for your blog platform? I’m new to
    the blog world but I’m trying to get started and create my own. Do you need any html
    coding knowledge to make your own blog? Any help would be really appreciated!

  14. Howdy are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get
    started and create my own. Do you need any html coding knowledge to make your own blog?
    Any help would be really appreciated!

  15. Ԍreat blog! Is your theme custom made orr did you download
    it from somewhere? A deѕign like yours witһ a
    few simple tweeks would reɑlly make mmy Ьlog jump out.

    Plеase let me know where youu ggot your design. Thank you

  16. Great bⅼog! Is ʏopur theme custom madfe or ԁid you Ԁownload it frօm sօmewhere?
    A design like уours with a few simple tweeks would really make my blog jump out.
    Pleas let me know where you got your design. Thank you

  17. І wɑs suggested this blog bby my cousin. I’m not sure whetheг this post iѕ written by him as nobody else know suc detaileԀ about my probⅼem.
    You are amazіng! Τhanks!

  18. I was suggested tһis blog by my cousin. I’m not sure whetһer this post is written bby him as nobody else know suсh dеtailed about myy problem.
    You are amazing! Thanks!

  19. I all the time used to stuԀy piece of writing in news
    papers bᥙt now as I am a user of innternet so from noow Ι am using net for content, thanks to web.

  20. I all the timе usеd to study piecе of writing iin news papers but now as
    I am a user of internet so from now I am using net ffor content, thanks t᧐ web.

  21. Fantastic web site. A lot of helpful information here. I am
    sending it to several friends ans also sharing in delicious.
    And obviously, thanks to your sweat!

  22. Fantastic web site. A lot of helpful information here.

    I am sending it to several friends ans also sharing in delicious.
    And obviously, thanks to your sweat!

  23. Aw, thіs was a very good post. Spending some time and actual effort
    to produce а really good article… but what can I say… I
    hesitate a lot and don’t seem to get anything done.

  24. Aw, this wɑs a very good post. Spending ѕomee time and actual effort
    tto produce a really good article… but what cann I say… I hesitate
    a lot annd don’t seem to ɡеt anything done.

  25. Ԍreat ᴡeblog rіght here! Αllso your site a lot up fast!
    What weeb host are you the usge of? Can Ӏ am gettіng yοuг affiliate hyperlink to your host?

  26. Gгeat weblog right here! Also yоur site a lot սp fast!
    What web host аre you the usage ⲟf? Can I am getting your affiliate hyperlink to yоur host?

  27. Hi there, i read your blog occasionally and i own a similar
    one and i was just curious if you get a lot of spam feedback?
    If so how do you prevent it, any plugin or anything you can recommend?
    I get so much lately it’s driving me mad so any help is very much
    appreciated. I like what you guys are up too.
    This sort of clever work and reporting! Keep up the excellent
    works guys I’ve added you guys to my personal blogroll.
    I am sure this piece of writing has touched all the internet visitors, its really really nice piece of writing on building up new weblog.

  28. Hеy are using Wordpress for your site platform?
    Ι’m new to the blog world but I’m trying to get started and create my own. Do yyou requide any htfml cоding expertise to make yoᥙr own Ьlog?
    Any help would be really appreciated!

  29. Hey aгe using W᧐rdpress for your site platform?
    I’m new to thе blog world but I’m trying to get
    started and crsate mʏ own. Do you require any htmkl coding exρertise to make your own blog?

    Any һelp ᴡould be really appreciated!

  30. Exceⅼlent pieces. Keep posting suсh kind
    of ihf᧐ on your page. Im really impressed by it.

    Hey there, You’ve done a fantastic job. I’ll definitely digg it and in my opinion rеcommend tto
    my friends. I am conficent they’ll be benefited from
    this web ѕite.

  31. Еxcellеnt pieces. Keep posting such kind of info on your pagе.
    Im reqⅼly impressed by it.
    Hey there, You’ve done a fantastic joƅ. I’ll efinitely dіցg it
    andd in my opinion recommend to my friends. I am confidеnt they’ll be benefited from this weƄ site.

  32. My brother recommended I might like this web site.
    He used to be entirely right. This post truly made my day.

    You can not consider just how so much time I had spent for this info!
    Thank you!

  33. I like the helpful info you provide in your articles. I will bookmark your blog and check again here frequently.
    I’m quite sure I’ll learn a lot of new stuff right here!
    Good luck for the next!

  34. Hello there, just became alert to your blog through Google, and found that it is really informative.
    I’m gonna watch out for brussels. I will appreciate if you continue this in future.
    Lots of people will be benefited from your writing.
    Cheers!

  35. Thanks for ones marvelous posting! I truly enjoyed reading it, you are a great
    author. I will be sure to bookmark your blog and definitely will come
    back very soon. I want to encourage you to continue your great work, have a nice afternoon!

  36. Hey there would you mind stating which blog platform you’re using?
    I’m looking to start my own blog in the near future
    but I’m having a hard time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.

    The reason I ask is because your layout seems different then most blogs and I’m looking for something completely
    unique. P.S Apologies for getting off-topic but I had to ask!

  37. It’s actually very complex in this busy life to listen news on Television, therefore I only use world wide web for that purpose, and obtain the most recent information.

  38. I don’t know if it’s just me or if perhaps everybody else experiencing issues with your blog.

    It looks like some of the text on your content
    are running off the screen. Can somebody else please comment and let me know if this is happening to them too?
    This might be a issue with my browser because I’ve had
    this happen previously. Many thanks

  39. hi!,I like your writing very much! share we communicate a lot more about your post on AOL? I require a specialist on this area to solve my problem. Maybe that’s you! Looking forward to see you.

  40. Hello there I am so grateful I found your webpage, I really found you by accident, while I was browsing on Aol for something else, Regardless I am here now and would just like to say many thanks for a incredible post and a all round exciting blog (I also love the theme/design), I don’t have time to look over it all at the moment but I have bookmarked it and also included your RSS feeds, so when I have time I will be back to read much more, Please do keep up the excellent work.

  41. Usually I do not read article on blogs, but I wish to say that this write-up very forced me to try and do so! Your writing style has been surprised me. Thanks, very nice post.

  42. What i don’t realize is actually how you’re no longer actually a lot more smartly-appreciated than you may be right now. You are very intelligent. You recognize thus significantly in the case of this subject, made me in my opinion imagine it from so many various angles. Its like women and men aren’t involved unless it is something to accomplish with Girl gaga! Your own stuffs great. All the time take care of it up!

  43. Appreciating the dedication you put into your site and
    detailed information you provide. It’s great to come across a blog every
    once in a while that isn’t the same out of date rehashed material.

    Great read! I’ve bookmarked your site and I’m including your RSS feeds to
    my Google account.

  44. ZFN Liker, Autolike, autoliker, Auto Like, autolike, Autoliker, Status Auto Liker, Autolike International, Photo Liker, Status Liker, Increase Likes, Working Auto Liker, auto liker, Autoliker, auto like, Photo Auto Liker, Auto Liker

  45. I have been exploring for a little for any high quality articles or weblog posts in this sort of house . Exploring in Yahoo I at last stumbled upon this web site. Studying this info So i’m glad to express that I have a very excellent uncanny feeling I came upon exactly what I needed. I most unquestionably will make certain to don’t omit this site and give it a look on a continuing basis.

  46. I’ve been exploring for a little bit for any high quality articles or weblog posts in this kind of area . Exploring in Yahoo I at last stumbled upon this site. Studying this info So i’m happy to convey that I have an incredibly excellent uncanny feeling I discovered just what I needed. I such a lot surely will make sure to do not fail to remember this web site and give it a glance on a constant basis.

  47. I think other web-site proprietors should take this web site as an model, very clean and fantastic user genial style and design, as well as the content. You are an expert in this topic!

  48. hey there and thank you for your info – I have definitely picked up anything new from right here. I did however expertise some technical points using this web site, as I experienced to reload the website a lot of times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I am complaining, but slow loading instances times will very frequently affect your placement in google and could damage your high quality score if advertising and marketing with Adwords. Anyway I am adding this RSS to my e-mail and can look out for much more of your respective exciting content. Make sure you update this again soon..

  49. I am really inspired together with your writing talents as neatly as with the structure in your weblog. Is this a paid topic or did you customize it your self? Either way keep up the nice quality writing, it is uncommon to peer a nice blog like this one nowadays..

  50. I like the helpful information you provide in your articles.
    I’ll bookmark your weblog and check again here frequently.
    I’m quite sure I’ll learn plenty of new stuff right here!

    Good luck for the next!

  51. I have been surfing online more than 3 hours as of late, yet I by
    no means discovered any interesting article like yours.
    It’s pretty price sufficient for me. In my view, if all webmasters and bloggers made good content as you did, the web will probably be a lot more useful than ever before.

  52. My bestfriend and I want to create a blogging site, but we dont know which one to use. We basically will just be uploading random stuff about anything but we want the site to be fun and decorative, not just a plain layout..

  53. Jika kita menetapkan untuk memainkan situs judi bola bola, maka tebakan atau prediksi team yang akan memenangkan permainan pun sepatutnya kalian keluarkan. Jadi, pada intinya kalian akan menerima alat atau bantuan memainkan setelah memilih jenis game apa yang akan dimainkan.

  54. My partner and I Stumbled over here different website and thought I might also check things out. I like what I see so now I am following you. Look forward to checking out your web page repeatedly.

  55. İstanbul Ataşehir Evden Eve Nakliyat bölgesinde en kaliteli ve güvenilir nakliyat firmasını mı arıyorsunuz o halde doğru yerdesiniz. istanbul Nakliyat firmamız İstanbul başta olmak üzere tüm İstanbul’ da taşımacılık hizmeti vermektedir. Evden eve nakliyat konusunda profesyonel ekibimiz ile eski evinizden eşyalarınızı alınmasıyla başlayan süreçten yeni evinize taşınmasına kadar olan sürece kadar taşımanın her aşamasında sizlere destek vermekteyiz.
    Ataşehir ilçesinde toplam 17 mahalle de evden eve nakliyat hizmetini kusursuz olarak vermekteyiz.

  56. Thanks for all your efforts on this web site. My mum loves working on internet research and it’s really obvious why. Almost all learn all regarding the lively mode you make powerful solutions by means of this web blog and as well boost response from visitors on that article then my princess is without a doubt learning a whole lot. Enjoy the rest of the new year. You’re doing a splendid job.

  57. istanbul Nakliye şirketleri arasında uygun istanbul taşımacılık konusunda ucuz profesyonel ve kurumsal olarak istanbul evden eve nakliyat işinde en iyi taşıma firmas. istanbul’un tüm ilcelerinde kusursuz nakliyat hizmeti veren öncü firlar arasındayız bizleri tercih edem tüm müşterilerimize sonsuz teşekür ederiz.

  58. I have been blogging since last month, my blog was indexed already in google but during the test i conducted, i search for a certain keyword related on my blog but it only shows the blog title and it directs me to the homepage not on the actual post. Need help!!!.

  59. Dalaman havalimanında araç kiralama konusunda faaliyet göstermekte olan Dalaman Daily Rent A Car, araç kiralama sektöründeki tecrübesi ve son model araçlarıyla Dalaman’da önde gelen rent a car firması olma yolunda hızla ilerlemektedir. 7 gün 24 saat kesintisiz oto kiralama ihtiyacınızı karşılayan daily rent a car firmamız lüks ve ekonomik otomobil çeşitleriyle araç kirlama konusunda her bütçeye hitap etmektedir. Geniş araç filomuz ile dalamanda rent a car sektöründe yerli ve yabancı müşterilerimize hizmet vermekteyiz.

  60. I’ve been browsing on-line greater than three hours lately, yet I by no means discovered any attention-grabbing article like yours. It is beautiful value enough for me. Personally, if all website owners and bloggers made just right content material as you probably did, the internet might be much more useful than ever before.

  61. Antalya nakliyat; İşinin temelinde memnuniyet yatan pek çok sektörün soru öncelikli olarak müşterisi üzerinde pozitif bir etki yaratmayı görev olarak kabul etmektedir. Burada sizin bireysel olarak kabul ettiğiniz görev ve bir o kadar sorumluluk içeren çalışma anlayışında, gerçekten endüstriyel nakliye çalışmalarının inanılmaz boyutta çok iyi sonuçları ortaya çıkmaktadır. Antalya nakliyat firmasının pratik ve hızlı çözüm üretme konusunda, yıllardan beri süregelen belli bir kabiliyeti bulunmaktadır. Bu kabiliyet siz değerli müşterileri zerinde her zaman iyi bir intiba ve iyi bir fırsat yaratmaya devam etmektedir. Oluşan en makul çözümlerle birlikte memnuniyet ve sadakat gerçekten sizin firmanızı daha iyi bir yere taşımaya devam edecektir. Böylelikle uygun fiyatlı hizmet ve taşımacılık anlayışından faydalanmak kolay olacaktır.

  62. Lakukanlah judi di agen judi online tak cuma satu kali saja, tapi berkali-jali. Dengan memasang judi yang banyak, kemungkinan supaya beruntung jadi lebih besar. Tapi risikonya apabila kamu kalah permainan, modal yang keluar juga tak sedikit.

  63. Hızlı ve gelişmiş potansiyeli ile birlikte görevine sadık olan firmanın, emniyet ve tecrübe konusunda her zaman beklentilere zamanında cevap vermesi önemli olacaktır. Planlamalı bir şekilde hareket etmesi ile bilinen Çankaya nakliyat çevresine ışık dağıtıyor ve hizmet boyutları ile birlikte memnuniyet seviyesini olabilecek en mümkün mertebeye ulaştırıyor. Taşıma becerisini zaman içerisinde kazanmış olan ve bu beceriyi sürekli olarak geliştirmiş olan firma anlayışı, pek çok insanın kabiliyetli ve güvenilir hizmetlerini burada planlı bir şekilde oluşturmaya devam etmektedir. Eğer siz de doğru firma kabiliyetini ve avantajlı fiyat koşullarını yan yana değerlendirmek istiyorsanız, bunun için bir şansınız var. Fiyatları uygun olduğu noktada avantajlı ürün ve hizmet seçenekleri kolay taşımacılık için size yardımcı oluyor.

  64. An impressive share, I just given this onto a colleague who was doing a little analysis on this. And he in fact bought me breakfast because I found it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to discuss this, I feel strongly about it and love reading more on this topic. If possible, as you become expertise, would you mind updating your blog with more details? It is highly helpful for me. Big thumb up for this blog post!

  65. Pretty nice post. I just stumbled upon your blog and wanted to say that I have truly enjoyed browsing your blog posts. In any case I will be subscribing to your rss feed and I hope you write again soon!

  66. untuk bergabung ke dalam link game judi slot uang asli terupdate dengan kwalitas terbaik kamu bisa masuk ke dalam situsnya. Disana, anda akan menemukan menu daftar yang telah dikasih. Pilih dan kemudian kalian akan dikasih form pendaftaran yang sepatutnya diisi semuanya dan pastikan apabila segala datanya valid.

  67. Situs Judi Online The world we all live within today is completely distinct as opposed to 15 years ago, today folks are generally online, helping to make getting a presence online that much more attractive for business to possess. In the event you wish to create an online presence through blogging then the understanding out of this article should help.

  68. beberapa masyarakat dikala ini yang memilih untuk konsisten merasakan kegiatan menyenangkan diri dengan bermain judi mama togel terpercaya secara online. Sedangkan memang togel asia ialah hiburan yang telah betul-betul sebagian dimainkan oleh masyarakat dan ada aturan serta hukuman yang ketat untuk kita yang terbukti main bandar togel terpercaya melainkan hal itu nyatanya belum dapat seutuhnnya membikin memainkan bandar togel terpercaya dihentikan.

  69. Excellent way of explaining, and pleasant article to take data on the topic of my presentation subject, which i am going to
    convey in university.

  70. Bila kita lihat dari perjalanan sejarah main judi togel memang sudah dimainkan dan dipercaya sepenuhnya oleh masyarakat sebagai salah satu alternative hiburan yang paling menyenangkan dan tidak membikin jenuh . Malah pada ketika itu waktu senggang tidak akan terasa menyenangkan sekiranya kita belum bisa memainkan yang namanya bermain togel online.

  71. bermain judi online yang telah mengalami perkembangan dengan adanya Judi Togel Online di sebuah Togel Toto Garuda yakni perkembangan dunia teknologi kabar yang kian lama semakin canggih dan ini membikin banyak perkembangan dalam semua jenis kegiatan. memainkan judi online satu ini dapat memberikan banyak kemudahan bagi anda supaya menikmati permainan judi tanpa harus menggunakan banyak tenaga serta waktu supaya memainkannya dan memenangkannya.

  72. hello!,I like your writing very much! percentage we keep in touch more about your article on AOL? I require a specialist on this area to resolve my problem. Maybe that is you! Taking a look forward to see you.

  73. Samsun evden eve nakliyat; pek çok farklı sektörün hem isteklerini yerine getirmek hem de hizmet boyutlarını karşılamak için öncelikli olarak bu konuda yapılmış çalışmalara bir göz atmak gerekiyor. İmalat anlamındaki gelişmiş sektörel çalışmalar ile birlikte, bu konuda hem faaliyetler hem de fırsatlar göz önüne gelmek durumundadır. Belli bir tecrübesi ve belli bir kabiliyeti ile beraber pek çok firmanın sadakati yüksek pozisyonda dikkat çeken çalışmaları burada ortaya çıkmaktadır. Günümüz avantajı koşulları ile beraber, her gün memnuniyet ve beceri isteyen sonuçları burada nakliye çözümleri ile yan yana görmek önemli. Samsun nakliyat çok sayıda insanın güvenilir firma kapasitesini değerlendiren bir pozisyonu ortaya koymaktadır. Ambalaj olsun veya diğer benzer aşamalar olsun, burada zamanlamalı planlama ile birlikte çok iyi çözümler elde edilmek durumundadır.

  74. Apa bahkan yang anda lakukan, pastikan bahwa seluruh konten kita asli. Sekiranya kita menyalin komponen dari situs atau artikel orang lain ke blog kamu, anda dapat tertangkap dan itu akan merusak reputasi kalian. Tiap-tiap hari orang bisa menjadi blogger yang benar-benar sukses, hanya dengan menulis dengan penuh motivasi dan integritas.

  75. Apa malahan yang kita lakukan, pastikan bahwa seluruh konten kita absah. Jika kalian menyalin komponen dari blog atau tulisan orang lain ke website anda, kita bisa tertangkap dan itu akan merusak reputasi kita. Tiap-tiap hari orang bisa menjadi blogger yang amat berhasil, hanya dengan menulis dengan penuh semangat dan integritas.

  76. malah yang kamu lakukan, pastikan bahwa seluruh konten kita autentik. Bila anda menyalin bagian dari blog atau tulisan orang lain ke website kamu, kamu dapat tertangkap dan itu akan merusak reputasi anda. Tiap-tiap hari orang dapat menjadi situsger yang betul-betul sukses, hanya dengan menulis dengan penuh motivasi dan integritas.

4 Trackbacks / Pingbacks

  1. Google
  2. Google
  3. 바카라
  4. Mitsubishi Banten

Leave a Reply

Your email address will not be published.


*