Skip to main content

Home/ Android Dev/ Group items tagged ui

Rss Feed Group items tagged

Kiran Kuppa

How to Position Views Properly in Layouts | Think Android - 0 views

  •  
    "First off, the difference between android:gravity and android:layout_gravity is that android:gravity positions the contents of that view (i.e. what's inside the view), whereas android:layout_gravity positions the view with respect to its parent (i.e. what the view is contained in). "
Simon Pan

Custom Drawing | Android Developers - 1 views

  • Creating objects ahead of time is an important optimization. Views are redrawn very frequently, and many drawing objects require expensive initialization. Creating drawing objects within your onDraw() method significantly reduces performance and can make your UI appear sluggish.
    • Simon Pan
       
      將物件在初始化時就實例化是很重要的概念,onDraw()的運作速度很快,如困每一個Paint畫圖物件都臨時才在onDraw()產生,將會大幅下降整体程式的流暢效能。
  • If your view doesn't need special control over its size, you only need to override one method: onSizeChanged().
  • is mandatory.
Kiran Kuppa

HoloEverywhere · GitHub - 1 views

  •  
    Holo Everywhere is an android library /extension to be able to use Holo theme on older android devices as well 
Kiran Kuppa

Android Layout Tricks #3: Optimize by merging - 1 views

  •  
    The was created for the purpose of optimizing Android layouts by reducing the number of levels in view trees.When the LayoutInflater encounters this tag, it skips it and adds the children to the parent.You can also use when you create a custom composite view. 
Kiran Kuppa

A Visual Guide to Relative Layouts In Android » Mark Lapasa - 0 views

  •  
    " I will walk through the 4 kinds of Relative Layout use cases. 1.Target view position in relation to parenting View Group (i.e. a layout container) 2.Target view alignment in relation to parenting View Group 3.Target view position in relation to another View 4.Target view alignment in relation to another View We'll use Jack and Jill buttons to demonstrate this. The first two categories are in relation to a parent layout (Jack and the parent view group). The last two categories show laying out in relation to another View (i.e. Jack + Jill)"
Kiran Kuppa

Image Loading Library - 0 views

  •  
    "In this part, we are going to talk about some image libraries using which we can load image(s) asynchronously, can cache images and also can download images into the local storage."
Kiran Kuppa

Emojicon Android Text View library - 0 views

  •  
    "Do you like emojis in Whatsapp, iMessage? Emojicon is a library to implement such a thing for Android."
Vincent Tsao

How to handle screen orientation change when progress dialog and background thread acti... - 0 views

  • When you switch orientations, Android will create a new View. You're probably getting crashes because your background thread is trying to change the state on the old one. (It may also be having trouble because your background thread isn't on the UI thread) I'd suggest making that mHandler volatile and updating it when the orientation changes.
Vincent Tsao

The CommonsBlog - Activity or Notification via Ordered Broadcast - 0 views

  • I’ve run into the following generalized question a lot recently: I have an event that occurs in the background. I want to update my activity, if the activity is on the screen. Otherwise, I want to raise a Notification.
  • Hence, the recipe for the activity-or-Notification pattern is: Define an action string you will use when the event occurs that you want to go to the activity or notification (e.g., com.commonsware.java.packages.are.fun.EVENT). Dynamically register a BroadcastReceiever in your activity, with an IntentFilter set up for the aforementioned action string and with a positive priority (the default priority for a filter is 0). This receiver should then have the activity do whatever it needs to do to update the UI based on this event. The receiver should also call abortBroadcast() to prevent others from getting it. Be sure to register the receiver in onStart() or onResume() and unregister the receiver in the corresponding onStop or onPause() method. Register in your manifest a BroadcastReceiver, with an <intent-filter> set up for the aforementioned action string. This receiver should raise the Notification. In your service (e.g., an IntentService), when the event occurs, call sendOrderedBroadcast(). And that’s it. If the activity is on-screen, its receiver will be registered, so it will get the event, process it, and cancel the broadcast. If the activity is not on-screen, its receiver will not be registered, so the event will go to the default handler, in the form of your manifest-registered BroadcastReceiver, which will raise the Notification.
Vincent Tsao

Applying Styles and Themes | Android Developers - 0 views

  •  
    using style/theme to make our layout views neat and maintainable
Simon Pan

Service | Android Developers - 0 views

  • avoid
    • Simon Pan
       
      如果在Service裡做了要做的事,它們還是在UI thread裡做事情,而不是在什麼別的thread做事情。但是Service很特別,它又不是一個執行緒,因為通常Service要做的事情都蠻耗時的,萬一Service算是執行緒,那麼就會強碰到系統的ANR機制。
  • A facility for the application to tell the system about something it wants to be doing in the background
  • A facility for an application to expose some of its functionality to other applications.
  • ...3 more annotations...
  • two reasons
  • depending on the value they return from onStartCommand(): START_STICKY is used for services that are explicitly started and stopped as needed,
  • then take the service out of the started state and don't recreate until a future explicit call to Context.startService(Intent).
Vincent Tsao

Lazy Loading Images in a ListView - consensus approach? - Android Developers | Google G... - 0 views

  • I haven't looked in details at the 3 other approaches but I know that a big difference between what I do in Shelves and what I've seen done in other places is how user interaction is handled. Shelves listens to scroll events on the ListView and tries to identify taps vs scrolls vs fling to always give priority to the UI. For instance, when you touch the screen to stop a fling, Shelves starts loading images, but does so only after a very short delay so that if you are touching the screen to fling some more, the fling animation won't stutter because of the extra work load. But that's details.
    • Vincent Tsao
       
      From Romain Guy, the author of Shelves app
Vincent Tsao

[TinyTut]Custom Button backgrounds/Better ImageButton :: anddev.org - Android Developme... - 0 views

  • In my_button we define 4 states (as a button has 4 states: not pressed and not focused, pressed and focused, pressed and not focused, not pressed and focused) with each of those states having their own drawable.
Vincent Tsao

Binding to Data with AdapterView | Android Developers - 0 views

  • Spinner s2 = (Spinner) findViewById(R.id.spinner2);Cursor cur = managedQuery(People.CONTENT_URI, PROJECTION, null, null);     SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,    android.R.layout.simple_spinner_item, // Use a template                                          // that displays a                                          // text view    cur, // Give the cursor to the list adatper    new String[] {People.NAME}, // Map the NAME column in the                                         // people database to...    new int[] {android.R.id.text1}); // The "text1" view defined in                                     // the XML template                                         adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);s2.setAdapter(adapter2);
Vincent Tsao

Window Backgrounds & UI Speed | Android Developers - 0 views

  • Removing the window's background can be achieved very easily by using a custom theme. To do so, first create a file called res/values/theme.xml containing the following:
  • <resources>    <style name="Theme.NoBackground" parent="android:Theme">        <item name="android:windowBackground">@null</item>    </style></resources>
  • You then need to apply the theme to your activity by adding the attribute android:theme="@style/Theme.NoBackground" to your <activity /> or <application /> tag. This trick comes in very handy for any app that uses a MapView, a WebView or any other full screen opaque view.
‹ Previous 21 - 40 of 48 Next ›
Showing 20 items per page